Exemple #1
0
        string FormatGameServerInfo(GameServerInfo gsi)
        {
            string s = string.Format(@"\gamename\{0}\gamever\{1}\tickrate\{12}\hostname\{2}\hostport\{3}\maptitle\{4}\mapname\{5}\gametype\{6}\numplayers\{7}\maxplayers\{8}\updaterate\{13}\password\{9}\timelimit\0\fraglimit\0\webport\{14}\AdminName\{10}\AdminEMail\{11}\uptime\{15}\",
                gsi.Game, gsi.Version, gsi.ServerName, gsi.GamePort, gsi.Map, gsi.Map, gsi.GameType, gsi.NumPlayers, gsi.MaxPlayers, gsi.Password, gsi.AdminName, gsi.AdminMail, gsi.TickRate, gsi.UpdateRate, gsi.WebPort, Root.Instance.Time);

            if (gsi.Players != null)
            {
                //for (int i = 0; i < gsi.Players.Length; ++i)
                int i = 0;
                foreach (Player player in gsi.Players)
                {
                    //if (gsi.Players[i] == null)
                    //     continue;
                    string p = string.Format(@"player_{0}\{1}\frags_{0}\{2}\ping_{0}\{3}\deaths_{0}\{4}\", i, player.Name, player.Frags, player.RTT, player.Deaths);
                    s += p;
                    ++i;
                }
            }
            s += @"queryid\" + (id++) + @".1\final\";
            //player_0\_6T3_Stringer\frags_0\28\ping_0\.57\team_0\1\mesh_0\Male.Commando\skin_0\CommandoSkins.goth\face_0\CommandoSkins.Necrotic\ngsecret_0\true\player_1\[HERD]:CyBeR-ShEeP:\frags_1\15\ping_1\.68\team_1\255\mesh_1\Nali.Cow\skin_1\TCowMeshSkins.atomiccow\face_1\\ngsecret_1\false\player_2\Mikkeeee\frags_2\12\ping_2\.48\team_2\1\mesh_2\Male.Soldier\skin_2\SoldierSkins.sldr\face_2\SoldierSkins.Brock\ngsecret_2\false\queryid\" + (id++) + @".1\final\")
            return s;
        }