Giter Site home page Giter Site logo

szymonlisowiec / node-epicgames-client Goto Github PK

View Code? Open in Web Editor NEW
110.0 10.0 34.0 692 KB

Unofficial EpicGames Launcher in javascript.

License: MIT License

JavaScript 99.65% Shell 0.35%
epicgames-launcher launcher api fortnite client mit-license epicgames epic-games javascript-client

node-epicgames-client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-epicgames-client's Issues

Client Presence

I noticed the library sets a default presence that seems to be a bit difficult to override. An option to change the default presence data would be quite helpful, or to disable it from setting it automatically by default.

Also another slight issue, the library sets the status as "Lobby Battle Royale" when it is usually "Battle Royale Lobby".

Client Auth Access Error

When initializing a client, I am getting this error:
Error: errors.com.epicgames.common.oauth.unauthorized_client

new message from ps4 logged in client not coming

i am able to receive/send message/DM/Whisper from everyone after accepting the friend requests, but when i send a friend request from ps4 and send message from Ps4 to nodejs client, client is unable to receive those messages. no event gotten in here

launcher.communicator.on('friend:message', async(friendMessage) => {
console.log("msg coming from other people are fine, but i wouldnt run when ps4 guy messages me,i just dnt like him");
}
);

Error while initialize or login p rocess.

hello I have this error on run my script :
Error: TypeError: Cannot read property 'client_id' of null
at AccountAuth.auth (/root/snipe_bot/node_modules/epicgames-client/src/Accou
nt/Auth.js:89:28)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:18402) UnhandledPromiseRejectionWarning: Error while initialize or login p
rocess.

I have it since the update

Party join not working

Skins of bot and other invited people dnt appear in party , this only happends if i leave default party created by login and create a new party,
if i dnt leave the default party and invite friends in that party, everything works good

const {EPartyPrivacy} = require('epicgames-client');


const {Launcher} = require('epicgames-client');

const {Party} = Launcher;
const db = require('./db.js');
const EGClient = require('epicgames-client').Client;
const Fortnite = require('epicgames-fortnite-client');
const {ESubGame} = Fortnite;
var discord = require('./discord');
const launcher = new Launcher({
    email: '[email protected]',
    password: '',
    createPartyOnStart: true,
    debug: console.log


});
let egClient = new EGClient({
    email: '[email protected]',
    password: ''
});
(async () => {

    if (!await launcher.init() || !await launcher.login()) {
        throw new Error('Error while initialize or login process.');
    }
    console.log(`Logged account's displayName: ${launcher.account.displayName}`);
    const app = await launcher.runGame(Fortnite);
    launcher.communicator.on('party:invitation', (invitation) => {
        console.log("invitation came" + invitation);
        (async () => {
            await invitation.accept();
        })();
    });
    app.communicator.on('party:invitation', (invitation) => {
        console.log("invitation came" + invitation);
        (async () => {
            await invitation.accept();
        })();
    });
    egClient.init().then(async (success) => {
        console.log("Logged in to epic game client");

        let partyStatus = await launcher.Party.lookupUser(app, launcher.account.id);
        if (partyStatus.current.length > 0) {
            console.log("Previous Party found lets leave it");
            await   app.party.leave();
            console.log('You left previous party');
        } else {
            console.log("No previous party was found")
        }
        let defaultPartyConfig = {
            privacy: EPartyPrivacy.PUBLIC,
            joinConfirmation: false,
            joinability: 'OPEN',
            maxSize: 16,
            subType: 'default',
            type: 'default',
            inviteTTL: 14400,
            chatEnabled: true,
        };
        var party = await launcher.Party.create(app, defaultPartyConfig);
        try {

            await party.waitForRevision(1);
        }
        catch (e) {
            console.log('exception', e);
        }

        await  party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/CID_313_Athena_Commando_M_KpopFashion.CID_313_Athena_Commando_M_KpopFashion");

        await  party.me.setBattlePass(true, 99999999, 99999999, 99999999);


        party.updatePresence();
        console.log("Party Created");
        partyStatus = await launcher.Party.lookupUser(app, launcher.account.id);
        if (partyStatus.current.length > 0) {
            console.log("Party new created well")
        }
        partyStatus = await launcher.Party.lookupUser(app, launcher.account.id);
        console.log("partystatus", partyStatus);

        // app.party.update(partyStatus);
        console.log("Presence", launcher.config.autoPresenceUpdating);
        party.invite("f7b1a006b3dd47e887cff4d4c481872a");
        party.updatePresence();
    });
})();

Add graphql support

Functionality, like redeeming product codes, rely on graphql queries and mutations. It would be nice to see some kind of abstraction for graphql requests. I could PM you some examples.

Support 2FA/Email Verification

The login method could automatically pop open a window to confirm the code, and let you solve it before it resolves the promise in order to authenticate properly

Add hasFriend Method

Just another suggestion. A method that would be helpful is a hasFriend(id_or_name) method for the client.

Cannot get launcher status

With the new update, I have noticed that I get the following error sometimes when a client is initialized:

Cannot get launcher status.
Error: errors.com.epicgames.common.missing_permission
    at Client.getLauncherStatus (C:\Discord Bots\Test\node_modules\epicgames-client\src\Client\index.js:409:16)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)

TypeError: this.stream.sendRequest is not a function

Uncaught Promise Error:  TypeError: this.stream.sendRequest is not a function
    at Communicator.sendMessage (C:\TestBot\node_modules\epicgames-client\src\Communicator\index.js:277:15)
    at Communicator.communicator.on (C:\TestBot\index.js:72:26)
    at Communicator.emit (events.js:182:13)
    at Client.stream.on.stanza (C:\TestBot\node_modules\epicgames-client\src\Communicator\index.js:243:13)
    at Client.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:117:30)
    at Client.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\client.js:91:14)
    at Client.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:117:30)
    at WSConnection.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\client.js:341:18)
    at WSConnection.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:128:30)
    at WSConnection.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\transports\websocket.js:86:14)
