c# - How to "query" a (game) server for data, by sending a message and recieving info like status, players online, etc -


a small c# game making runs client , server. send message server possible , have server return stats such players online, status, server name, etc, able create list of online servers simple stats.

the similar example can think of minecraft: http://img28.imageshack.us/img28/8772/5l16.png

we use lidgren library handle connections servers, however, connecting them takes far long. there quick way send request server , have reply simple stats in order make server list above?

as lidgren connections thick, meaning establishes link own protocols before returning connections you, best have stated use different method.

one of fastest solutions built directly on udp socket (see udpclient this) on fire out requests list of endpoints, , parse returns. note udp connectionless , issues no guarantees returns (one may dropped). offer checksum capability don't have worry corrupted responses. game server polling application such this, i'd udp work fine, , in fact unspoken industry standard way. fire wireshark , launch favorite game, chances uses simple udp datagram solution.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -