예제 #1
0
        /// <summary>
        /// Create a packet buffer
        /// </summary>
        /// <returns></returns>
        public byte[] CreateBuff()
        {
            byte[] block = new byte[0x253]; // Create our null byte array
            PacketWriter PW = new PacketWriter(block); // Initialize the writer

            PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x920)); // Write the packet header
            PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); // Write the string success cmd
            PW.WriteString(39, charname); // Write the character's name, you can use some html code like: <#ff0000> or <glow>

            if(clanid.Length > 4)
            { // Player's clan id must be under 4 letters
                Error.Invoke("Clan id is too long"); // Optional
                PW.WriteString(156, "null"); // Optional
            }
            else
            {
                PW.WriteString(156, clanid);
            } // Write the clan's ID, still don't know what is it exactly, I just use "CL#1", its a 4 lenght string

            PW.WriteString(160, clanname); // Write the clan name
            PW.WriteSByte(0x26, (SByte)chartype); // Choose the desired character (luna, etc..)
            PW.WriteSByte(247, (SByte)_age); // Write the age
            PW.WriteInt16(248, (Int16)_level); // Write the level
            PW.WriteInt16(250, (Int16)_license); // Write the license
            PW.WriteInt32(252, (Int32)zoneid); // Write the country (France, etc...) check the list in mate_zip.txt
            PW.WriteString(256, zoneinfo); // Write the zone info
            PW.WriteString(377, biostr); // Write the bio

            return block;
        }
        /// <summary>
        /// Create 'InventoryItems' packet
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public byte[] CreateBuff()
        {
            byte[] block = new byte[0x118F]; // Create our null byte array
            PacketWriter PW = new PacketWriter(block); // Initialize the writer

            PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x833)); // Write the packet header
            PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); // Write the string success cmd

            switch (chartype)
            {
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_ROOKIE:
                    CreateItemList(block, EngineEnum.PlayerEnum.CharactersType.CHARACTER_ROOKIE);
                    break;
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_LUNA:
                    CreateItemList(block, EngineEnum.PlayerEnum.CharactersType.CHARACTER_LUNA);
                    break;
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_RUSH:
                    CreateItemList(block, EngineEnum.PlayerEnum.CharactersType.CHARACTER_RUSH);
                    break;
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_TIPPY:
                    CreateItemList(block, EngineEnum.PlayerEnum.CharactersType.CHARACTER_TIPPY);
                    break;
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_KLAUS: // There is still no avaiable items for klaus
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_KARA: // There is still no avaiable items for kara
                    break;
            }

            return block;
        }
        /// <summary>
        /// Create 'SelectServer' packet
        /// </summary>
        /// <returns></returns>
        public byte[] CreateBuff()
        {
            byte[] block = new byte[0x12]; // Create our null byte array
            PacketWriter PW = new PacketWriter(block); // Initialize the reader

            PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x3EF)); // Write the packet header
            PW.WriteInt32(5, (Int32)_status); // Write the server status (idle)

            return block;
        }
예제 #4
0
        /// <summary>
        /// Create 'CashBalance' packet
        /// </summary>
        /// <returns></returns>
        public byte[] CreateBuff()
        {
            byte[] block = new byte[0x21]; // Create our null byte array
            PacketWriter PW = new PacketWriter(block); // Initialize the reader

            PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x8E0)); // Create the packet header
            PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); // Write the success string cmd
            PW.WriteInt32(29, _gpotatos); // Write the gpotatos number

            return block;
        }
        /// <summary>
        /// Create 'EnterChannel' packet
        /// </summary>
        /// <returns></returns>
        public byte[] CreateBuff()
        {
            byte[] block = new byte[0x20]; // Write our null byte array
            PacketWriter PW = new PacketWriter(block); // Initialize the writer

            PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x7D8)); // Write the packet header
            PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); // Write the success string cmd
            PW.WriteSByte(29, 1); // Not sure? Selected channel?
            PW.WriteSByte(30, 1); // Not sure? Selected channel?

            return block;
        }
예제 #6
0
        /// <summary>
        /// Create 'LevelInfo' packet
        /// </summary>
        /// <returns></returns>
        public byte[] CreateBuff()
        {
            byte[] block = new byte[0x29]; // Create our null byte array
            PacketWriter PW = new PacketWriter(block); // Initialize the writer

            PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x831)); // Write the packet header
            PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); // Write the string success cmd
            PW.WriteInt32(29, _exp); // Write the player's experience
            PW.WriteInt32(33, _level); // Write the player's level
            PW.WriteInt32(37, _license); // Write the player's licence number

            return block;
        }
