Example #1
0
        public static bool SendLoginPacket3()
        {
            UOAMPacket p = new UOAMPacket();

            p.Write((short)5);
            p.Write((short)0x300);
            p.Write(0x10);
            p.Write(0);
            p.Write(m_Sequence++);
            p.Write(0);
            p.Write(1);
            p.Write(m_Password, 20);
            p.Write(m_Address);
            p.Write(0);
            p.Write(2);
            p.Write((short)0x70);
            p.Write((short)0xd5);
            p.Write((int)(m_Username.Length + 1));
            p.Write(0);
            p.Write((int)(m_Username.Length + 1));
            p.Write(m_Username, m_Username.Length + 1);
            p.Seek(0x10L, SeekOrigin.Begin);
            p.Write((int)(p.Length - 0x18L));
            return(Send(p));
        }
Example #2
0
        public static bool SendLoginPacket2()
        {
            byte[] buffer = new byte[] {
                5, 0, 14, 3, 0x10, 0, 0, 0, 0x48, 0, 0, 0, 2, 0, 0, 0,
                0xd0, 0x16, 0xd0, 0x16, 0x39, 0x79, 0x53, 0x30, 1, 0, 0, 0, 1, 0, 1, 0,
                0xa2, 160, 110, 0xd7, 240, 0x2c, 0xb9, 70, 0xa8, 0x7b, 0xe4, 0x22, 0x77, 0xbc, 30, 0xf2,
                1, 0, 0, 0, 4, 0x5d, 0x88, 0x8a, 0xeb, 0x1c, 0xc9, 0x11, 0x9f, 0xe8, 8, 0,
                0x2b, 0x10, 0x48, 0x60, 2, 0, 0, 0
            };
            UOAMPacket p = new UOAMPacket();

            p.Write(buffer);
            return(Send(p));
        }
Example #3
0
        public static bool SendConnectPacket()
        {
            byte[] buffer = new byte[] {
                5, 0, 11, 3, 0x10, 0, 0, 0, 0x48, 0, 0, 0, 1, 0, 0, 0,
                0xd0, 0x16, 0xd0, 0x16, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,
                0x10, 0x66, 0x15, 0x9e, 0x5c, 0x7b, 210, 0x11, 0xb8, 0xcf, 0, 0x80, 0xc7, 0x97, 0x1b, 0xe1,
                1, 0, 0, 0, 4, 0x5d, 0x88, 0x8a, 0xeb, 0x1c, 0xc9, 0x11, 0x9f, 0xe8, 8, 0,
                0x2b, 0x10, 0x48, 0x60, 2, 0, 0, 0
            };
            UOAMPacket p = new UOAMPacket();

            p.Write(buffer);
            return(Send(p));
        }
Example #4
0
 public static bool Send(UOAMPacket p)
 {
     if (m_Socket == null)
     {
         return(false);
     }
     try
     {
         byte[] buffer = p.Compile();
         m_Socket.Send(buffer, 0, buffer.Length, SocketFlags.None);
         return(true);
     }
     catch
     {
         Disconnect();
         return(false);
     }
 }
Example #5
0
        public static bool Post()
        {
            char   ch;
            Mobile player = World.Player;

            if (player == null)
            {
                return(false);
            }
            if (Engine.m_World == 0)
            {
                ch = 'f';
            }
            else if (Engine.m_World == 1)
            {
                ch = 't';
            }
            else
            {
                ch = 'i';
            }
            m_LastPost = DateTime.Now;
            UOAMPacket p = new UOAMPacket();

            p.Write((short)5);
            p.Write((short)0x300);
            p.Write(0x10);
            p.Write(0);
            p.Write(m_Sequence++);
            p.Write(0);
            p.Write(0);
            p.Write(m_Password, 20);
            p.Write(m_Address);
            p.Write(m_Username, 0x4f);
            p.Write((byte)ch);
            p.Write((int)player.X);
            p.Write((int)player.Y);
            p.Write(0);
            p.Seek(0x10L, SeekOrigin.Begin);
            p.Write((int)(p.Length - 0x18L));
            return(Send(p));
        }
Example #6
0
        public static bool SendLoginPacket4()
        {
            UOAMPacket p = new UOAMPacket();

            p.Write((short)5);
            p.Write((short)0x300);
            p.Write(0x10);
            p.Write(0);
            p.Write(m_Sequence++);
            p.Write(0);
            p.Write(1);
            p.Write(m_Password, 20);
            p.Write(m_Address);
            p.Write(0);
            p.Write(3);
            p.Write((short)0x76e8);
            p.Write((short)0xdb);
            p.Write((int)(m_Username.Length + 1));
            p.Write(0);
            p.Write((int)(m_Username.Length + 1));
            p.Write(m_Username, m_Username.Length + 1);
            p.Align(4);
            p.Write(0x40);
            p.Write((short)0x4390);
            p.Write((short)0xd8);
            p.Write(0x40);
            p.Write((ushort)0xf200);
            p.Write((short)0xff);
            p.Write((ushort)0xfff6);
            p.Write((ushort)0xffff);
            p.Write(0);
            p.Write(0);
            p.Write(0);
            p.Write(0);
            p.Write(0);
            p.Write(0);
            p.Write("Comic Sans MS", 0x20);
            p.Seek(0x10L, SeekOrigin.Begin);
            p.Write((int)(p.Length - 0x18L));
            return(Send(p));
        }
