public virtual void SendTCPRaw(PacketOut packet) { if (!packet.Finalized) { packet.WritePacketLength(); } SendAsynchronousTCP2((byte[])packet.GetBuffer().Clone()); }
// Envoi un packet public void SendTCP(PacketOut packet) { //Fix the packet size packet.WritePacketLength(); packet = Crypt(packet); //Get the packet buffer byte[] buf = packet.ToArray(); //packet.WritePacketLength sets the Capacity //Send the buffer SendTCP(buf); }
// Envoi un packet public virtual void SendPacket(PacketOut packet) { if (!packet.Finalized) { packet.WritePacketLength(); } //Send the encrypted packet SendPacketNoBlock(packet); // Crypt(packet); // SendAsynchronousTCP(TLSendBuffer.Value); }
public void SendToAll(PacketOut Packet) { Packet.WritePacketLength(); lock (Clients.SyncRoot) { for (int i = 0; i < Clients.Length; ++i) { if (Clients[i] != null) { Clients[i].SendTCP(Packet.ToArray()); } } } }
public void SendToAll(PacketOut Packet) { Packet.WritePacketLength(); LockReadClients(); for (int i = 0; i < Clients.Length; ++i) { if (Clients[i] != null) { Clients[i].SendTCP(Packet.ToArray()); } } UnLockReadClients(); }
// Unused public void SendToAll(PacketOut Packet) { if (!Packet.Finalized) { Packet.WritePacketLength(); } LockReadClients(); for (int i = 0; i < Clients.Length; ++i) { if (Clients[i] != null) { Clients[i].SendAsynchronousTCP(Packet.ToArray()); } } UnLockReadClients(); }
static public void F_REQUEST_CHAR(BaseClient client, PacketIn packet) { GameClient cclient = client as GameClient; cclient.State = (int)eClientState.CharScreen; UInt16 Operation = packet.GetUint16(); if (Operation == 0x2D58) { PacketOut Out = new PacketOut((byte)Opcodes.F_REQUEST_CHAR_ERROR); Out.WriteByte((byte)CharMgr.GetAccountRealm(cclient._Account.AccountId)); cclient.SendPacket(Out); } else { PacketOut Out = new PacketOut((byte)Opcodes.F_REQUEST_CHAR_RESPONSE); Out.FillString(cclient._Account.Username, 21); Out.WriteByte(0); Out.WriteByte(0); Out.WriteByte(0); Out.WriteByte(4); if (cclient._Account.GmLevel == 0 && !Program.Config.CreateBothRealms) Out.WriteByte((byte)CharMgr.GetAccountRealm(cclient._Account.AccountId)); else Out.WriteByte(0); byte[] Chars = CharMgr.BuildCharacters(cclient._Account.AccountId); Out.Write(Chars, 0, Chars.Length); Out.WritePacketLength(); cclient.SendPacket(Out); } }
private void SendBuffer(Player Plr,ref PacketOut Buffer,ref byte Count) { // On Envoi le Packet des items byte[] ArrayBuf = Buffer.ToArray(); PacketOut Packet = new PacketOut((byte)Opcodes.F_GET_ITEM); Packet.WriteByte(Count); Packet.Fill(0, 3); Packet.Write(ArrayBuf, 0, ArrayBuf.Length); Packet.WritePacketLength(); Plr.SendPacket(Packet); // On Remet le compteur a zero Count = 0; // On Initalise un nouveau buffer Buffer = new PacketOut(0); Buffer.Position = 0; }
public void SendCopy(PacketOut Out) { Out.WritePacketLength(); PacketOut packet = new PacketOut(0); packet.Position = 0; packet.Write(Out.ToArray(), 0, Out.ToArray().Length); SendPacket(packet); }
public void SendCopy(PacketOut Out) { Out.WritePacketLength(); byte[] Buf = Out.ToArray(); PacketOut packet = new PacketOut(0); packet.Position = 0; packet.Write(Buf, 0, Buf.Length); SendPacket(packet); }
public void SendSniff(string Str) { string Result = ""; using (StringReader Reader = new StringReader(Str)) { string Line; while ((Line = Reader.ReadLine()) != null) { Result+=Line.Substring(1, 48).Replace(" ", string.Empty); } } Result = Result.Remove(0, 4); byte Opcode = Convert.ToByte(Result.Substring(0, 2), 16); Result = Result.Remove(0, 2); PacketOut Out = new PacketOut(Opcode); Out.WriteHexStringBytes(Result); Out.WritePacketLength(); SendPacket(Out); }