friend-connect
Version:
**BEFORE YOU USE THIS TOOL, PLEASE READ THE FOLLOWING: WE _AS CONTRIBUTORS_ ARE NOT RESPONSIBLE FOR ANY DAMAGE OR LOSS CAUSED BY THIS APP. USE AN ALT ACCOUNT, JUST IN CASE THERE IS AN ISSUE WITH THIS METHOD.**
101 lines (100 loc) • 3.44 kB
TypeScript
/// <reference types="node" />
import { EventEmitter } from "events";
interface SessionOptionsConstants {
gamemode?: boolean;
protocol?: boolean;
version?: boolean;
worldName?: boolean;
hostName?: boolean;
maxConnectedPlayers?: boolean;
connectedPlayers?: boolean;
}
interface AdditionalSessionOptions {
autoFriending?: boolean;
log?: boolean;
constants?: SessionOptionsConstants;
pingServerForInfo?: boolean;
}
interface FriendConnectSessionInfoOptions {
/**
* The name of the server, this can be up to 35 characters long but I would stay to a maximum of 26-27
*/
hostName: string;
/**
* The subheader of the server name, use this as the motd (message of the day). I would stay at a maximum of 24 ish characters long
*/
worldName: string;
/**
* A string that can be any value that is in the place of the version
*/
version: string;
/**
* The path to the directory that the authentication tokens are stored.
*/
tokenPath: string;
/**
* The protocol number that corresponds which versions of the game can join
*/
joinability: "joinable_by_friends";
pingServerForInfo?: boolean;
protocol: number;
connectedPlayers: number;
maxConnectedPlayers: number;
ip: string;
port: number;
log?: boolean;
connectionType: number;
autoFriending?: boolean;
constants?: SessionOptionsConstants;
accounts: string[];
}
interface MinecraftLobbyCustomProperties {
BroadcastSetting: number;
CrossPlayDisabled: boolean;
Joinability: string | "joinable_by_friends";
LanGame: boolean;
MaxMemberCount: number;
MemberCount: number;
OnlineCrossPlatformGame: boolean;
SupportedConnections: {
ConnectionType: number;
HostIpAddress: string;
HostPort: number;
RakNetGUID: string;
}[];
TitleId: number;
TransportLayer: number;
levelId: string;
hostName: string;
ownerId: string;
rakNetGUID: string;
worldName: string;
worldType: string;
protocol: number;
version: string;
}
import { XboxClient } from "./xbox";
import { RTAMultiplayerSession } from "./xbox/modules/rta";
declare class Session extends EventEmitter {
#private;
xboxAccounts: Map<string, XboxClient>;
hostAccount: XboxClient;
get sessionInstance(): RTAMultiplayerSession;
minecraftLobbyCustomOptions: MinecraftLobbyCustomProperties;
get friendXuids(): IterableIterator<string>;
additionalOptions: AdditionalSessionOptions;
get accountXuids(): IterableIterator<string>;
fullOfFriends: Set<string>;
started: boolean;
doingDuplicateFriendCheck: boolean;
doingAutoFriendInterval: boolean;
constructor(options: FriendConnectSessionInfoOptions);
duplicateFriendCheck(callback?: () => void): void;
initializeAccounts(accountEmails: string[], tokenPath: string): void;
checkAchievements(accounts: IterableIterator<XboxClient>): void;
createMinecraftLobbyCustomProperties(xbox: XboxClient, options: FriendConnectSessionInfoOptions): MinecraftLobbyCustomProperties;
setFriendInterval(accounts: IterableIterator<XboxClient>): void;
getAdvertisement(): Promise<void>;
errorHandling(error: Error, xuid: string, source: string): void;
}
export { Session };