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); }
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); }
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); }
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")); }
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); }