Ejemplo n.º 1
0
        /// <summary>
        /// Get Channel Information.
        /// </summary>
        /// <returns>KeyValuePair<ChannelID, ChannelName></returns>
        public KeyValuePair<uint, string> GetChannelInfo(InternalChannels channel)
        {
            switch (channel) {

                case InternalChannels.Command:
                    return new KeyValuePair<uint, string>(0x1A, "Command®");

                case InternalChannels.TradeWatcher:
                    return new KeyValuePair<uint, string>(0x1B, "MyTrade®");
            }
            return new KeyValuePair<uint, string>(0, "");
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Send Message to defined Internal Channel.
 /// </summary>
 public void SendToChannel(InternalChannels channel, CustomMessageType color, string message)
 {
     SendToChannel(channel, color, "KTibiaX®", 0x0, message);
 }
Ejemplo n.º 4
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());
        }