예제 #1
0
 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();
     }
 }
예제 #2
0
 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();
     }
 }
예제 #3
0
 public void CheckDonationTable()
 {
     lock (this)
     {
         var list = new List <string>();
         foreach (var member in Members)
         {
             if (!DonationTable.ContainsKey(member))
             {
                 DonationTable.Add(member, 0);
             }
         }
     }
 }