Beispiel #1
0
        /// <summary>
        /// Send a Message to Default Channel.
        /// </summary>
        public void Default(string message)
        {
            #region "[rgn] Packet Structure Analyze "
            //---------------------------------------
            //SZ      ID  SZ NM
            //---------------------------------------
            //07 00 96 01 03 00 61 65 77
            //0B 00 96 01 07 00 62 6C 7A 69 6E 68 61
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x96, Connection);
            Builder.Append(MessageType.Normal.GetHashCode());
            Builder.Append(message, true);
            Builder.SetPacketSource(PacketSource.Client);
            Connection.Send(Builder.GetPacket());
        }
Beispiel #2
0
        /// <summary>
        /// Open the specified Channel.
        /// </summary>
        /// <param name="channel"></param>
        public void OpenChannel(InternalChannels channel)
        {
            #region "[rgn] Packet Structure Analyze "
            //---------------------------------------
            //.  .  ID ID .  SZ .  H  e  l  p  .  .
            //---------------------------------------
            //0B 00 AC 0A 00 06 00 4B 65 79 58 00 00
            //---------------------------------------
            //00 01 02 03 04 05 06 07 08 09 10 11 12
            #endregion

            PacketBuilder Builder = new PacketBuilder(0xAC, Connection);
            Builder.Append(GetChannelInfo(channel).Key, 2);
            Builder.Append(GetChannelInfo(channel).Value, true, true);

            Builder.SetPacketSource(PacketSource.Server);
            Connection.Send(Builder.GetPacket());
        }
Beispiel #3
0
        /// <summary>
        /// Send a Private Message.
        /// </summary>
        public void Private(string playerName, string message)
        {
            #region "[rgn] Packet Structure Analyze "
            //------------------------------------------------------------------------
            //SZ      ID  SZ NM                         SZ MS
            //------------------------------------------------------------------------
            //16 00 96 04 08 00 53 75 64 75 64 69 67 75 08 00 62 6C 7A 20 63 61 72 61
            //00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x96, Connection);
            Builder.Append(ChannelType.GameChat.GetHashCode());
            Builder.Append(playerName, true);
            Builder.Append(message, true);
            Builder.SetPacketSource(PacketSource.Client);
            Connection.Send(Builder.GetPacket());
        }
Beispiel #4
0
        /// <summary>
        /// Opens Trade Channel.
        /// </summary>
        public void OpenTradeChannel()
        {
            #region "[rgn] Packet Structure Analyze "
            //------------------------------------------------------------------------
            //SZ    ID CHANNEL
            //------------------------------------------------------------------------
            //03 00 98 05 00
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x98, Connection);
            Builder.Append(0x05, 2);
            Builder.SetPacketSource(PacketSource.Client);
            Connection.Send(Builder.GetPacket());
        }
Beispiel #5
0
        /// <summary>
        /// Send a Message to Default Channel.
        /// </summary>
        public void Trade(string message)
        {
            #region "[rgn] Packet Structure Analyze "
            //------------------------------------------------------------------------
            //SZ    ID          SZ    MSG
            //------------------------------------------------------------------------
            //14 00 96 05 05 00 0E 00 73 65 6C 6C 20 63 72 6F 73 73 20 62 6F 77
            //0A 00 96 05 05 00 04 00 73 65 6C 6C
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x96, Connection);
            Builder.Append(ChannelType.Trade.GetHashCode());
            Builder.Append(0x05);
            Builder.Append(0x00);
            Builder.Append(message, true);
            Builder.SetPacketSource(PacketSource.Client);
            Connection.Send(Builder.GetPacket());
        }
Beispiel #6
0
        /// <summary>
        /// Send a System Message to Client.
        /// </summary>
        public byte[] Send(string message, SystemMsgColor color)
        {
            #region "[rgn] Packet Structure Analyze "
            //---------------------------
            //07 00 B4 12 03 00 69 61 65
            //---------------------------
            //SZ    ID CR SZ    i  a  e
            //---------------------------
            #endregion

            PacketBuilder Builder = new PacketBuilder(0xB4, Connection);
            Builder.Append(color.GetHashCode());
            Builder.Append(message, true, true);
            Builder.SetPacketSource(PacketSource.Server);
            Connection.Send(Builder.GetPacket());
            return Builder.GetPacket().Data;
        }
Beispiel #7
0
        /// <summary>
        /// Send Message to defined Internal Channel.
        /// </summary>
        public void SendToChannel(InternalChannels channel, CustomMessageType color, string charname, uint level, string message)
        {
            #region "[rgn] Packet Structure Analyze "
            //--------------------------------------------------------------------------------------------------------------
            //SZ    ID ?? ?? ?? ?? SZ    [                   NAME                ] LV    CR CH    SZ    [        MSG       ]
            //--------------------------------------------------------------------------------------------------------------
            //23 00 AA 00 00 00 00 0E 00 4F 6D 65 67 61 20 4C 61 6D 62 61 20 4C 61 04 00 0C 0A 00 07 00 68 65 6C 6C 6F 00 00
            //.  .  .  .  S  .  .  .  .  N  i  g  h  t  .  C  r  e  a  t  u  r  e  .  .  .  .  .  .  .  H  e  l  l  o  .  .
            //--------------------------------------------------------------------------------------------------------------
            //00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
            //--------------------------------------------------------------------------------------------------------------
            #endregion

            PacketBuilder Builder = new PacketBuilder(0xAA, Connection);
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(charname, true);
            Builder.Append(level, 2);
            Builder.Append(color.GetHashCode());
            Builder.Append(GetChannelInfo(channel).Key, 2);
            Builder.Append(message, true, true);

            Builder.SetPacketSource(PacketSource.Server);
            Connection.Send(Builder.GetPacket());
        }
Beispiel #8
0
        /// <summary>
        /// Send a Animated Message to Client.
        /// </summary>
        public byte[] SendAnimated(AnimatedMsgColor color, Location sqm, string message)
        {
            #region "[rgn] Packet Structure Analyze "
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x84, Connection);
            Builder.Append(sqm.X, 2);
            Builder.Append(sqm.Y, 2);
            Builder.Append(sqm.Z, 1);
            Builder.Append(color.GetHashCode(), 1);
            Builder.Append(message, true);
            Builder.SetPacketSource(PacketSource.Server);
            Connection.Send(Builder.GetPacket());
            return Builder.GetPacket().Data;
        }