25 lines
856 B
TypeScript
25 lines
856 B
TypeScript
import './PlayerIOClient.development';
|
|
|
|
export const authenticate = function (
|
|
gameId: string,
|
|
connectionId: string,
|
|
authenticationArguments: Record<string, string>,
|
|
playerInsightSegments: Array<string>,
|
|
): Promise<PlayerIO.Client> {
|
|
return new Promise<PlayerIO.Client>((resolve, reject) => {
|
|
PlayerIO.authenticate(gameId, connectionId, authenticationArguments, playerInsightSegments, resolve, reject);
|
|
});
|
|
}
|
|
|
|
export const listRooms = function (
|
|
multiplayer: PlayerIO.Multiplayer,
|
|
roomType: string,
|
|
searchCriteria: Record<string, string>,
|
|
resultLimit: number,
|
|
resultOffset: number,
|
|
): Promise<Array<PlayerIO.RoomInfo>> {
|
|
return new Promise<Array<PlayerIO.RoomInfo>>((resolve, reject) => {
|
|
multiplayer.listRooms(roomType, searchCriteria, resultLimit, resultOffset, resolve, reject);
|
|
});
|
|
}
|