Exemplo n.º 1
0
    public void SendToClients(NetworkMessage incoming)
    {
        ClientJoinedMessage message = incoming.ReadMessage <ClientJoinedMessage>();

        Usernames.Add(incoming.conn.connectionId, message.Username);
        NetworkServer.SendToClient(incoming.conn.connectionId, UpdatePlayerAssignment.Code, new UpdatePlayerAssignment()
        {
            PlayerId = incoming.conn.connectionId
        });
    }
Exemplo n.º 2
0
 private void ClientJoinedCallback(ClientJoinedMessage msg, float travelTime)
 {
     clients.Add(new MatchClient(msg.ClientGuid, msg.ClientName));
     Debug.Log("New client " + msg.ClientName);
 }
Exemplo n.º 3
0
    private void OnClientJoinedMessage(NetworkMessage incoming)
    {
        ClientJoinedMessage message = incoming.ReadMessage <ClientJoinedMessage> ();

        chatText.AddText(String.Format(FindObjectOfType <LanguageManager> ().GetString("chat.userJoined"), message.Username));
    }