Florian2406 / Okolni-Source-Query

Source Engine Query Requests in C#
GNU Lesser General Public License v3.0
21 stars 3 forks source link

player.Index not working #5

Closed dani142c closed 3 years ago

dani142c commented 3 years ago

I'm trying to get the Index of players on the server, using the following code:

         public static void IndexPlayers(Server server)
        {
            IQueryConnection con = new QueryConnection();

            con.Host = server.IP;
            con.Port = server.Port;
            con.Connect();

            var players = con.GetPlayers();
            var newPlayers = players.Players.ToArray();

            foreach (var player in newPlayers)
            {
                Console.WriteLine(player.Index);
            }
        }

All I get is 0, 0, and so on. I don't get any unique ID. Even If i don't convert it to an array, I still get the same response:

Console.WriteLine(players.Players[3].Index);

Florian2406 commented 3 years ago

I'll start investigating

Florian2406 commented 3 years ago

The issue is probably not in the library afaik. I tried to check with my server and also random servers but i couldn't actually find any server that really uses the index. It seems as if it is always 0 for everyone.

Can you add an example where it should come with the ids? Maybe an ip/port-combination so i can verify the bytes returned by it.

Florian2406 commented 3 years ago

Closed as there probably is no issue in the library. Investigated the returned response on byte level and i couldn't find any server that actually uses the index.