コード例 #1
0
        /// <summary>
        /// Will make packet to display ping to player
        /// </summary>
        /// <param name="packet"></param>
        /// <returns></returns>
        public static byte[] DisplayPing(int clientID, long ping)
        {
            byte[] packet = new byte[4];
            packet = CreateReverseHexPacket(clientID);
            packet = CombineByteArray(packet, new byte[] { 0x03, 0xFF, 0x00, 0x18 });
            packet = CombineByteArray(packet, new byte[] { 0x0C, 0xFF, 0xFF, 0xFF, 0xFF, 0x4E, 0x4F, 0x54, 0x49, 0x43, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
            packet = CombineByteArray(packet, GetBytesFrom("Wz:" + Config.WZ + "  "));
            packet = CombineByteArray(packet, GetBytesFrom("Exp:" + Config.EXP + "  "));
            packet = CombineByteArray(packet, GetBytesFrom("Quest Exp:" + Config.QUEST_EXP + "  "));
            packet = CombineByteArray(packet, GetBytesFrom("Drop Rate:" + Config.DROP_RATE + "  "));
            if (ping < 1000)
            {
                packet = CombineByteArray(packet, GetBytesFrom("Ping:" + ping.ToString() + " ms"));
            }
            else
            {
                packet = CombineByteArray(packet, GetBytesFrom("Ping:---"));
            }
            int MsgLength = packet.Length - 34;

            MsgLength %= 4;
            packet     = CombineByteArray(packet, GetBytesFrom(GetNullString(4 - MsgLength)));
            packet     = CombineByteArray(CreateReverseHexPacket(packet.Length + 4), packet);
            var tempBytes = Crypt.Encrypt(packet);

            return(tempBytes);
        }
コード例 #2
0
        /// <summary>
        /// Alter charcter packet received from AccountServer(.acl file) according to 562 client
        /// </summary>
        /// <param name="packet">packet data</param>
        /// <returns>returns 952 bytes packet that contains character info compatible</returns>
        public static byte[] AlterAccountServerPacket(byte[] packet)
        {
            var tempbytes = Crypt.Decrypt(packet);

            for (int i = 32; i <= 784; i += 188)
            {
                tempbytes[i + 3] = tempbytes[i + 2];
                tempbytes[i + 2] = tempbytes[i + 1];
                tempbytes[i + 1] = Convert.ToByte(1);
                tempbytes[i]     = 0x00;
            }
            return(Crypt.Encrypt(tempbytes));
        }
コード例 #3
0
        /// <summary>
        /// Payement information when client clicks Check Payment Info.
        /// </summary>
        /// <param name="clientID">uniq id of client</param>
        /// <returns>payement information</returns>
        public static byte[] PrivateMessage(int clientID, string message)
        {
            byte[] packet = new byte[4];
            packet = CreateReverseHexPacket(clientID);
            packet = CombineByteArray(packet, new byte[] { 0x03, 0xFF, 0x00, 0x18 });
            packet = CombineByteArray(packet, new byte[] { 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x00 });
            packet = CombineByteArray(packet, GetBytesFrom(message));
            int MsgLength = packet.Length - 34;

            MsgLength %= 4;
            packet     = CombineByteArray(packet, GetBytesFrom(GetNullString(4 - MsgLength)));
            packet     = CombineByteArray(CreateReverseHexPacket(packet.Length + 4), packet);
            var tempBytes = Crypt.Encrypt(packet);

            return(tempBytes);
        }