public static void DismissTeam(Team team, Client.GameState client)
        {
            if (client.Team != null)
            {
                if (!client.Entity.Dead && client.Team.TeamLeader)
                {
                    Leadership lship = new Leadership();
                    lship.Type = 1;
                    lock (client.Team.Teammates)
                    {
                        foreach (Client.GameState Teammate in client.Team.Teammates)
                        {
                            if (Teammate != null)
                            {
                                if (Teammate.Entity.UID != client.Entity.UID)
                                {
                                    lship.UID = Teammate.Entity.UID;
                                    Teammate.Send(lship);
                                    Teammate.Send(team);
                                    Teammate.Team = null;
                                }
                            }
                        }
                    }
                    lship.UID = client.Entity.UID;
                    client.Send(lship);
                    client.Send(team);
                    client.Team = null;

                    client.Entity.RemoveFlag(Update.Flags.TeamLeader);
                }
            }
        }
 public static void CreateTeam(Team team, Client.GameState client)
 {
     if (!client.Entity.Dead && client.Team == null)
     {
         Leadership lship = new Leadership();
         lship.Type = 1;
         lship.UID = client.Entity.UID;
         lship.LeaderUID = client.Entity.UID;
         lship.IsLeader = 1;
         client.Send(lship);
         client.Entity.AddFlag(Update.Flags.TeamLeader);
         client.Team = new PhoenixProject.Game.ConquerStructures.Team();
         client.Team.Active = true;
         client.Team.TeamLeader = true;
         client.Team.Add(client);
         client.Send(team);
     }
 }