New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: UDP query of game script #7771
Conversation
Reopened from old flyspray issue OpenTTD#6211. Patch adds a possibility to query OpenTTD server for running game scripts and returns its name and version if any present. Goal of this fork is to make also ingame interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just codestyle issues, nothing major
@@ -32,6 +32,8 @@ enum PacketUDPType { | |||
PACKET_UDP_CLIENT_GET_NEWGRFS, ///< Requests the name for a list of GRFs (GRF_ID and MD5) | |||
PACKET_UDP_SERVER_NEWGRFS, ///< Sends the list of NewGRF's requested. | |||
PACKET_UDP_MASTER_SESSION_KEY, ///< Sends a fresh session key to the client | |||
PACKET_UDP_CLIENT_GET_GAMESCRIPT,///< Requests the name of a game script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a space separator, or the whole thing needs realigning
if(info == NULL){ | ||
packet.Send_uint8(0); | ||
} | ||
else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
various codestyle issues with the if here
/** The return of the client's request of the names of GameScript */ | ||
void ClientNetworkUDPSocketHandler::Receive_SERVER_GAMESCRIPT(Packet *p, NetworkAddress *client_addr) | ||
{ | ||
uint8 num_gs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to predeclare the variable, just on-use will be fine
@@ -299,6 +326,7 @@ class ClientNetworkUDPSocketHandler : public NetworkUDPSocketHandler { | |||
void Receive_SERVER_RESPONSE(Packet *p, NetworkAddress *client_addr) override; | |||
void Receive_MASTER_RESPONSE_LIST(Packet *p, NetworkAddress *client_addr) override; | |||
void Receive_SERVER_NEWGRFS(Packet *p, NetworkAddress *client_addr) override; | |||
void Receive_SERVER_GAMESCRIPT(Packet *p, NetworkAddress *client_addr) override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not tab indented (this is why the commit checker is failing)
Three things worth mentioning:
|
Reopened from old flyspray issue #6211.
Patch adds a possibility to query OpenTTD server for running game scripts and returns its name and version if any present.
Goal of this fork is to also create ingame interface.