Пример #1
0
 private void CreateLocalButton()
 {
     // Check if connected, there is a name and if there local exists
     if (NetworkClient.Connected && ((TextBox)MenuItems["Name"]).Text.Length > 0 && !GameplayNetworkHandler.LocalExists)
     {
         GameplayNetworkHandler.Send("LGH" + ((TextBox)MenuItems["Name"]).Text); // Request to become host by: Local Game Host: LGH<playerName>
     }
 }
Пример #2
0
 private void JoinLocalButton()
 {
     // Check if connected, and if there is a name and if there is a local game
     if (NetworkClient.Connected && ((TextBox)MenuItems["Name"]).Text.Length > 0 && GameplayNetworkHandler.LocalExists)
     {
         GameplayNetworkHandler.Send("LGJ" + ((TextBox)MenuItems["Name"]).Text); // Send Local Game Join request: LGJ<playerName>
     }
 }
Пример #3
0
 private void mainMenuButton()
 {
     // If host leaves let the server know and reset values
     if (GameplayNetworkHandler.IsHost)
     {
         GameplayNetworkHandler.Send("LHL");
         GameplayNetworkHandler.IsHost      = false;
         GameplayNetworkHandler.JoinedLocal = false;
     }
 }
Пример #4
0
 private void MainMenuButton()
 {
     Game1.WindowManager.GameState = Managers.GameState.MainMenu;
     GameplayNetworkHandler.Reset();
 }
Пример #5
0
 private void startButtonClick()
 {
     // If host starts the game then let the server know
     GameplayNetworkHandler.Send("LGS");
 }