private void ConnectToChat() { if (GameConstants.PHOTON_CHAT_DISABLED) { this.chatAdapter.Disable(); return; } Squad currentSquad = this.controller.StateManager.GetCurrentSquad(); if (currentSquad == null) { return; } string pHOTON_CHAT_APP_VERSION = GameConstants.PHOTON_CHAT_APP_VERSION; if (string.IsNullOrEmpty(pHOTON_CHAT_APP_VERSION)) { Service.Logger.Error("Connecting to Photon failed. photon app version not set in game constants"); return; } string photonAppId = AppServerEnvironmentController.GetPhotonAppId(); string playerId = Service.CurrentPlayer.PlayerId; string squadID = currentSquad.SquadID; this.chatAdapter.Connect(photonAppId, pHOTON_CHAT_APP_VERSION, GameConstants.PHOTON_CHAT_HISTORY_LENGTH, GameConstants.PHOTON_CHAT_KEEP_ALIVE_TICK, playerId); GetSquadChatKeyCommand getSquadChatKeyCommand = new GetSquadChatKeyCommand(new SquadIDRequest { PlayerId = Service.CurrentPlayer.PlayerId, SquadId = squadID }); getSquadChatKeyCommand.AddSuccessCallback(new AbstractCommand <SquadIDRequest, GetSquadChatKeyResponse> .OnSuccessCallback(this.OnGetChatKeySuccess)); getSquadChatKeyCommand.AddFailureCallback(new AbstractCommand <SquadIDRequest, GetSquadChatKeyResponse> .OnFailureCallback(this.OnGetChatKeyFailure)); Service.ServerAPI.Sync(getSquadChatKeyCommand); }
public override void Start() { this.useRealAuthentication = !AppServerEnvironmentController.IsLocalServer(); this.hasSecondary = true; new QuietCorrectionController(); new ServerAPI(Service.AppServerEnvironmentController.Server, Convert.ToUInt32("77"), Service.ViewTimerManager, Service.Engine, new ServerAPI.DesynHandler(this.OnDesync), new ServerAPI.MessageHandler(this.MessageHandler)); new ServerController(); new GameIdleController(); this.FigureOutAuth(); }
private void FigureOutAuth() { this.useRealAuthentication = !AppServerEnvironmentController.IsLocalServer(); this.GetOrCreatePlayer(); }