//Has server control the username (MasterServer Example) public void SendChatMsg(string data) { client.Send((short)MsgId.Chat, new ChatMsg() { Data = data }); }
//Has server control the username (MasterServer Example) public void SendChatMsg(string data) { client.Send(new ChatMsg() { Data = data }); }
public void SendStartMatchMaking() { client.Send((short)MsgId.StartMatchMaking, new StartMatchMaking() { PlayListName = "SuperAwesomeGame" }); }
private void SendGameRegistrationToGameManager() { Debug.Log("[GameRegistration] - registering with master"); client.Send((short)MsgId.RegisterGame, new RegisterGameMsg() { UniqueID = UniqueID, SceneName = GameScene, NetworkPort = NetworkPort, NetworkAddress = NetworkAddress }); }
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; } } }
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 }
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"); } }); }
public void SendGetGamesListMsg() { client.Send((short)MsgId.RequestGame, new PropertiesMsg() { }); //you should also be able to specify options }