Exemplo n.º 1
0
 //Has server control the username (MasterServer Example)
 public void SendChatMsg(string data)
 {
     client.Send((short)MsgId.Chat, new ChatMsg()
     {
         Data = data
     });
 }
Exemplo n.º 2
0
 //Has server control the username (MasterServer Example)
 public void SendChatMsg(string data)
 {
     client.Send(new ChatMsg()
     {
         Data = data
     });
 }
Exemplo n.º 3
0
 public void SendStartMatchMaking()
 {
     client.Send((short)MsgId.StartMatchMaking, new StartMatchMaking()
     {
         PlayListName = "SuperAwesomeGame"
     });
 }
Exemplo n.º 4
0
 private void SendGameRegistrationToGameManager()
 {
     Debug.Log("[GameRegistration] - registering with master");
     client.Send((short)MsgId.RegisterGame, new RegisterGameMsg()
     {
         UniqueID = UniqueID, SceneName = GameScene, NetworkPort = NetworkPort, NetworkAddress = NetworkAddress
     });
 }
Exemplo n.º 5
0
 void Update()
 {
     //Used only if acting as a ChildSpawner under a MasterServer
     if (client && !registrationComplete)
     {
         if (client.isConnected)
         {
             UnityEngine.Debug.LogWarning("[ProcessSpawner] - Registering to Master");
             client.Send((short)MsgId.RegisterSpawner, new RegisterSpawnerMsg()
             {
                 UniqueID   = "",
                 MaxThreads = MaximumProcesses
             });                                   //Can provide a password to authenticate to the master as a trusted spawner
             registrationComplete = true;
         }
     }
 }
Exemplo n.º 6
0
    public void HandleSendChat()
    {
        insight.Send((short)MsgId.Chat, new ChatMsg()
        {
            Origin = nameInput.text, Data = chatInput.text
        });

        chatInput.text = ""; //Clear out the previously entered text from the field
    }
Exemplo n.º 7
0
 public void SendLoginMsg(string username, string password)
 {
     client.Send((short)MsgId.Login, new LoginMsg()
     {
         AccountName = username, AccountPassword = Sha256(password)
     }, (callbackStatus, reader) =>
     {
         if (callbackStatus == CallbackStatus.Ok)
         {
             StatusMsg msg  = reader.ReadMessage <StatusMsg>();
             loginResponse  = msg.Text;
             loginSucessful = true; //This will always be true for prototyping
             Debug.Log(msg.Text);
         }
         if (callbackStatus == CallbackStatus.Error)
         {
             Debug.LogError("Callback Error: Login error");
         }
         if (callbackStatus == CallbackStatus.Timeout)
         {
             Debug.LogError("Callback Error: Login attempt timed out");
         }
     });
 }
Exemplo n.º 8
0
 public void SendGetGamesListMsg()
 {
     client.Send((short)MsgId.RequestGame, new PropertiesMsg()
     {
     });                                                              //you should also be able to specify options
 }