コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
ファイル: INVCommandHandler.cs プロジェクト: waebbl/CS-ELBot
        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);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
ファイル: INVCommandHandler.cs プロジェクト: bignall/CS-ELBot
        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);
            }
        }
コード例 #7
0
 /// <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);
 }
コード例 #8
0
ファイル: TradeWindow.cs プロジェクト: 0xFh/Asda2-Project
 /// <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);
 }
コード例 #9
0
 /// <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);
 }
コード例 #10
0
ファイル: TradeWindow.cs プロジェクト: 0xFh/Asda2-Project
 /// <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);
 }
コード例 #11
0
        /// <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);
        }
コード例 #12
0
 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;
 }
コード例 #13
0
ファイル: CancelTrade.cs プロジェクト: bignall/CS-ELBot
 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);
 }
コード例 #14
0
    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";
    }
コード例 #15
0
 /// <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);
 }
コード例 #16
0
    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";
    }
コード例 #17
0
    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";
    }
コード例 #18
0
    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";
    }
コード例 #19
0
    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";
    }
コード例 #20
0
    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";
    }
コード例 #21
0
    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";
    }
コード例 #22
0
    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";
    }
コード例 #23
0
    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";
    }
コード例 #24
0
    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";
    }
コード例 #25
0
ファイル: WhosIsTrading.cs プロジェクト: bignall/CS-ELBot
 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);
 }
コード例 #26
0
 /// <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);
 }
コード例 #27
0
 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);
 }
コード例 #28
0
    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";
    }
コード例 #29
0
    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";
    }
コード例 #30
0
    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";
    }
コード例 #31
0
    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";
    }
コード例 #32
0
    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";
    }
コード例 #33
0
    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";
    }
コード例 #34
0
    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";
    }
コード例 #35
0
ファイル: WhosIsTrading.cs プロジェクト: waebbl/CS-ELBot
 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);
 }
コード例 #36
0
 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);
 }
コード例 #37
0
 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);
     }
 }
コード例 #38
0
ファイル: rules.cs プロジェクト: bignall/CS-ELBot
        /*
        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);
        }
コード例 #39
0
        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);
            }
        }
コード例 #40
0
        //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);
            }
        }
コード例 #41
0
        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);
            }
        }
コード例 #42
0
        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);
            }
        }
コード例 #43
0
        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);
            }
        }
コード例 #44
0
        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);
            }
        }
コード例 #45
0
        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);
            }
        }
コード例 #46
0
        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);
            }
        }
コード例 #47
0
        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);
            }
        }
コード例 #48
0
        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);
            }
        }
コード例 #49
0
        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);
                    }
        }
コード例 #50
0
        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);
            }
        }
コード例 #51
0
ファイル: STOCommandHandler.cs プロジェクト: bignall/CS-ELBot
        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);
            }
        }
コード例 #52
0
ファイル: AdvertHandler.cs プロジェクト: bignall/CS-ELBot
        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);
        }
コード例 #53
0
ファイル: BUYCommandHandler.cs プロジェクト: bignall/CS-ELBot
        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);
            }
        }
コード例 #54
0
ファイル: AltAdvertsHandler.cs プロジェクト: bignall/CS-ELBot
        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);
        }
コード例 #55
0
        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);
            }
        }