public PRIZECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats, Logger MyLogger, ActorHandler MyActorHandler) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheInventory = MyInventory; this.TheTradeHandler = MyTradeHandler; this.TheStats = MyStats; this.TheActorHandler = MyActorHandler; this.TheLogger = MyLogger; this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand); //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid); //if (CommandIsDisabled == false) { if (Settings.IsTradeBot == true && TheMySqlManager.IGamble()) { TheHelpCommandHandler.AddCommand("#prize - show my prize list"); TheHelpCommandHandler.AddCommand("#prizes - null"); } TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); this.TheInventory.GotNewInventoryList += new Inventory.GotNewInventoryListEventHandler(OnGotNewInventoryList); this.TheMessageParser.Got_AbortTrade += new BasicCommunication.MessageParser.Got_AbortTrade_EventHandler(OnGotAbortTrade); } }
public WANTEDCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, Inventory MyInventory, Stats MyStats) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; this.TheInventory = MyInventory; this.TheStats = MyStats; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#wanted",Settings.botid); //if (CommandIsDisabled == false) { if (Settings.IsTradeBot == true) { TheHelpCommandHandler.AddCommand("#wanted / #w - see what I am buying"); TheHelpCommandHandler.AddCommand("#w - null"); TheHelpCommandHandler.AddCommand("#want - null"); TheHelpCommandHandler.AddCommand("#buying - null"); } TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public INVCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheInventory = MyInventory; this.TheTradeHandler = MyTradeHandler; this.TheStats = MyStats; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid); //if (CommandIsDisabled == false) { if (Settings.IsTradeBot == true) { TheHelpCommandHandler.AddCommand("#inventory / #inv / #i - show what I am selling"); TheHelpCommandHandler.AddCommand("#invmembers / #im - member rates"); TheHelpCommandHandler.AddCommand("#inv - null"); TheHelpCommandHandler.AddCommand("#i - null"); TheHelpCommandHandler.AddCommand("#inb - null"); TheHelpCommandHandler.AddCommand("#sell - null"); TheHelpCommandHandler.AddCommand("#selling - null"); TheHelpCommandHandler.AddCommand("#im - null"); TheHelpCommandHandler.AddCommand("#invmember - null"); TheHelpCommandHandler.AddCommand("#invmemver - null"); TheHelpCommandHandler.AddCommand("#invmemvers - null"); } TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public PRIZECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats, Logger MyLogger, ActorHandler MyActorHandler) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheInventory = MyInventory; this.TheTradeHandler = MyTradeHandler; this.TheStats = MyStats; this.TheActorHandler = MyActorHandler; this.TheLogger = MyLogger; this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand); //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid); //if (CommandIsDisabled == false) { if (Settings.IsTradeBot == true && TheMySqlManager.IGamble()) { TheHelpCommandHandler.AddCommand("#prize - show my prize list"); TheHelpCommandHandler.AddCommand("#prizes - null"); } TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); this.TheInventory.GotNewInventoryList += new Inventory.GotNewInventoryListEventHandler(OnGotNewInventoryList); this.TheMessageParser.Got_AbortTrade += new BasicCommunication.MessageParser.Got_AbortTrade_EventHandler(OnGotAbortTrade); } }
public INVCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheInventory = MyInventory; this.TheTradeHandler = MyTradeHandler; this.TheStats = MyStats; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid); //if (CommandIsDisabled == false) { if (Settings.IsTradeBot == true) { TheHelpCommandHandler.AddCommand("#inventory / #inv / #i - show what I am selling"); TheHelpCommandHandler.AddCommand("#invmembers / #im - member rates"); TheHelpCommandHandler.AddCommand("#inv - null"); TheHelpCommandHandler.AddCommand("#i - null"); TheHelpCommandHandler.AddCommand("#inb - null"); TheHelpCommandHandler.AddCommand("#sell - null"); TheHelpCommandHandler.AddCommand("#selling - null"); TheHelpCommandHandler.AddCommand("#im - null"); TheHelpCommandHandler.AddCommand("#invmember - null"); TheHelpCommandHandler.AddCommand("#invmemver - null"); TheHelpCommandHandler.AddCommand("#invmemvers - null"); } TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
/// <summary> /// Makes initChr propose trading to targetChr /// Call CheckRequirements first /// </summary> /// <param name="initChr">initiator of trading</param> /// <param name="targetChr">traget of trading</param> public static void Propose(Character initChr, Character targetChr) { initChr.TradeWindow = new TradeWindow(initChr); targetChr.TradeWindow = new TradeWindow(targetChr); initChr.TradeWindow.m_otherWindow = targetChr.TradeWindow; targetChr.TradeWindow.m_otherWindow = initChr.TradeWindow; TradeHandler.SendTradeProposal((IPacketReceiver)targetChr.Client, initChr); }
/// <summary> /// Sets new status of trade and sends notification about the change to both parties /// </summary> /// <param name="status">new status</param> private void SendStatus(TradeStatus status, bool notifySelf = true) { if (notifySelf) { TradeHandler.SendTradeStatus(m_chr.Client, status); } TradeHandler.SendTradeStatus(OtherWindow.m_chr.Client, status); }
/// <summary> /// Sets new status of trade and sends notification about the change to both parties /// </summary> /// <param name="status">new status</param> private void SendStatus(TradeStatus status, bool notifySelf = true) { if (notifySelf) { TradeHandler.SendTradeStatus((IPacketReceiver)this.m_chr.Client, status); } TradeHandler.SendTradeStatus((IPacketReceiver)this.OtherWindow.m_chr.Client, status); }
/// <summary> /// Sends new information about the trading process to other party /// </summary> private void SendTradeInfo(bool updateSelf) { if (updateSelf) { TradeHandler.SendTradeUpdate(m_chr.Client, false, m_money, m_items); TradeHandler.SendTradeUpdate(m_chr.Client, true, OtherWindow.m_money, OtherWindow.m_items); } TradeHandler.SendTradeUpdate(OtherWindow.m_chr.Client, true, m_money, m_items); }
/// <summary> /// Checks requirements for trading between two characters /// </summary> /// <param name="initChr">possible initiator of trading</param> /// <param name="targetChr">possible target of trading</param> public static bool MayProposeTrade(Character initChr, Character targetChr) { TradeStatus tradeStatus1; if (targetChr == null || !targetChr.IsInContext) { tradeStatus1 = TradeStatus.PlayerNotFound; return(false); } TradeStatus tradeStatus2; if (initChr.IsLoggingOut || targetChr.IsLoggingOut) { tradeStatus2 = TradeStatus.LoggingOut; } else if (!initChr.IsAlive) { tradeStatus2 = TradeStatus.PlayerDead; } else if (!targetChr.IsInRadius((WorldObject)initChr, TradeMgr.MaxTradeRadius)) { tradeStatus2 = TradeStatus.TooFarAway; } else if (!targetChr.IsAlive) { tradeStatus2 = TradeStatus.TargetDead; } else if (targetChr.IsStunned) { tradeStatus2 = TradeStatus.TargetStunned; } else if (targetChr.IsIgnoring((IUser)initChr)) { tradeStatus2 = TradeStatus.PlayerIgnored; } else if (targetChr.TradeWindow != null) { tradeStatus2 = TradeStatus.AlreadyTrading; } else if (targetChr.Faction.Group != initChr.Faction.Group && !initChr.Role.IsStaff) { tradeStatus2 = TradeStatus.WrongFaction; } else if (targetChr.IsLoggingOut) { tradeStatus2 = TradeStatus.TargetLoggingOut; } else { tradeStatus1 = TradeStatus.Proposed; return(true); } TradeHandler.SendTradeStatus((IPacketReceiver)initChr, tradeStatus2); return(false); }
public void Initialize() { _viewSource.Source = TradeHandler?.TradeVMCollection; TradeTreeView.ItemsSource = _viewSource.View; mColumns = ColumnObject.GetColumns(TradeTreeView); TradeHandler.TradeVMCollection.Clear(); TradeHandler.QueryTrade(); FilterSettingsWin.UserID = TradeHandler.MessageWrapper?.User.Id; }
public CancelTradeCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdminHelpCommandHandler MyAdminHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheMySqlManager = MyMySqlManager; this.TheAdminHelpCommandHandler = MyAdminHelpCommandHandler; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; TheAdminHelpCommandHandler.AddCommand("#canceltrade - cancels trade and resets trade indicator"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); }
public WellCraftedBow(int basePrice) : base(basePrice) { GearType = WarGearType.Bow; Rarity = TradeHandler.GetRandomRarity(2); Description = "A bow crafted with materials of good quality.\n" + "Maybe an Archer can find some use for it."; CustomName = "Well Crafted Bow"; }
/// <summary> /// Checks if the party has enough money for trade /// If not, unaccepts the trade /// </summary> /// <returns></returns> private bool CheckMoney() { if (this.m_money <= this.m_chr.Money) { return(true); } this.m_chr.SendSystemMessage("Not enough gold"); this.m_accepted = false; TradeHandler.SendTradeStatus((IPacketReceiver)this.m_chr.Client, TradeStatus.StateChanged); return(false); }
public DepthStone(int basePrice) : base(basePrice) { StoneType = StoneType.Water; Rarity = TradeHandler.GetRandomRarity(3); Description = "A magic stone infused with oceanic might.\n" + "Maybe a Water Wizard can find some use for it."; CustomName = "Depth Stone"; }
public StickAndString(int basePrice) : base(basePrice) { GearType = WarGearType.Bow; Rarity = TradeHandler.GetRandomRarity(1); Description = "A poorly-made, rudimentary 'bow'.\n" + "Maybe an Archer can find some use for it."; CustomName = "Stick and String"; }
public LavaStone(int basePrice) : base(basePrice) { StoneType = StoneType.Fire; Rarity = TradeHandler.GetRandomRarity(3); Description = "A magic stone infused with volcanic torment.\n" + "Maybe a Fire Wizard can find some use for it."; CustomName = "Lava Stone"; }
public Naturezima(int basePrice) : base(basePrice) { StoneType = StoneType.Nature; Rarity = TradeHandler.GetRandomRarity(2); Description = "A magic stone infused with a forest spirit.\n" + "Maybe a Nature Wizard can find some use for it."; CustomName = "Naturezima Stone"; }
public Necrozima(int basePrice) : base(basePrice) { StoneType = StoneType.Necromancy; Rarity = TradeHandler.GetRandomRarity(2); Description = "A magic stone infused with a demon's essence.\n" + "Maybe a Necromancer can find some use for it."; CustomName = "Necrozima Stone"; }
public BurnedZima(int basePrice) : base(basePrice) { StoneType = StoneType.Fire; Rarity = TradeHandler.GetRandomRarity(2); Description = "A magic stone infused with the roar of fire.\n" + "Maybe a Fire Wizard can find some use for it."; CustomName = "Burnedzima Stone"; }
public RustyShield(int basePrice) : base(basePrice) { GearType = WarGearType.Shield; Rarity = TradeHandler.GetRandomRarity(1); Description = "A decrepit, old rusty shield.\n" + "Maybe a Paladin can find some use for it."; CustomName = "Rusty Shield"; }
public LifeStone(int basePrice) : base(basePrice) { StoneType = StoneType.Necromancy; Rarity = TradeHandler.GetRandomRarity(3); Description = "A magic stone infused by an elder demon's spell.\n" + "Maybe a Necromancer can find some use for it."; CustomName = "Life Stone"; }
public Moisterzima(int basePrice) : base(basePrice) { StoneType = StoneType.Water; Rarity = TradeHandler.GetRandomRarity(1); Description = "A magic stone infused with various droplets.\n" + "Maybe a Water Wizard can find some use for it."; CustomName = "Watercell Stone"; }
public WhoIsTradingCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdminHelpCommandHandler MyAdminHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheMySqlManager = MyMySqlManager; this.TheAdminHelpCommandHandler = MyAdminHelpCommandHandler; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; TheAdminHelpCommandHandler.AddCommand("#whoistrading - tells you who's trading with me"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); }
/// <summary> /// Checks if the party has enough money for trade /// If not, unaccepts the trade /// </summary> /// <returns></returns> private bool CheckMoney() { if (m_money <= m_chr.Money) { return(true); } m_chr.SendSystemMessage("Not enough gold"); m_accepted = false; TradeHandler.SendTradeStatus(m_chr.Client, TradeStatus.StateChanged); return(false); }
public RustySword(int basePrice) : base(basePrice) { GearType = WarGearType.Sword; Rarity = TradeHandler.GetRandomRarity(1); Description = "A plain old rusty sword.\n" + "Maybe a Swordsman can find some use for it."; CustomName = "Rusty Sword"; }
public Leafcell(int basePrice) : base(basePrice) { StoneType = StoneType.Nature; Rarity = TradeHandler.GetRandomRarity(1); Description = "A magic stone infused with minor natural powers.\n" + "Maybe a Nature Wizard can find some use for it."; CustomName = "Leafcell Stone"; }
public Firecell(int basePrice) : base(basePrice) { StoneType = StoneType.Fire; Rarity = TradeHandler.GetRandomRarity(3); Description = "A plain old rusty sword.\n" + "Maybe a Fire Wizard can find some use for it."; CustomName = "Firecell Stone"; }
public DivineSword(int basePrice) : base(basePrice) { GearType = WarGearType.Sword; Rarity = TradeHandler.GetRandomRarity(3); Description = "A sword blessed by an unknown deity.\n" + "Maybe a Swordsman can find some use for it."; CustomName = "Divine Sword"; }
public ShinyShield(int basePrice) : base(basePrice) { GearType = WarGearType.Shield; Rarity = TradeHandler.GetRandomRarity(2); Description = "A well-maintained, shiny shield.\n" + "Maybe a Paladin can find some use for it."; CustomName = "Shiny Shield"; }
public DivineShield(int basePrice) : base(basePrice) { GearType = WarGearType.Shield; Rarity = TradeHandler.GetRandomRarity(3); Description = "A glowing shield, blessed by an elder god.\n" + "Maybe a Paladin can find some use for it."; CustomName = "Divine Shield"; }
public Watercell(int basePrice) : base(basePrice) { StoneType = StoneType.Water; Rarity = TradeHandler.GetRandomRarity(1); Description = "A magic stone infused with a river's current.\n" + "Maybe a Water Wizard can find some use for it."; CustomName = "Watercell Stone"; }
public QuitCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdminHelpCommandHandler MyAdminHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, Inventory MyInventory) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheMySqlManager = MyMySqlManager; this.TheAdminHelpCommandHandler = MyAdminHelpCommandHandler; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; this.TheInventory = MyInventory; TheAdminHelpCommandHandler.AddCommand("#quit / #exit / #shutdown - make me shut down"); TheAdminHelpCommandHandler.AddCommand("#exit - null"); TheAdminHelpCommandHandler.AddCommand("#shutdown - null"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); }
public DepositCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats, Storage MyStorage) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheInventory = MyInventory; this.TheTradeHandler = MyTradeHandler; this.TheStats = MyStats; this.TheStorage = MyStorage; { TheAdvHelpCommandHandler.AddCommand("#deposit - deposit something(s) into my storage"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand); } }
/* public int nextlineset { get { return nextline; } set { nextline = value; } } */ public RulesHandler(TCPWrapper MyTCPWrapper, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler) { if (Settings.botid != 1) return; this.TheLogger = MyLogger; this.TheMySqlManager = MyMySqlManager; this.TheTCPWrapper = MyTCPWrapper; this.TheTradeHandler = MyTradeHandler; TheTCPWrapper = MyTCPWrapper; TheMySqlManager = MyMySqlManager; this.RulesTimer.Interval = 1000; RulesTimer.Elapsed += new ElapsedEventHandler(RulesTimer_Tick); TheTCPWrapper.GotConnected += new TCPWrapper.GotConnectedEventHandler(OnGotConnected); TheTCPWrapper.GotDisconnected += new TCPWrapper.GotDisconnectedEventHandler(OnGotDisconnected); }
public DropCommandHandler(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.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#drop",Settings.botid); //if (CommandIsDisabled == false) { TheAdminHelpCommandHandler.AddCommand("#drop - make me drop a item from my inventory"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
//private bool CommandIsDisabled; public RetradeCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, ActorHandler MyActorHandler, TradeHandler MyTradeHandler) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheActorHandler = MyActorHandler; this.TheTradeHandler = MyTradeHandler; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#pm",Settings.botid); //if (CommandIsDisabled == false) { TheHelpCommandHandler.AddCommand("#retrade / #r - Reinitialise trade"); TheHelpCommandHandler.AddCommand("#r - null"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public DESCRIBECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, PMHandler MyPMHandler) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheAdvHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; this.ThePMHandler = MyPMHandler; //if (CommandIsDisabled == false) { TheAdvHelpCommandHandler.AddCommand("#describe / #d - describe an item"); ThePMHandler.AddCommand("#d"); // TheAdvHelpCommandHandler.AddCommand("#d - null"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public WithdrawCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Storage MyStorage, TradeHandler MyTradeHandler, Stats MyStats, Inventory MyInventory) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheStorage = MyStorage; this.TheTradeHandler = MyTradeHandler; this.TheStats = MyStats; this.TheInventory = MyInventory; { TheAdvHelpCommandHandler.AddCommand("#withdraw - withdraw an item from storage"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand); TheMessageParser.Get_GlobalMessage += new cs_elbot.BasicCommunication.MessageParser.Get_GlobalMessageEventHandler(TheMessageParser_Get_GlobalMessage); } }
public INVRCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheInventory = MyInventory; this.TheTradeHandler = MyTradeHandler; this.TheStats = MyStats; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid); //if (CommandIsDisabled == false) { TheHelpCommandHandler.AddCommand("#invr - inventory without item numbers"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public DONATECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#donate",Settings.botid); //if (CommandIsDisabled == false) { TheAdvHelpCommandHandler.AddCommand("#donate - donate something to me"); TheAdvHelpCommandHandler.AddCommand("#donation - null"); TheAdvHelpCommandHandler.AddCommand("#d - null"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public GiveToCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, PMHandler MyPMHandler) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; this.ThePMHandler = MyPMHandler; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#give",Settings.botid); //if (CommandIsDisabled == false) { TheAdvHelpCommandHandler.AddCommand("#giveto - give item to person trading with bot"); // ThePMHandler.AddCommand("#g"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public PUTONSALECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,AdminHelpCommandHandler MyAdminHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheAdminHelpCommandHandler = MyAdminHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#putonsale",Settings.botid); //if (CommandIsDisabled == false) { if (Settings.IsTradeBot == true) { TheAdminHelpCommandHandler.AddCommand("#putonsale - put something on sale"); } TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public ReserveCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats, Storage MyStorage) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheInventory = MyInventory; this.TheTradeHandler = MyTradeHandler; this.TheStats = MyStats; this.TheStorage = MyStorage; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid); //if (CommandIsDisabled == false) { TheHelpCommandHandler.AddCommand("#reserve - manipulate reserved items"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
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 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 GAMBLECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, Inventory MyInventory) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; this.TheInventory = MyInventory; this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand); TheInventory.GotNewInventoryList += new Inventory.GotNewInventoryListEventHandler(TheInventory_GotNewInventoryList); TheMessageParser.Got_AbortTrade += new cs_elbot.BasicCommunication.MessageParser.Got_AbortTrade_EventHandler(TheMessageParser_Got_AbortTrade); //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#donate",Settings.botid); //if (CommandIsDisabled == false) { TheHelpCommandHandler.AddCommand("#gamble - gamble with me for a prize."); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public STOCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Storage MyStorage, TradeHandler MyTradeHandler, Stats MyStats) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheStorage = MyStorage; this.TheTradeHandler = MyTradeHandler; this.TheStats = MyStats; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid); //if (CommandIsDisabled == false) { TheAdvHelpCommandHandler.AddCommand("#sto - show what's in my storage"); //TheAdvHelpCommandHandler.AddCommand("#sto - null"); //TheAdvHelpCommandHandler.AddCommand("#storage - null"); TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public AdvertHandler(TCPWrapper MyTCPWrapper, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, Inventory MyInventory, errorHandler MyErrorHandler) { Random RandomClass = new Random(); int i; this.TheLogger = MyLogger; this.TheMySqlManager = MyMySqlManager; this.TheTCPWrapper = MyTCPWrapper; this.TheTradeHandler = MyTradeHandler; this.TheInventory = MyInventory; this.TheErrorHandler = MyErrorHandler; TheTCPWrapper = MyTCPWrapper; TheMySqlManager = MyMySqlManager; TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand); if (TheMySqlManager.advertise()) { this.AdvertTimer.Interval = 1000; if (TheMySqlManager.advertchannel(Settings.botid) != 99999999) { //if (TheMySqlManager.lastadverttime(Settings.botid) + TheMySqlManager.minadverttime() <= DateTime.Now ) if (TheMySqlManager.lastadverttime(Settings.botid) <= TheMySqlManager.minadverttime()) { i = TheMySqlManager.minadverttime() * 1000; i += (RandomClass.Next(0, TheMySqlManager.randomadvertdelay()) * 1000); if (i < 900000) i = 900000;//minimum 15 minute delay this.AdvertTimer.Interval = i; } } } else { this.AdvertTimer.Interval = 900000; } TheLogger.Debug("New AdvertTimer.Interval: " + this.AdvertTimer.Interval + "\n"); AdvertTimer.Elapsed += new ElapsedEventHandler(AdvertTimer_Tick); TheTCPWrapper.GotConnected += new TCPWrapper.GotConnectedEventHandler(OnGotConnected); TheTCPWrapper.GotDisconnected += new TCPWrapper.GotDisconnectedEventHandler(OnGotDisconnected); }
public BUYCommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheHelpCommandHandler = MyHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheLogger = MyLogger; this.TheTradeHandler = MyTradeHandler; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#buy",Settings.botid); //if (CommandIsDisabled == false) { if (Settings.IsTradeBot == true) { TheHelpCommandHandler.AddCommand("#buy / #b - buy something from me"); TheHelpCommandHandler.AddCommand("#b - null"); TheHelpCommandHandler.AddCommand("#byt - null"); } TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }
public AltAdvertHandler(TCPWrapper MyTCPWrapper, MySqlManager MyMySqlManager, Logger MyLogger, TradeHandler MyTradeHandler, Inventory MyInventory, errorHandler MyErrorHandler) { Random RandomClass = new Random(); int i; this.TheLogger = MyLogger; this.TheMySqlManager = MyMySqlManager; this.TheTCPWrapper = MyTCPWrapper; this.TheTradeHandler = MyTradeHandler; this.TheInventory = MyInventory; this.TheErrorHandler = MyErrorHandler; TheTCPWrapper = MyTCPWrapper; TheMySqlManager = MyMySqlManager; uint altadvertchannel = TheMySqlManager.altadvertchannel(Settings.botid); this.AltAdvertTimer.Interval = 900000; if (TheMySqlManager.altadvertise()) { this.AltAdvertTimer.Interval = 1000; if (altadvertchannel != 99999999) { if (TheMySqlManager.lastaltadverttime(Settings.botid) <= TheMySqlManager.minaltadverttime()) { i = TheMySqlManager.minaltadverttime() * 1000; i += (RandomClass.Next(0, TheMySqlManager.randomaltadvertdelay()) * 1000); if (i < 900000) i = 900000;//minimum 15 minute delay this.AltAdvertTimer.Interval = i; } } } TheLogger.Debug("New AltAdvertTimer.Interval: " + this.AltAdvertTimer.Interval + "\n"); if (altadvertchannel != 99999999 && TheMySqlManager.lastaltadverttime(Settings.botid) < TheMySqlManager.minaltadverttime() && MainClass.serverName != "test") return; AltAdvertTimer.Elapsed += new ElapsedEventHandler(AltAdvertTimer_Tick); TheTCPWrapper.GotConnected += new TCPWrapper.GotConnectedEventHandler(OnGotConnected); TheTCPWrapper.GotDisconnected += new TCPWrapper.GotDisconnectedEventHandler(OnGotDisconnected); }
public INVLISTCommandHandler(HelpCommandHandler MyHelpCommandHandler, TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, AdvHelpCommandHandler MyAdvHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats) { this.TheTCPWrapper = MyTCPWrapper; this.TheMessageParser = MyMessageParser; this.TheAdvHelpCommandHandler = MyAdvHelpCommandHandler; this.TheMySqlManager = MyMySqlManager; this.TheInventory = MyInventory; this.TheTradeHandler = MyTradeHandler; this.TheStats = MyStats; this.TheHelpCommandHandler = MyHelpCommandHandler; //this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#invlist",Settings.botid); //if (CommandIsDisabled == false) { // if (Settings.IsTradeBot == true) { TheAdvHelpCommandHandler.AddCommand("#invlist / #il - lists my entire inventory"); TheHelpCommandHandler.AddCommand("#il - null"); } TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM); } }