/// <summary> /// Executes the command and sends response. /// </summary> /// <param name="s">The session.</param> /// <param name="i">The package info.</param> public override void ExecuteCommand(Session s, Package p) { PacketBBotNetBasePacketCustomChatConnect Request = new PacketBBotNetBasePacketCustomChatConnect(p.Content); //@TODO - Create custom chat level to spam only when requested //if (s.Logger.IsDebugEnabled) //{ // // s.Logger.Debug($"Execute command: {Request}"); // //} PacketBBotNetBasePacketCustomChatPong ResponseContent = new PacketBBotNetBasePacketCustomChatPong(15); //@TODO - Create custom chat level to spam only when requested //if (s.Logger.IsDebugEnabled) // s.Logger.Debug($"Command response: {ResponseContent}"); byte[] Response = ResponseContent.ToByteArray(); Package Package = new Package(p.HeaderXuid, p.HeaderField20, p.HeaderServiceId, p.HeaderField22, (byte)PacketTypesChat.BBotNetBasePacketCustomChatPong, p.HeaderRequestId, Response, "chat"); byte[] ToSend = Package.ToByteArray(); s.Send(ToSend, 0, ToSend.Length); }
/// <summary> /// Executes the command and sends response. /// </summary> /// <param name="s">The session.</param> /// <param name="p">The package info.</param> public override void ExecuteCommand(Session s, PackageChat p) { PacketBBotNetBasePacketCustomChatConnect Request = new PacketBBotNetBasePacketCustomChatConnect(p.Content); Logger.Chat($"{p.Key}::ExecuteCommand - Execute command: {Request}"); PacketBBotNetBasePacketCustomChatPong ResponseContent = new PacketBBotNetBasePacketCustomChatPong(15); Logger.Chat($"{p.Key}::ExecuteCommand - Execute command: {ResponseContent}"); byte[] Response = ResponseContent.ToByteArray(); PackageChat Package = new PackageChat(p.HeaderUnk0, p.HeaderXuid, PacketTypesChat.BBotNetBasePacketCustomChatPong, Response); byte[] ToSend = Package.ToByteArray(); s.Send(ToSend, 0, ToSend.Length); }