public void Send(CtosMessage message, int value) { GameClientPacket packet = new GameClientPacket(message); packet.Write(value); Send(packet); }
public void Chat(string message) { byte[] content = Encoding.Unicode.GetBytes(message + "\0"); GameClientPacket chat = new GameClientPacket(CtosMessage.Chat); chat.Write(content); Connection.Send(chat); }
private void InternalSend(GameClientPacket packet) { m_lastAction = DateTime.Now; MemoryStream ms = new MemoryStream(); BinaryWriter writer = new BinaryWriter(ms); byte[] content = packet.GetContent(); writer.Write((short)content.Length); if (content.Length > 0) { writer.Write(content); } byte[] data = ms.ToArray(); m_client.Client.Send(data); }
public void Start() { Connection = new GameConnection(IPAddress.Parse(m_server.ServerAddress), m_server.ServerPort); m_behavior = new GameBehavior(this); GameClientPacket packet = new GameClientPacket(CtosMessage.PlayerInfo); packet.Write(Program.Config.Username + "$" + (IsCheckmate ? Program.Config.Password : DevClient.Token.ToString()), 20); Connection.Send(packet); byte[] junk = {0xCC, 0xCC, 0x00, 0x00, 0x00, 0x00}; packet = new GameClientPacket(CtosMessage.JoinGame); packet.Write(Version); packet.Write(junk); packet.Write(m_roomInfos, 30); Connection.Send(packet); }
public void Send(CtosMessage message, int value) { GameClientPacket packet = new GameClientPacket(message); packet.Write(value); Send(packet); }
public void Send(GameClientPacket packet) { lock (m_sendQueue) m_sendQueue.Enqueue(packet); }
private void InternalSend(GameClientPacket packet) { m_lastAction = DateTime.Now; MemoryStream ms = new MemoryStream(); BinaryWriter writer = new BinaryWriter(ms); byte[] content = packet.GetContent(); writer.Write((short)content.Length); if (content.Length > 0) writer.Write(content); byte[] data = ms.ToArray(); m_client.Client.Send(data); }
public void Send(GameClientPacket packet) { lock (m_sendQueue) m_sendQueue.Enqueue(packet); }