TypeError: this.stream.sendRequest is not a function
    at Communicator.sendMessage (C:\TestBot\node_modules\epicgames-client\src\Communicator\index.js:277:15)
    at Communicator.communicator.on (C:\TestBot\index.js:72:26)
    at Communicator.emit (events.js:182:13)
    at Client.stream.on.stanza (C:\TestBot\node_modules\epicgames-client\src\Communicator\index.js:243:13)
    at Client.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:117:30)
    at Client.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\client.js:91:14)
    at Client.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:117:30)
    at WSConnection.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\client.js:341:18)
    at WSConnection.prototype.emit (C:\TestBot\node_modules\wildemitter\wildemitter.js:128:30)
    at WSConnection.<anonymous> (C:\TestBot\node_modules\stanza.io\lib\transports\websocket.js:86:14)

I am receiving the above error when using the code below:

client.egClient = new EpicGamesClient({
	email: "email",
	password: "password"
});

try {
	await client.egClient.init();
	await client.egClient.login();

	const communicator = client.egClient.communicator;

	communicator.on("friend:request", async (data) => {
		communicator.sendMessage(data.account_id, "[Debug 1] This is a test message!");
	});
} catch (error) {
	console.log(error);
}

git submodule fail when this repo is used as a dependency

This happens when you try to run git submodule update on this repo - which incidentally is what npm does when you declare SzymonLisowiec/node-epicgames-client as a dependency, making the package install fail:

$git submodule update -q --init --recursive
fatal: No url found for submodule path 'docs/.vuepress/dist' in .gitmodules

git rm on the "ghost" gitlink allows the command to complete successfully and unblocks npm, but you'd have to figure out whether this was actually supposed to be a real submodule which is missing for some reason.
$git rm docs\.vuepress\dist\

Add getFriendStatus Method

A method to return the current status of a single friend would be very helpful, rather than having to listen to the friend:status event which only sends data when a friend's status changes. It would also be good if there could be another method to retrieve the status of multiple friends, similar to getProfiles

getFriendStatus(account_id) - Returns the status of a friend.
getFriendStatuses(account_ids) - Returns the status of multiple friends.

More extensive XMPP Features

Just discovered this repo last night, I suspect this is how people like FNPL and FortniteTracker are making bot accounts. I used to be making a node.js program Konsole with Jaren until he got a c&d from Epic. We did pretty extensive xmpp stuff such as faking being in game, forcing people to ready up, infinite emotes, etc. Obviously forcing ready up won't work on a bot (theoretically) However I think some things like showing status as in the Epic launcher vs in Fortnite and being able to set if it's in game or not would be nice additions.

Here's what it looks like in the Launcher vs in Fortnite:
image

"Directory's path to store" issue

I want to install node-epicgames-clienton Firebase functions.
The only folder with write permissions is the tmp/ folder.

So I use this config :

  const launcher = new Launcher({
    email: 'E-MAIL',
    password: 'PASSWORD',
    store: '/tmp/.egstore',
  });

And i have this error :
Error: EROFS: read-only file system, mkdir '/workspace/.egstore'

Chat support?

Any chance you've looked into chat support before?

Accept or deny friend requests

Just a feature request which I noticed was not currently in. The ability to either accept or deny a received friend request such as through the friend:request event.

login with auth code?

Hello, account, what i use for this have email verification, it's here some solution, how login with email verification code? Something like writing email code to script? Thank you and have a nice day

//edit: we talk about it on discord, probably solved, this function will be added probably

Always getting a "Error while initialize or login process"

While logging in I always get the message "Error while initialize or login process"

(node:23416) UnhandledPromiseRejectionWarning: Error: Error while initialize or login process.
    at Object.exports.login ([path]\epic.js:7:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:23416) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:23416) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

My code:

const { Launcher } = require('epicgames-client');

const launcher = new Launcher({ email: "email", password: "pass" });

exports.login = async (email, password) => {
    if(!await launcher.init() || !await launcher.login()) {
      throw new Error('Error while initialize or login process.');
    }
    
    console.log(`Logged in as ${launcher.account.name}`);
};

Also, is there any way to get more information on why it failed or something?

Pickaxe Variants

Currently, I have this,

            async function setPickaxe(member, asset, key, variants) {
              await member.meta.setCosmeticLoadout({
                pickaxeDef: asset,
                pickaxeEKey: key || '',
                variants: variants || []
               })
          }

All that does is set the pickaxe, I want to figure out how to put variants on pickaxes.

Be able to answer prompts in code instead of only stdin

Hi Kysune!

Thank you for this wonderful project!
I tried using it to claimer free games at epicgames automatically.
What made me really hard is the code is fixed to use stdin as input to answer prompts (e.g. 2-Factor Code). I can not do it while my server is deployed to the cloud. I hope there is a way to receive a variable as the answer.
Also, I hope the client is able to receive an argument to change the .esstore location.

Thanks again.

eg.logout() doesn't work

Hello,
If I use eg.logout, I take error:
UnhandledPromiseRejectionWarning: errors.com.epicgames.common.oauth
.invalid_token
(node:17474) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejectio
n id: 2)

updateStatus() does not set status

Unfortunately, everytime I try use updateStatus() it fails. I have tried put strings, no strings, big strings etc. None have set my status correctly.

Add methods and classes

Seems alot easier to understand and easier to use if you could be able to do message.reply() or invite.accept

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.