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); } }
public void Send(Packet packet) { packet.OnSend(); this.Send(NetworkHelper.EncodePacket(packet)); }