private void DebugMessage(BgoProtocolWriter w) { BgoProtocolReader buffer = new BgoProtocolReader(w.GetBuffer()); buffer.ReadUInt16(); byte protocolId = buffer.ReadByte(); Log.Add(LogSeverity.INFO, Log.LogDir.Out, string.Format("Protocol ID: {0} ({1}) - msgType: {2}", protocolId, (ProtocolID)protocolId, buffer.ReadUInt16())); }
/// <summary> /// Sends a message to one specific client by his index. /// </summary> /// <param name="index"></param> /// <param name="message"></param> public static void SendDataToClient(int index, BgoProtocolWriter message) { foreach (Client clients in _clients) { if (clients.socket != null && !clients.closing && clients.index == index) { clients.socket.Send(message.GetBuffer(), 0, message.GetLength(), SocketFlags.None); } } }