Пример #1
0
 public static void SendToClientOfPlayer(NetworkIdentity identity, int msgType, MessageBase msg)
 {
     if (identity != null)
     {
         identity.connectionToClient.Send(msgType, msg);
     }
     else
     {
         Debug.LogError("SendToClientOfPlayer: player has no NetworkIdentity: " + identity.name);
     }
 }
Пример #2
0
 public bool Send(int msgType, MessageBase msg, int channelId = Channels.DefaultReliable)
 {
     // pack message and send
     byte[] message = MessagePacker.PackMessage(msgType, msg);
     return(Send(new ArraySegment <byte>(message), channelId));
 }
Пример #3
0
 public void Write(MessageBase msg)
 {
     msg.Serialize(this);
 }
Пример #4
0
 public virtual bool Send(int msgType, MessageBase msg, int channelId = Channels.DefaultReliable)
 {
     // pack message and send
     byte[] message = MessagePacker.PackMessage(msgType, msg);
     return(SendBytes(message, channelId));
 }