public void prepare(ChatReceiveContext context, string world, uint entityID, string name, string message) { tmpArray.Add("context", context); tmpArray.Add("world", world); tmpArray.Add("entityID", entityID); tmpArray.Add("name", name); tmpArray.Add("message", message); }
public void prepare(ChatReceiveContext context, string message) { tmpArray.Add("context", context); tmpArray.Add("world", ""); tmpArray.Add("entityID", 0); tmpArray.Add("name", ""); tmpArray.Add("message", message); }
public void sendChatMessage(ChatReceiveContext context, string world, uint clientID, string name, string message) { if (state != ClientState.Connected) { return; } Packet11ChatSend packet = new Packet11ChatSend(this, Util.Direction.Client); packet.prepare(context, world, clientID, name, message); this.packetQueue.Add(packet); }
public override void onSend() { if (tmpArray.Count < 5) { return; } MemoryStream packet = new MemoryStream(); BinaryWriter packetWrite = new BinaryWriter(packet); ChatReceiveContext sContext = (ChatReceiveContext)tmpArray["context"]; string sWorld = (string)tmpArray["world"]; uint sClientID = (uint)tmpArray["entityID"]; // Player entity ID string sName = (string)tmpArray["name"]; // Name string sMessage = (string)tmpArray["message"]; // Message packetWrite.Write((byte)sContext); packetWrite.WriteStarString(sWorld); packetWrite.WriteBE(sClientID); packetWrite.WriteStarString(sName); packetWrite.WriteStarString(sMessage); this.client.sendClientPacket(Packet.ChatReceive, packet.ToArray()); }
public void sendChatMessage(ChatReceiveContext context, string world, uint clientID, string name, string message) { if (clientState != ClientState.Connected) return; Packet11ChatSend packet = new Packet11ChatSend(this, false, Util.Direction.Client); packet.prepare(context, world, clientID, name, message); packet.onSend(); }
public void sendChatMessage(ChatReceiveContext context, string name, string message) { sendChatMessage(context, "", 0, name, message); }
public void sendChatMessage(ChatReceiveContext context, string name, string message) { if (state != ClientState.Connected) return; Packet11ChatSend packet = new Packet11ChatSend(this, Util.Direction.Client); packet.prepare(context, "", 0, name, message); packet.onSend(); }