private async void HandleServerStartMultiplayer() { GameNetwork.PreStartMultiplayerOnServer(); BannerlordNetwork.StartMultiplayerLobbyMission(LobbyMissionType.Custom); if (Module.CurrentModule.StartMultiplayerGame(this._gameClient.CustomGameType, this._gameClient.CustomGameScene)) { ; } while (Mission.Current == null || Mission.Current.CurrentState != Mission.State.Continuing) { await Task.Delay(1); } GameNetwork.StartMultiplayerOnServer(9999); if (!this._gameClient.IsInGame) { return; } BannerlordNetwork.CreateServerPeer(); MBDebug.Print("Server: I finished loading and I am now visible to clients in the server list.", debugFilter: 17179869184UL); if (GameNetwork.IsDedicatedServer) { return; } GameNetwork.ClientFinishedLoading(GameNetwork.MyPeer); }
public static void CreateServerPeer() { if (MBCommon.CurrentGameType != MBCommon.GameType.MultiClientServer) { return; } GameNetwork.AddNewPlayerOnServer(BannerlordNetwork.CreateServerPeerConnectionInfo(), true, true); }
private async void HandleServerEventUnloadMissionAux() { GameNetwork.MyPeer.IsSynchronized = false; this.CurrentIntermissionTimer = 0.0f; this.ClientIntermissionState = MultiplayerIntermissionState.Idle; BannerlordNetwork.EndMultiplayerLobbyMission(); while (Mission.Current != null) { await Task.Delay(1); } LoadingWindow.DisableGlobalLoadingWindow(); MBDebug.Print("Client: I finished HandleServerEventUnloadMissionAux. Sending confirmation to server.", debugFilter: 17179869184UL); GameNetwork.BeginModuleEventAsClient(); GameNetwork.WriteMessage((GameNetworkMessage) new FinishedLoading()); GameNetwork.EndModuleEventAsClient(); }
protected override void StartMultiplayer() { MBDebug.Print("CUSTOM GAME SERVER ADDRESS: " + this._address); GameNetwork.StartMultiplayerOnClient(this._address, this._port, this._sessionKey, this._peerIndex); BannerlordNetwork.StartMultiplayerLobbyMission(LobbyMissionType.Custom); }
protected override void StartMultiplayer() { GameNetwork.StartMultiplayerOnClient(this._address, this._assignedPort, this._sessionKey, this._playerIndex); BannerlordNetwork.StartMultiplayerLobbyMission(LobbyMissionType.Matchmaker); Module.CurrentModule.StartMultiplayerGame(this._multiplayerGameType, this._scene); }