Пример #1
0
 public override void PostUpdate()
 {
     if (Main.netMode != NetmodeID.MultiplayerClient)
     {
         if (Main.dayTime && hasSynced) hasSynced = false;
         bool EnableAutoCollect = true;
         if (EnableAutoCollect && !hasSynced && !Main.dayTime && Main.time >= 15000 && Main.time < 16200)
         {
             ClientBanksList = BankHandler.HasBank();
             if (Main.netMode == NetmodeID.Server) NetMessage.SendData(MessageID.WorldData);
             hasSynced = true;
         }
     }
 }
Пример #2
0
        public override void PostUpdate()
        {
            if (Main.netMode != NetmodeID.Server)
            {
                Player.taxRate = (TimeBetweenPaychecks < 1) ? 1 : (TimeBetweenPaychecks * 60);

                if (Main.dayTime && hasCollected)
                {
                    hasCollected = false;
                }
                if (EnableAutoCollect && !Main.dayTime && !hasCollected && Main.time >= 16200 && player.taxMoney > 0)
                {
                    hasCollected = true;
                    bool succeeded = false;
                    if (TaxWorld.ClientBanksList[0] && !succeeded)
                    {
                        succeeded = BankHandler.AddCoins(player.bank, player.taxMoney);
                    }
                    if (TaxWorld.ClientBanksList[1] && !succeeded)
                    {
                        succeeded = BankHandler.AddCoins(player.bank2, player.taxMoney);
                    }
                    if (TaxWorld.ClientBanksList[2] && !succeeded)
                    {
                        succeeded = BankHandler.AddCoins(player.bank3, player.taxMoney);
                    }
                    if (succeeded)
                    {
                        player.taxMoney           = 0;
                        BankHandler.LastCheckBank = true;
                    }
                    else
                    {
                        BankHandler.LastCheckBank = false;
                    }
                }
            }
        }