public void ServerJoin(JoinEventArgs e) { ListBoxUsernames.MainThreadInvoke(() => { ListBoxUsernames.Clear(); ListBoxUsernames.AddRange((from tsplr in TShock.Players where tsplr != null orderby tsplr.Name select tsplr.Name).ToArray()); }); }
public void ServerLeave(LeaveEventArgs e) { ListBoxUsernames.MainThreadInvoke(() => { ListBoxUsernames.Clear(); ListBoxUsernames.AddRange((from tsplr in TShock.Players where tsplr != null && tsplr.Index != e.Who orderby tsplr.Name select tsplr.Name).ToArray()); }); if (TShock.Utils.ActivePlayers() == 1) { GuiSkin.Text = Utils.GetTitle(true); GuiSkin.Invalidate(); } }