Inheritance: Party
Esempio n. 1
0
 public Party AddUpdatePartyFromElement(PartyElement partyElement)
 {
     //Logger.Debug("Updating party " + partyElement.user + " from partyElement.");
     Party party = null;
     lock (_partiesLock)
     {
         if (!_partyLookup.TryGetValue(partyElement.user, out party))
         {
             //Logger.Debug("Party " + partyElement.user + " doesn't exist locally, creating.");
             // create the party
             if (partyElement is UserElement)
             {
                 party = new Person(partyElement as UserElement);
             }
             else
             {
                 party = new Team(partyElement as TeamElement);
             }
             _partyLookup[party.Username] = party;
             Parties.Add(party);
         }
         else
         {
             //Logger.Debug("Party " + partyElement.user + " does exist locally, updating.");
             // update the party
             if (partyElement is UserElement)
             {
                 (party as Person)?.InitPerson(partyElement as UserElement);
             }
             else
             {
                 (party as Team)?.InitTeam(partyElement as TeamElement);
             }
         }
     }
     return party;
 }
Esempio n. 2
0
 private void CheckTeamAccess(Team team)
 {
     // if the team is no longer applicable to me, then it must go
     if (team != null && !team.Admin && team.Player == PlayerMembership.none)
     {
         Logger.Debug("I am no longer a member of this team" + team.Username + ", removing team from my list.");
         Teams.Remove(team);
     }
 }