/// <summary> /// Send balance infos to the client. /// </summary> /// <param name="coins"></param> /// <param name="rupees"></param> /// <param name="gpotatos"></param> /// <param name="trickpoints"></param> /// <returns></returns> public static byte[] BalanceInfo_Buff(Int32 coins, Int32 rupees, Int32 gpotatos, Int32 trickpoints) { byte[] block = new byte[0x2D]; // Create the packet's data base byte[] c_block = EngineUtils.PacketUtils.calcPacket(0x2D, 0x82F); // Calc the packet's header // Initializing the packet writer PacketWriter PW = new PacketWriter(block); // Write the packet's header PW.WriteByteArray(0, c_block); // Write the packet's data PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); PW.WriteSByte(12, 0); PW.WriteUInt32(29, (UInt32)rupees); PW.WriteUInt32(33, (UInt32)coins); PW.WriteUInt32(37, (UInt32)gpotatos); PW.WriteUInt32(41, (UInt32)trickpoints); return block; }
/// <summary> /// Create a channel list (only one channel at the moment). /// </summary> /// <param name="channel_name"></param> /// <returns></returns> public static byte[] ChannelList_Buff(string channel_name) { byte[] block = new byte[0x40]; // Create the packet's data base byte[] c_block = EngineUtils.PacketUtils.calcPacket(0x40, 0x7D6); // Calc the packet's header // Initializing the packet writer PacketWriter PW = new PacketWriter(block); // Write the packet's header PW.WriteByteArray(0, c_block); // Write the packet's data PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); PW.WriteUInt16(29, 1); PW.WriteUInt16(31, 1); PW.WriteString(32, channel_name); PW.WriteUInt32(44, 5); PW.WriteUInt32(48, 6); PW.WriteUInt32(52, 7); PW.WriteUInt32(56, 9); PW.WriteUInt32(60, 10); if(channel_name.Length > 11) { EngineConsole.Log.Error("channel name too long"); } return block; }
/// <summary> /// Create a player character list. /// </summary> /// <param name="isFirstTime"></param> /// <param name="char_type"></param> /// <param name="char_name"></param> /// <returns></returns> public static byte[] PlayerCharacterList_Buff(bool isFirstTime, EngineEnum.WorldEnum.CharactersType char_type, string char_name) { byte[] block = new byte[0x120]; // Create the packet's data base byte[] c_block = EngineUtils.PacketUtils.calcPacket(0x120, 0x90E); // Calc the packet's header // Initializing the packet writer PacketWriter PW = new PacketWriter(block); // Write the packet's header PW.WriteByteArray(0, c_block); // Write the packet's data PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); PW.WriteString(30, char_name); // Write the character's name, you can use some html code like: <#ff0000> or <glow> PW.WriteInt32(73, isFirstTime ? 1 : 0); // Create a character/or no PW.WriteUInt32(75, 0); // I don't know what is it PW.WriteUInt32(79, (UInt32)char_type); // Choose the desired character (luna, etc..) PW.WriteUInt32(83, 0); // I don't know what is it return block; }