Skip to content

Conversation

MaxLevs
Copy link
Owner

@MaxLevs MaxLevs commented Nov 19, 2024

Full interface refactoring.

Only public clients and data strucures can be accessed from outside code

# Conflicts:
#	Directory.Packages.props
#	McQuery.Net.slnx
#	README.md
#	sources/McQuery.Net/Data/ChallengeToken.cs
#	sources/McQuery.Net/Data/Packages/Request.cs
#	sources/McQuery.Net/Data/Packages/Responses/IResponse.cs
#	sources/McQuery.Net/Data/Packages/Responses/RawResponse.cs
#	sources/McQuery.Net/Data/Packages/Responses/ServerBasicStateResponse.cs
#	sources/McQuery.Net/Data/Packages/Responses/ServerFullStateResponse.cs
#	sources/McQuery.Net/Data/Packages/Responses/TimeoutResponse.cs
#	sources/McQuery.Net/Data/Packages/Responses/WrongResponse.cs
#	sources/McQuery.Net/Data/Server.cs
#	sources/McQuery.Net/Data/SessionId.cs
#	sources/McQuery.Net/GlobalUsings.cs
#	sources/McQuery.Net/Services/McQueryService.cs
#	sources/McQuery.Net/Services/RequestFormingService.cs
#	sources/McQuery.Net/Services/ResposeParsingService.cs
#	sources/McQuery.Net/Services/SessionIdProviderService.cs
#	sources/McQuery.Net/Services/UdpSendReceiveService.cs
Comment on lines +33 to +44
return new FullStatus(
statusKeyValues["hostname"],
statusKeyValues["gametype"],
statusKeyValues["game_id"],
statusKeyValues["version"],
statusKeyValues["plugins"],
statusKeyValues["map"],
int.Parse(statusKeyValues["numplayers"]),
int.Parse(statusKeyValues["maxplayers"]),
players.ToArray(),
int.Parse(statusKeyValues["hostport"]),
statusKeyValues["hostip"])
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add try catch block in order to throw an appropriate exception in case if some field was gone missing for some reason

namespace McQuery.Net.Exceptions;

[PublicAPI]
public class AlreadyExpiredException : ArgumentException
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be internal. Should add public common McQuery exception instead to provide an appropriate message.
That's all we need to mark that something goes wrong I belive

@MaxLevs MaxLevs self-assigned this Nov 19, 2024
@MaxLevs MaxLevs force-pushed the new-interface branch 2 times, most recently from be329b2 to 8c88eef Compare November 19, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant