예제 #1
0
 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);
 }
예제 #2
0
 private async void HandleClientEventFinishedLoadingAux(
     NetworkCommunicator networkPeer,
     FinishedLoading message)
 {
     while (Mission.Current != null && Mission.Current.CurrentState != Mission.State.Continuing)
     {
         await Task.Delay(1);
     }
     if (networkPeer.IsServerPeer)
     {
         return;
     }
     MBDebug.Print("Server: " + networkPeer.UserName + " has finished loading. From now on, I will include him in the broadcasted messages", debugFilter: 17179869184UL);
     GameNetwork.ClientFinishedLoading(networkPeer);
 }