Really the best way to do this sort of server pinging is just to hack into enet_protocol_receive_incoming_commands, and use some distinguished invalid peer ID to identify packets that you dispatch to your app via a callback into it or what not.
On Thu, May 24, 2012 at 5:07 AM, Emmanuel Rivoire <[email protected]>wrote: > Hello, > > would it be possible to add the possibility to question a server without > connecting to it ? > > I'd like to ping several servers to know if they are accessible and with > what latency, to display in a server list. > I'd need custom info sent with the answer ( = variable buffer size). > I'd fill this buffer with information about the current state of the > server. > > It might need a request ID, so the server can know the client is able to > request the info (ie: the server and client run the same application / > game). > > API would be something like this for the client : > - a function to send info request message with ID to specified address > - get back a Info Reply event when it comes (if it comes) when calling > enet_host_service() with event.packet containing the custom info , and the > server address (that should be added to event, I guess) > > and for server : > - an Info Request event with event.packet containing ID , and the client > address > - send info reply with custom Buffer to specified address > > That would be quite useful for games (maybe not much for applications, > though). > > And if not possible, I'll try to do by myself... Hopefully, it won't be > too hard. > > ______________________________**_________________ > ENet-discuss mailing list > [email protected] > http://lists.cubik.org/**mailman/listinfo/enet-discuss<http://lists.cubik.org/mailman/listinfo/enet-discuss> >
_______________________________________________ ENet-discuss mailing list [email protected] http://lists.cubik.org/mailman/listinfo/enet-discuss
