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); } }
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)); }
public void Write(MessageBase msg) { msg.Serialize(this); }
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)); }