internal void AddMember(string name, int id) { if (this.Team.TeamMembers.Count >= TeamGame.MAX_TEAM_MEMBERS) { Messaging.SendCustomCommand(name, CustomCommands.TeamGameFull, new object[0]); } else if (this.GameLaunched) { Messaging.SendCustomCommand(name, CustomCommands.TeamGameUnavailable, new object[0]); } else { TeamGame.TeamGameMember member = new TeamGame.TeamGameMember(this.Team, name, id); Messaging.SendCustomCommand(this.Team.GetOtherMemberNames(), CustomCommands.TeamGameMember, new object[] { member.ToDataString() }); base.Invoke((VGen0)delegate { this.UpdateMember(member); this.MainForm.RefreshPMWindows(); }); this.ValidateMaps(); Messaging.SendCustomCommand(name, CustomCommands.TeamGame, new object[] { this.Team.ToDataString() }); } }
public void SetPlayer(TeamGame.TeamGameMember member) { this.mTeamMember = member; this.pingIndicator.PingMonitor = this.TeamMember; if (this.TeamMember != null) { if (this.TeamMember.IsSelf && this.TeamMember.IsTeamLeader) { if (!this.Team.HasLaunched) { this.Enable(); } this.gpgLabelInvite.Visible = false; this.gpgLabelKick.Visible = false; this.gpgLabelLeave.Visible = false; this.gpgLabelDisband.Visible = true; } else if (this.TeamMember.IsSelf) { if (!this.Team.HasLaunched) { this.Enable(); } this.gpgLabelDisband.Visible = false; this.gpgLabelInvite.Visible = false; this.gpgLabelKick.Visible = false; this.gpgLabelLeave.Visible = true; } else if (this.Team.TeamLeader.IsSelf) { this.Disable(); this.gpgLabelDisband.Visible = false; this.gpgLabelInvite.Visible = false; this.gpgLabelLeave.Visible = false; this.gpgLabelKick.Visible = true; } else { this.Disable(); this.gpgLabelDisband.Visible = false; this.gpgLabelInvite.Visible = false; this.gpgLabelKick.Visible = false; this.gpgLabelLeave.Visible = false; } this.UpdatePlayer(); this.gpgLabelName.ForeColor = Color.ForestGreen; } else { if (this.Team.TeamLeader.IsSelf) { this.Disable(); this.gpgLabelDisband.Visible = false; this.gpgLabelKick.Visible = false; this.gpgLabelLeave.Visible = false; this.gpgLabelInvite.Visible = true; } else { this.Disable(); this.gpgLabelDisband.Visible = false; this.gpgLabelInvite.Visible = false; this.gpgLabelKick.Visible = false; this.gpgLabelLeave.Visible = false; } this.gpgLabelName.Text = Loc.Get("<LOC>Open"); this.gpgLabelName.ForeColor = Color.DodgerBlue; this.factionPicker.SelectItem(SupcomLookups._Factions.Any); this.factionPicker.Text = Loc.Get("<LOC>Open"); this.gpgPictureBoxReady.Image = ControlRes.open_ready; } }
public static TeamGame.TeamGameMember FromDataString(TeamGame team, string data) { TeamGame.TeamGameMember member = new TeamGame.TeamGameMember(team); string[] strArray = data.Split(new char[] { ';' }); member.mName = strArray[0]; member.mID = int.Parse(strArray[1]); member.mFaction = (SupcomLookups._Factions) uint.Parse(strArray[2]); member.mIsReady = byte.Parse(strArray[3]) > 0; return member; }