SzymonLisowiec / node-epicgames-client

Unofficial EpicGames Launcher in javascript.
MIT License
110 stars 34 forks source link

Party join not working #55

Closed adeelahmed1786 closed 4 years ago

adeelahmed1786 commented 5 years ago

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: 'adeelahmedfeelfriendly@gmail.com',
    password: '',
    createPartyOnStart: true,
    debug: console.log

});
let egClient = new EGClient({
    email: 'adeelahmedfeelfriendly@gmail.com',
    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();
    });
})();
SzymonLisowiec commented 5 years ago

EGClient is same thing as Launcher. Please update library version to 2.0.16. PS. Remove your account's credentials from code.

alextusinean commented 5 years ago

When this'll be fixed?