Exemplo n.º 1
0
 private void UpdateBattleInfo(bool lck, MapInfo mapname)
 {
     if (battle != null)
     {
         con.SendCommand(0, "UPDATEBATTLEINFO", battle.CountSpectators(), (int)(lck ? 1 : 0), mapname.Checksum, mapname.Name);
     }
 }
Exemplo n.º 2
0
        private void UpdateStatusInfo()
        {
            if (InvokeRequired)
            {
                Invoke(new DelegEmpty(UpdateStatusInfo));
            }
            else
            {
                try {
                    if (!main.Tas.IsLoggedIn)
                    {
                        return;
                    }
                    Client.Battle b = main.Tas.GetBattle();
                    if (b == null)
                    {
                        return;
                    }

                    int players = b.Users.Count - b.CountSpectators();

                    toolStripStatusLabel1.Text = "on since: " + Program.startupTime.ToString("g");
                    toolStripStatusLabel2.Text = "players: " + players + "/" + b.MaxPlayers;
                    toolStripStatusLabel3.Text = "mod: " + b.Mod.Name;
                    toolStripStatusLabel4.Text = "map: " + b.Map.Name;
                    toolStripStatusLabel5.Text = "last game: " + (main.Spring.GameStarted != DateTime.MinValue ? main.Spring.GameStarted.ToString("g") : "never");



                    if (!main.Spring.IsRunning)
                    {
                        if (players > 0)
                        {
                            if (notifyIcon1.Icon != Resources.joined)
                            {
                                notifyIcon1.Icon = Resources.joined;
                            }
                        }
                        else if (notifyIcon1.Icon != Resources.ok)
                        {
                            notifyIcon1.Icon = Resources.ok;
                        }
                    }

                    notifyIcon1.Text = players + "/" + b.MaxPlayers + "\r\n" + b.Map.Name + "\r\n" + (main.Spring.GameStarted != DateTime.MinValue ? main.Spring.GameStarted.ToString("g") : "never");
                } catch {}
            }
        }