public void Donate(ServerPlayer splayer, long amount) { lock (this) { IncreaseEXP(amount); IncreaseWealth(amount); splayer.GuCoin -= amount; if (!DonationTable.ContainsKey(splayer.Name)) { DonationTable.Add(splayer.Name, amount); } else { DonationTable[splayer.Name] += amount; } foreach (var member in Members) { var player = ServerSideCharacter2.PlayerCollection.Get(member); if (player.PrototypePlayer != null) { player.SendInfoMessage($"玩家 {splayer.Name} 给公会捐献了 {amount} 财富", Color.LimeGreen); } } SyncToAllMembers(); } }
public void AddMember(ServerPlayer player) { lock (this) { player.Union = this; Members.Add(player.Name); if (!DonationTable.ContainsKey(player.Name)) { DonationTable.Add(player.Name, 0); } SyncToAllMembers(); player.SyncUnionInfo(); } }
public void CheckDonationTable() { lock (this) { var list = new List <string>(); foreach (var member in Members) { if (!DonationTable.ContainsKey(member)) { DonationTable.Add(member, 0); } } } }