public static byte[] Identify(byte[] key)
 {
     PacketWriter packet = new PacketWriter();
     packet.WriteCenterServerOpcode(CenterRecvOps.Identify);
     packet.WriteByte(2);
     packet.WriteBytes(key);
     return packet.ToArray();
 }
 public static byte[] Migrate(int accid, int cid, byte[] ip, ushort port)
 {
     PacketWriter packet = new PacketWriter();
     packet.WriteCenterServerOpcode(CenterSendOps.Migrate);
     packet.WriteInt(accid);
     packet.WriteInt(cid);
     packet.WriteBytes(ip);
     packet.WriteShort(port);
     return packet.ToArray();
 }
Esempio n. 3
0
 public static byte[] SelectCharacter(byte primary, byte secondary, byte[] IP = null, ushort port = 0, int clientID = 0)
 {
     PacketWriter packet = new PacketWriter();
     packet.WriteOpcode(SendOps.SelectCharacter);
     packet.WriteByte(primary);
     packet.WriteByte(secondary);
     packet.WriteBytes(IP);
     packet.WriteShort(port);
     packet.WriteInt(clientID);
     packet.WriteByte(0);
     packet.WriteInt(0);
     packet.WriteByte(0);
     packet.WriteShort(0);
     packet.WriteShort(0);
     return packet.ToArray();
 }
Esempio n. 4
0
 public void SendInitialPacket(int pVersion, string pPatchLoc, byte[] pRIV, byte[] pSIV, byte pServerType)
 {
     PacketWriter writer = new PacketWriter();
     writer.WriteShort(pPatchLoc == "" ? 0x0D : 0x0E);
     writer.WriteShort(pVersion);
     writer.WriteMapleString(pPatchLoc);
     writer.WriteBytes(pRIV);
     writer.WriteBytes(pSIV);
     writer.WriteByte(pServerType);
     SendRawPacket(writer);
 }
Esempio n. 5
0
 //public static byte[] UserMove(int cid, Point start, List<IMovePath> movement)
 //{
 //    var packet = new PacketWriter();
 //    packet.WriteOpcode(SendOps.UserMove);
 //    packet.WriteInt(cid);
 //    packet.WritePos(start);
 //    packet.WriteBytes(new byte[4]);
 //    packet.WriteByte(movement.Count);
 //    foreach (IMovePath move in movement)
 //        move.Encode(packet);
 //    return packet.ToArray();
 //}
 public static byte[] UserMove(int cid, Point start, byte[] movement)
 {
     var packet = new PacketWriter();
     packet.WriteOpcode(SendOps.UserMove);
     packet.WriteInt(cid);
     packet.WritePos(start);
     packet.WriteBytes(movement);
     return packet.ToArray();
 }
Esempio n. 6
0
        public static byte[] UserEnterField(Character chr)
        {
            var packet = new PacketWriter();
            packet.WriteOpcode(SendOps.UserEnterField);
            packet.WriteInt(chr.mID);
            packet.WriteByte(chr.mPrimaryStats.Level);
            packet.WriteMapleString(chr.mName);
            packet.WriteMapleString(""); // ultimate explourer
            packet.WriteMapleString(chr.mGuild.Name);
            packet.WriteShort(chr.mGuild.EmblemBG);
            packet.WriteByte(chr.mGuild.EmblemBGColour);
            packet.WriteShort(chr.mGuild.Emblem);
            packet.WriteByte(chr.mGuild.EmblemColour);
            int[] buffs = new int[8];
            foreach (Buff buff in chr.mBuffs)
                buffs[buff.Position] |= buff.BuffID;
            //foreach (int i in buffs)
            //    packet.WriteInt(i); // buffer 32
            packet.WriteHexString("00 00 00 FE 00 00 A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ");
            //buff values

            packet.WriteInt(-1); // end buff values reading ?

            //packet.WriteByte(0);
            //packet.WriteByte(0);
            //packet.WriteByte(0);
            //packet.WriteByte(0);

            //packet.WriteBytes(new byte[4]);
            //packet.WriteBytes(new byte[4]);
            //packet.WriteByte(1);

            packet.WriteHexString("00 00 00 00 00 00 00 00 00 00 00 00 01");

            packet.WriteInt(Environment.TickCount);
            packet.WriteShort(0);
            packet.WriteBytes(new byte[4]);
            packet.WriteBytes(new byte[4]);
            packet.WriteByte(1);
            packet.WriteInt(Environment.TickCount);
            packet.WriteShort(0);
            packet.WriteBytes(new byte[4]);
            packet.WriteBytes(new byte[4]);
            packet.WriteByte(1);
            packet.WriteInt(Environment.TickCount);
            packet.WriteShort(0);
            packet.WriteBytes(new byte[4]);
            packet.WriteBytes(new byte[4]);
            packet.WriteByte(1);
            packet.WriteInt(Environment.TickCount);
            packet.WriteBytes(new byte[4]);
            packet.WriteBytes(new byte[4]);
            packet.WriteByte(1);
            packet.WriteInt(Environment.TickCount);
            packet.WriteByte(1);
            packet.WriteInt(0);
            packet.WriteShort(0);
            packet.WriteBytes(new byte[4]);
            packet.WriteBytes(new byte[4]);
            packet.WriteByte(1);
            packet.WriteInt(Environment.TickCount);
            packet.WriteInt(0);
            packet.WriteInt(0);
            packet.WriteBytes(new byte[4]);
            packet.WriteBytes(new byte[4]);
            packet.WriteByte(1);
            packet.WriteInt(Environment.TickCount);
            packet.WriteShort(0);

            packet.WriteShort(chr.mPrimaryStats.Job);
            packet.WriteShort(0);
            Global.AddAvatarData(packet, chr);
            packet.WriteInt(0);
            packet.WriteBytes(new byte[12]);
            packet.WriteInt(0);
            packet.WriteInt(0);
            packet.WriteInt(0);
            packet.WriteInt(0);
            packet.WriteInt(0);
            packet.WriteInt(0);
            packet.WriteInt(0);
            packet.WriteInt(0);
            packet.WriteInt(0);

            packet.WriteShort(chr.mPosition.X);
            packet.WriteShort(chr.mPosition.Y);
            packet.WriteByte(chr.mStance); // chr.mStance
            packet.WriteShort(chr.mFoothold);

            packet.WriteByte(0);
            packet.WriteByte(0);

            packet.WriteByte(1);
            packet.WriteByte(0);

            packet.WriteInt(1); // mount level
            packet.WriteInt(0); // mount exp
            packet.WriteInt(0); // mount fatigue

            packet.WriteByte(0); // ``Announce Box''

            packet.WriteByte(0); // Chalk Board

            Global.AddRingData(packet, chr);
            Global.AddRingData(packet, chr);
            Global.AddRingData(packet, chr);

            packet.WriteByte(0); // berserk
            packet.WriteInt(0);
            packet.WriteByte(0); // new year cards
            packet.WriteInt(0);
            return packet.ToArray();
        }