armageddonapps / querymaster Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
It gets the correct number of players, but the actual player objects are malformed, except time I think.
I picked several random populated servers and the behaviour was consistent.
Older games still work as expected. Either CS2 isn't adhering to the Valve Query format, or they've got a modified version of it for CS2?
Code I used to check this, posting in case I'm misusing this utility.
string serverIp = "23.88.73.61";
ushort serverPort = 27015;
using var server = ServerQuery.GetServerInstance(EngineType.Source, serverIp, serverPort);
var players = server.GetPlayers();
if (players is null)
{
Console.WriteLine("Failed to retrieve player list");
return;
}
foreach (var player in players)
{
Console.WriteLine("Player: " + player.Name);
}
public static string getNameFromID(ulong ID)
{
GetPlayerSummariesResponse resp = ISteamUser.GetPlayerSummaries(ID);
return resp.ParsedResponse.Players[0].PersonaName;
}
The 3rd line, no matter what I do, will error with "An object reference is required for the non-static field, method, or property 'ISteamUser.GetPlayerSummaries(param ulong[])". I've also tried making the method non-static, neither work.
I am trying to query a Garry's Mod server, wich uses Source 2013 Multiplayer, and it throws that error.
Here is the code
Server server = ServerQuery.GetServerInstance(EngineType.Source, "194.147.5.25",27016, false, 3000, 3000, 3, true);
ServerInfo info = server.GetInfo();
Does Steam provide info about player steamId and any other?
If it does please add new fields in Player.cs
for (int i = 0; i < playerCount; i++) { parser.ReadByte(); players.Add(new PlayerInfo() { Name = parser.ReadString(), Score = parser.ReadInt(), Time = TimeSpan.FromSeconds(parser.ReadFloat()) }); }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.