Thread: Cached C#
View Single Post
Old 28.10.2007, 22:00   #5
bvmster
Guest
 
Posts: n/a
Default Cached C#

Quote:


Originally Posted by GMan
View Post

easyest is to use the dll from the petition server NC.Toolnet.dll or something like that name. it has all the packed creating stuff.but you would need to create a receive and send function. heres our send function from our petition client

Code:

Code:
        public void SendPacket(Packer p)
        {
            lock (mSenderMutex)
            {
                byte[] sourceArray = p.ToArray();
                int num = sourceArray.Length - 1;
                byte[] destinationArray = new byte[num + 3];
                destinationArray[0] = (byte)(num & 0xff);
                destinationArray[1] = (byte)((num & 0xff00) >> 8);
                Array.Copy(sourceArray, 0, destinationArray, 2, sourceArray.Length);

                GetStream().Write(destinationArray, 0, destinationArray.Length);
                GetStream().Flush();
            }
        }
so basically what you want to do is


Packer p = new Packer((byte) (PacketType.KICK));

p.addint32(char_id);

p.addstring(GMName);

SendPacket(p);


hope this helps you out

Can you show this file?

I have some trouble with PacketType.KICK, i don't know namespace Sad

Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. В снимке указана только дата, без времени: 29 October 2007. Открыть источник.