Example #7
0
        public static bool Query()
        {
            m_LastQuery = DateTime.Now;
            UOAMPacket p = new UOAMPacket();

            p.Write((short)5);
            p.Write((short)0x300);
            p.Write(0x10);
            p.Write(0);
            p.Write(m_Sequence++);
            p.Write(0);
            p.Write((byte)0);
            p.Write((byte)0);
            p.Write((byte)2);
            p.Write((byte)0);
            p.Write(m_Password, 20);
            p.Write(m_Address);
            p.Seek(0x10L, SeekOrigin.Begin);
            p.Write((int)(p.Length - 0x18L));
            return(Send(p));
        }
Example #8
0
        public static bool Chat(string text)
        {
            text = text.Trim();
            if (text.Length == 0)
            {
                return(false);
            }
            UOAMPacket p = new UOAMPacket();

            p.Write((short)5);
            p.Write((short)0x300);
            p.Write(0x10);
            p.Write(0);
            p.Write(m_Sequence++);
            p.Write(0);
            p.Write((byte)1);
            p.Write((byte)0);
            p.Write((byte)0);
            p.Write((byte)0);
            p.Write(m_Password, 20);
            p.Write(m_Address);
            p.Write(0);
            p.Write(1);
            p.Write((ushort)0xe390);
            p.Write((short)0xdb);
            p.Write((int)(m_Username.Length + 1));
            p.Write(0);
            p.Write((int)(m_Username.Length + 1));
            p.Write(m_Username, m_Username.Length + 1);
            p.Align(4);
            p.Write((int)(text.Length + 1));
            p.Write((short)0x4480);
            p.Write((short)0xd6);
            p.Write((int)(text.Length + 1));
            p.Write(text, text.Length + 1);
            p.Seek(0x10L, SeekOrigin.Begin);
            p.Write((int)(p.Length - 0x18L));
            return(Send(p));
        }
Example #9
0
 public static bool Chat(string text)
 {
     text = text.Trim();
     if (text.Length == 0)
     {
         return false;
     }
     UOAMPacket p = new UOAMPacket();
     p.Write((short) 5);
     p.Write((short) 0x300);
     p.Write(0x10);
     p.Write(0);
     p.Write(m_Sequence++);
     p.Write(0);
     p.Write((byte) 1);
     p.Write((byte) 0);
     p.Write((byte) 0);
     p.Write((byte) 0);
     p.Write(m_Password, 20);
     p.Write(m_Address);
     p.Write(0);
     p.Write(1);
     p.Write((ushort) 0xe390);
     p.Write((short) 0xdb);
     p.Write((int) (m_Username.Length + 1));
     p.Write(0);
     p.Write((int) (m_Username.Length + 1));
     p.Write(m_Username, m_Username.Length + 1);
     p.Align(4);
     p.Write((int) (text.Length + 1));
     p.Write((short) 0x4480);
     p.Write((short) 0xd6);
     p.Write((int) (text.Length + 1));
     p.Write(text, text.Length + 1);
     p.Seek(0x10L, SeekOrigin.Begin);
     p.Write((int) (p.Length - 0x18L));
     return Send(p);
 }
Example #10
0
 public static bool SendLoginPacket3()
 {
     UOAMPacket p = new UOAMPacket();
     p.Write((short) 5);
     p.Write((short) 0x300);
     p.Write(0x10);
     p.Write(0);
     p.Write(m_Sequence++);
     p.Write(0);
     p.Write(1);
     p.Write(m_Password, 20);
     p.Write(m_Address);
     p.Write(0);
     p.Write(2);
     p.Write((short) 0x70);
     p.Write((short) 0xd5);
     p.Write((int) (m_Username.Length + 1));
     p.Write(0);
     p.Write((int) (m_Username.Length + 1));
     p.Write(m_Username, m_Username.Length + 1);
     p.Seek(0x10L, SeekOrigin.Begin);
     p.Write((int) (p.Length - 0x18L));
     return Send(p);
 }
