public WearCommandHandler(AdvancedCommunication.ActorHandler MyActorHandler, TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdminHelpCommandHandler MyAdminHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, Inventory MyInventory) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheAdminHelpCommandHandler = MyAdminHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; this.TheInventory = MyInventory; this.TheActorHandler = MyActorHandler; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#drop",Settings.botid); //if (CommandIsDisabled == false) { TheAdminHelpCommandHandler.AddCommand("#wear - make me wear an item"); TheAdminHelpCommandHandler.AddCommand("#remove - make me remove an item"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand); } }
public UseItemCommandHandler(AdvancedCommunication.ActorHandler MyActorHandler, TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdminHelpCommandHandler MyAdminHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, Inventory MyInventory) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheAdminHelpCommandHandler = MyAdminHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; this.TheInventory = MyInventory; this.TheActorHandler = MyActorHandler; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#drop",Settings.botid); //if (CommandIsDisabled == false) { TheAdminHelpCommandHandler.AddCommand("#useitem - make me use an item in inventory"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand); TheInventory.GotNewInventoryList += new Inventory.GotNewInventoryListEventHandler(TheInventory_GotNewInventoryList); } }
public TradeHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, MySqlManager MyMySqlManager, Inventory MyInventory, AdvancedCommunication.ActorHandler MyActorHandler, Logger MyLogger, Storage MyStorage, errorHandler MyErrorHandler, AdvancedCommunication.HelpCommandHandler MyHelpCommandHandler) { this.TheErrorHandler = MyErrorHandler; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheMySqlManager = MyMySqlManager; this.TheInventory = MyInventory; this.TheActorHandler = MyActorHandler; this.TheLogger = MyLogger; this.TheStorage = MyStorage; //this.TheErrorHandler = MyErrorHandler; TradeTimer.Stop(); TradeTimer.Interval=1000; TradeTimer.Elapsed += new System.Timers.ElapsedEventHandler(TradeTimer_Tick ); this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand); this.TheMessageParser.Got_TradeRequest += new BasicCommunication.MessageParser.Got_TradeRequest_EventHandler(OnGotTradeRequest); this.TheMessageParser.Got_AbortTrade += new BasicCommunication.MessageParser.Got_AbortTrade_EventHandler(OnGotAbortTrade); this.TheInventory.GotNewInventoryList += new Inventory.GotNewInventoryListEventHandler(OnGotNewInventoryList); if (Settings.IsTradeBot == true) { MyHelpCommandHandler.AddCommand("#total - get a detailed total of your transaction"); } TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); }