Esempio n. 1
0
        public void UpdateGameInfo()
        {
            MyEventUpdateGame msg = new MyEventUpdateGame();

            msg.Name     = MyGuiScreenGamePlay.Static.GetGameName(GameType, MyGameplayConstants.GetGameplayDifficulty());
            msg.Password = null;
            msg.JoinMode = JoinMode;

            //if (JoinMode == MyJoinMode.Open)
            //{
            //    MyEventCreateGame createGameRequest = new MyEventCreateGame();
            //    createGameRequest.SectorName = msg.Name;
            //    createGameRequest.Password = String.Empty;
            //    createGameRequest.Type = GameType;
            //    createGameRequest.JoinMode = JoinMode;
            //    createGameRequest.Difficulty = MyGameplayConstants.GetGameplayDifficulty();
            //    Peers.SendServer(ref createGameRequest);
            //}

            Peers.SendServer(ref msg);
        }
Esempio n. 2
0
 private void AnnounceGame()
 {
     if (!Peers.IsConnectedToServer)
     {
         try
         {
             Peers.NetworkClient.RemoveCallback <MyEventLoginResponse>();
             Peers.NetworkClient.RemoveCallback <MyEventCreateGameResponse>();
             LastCreateGameRequest.JoinMode   = JoinMode;
             LastCreateGameRequest.SectorName = MyGuiScreenGamePlay.Static.GetGameName(GameType, MyGameplayConstants.GetGameplayDifficulty());
             Peers.SendServer(ref LastCreateGameRequest);
         }
         catch
         {
         }
     }
 }