예제 #7
0
        /// <summary>
        /// Create 'TrickList' packet
        /// </summary>
        /// <returns></returns>
        public byte[] CreateBuff()
        {
            byte[] block = new byte[0x95]; // Create our null byte array
            PacketWriter PW = new PacketWriter(block); // Initialize the writer

            PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x839)); // Write the packet header
            PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); // Write the success string cmd

            // Create our trick list
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.GRIND);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.DASH);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.BACK_SKATING);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.BUTTING);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.POWER_SLIDE);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.BACK_FLIP);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.FRONT_FLIP);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.AIR_TWIST);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.POWER_SWING);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.GRIP_TURN);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.JUMPING_STEER);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.POWER_JUMP);
            Tricks.Add(EngineEnum.PlayerEnum.TrickCode.WALL_RIDE);

            PW.WriteSByte(30, 0xD); // Write tricks number

            // Write each trick in our packet
            for (int i = 32, j = 0; i < 149 && j < Tricks.Count; i += 9, j++)
            {
                PW.WriteInt16(i, (Int16)Tricks[j]);
            }
            // Write each trick level in our packet
            for (int i = 0x24, j = 0; i < 0x95 && j < tricksLevel.Count(); i += 9, j++)
            {
                PW.WriteInt32(i, (Int32)tricksLevel[j]);
            }
            // Apply each trick (1/0 - Apply Yes/No)
            for (int i = 40; i < 149; i += 9) // TODO: Put this in the database
            {
                PW.WriteSByte(i, 1);
            }

            return block;
        }
예제 #8
0
        /// <summary>
        /// Create 'ServerList' packet
        /// </summary>
        /// <returns></returns>
        public byte[] CreateBuff()
        {
            byte[] block = new byte[0x4F]; // Create our null byte array
            PacketWriter PW = new PacketWriter(block); // Initialize the writer

            PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x3F4)); // Write the packet header
            PW.WriteSByte(5, 1); // I don't know what is it
            PW.WriteSByte(7, serverid); // Write the server id number - Int16?
            PW.WriteSByte(9, 2); // I don't know what is it
            PW.WriteSByte(11, 3); // I don't know what is it
            PW.WriteSByte(13, 4); // I don't know what is it
            PW.WriteString(15, _ip); // Write the msg ip
            PW.WriteString(31, _ip); // Write the lobby ip
            PW.WriteString(47, _ip); // Write the mmo ip
            PW.WriteInt16(63, (Int16)lobbyport); // Write the lobby port
            PW.WriteInt16(67, (Int16)msgport); // Write the msg port
            PW.WriteInt16(71, (Int16)mmoport); // Write the mmo port
            PW.WriteInt16(75, (Int16)unkclientnumb); // Still don't know what is it, something to do with players
            PW.WriteInt16(77, (Int16)maximumusers); // Write maximum users that can join the server

            return block;
        }
