Exemple #1
0
 public void Send(IEnumerable <ushort> tokenIds, Packet packet)
 {
     packet.OnSend();
     byte[] data = NetworkHelper.EncodePacket(packet);
     foreach (ushort tokenId in tokenIds)
     {
         if (!this._idToTokens.TryGetValue(tokenId, out KCPUserToken token))
         {
             Logger.Warn($"Usertoken {tokenId} not found");
             continue;
         }
         token.Send(data);
     }
 }
Exemple #2
0
 public void Send(Packet packet)
 {
     packet.OnSend();
     this.Send(NetworkHelper.EncodePacket(packet));
 }