Example #11
0
 public static bool SendLoginPacket4()
 {
     UOAMPacket p = new UOAMPacket();
     p.Write((short) 5);
     p.Write((short) 0x300);
     p.Write(0x10);
     p.Write(0);
     p.Write(m_Sequence++);
     p.Write(0);
     p.Write(1);
     p.Write(m_Password, 20);
     p.Write(m_Address);
     p.Write(0);
     p.Write(3);
     p.Write((short) 0x76e8);
     p.Write((short) 0xdb);
     p.Write((int) (m_Username.Length + 1));
     p.Write(0);
     p.Write((int) (m_Username.Length + 1));
     p.Write(m_Username, m_Username.Length + 1);
     p.Align(4);
     p.Write(0x40);
     p.Write((short) 0x4390);
     p.Write((short) 0xd8);
     p.Write(0x40);
     p.Write((ushort) 0xf200);
     p.Write((short) 0xff);
     p.Write((ushort) 0xfff6);
     p.Write((ushort) 0xffff);
     p.Write(0);
     p.Write(0);
     p.Write(0);
     p.Write(0);
     p.Write(0);
     p.Write(0);
     p.Write("Comic Sans MS", 0x20);
     p.Seek(0x10L, SeekOrigin.Begin);
     p.Write((int) (p.Length - 0x18L));
     return Send(p);
 }
Example #12
0
 public static bool SendLoginPacket2()
 {
     byte[] buffer = new byte[] {
         5, 0, 14, 3, 0x10, 0, 0, 0, 0x48, 0, 0, 0, 2, 0, 0, 0,
         0xd0, 0x16, 0xd0, 0x16, 0x39, 0x79, 0x53, 0x30, 1, 0, 0, 0, 1, 0, 1, 0,
         0xa2, 160, 110, 0xd7, 240, 0x2c, 0xb9, 70, 0xa8, 0x7b, 0xe4, 0x22, 0x77, 0xbc, 30, 0xf2,
         1, 0, 0, 0, 4, 0x5d, 0x88, 0x8a, 0xeb, 0x1c, 0xc9, 0x11, 0x9f, 0xe8, 8, 0,
         0x2b, 0x10, 0x48, 0x60, 2, 0, 0, 0
      };
     UOAMPacket p = new UOAMPacket();
     p.Write(buffer);
     return Send(p);
 }
Example #13
0
 public static bool SendConnectPacket()
 {
     byte[] buffer = new byte[] {
         5, 0, 11, 3, 0x10, 0, 0, 0, 0x48, 0, 0, 0, 1, 0, 0, 0,
         0xd0, 0x16, 0xd0, 0x16, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,
         0x10, 0x66, 0x15, 0x9e, 0x5c, 0x7b, 210, 0x11, 0xb8, 0xcf, 0, 0x80, 0xc7, 0x97, 0x1b, 0xe1,
         1, 0, 0, 0, 4, 0x5d, 0x88, 0x8a, 0xeb, 0x1c, 0xc9, 0x11, 0x9f, 0xe8, 8, 0,
         0x2b, 0x10, 0x48, 0x60, 2, 0, 0, 0
      };
     UOAMPacket p = new UOAMPacket();
     p.Write(buffer);
     return Send(p);
 }
Example #14
0
 public static bool Send(UOAMPacket p)
 {
     if (m_Socket == null)
     {
         return false;
     }
     try
     {
         byte[] buffer = p.Compile();
         m_Socket.Send(buffer, 0, buffer.Length, SocketFlags.None);
         return true;
     }
     catch
     {
         Disconnect();
         return false;
     }
 }
Example #15
0
 public static bool Query()
 {
     m_LastQuery = DateTime.Now;
     UOAMPacket p = new UOAMPacket();
     p.Write((short) 5);
     p.Write((short) 0x300);
     p.Write(0x10);
     p.Write(0);
     p.Write(m_Sequence++);
     p.Write(0);
     p.Write((byte) 0);
     p.Write((byte) 0);
     p.Write((byte) 2);
     p.Write((byte) 0);
     p.Write(m_Password, 20);
     p.Write(m_Address);
     p.Seek(0x10L, SeekOrigin.Begin);
     p.Write((int) (p.Length - 0x18L));
     return Send(p);
 }
Example #16
0
 public static bool Post()
 {
     char ch;
     Mobile player = World.Player;
     if (player == null)
     {
         return false;
     }
     if (Engine.m_World == 0)
     {
         ch = 'f';
     }
     else if (Engine.m_World == 1)
     {
         ch = 't';
     }
     else
     {
         ch = 'i';
     }
     m_LastPost = DateTime.Now;
     UOAMPacket p = new UOAMPacket();
     p.Write((short) 5);
     p.Write((short) 0x300);
     p.Write(0x10);
     p.Write(0);
     p.Write(m_Sequence++);
     p.Write(0);
     p.Write(0);
     p.Write(m_Password, 20);
     p.Write(m_Address);
     p.Write(m_Username, 0x4f);
     p.Write((byte) ch);
     p.Write((int) player.X);
     p.Write((int) player.Y);
     p.Write(0);
     p.Seek(0x10L, SeekOrigin.Begin);
     p.Write((int) (p.Length - 0x18L));
     return Send(p);
 }