示例#1
0
        public void GateFee(Int64 amount, ulong steamid, string GateName)
        {
            bankBalance += amount;
            BankLog     log  = GetLog();
            BankLogItem item = new BankLogItem();

            item.SteamId     = steamid;
            item.Amount      = amount;
            item.TimeClaimed = DateTime.Now;
            item.Action      = "gate fee " + GateName;
            item.BankAmount  = bankBalance;
            log.log.Add(item);
            utils.WriteToJsonFile <BankLog>(AlliancePlugin.path + "//AllianceBankLogs//" + AllianceId + "//log.json", log);
        }
示例#2
0
        public void Upkeep(Int64 amount, ulong steamid)
        {
            bankBalance -= amount;
            BankLog     log  = GetLog();
            BankLogItem item = new BankLogItem();

            item.SteamId     = steamid;
            item.Amount      = amount;
            item.TimeClaimed = DateTime.Now;
            item.Action      = "upkeep";
            item.BankAmount  = bankBalance;
            log.log.Add(item);
            utils.WriteToJsonFile <BankLog>(AlliancePlugin.path + "//AllianceBankLogs//" + AllianceId + "//log.json", log);
        }
示例#3
0
        public void PayShipyardFee(Int64 amount, ulong steamid)
        {
            bankBalance += amount;
            BankLog     log  = GetLog();
            BankLogItem item = new BankLogItem();

            item.SteamId     = steamid;
            item.Amount      = amount;
            item.Action      = "shipyard fee";
            item.TimeClaimed = DateTime.Now;
            item.BankAmount  = bankBalance;
            log.log.Add(item);
            utils.WriteToJsonFile <BankLog>(AlliancePlugin.path + "//AllianceBankLogs//" + AllianceId + "//log.json", log);
            AlliancePlugin.SaveAllianceData(this);
        }
示例#4
0
        public BankLog GetLog()
        {
            if (!Directory.Exists(AlliancePlugin.path + "//AllianceBankLogs//" + AllianceId))
            {
                Directory.CreateDirectory(AlliancePlugin.path + "//AllianceBankLogs//" + AllianceId + "//");
            }

            if (!File.Exists(AlliancePlugin.path + "//AllianceBankLogs//" + AllianceId + "//log.json"))
            {
                BankLog log = new BankLog
                {
                    allianceId = AllianceId
                };
                utils.WriteToJsonFile <BankLog>(AlliancePlugin.path + "//AllianceBankLogs//" + AllianceId + "//log.json", log);
                return(log);
            }
            return(utils.ReadFromJsonFile <BankLog>(AlliancePlugin.path + "//AllianceBankLogs//" + AllianceId + "//log.json"));
        }
示例#5
0
        public void PayDividend(Int64 amount, List <long> ids, ulong steamid)
        {
            Int64   amountToPay = amount / ids.Count();
            BankLog log         = GetLog();

            foreach (long id in ids)
            {
                BankLogItem item = new BankLogItem();
                EconUtils.addMoney(id, amountToPay);
                bankBalance     -= amountToPay;
                item.SteamId     = steamid;
                item.Amount      = amount;
                item.Action      = "dividend";
                item.PlayerPaid  = MySession.Static.Players.TryGetSteamId(id);
                item.TimeClaimed = DateTime.Now;
                item.BankAmount  = bankBalance;
                log.log.Add(item);
            }
            utils.WriteToJsonFile <BankLog>(AlliancePlugin.path + "//AllianceBankLogs//" + AllianceId + "//log.json", log);
        }