UNPKG

@xmobitea/gn-server

Version:

GearN Server by XmobiTea (Pro)

131 lines (130 loc) 6.43 kB
import { RequestController } from "./GN-app-api/handler/controller/RequestController"; import { OperationEvent } from "./GN-common/entity/operationEvent/OperationEvent"; import { xDatabase } from "./GN-library/xdatabase/lib/xDatabase"; import { SocketApp } from "./GN-startup/SocketApp"; import { HttpApp } from "./GN-startup/HttpApp"; import { IRequestHandler } from "./GN-app-api/handler/controller/handler/base/IRequestHandler"; import { IFacebookService } from "./GN-app-api/service/IFacebookService"; import { IAppleService } from "./GN-app-api/service/IAppleService"; import { ICloudScriptService } from "./GN-app-api/service/ICloudScriptService"; import { ITimerService } from "./GN-app-api/service/ITimerService"; import { OnRunSuccess } from "./GN-library/xbuilder/lib/OnRunSuccess"; import { ApiMiddleware } from "./GN-startup/middleware/ApiMiddleware"; import { IRequestConverterService } from "./GN-app-api/service/IRequestConverterService"; import { IGoogleService } from "./GN-app-api/service/IGoogleService"; import { IAnalyticsService } from "./GN-app-api/service/IAnalyticsService"; import { IPushNotificationService } from "./GN-app-api/service/IPushNotificationService"; import { IEmailService } from "./GN-app-api/service/IEmailService"; import { ICacheService } from "./GN-app-api/service/ICacheService"; import { IConfigService } from "./GN-app-api/service/IConfigService"; import { xGNSettings } from "./GN-library/xsettings/lib/xGNSettings"; import { IPostEventCallbackService, IPreEventCallbackService } from "./GN-app-api/service/IEventCallbackService"; import { IEventCallbackCloudScriptService } from "./GN-app-api/service/EventCallbackService"; import { IGameCenterService } from "./GN-app-api/service/IGameCenterService"; import { IGooglePlayGameService } from "./GN-app-api/service/IGooglePlayGameService"; import { ICountryIPDetailService } from "./GN-app-api/service/ICountryIPDetailService"; import { ServerDetail } from "./GN-library/xdatabase/lib/entity/pro/ServerDetail"; interface CreateIndexesOptions { unique?: boolean; sparse?: boolean; expireAfterSeconds?: number; } export declare class GNServer { static getServerVersion(): string; private socketApp; private httpApp; private apiMiddleware; private requestController; private idTypeCase; private restoreRootPassword; private xGNSettings; private xDatabase; private facebookService; private appleService; private googleService; private googlePlayGameService; private gameCenterService; private timerService; private requestConverterService; private analyticsService; private postEventCallbackService; private preEventCallbackService; private cloudScriptServiceDic; private eventCallbackCloudScriptService; private countryIPDetailService; private pushNotificationService; private emailService; private cacheServiceDic; private configServiceDic; private gameIds; private matchmakingHandler; private waitingServerDetailDict; private postEventCallbackCollection; constructor(); init(): void; run(onRunSuccess?: OnRunSuccess): void; setSocketApp(socketApp: SocketApp): void; setHttpApp(httpApp: HttpApp): void; setApiMiddleware(apiMiddleware: ApiMiddleware): void; getApiMiddleware(): ApiMiddleware; getSocketApp(): SocketApp; getHttpApp(): HttpApp; getRequestController(): RequestController; addCustomHandler(requestHandler: IRequestHandler, onlyAuthenticated?: boolean): void; getCustomHandler(operationCode: string): IRequestHandler; removeCustomHandler(operationCode: string): void; createIndex(collectionName: string, index: { [k: string]: any; }, options?: CreateIndexesOptions): void; logCreateIndex(collectionName: string, index: { [k: string]: any; }, options?: CreateIndexesOptions): void; getConfigService(gameId: string): IConfigService; setConfigGame(gameId: string, configService: IConfigService): void; setIdTypeCase(idTypeCase: number): void; getIdTypeCase(): number; setRestoreRootPassword(restoreRootPassword: string): void; getRestoreRootPassword(): string; getGNSettings(): xGNSettings; getDatabase(): xDatabase; getCacheService(gameId: string): ICacheService; setCacheService(gameId: string, cacheService: ICacheService): void; getFacebookService(): IFacebookService; getPostEventCallbackService(): IPostEventCallbackService; getPreEventCallbackService(): IPreEventCallbackService; getEventCallbackCloudScriptService(): IEventCallbackCloudScriptService; getCountryIPDetailService(): ICountryIPDetailService; getAppleService(): IAppleService; getGoogleService(): IGoogleService; getGooglePlayGameService(): IGooglePlayGameService; getGameCenterService(): IGameCenterService; getTimerService(): ITimerService; getAnalyticsService(): IAnalyticsService; getRequestConverterService(): IRequestConverterService; getEmailService(): IEmailService; getPushNotificationService(): IPushNotificationService; getCloudScriptService(gameId: string): ICloudScriptService; setCloudScriptService(gameId: string, cloudScriptService: ICloudScriptService): Map<string, ICloudScriptService>; sendEventTo(userId: string, operationEvent: OperationEvent): Promise<void>; private executeSendEventTo; sendEventToRoom(roomId: string, operationEvent: OperationEvent): Promise<void>; private executeSendEventToRoom; sendEventToMoreUser(userIds: string[], operationEvent: OperationEvent): Promise<void>; private executeSendEventToMoreUser; sendEventToAllPlayer(operationEvent: OperationEvent): Promise<void>; private executeSendEventToAllPlayer; joinRoom(userId: string, roomId: string): void; leaveRoom(userId: string, roomId: string): void; getRooms(userId: string): Promise<string[]>; private handleSocketDisconnect; private handleOnRequest; private handleMatchmaking; private handleRemoveCacheInvalidData; private handleMatchmakingForGame; private requestMatchServerDetail; setMatchServerDetail(gameId: string, matchId: string, serverDetail: ServerDetail, ticketIds: string[]): void; setMatchServerDetailFailed(gameId: string, matchId: string, ticketIds: string[], reason: string): void; getGameIds(): string[]; isPrimary(): boolean; } export {};