If someone played the game Dukkrak Online (or any similar multiplayer application) on Android, then there is the possibility of creating your own server and connect to it. As I understand the server is created on a remote computer. So I had a question, how can this be realized: creating a new server from an android device on a remote computer.

Or is it done differently? For example, servers are running in advance, and when the "Create game (server)" button is pressed on the device, it becomes visible and the settings change on it ...

PS I would also like to know about the monitoring of servers to which you can connect. Is the search and display of available servers implemented in a separate thread in an infinite while loop? Or is there a solution with a more "beautiful" implementation?

Closed due to the fact that the issue is too general for Regent , aleksandr barakin , ermak0ff , Cobalt , PashaPash 8 Oct '15 at 20:34 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    An application server is created in advance and placed on a remote physical server. "Create a game (server)" is better understood as creating a room or for a card game - creating a party. In a card game, other players then join the game. There is no need to create a server, room or party in advance. It is better to create these entities on demand, for example, when a player chooses the "Create a game (server)" option, after which they become visible to other players in one form or another.

    There are several options for monitoring servers (rooms, batches) on the client. It strongly depends on the chosen client-server architecture. If the architecture is selected on persistent connections (TCP or UDP sockets) - a two-way communication channel is created between the client and the server - the server, at the initiative of one user, creates a room and notifies other interested users about this event, for example those who view the list of available rooms at this time.

    • That is, it turns out that initially all the players that started the application are connected to the same server, and then distributed to the rooms depending on the ones created by them themselves? Is a game just an object on a server consisting of players connected to it? - shagi
    • On the example of a card game, yes. In more complex games, you need to implement a more complex scheme. In multiplayer games designed for thousands of simultaneously playing players there can be several servers. - sba