예제 #9
0
        /// <summary>
        /// Create 'PlayerInfo' packet
        /// </summary>
        /// <returns></returns>
        public byte[] CreateBuff()
        {
            byte[] block = new byte[0xD7]; // Create our null byte array
            PacketWriter PW = new PacketWriter(block); // Initialize the writer

            PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x90A)); // Write the packet header
            PW.WriteSByte(5, 4); // I don't know yet what is it
            PW.WriteSByte(9, 0x2D); // I don't know yet what is it
            PW.WriteString(11, EngineEnum.PacketEnum.PacketCommand.success_0); // Write the success cmd string
            PW.WriteSByte(41, 5); // I don't know yet what is it
            PW.WriteSByte(45, 1); // I don't know yet what is it
            PW.WriteSByte(47, 0x32); // I don't know yet what is it
            PW.WriteString(49, "ID1_Testo_2"); // I don't know yet what is it
            PW.WriteString(90, "ID1_Test"); // I don't know yet what is it
            PW.WriteSByte(99, 2); // I don't know yet what is it
            PW.WriteSByte(101, 0xC); // I don't know yet what is it
            PW.WriteSByte(103, 5); // I don't know yet what is it
            PW.WriteSByte(105, 5); // I don't know yet what is it
            PW.WriteSByte(107, _level); // Write the player level
            PW.WriteSByte(115, 4); // I don't know yet what is it
            PW.WriteSByte(117, 0xC); // I don't know yet what is it
            PW.WriteSByte(119, 5); // I don't know yet what is it
            PW.WriteInt32(123, 6); // I don't know yet what is it
            PW.WriteInt32(127, 7); // I don't know yet what is it
            PW.WriteSByte(131, 0x40); // I don't know yet what is it
            PW.WriteSByte(133, 0x10); // I don't know yet what is it
            PW.WriteSByte(135, 7); // I don't know yet what is it
            PW.WriteSByte(139, 8); // I don't know yet what is it
            PW.WriteSByte(143, 9); // I don't know yet what is it
            PW.WriteSByte(147, 10); // I don't know yet what is it
            PW.WriteInt16(152, 11266); // I don't know yet what is it
            PW.WriteInt16(200, 3076); // I don't know yet what is it
            PW.WriteSByte(203, 2); // I don't know yet what is it
            PW.WriteSByte(207, 3); // I don't know yet what is it
            PW.WriteSByte(211, 3); // I don't know yet what is it

            return block;
        }
        /// <summary>
        /// Create the selected character type items list
        /// </summary>
        /// <param name="data"></param>
        /// <param name="char_type"></param>
        public void CreateItemList(byte[] data, EngineEnum.PlayerEnum.CharactersType char_type)
        {
            // Initializing the packet writer
            PacketWriter PW = new PacketWriter(data);

            // Initializing basic stuff
            SByte unknow_number = 0x0A;
            Int32 item_number = 0;

            // Initializing items list
            List<int> rookieItemList = new List<int>();
            List<int> lunaItemList = new List<int>();
            List<int> rushItemList = new List<int>();
            List<int> tippyItemList = new List<int>();

            // Initializing inventory enums
            EngineEnum.IventoryEnum.ROOKIE_ITEM_LIST[] rookie_items = (EngineEnum.IventoryEnum.ROOKIE_ITEM_LIST[])Enum.GetValues(typeof(EngineEnum.IventoryEnum.ROOKIE_ITEM_LIST));
            EngineEnum.IventoryEnum.LUNA_ITEM_LIST[] luna_items = (EngineEnum.IventoryEnum.LUNA_ITEM_LIST[])Enum.GetValues(typeof(EngineEnum.IventoryEnum.LUNA_ITEM_LIST));
            EngineEnum.IventoryEnum.RUSH_ITEM_LIST[] rush_items = (EngineEnum.IventoryEnum.RUSH_ITEM_LIST[])Enum.GetValues(typeof(EngineEnum.IventoryEnum.RUSH_ITEM_LIST));
            EngineEnum.IventoryEnum.TIPPY_ITEM_LIST[] tippy_items = (EngineEnum.IventoryEnum.TIPPY_ITEM_LIST[])Enum.GetValues(typeof(EngineEnum.IventoryEnum.TIPPY_ITEM_LIST));

            switch (char_type)
            {
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_ROOKIE:
                    item_number = rookie_items.Count();
                    for (int i = 0x24, j = 0; i < (item_number * 0x1D) && j < item_number; i += 0x1D, j++)
                    {
                        PW.WriteInt16(i, (Int16)rookie_items[j]);
                    }
                    break; // Load rookie items
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_LUNA:
                    item_number = luna_items.Count();
                    for (int i = 0x24, j = 0; i < (item_number * 0x1D) && j < item_number; i += 0x1D, j++)
                    {
                        PW.WriteInt16(i, (Int16)luna_items[j]);
                    }
                    break; // Load luna items
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_RUSH:
                    item_number = rush_items.Count();
                    for (int i = 0x24, j = 0; i < (item_number * 0x1D) && j < item_number; i += 0x1D, j++)
                    {
                        PW.WriteInt16(i, (Int16)rush_items[j]);
                    }
                    break; // Load rush items
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_TIPPY:
                    item_number = tippy_items.Count();
                    for (int i = 0x24, j = 0; i < (item_number * 0x1D) && j < item_number; i += 0x1D, j++)
                    {
                        PW.WriteInt16(i, (Int16)tippy_items[j]);
                    }
                    break; // Load tippy items
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_KLAUS: // There is still no avaiable items for klaus
                case EngineEnum.PlayerEnum.CharactersType.CHARACTER_KARA: // There is still no avaiable items for kara
                    break;
            }
            PW.WriteInt32(30, item_number);

            // Write some unknow number for now (each items) maybe something to do with duration?
            for (int i = 0x2E; i < (item_number * 0x1D); i += 0x1D)
            {
                PW.WriteSByte(i, unknow_number);
            }
            // Write the position of each items
            for (int i = 0x20, j = 0; i < (item_number * 0x1D) && j < (item_number * 0x1D); i += 0x1D, j++)
            {
                PW.WriteInt16(i, (Int16)j);
            }
        }