示例#1
0
        public byte[] sendnoticecon(int type, int id, string text, string name)
        {
            //Create new packet writer
            PacketWriter Writer = new PacketWriter();

            //Add opcode for chat
            Writer.Create(Systems.SERVER_CHAT);
            //Write byte chat type 7 = notice
            Writer.Byte(7);
            //Set message to message long from string text given
            string Message = MessageToMessagelong(text);

            //Write textlenght value
            Writer.Textlen(Message);
            //Repeat for message lenght
            for (int g = 0; g < Message.Length;)
            {
                //Writer word value per letter
                Writer.Word(int.Parse(Message.Substring(g, 2), System.Globalization.NumberStyles.HexNumber, null));
                //Set g + 2
                g = g + 2;
            }
            //Return all bytes
            return(Writer.GetBytes());
        }