[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to spawn a server?
On Mon, 9 Sep 2002, Francesco Orsenigo wrote:
>
>My game works on a tight server/client system.
>This means that the player usually needs to run only the client.
>But when the player chooses to Host a game, the client program must create a
>server and connect to it immediatly.
>At the time, the program works this way: as soon as the program is launched,
>it creates a pipe and a socketpair, then forks.
>Server is controlled with the pipe, and initializes whenever needed.
>When pipe is severed, the server closes.
I assume you mean a system like:
Player1 ------- Server ------- Player2
We used the idea of a separately started server for our game, but it
quickly became a nuisance, as it's "magic" for most players to have to
start some extra weird "server application. So we integrated the server
into one the client, and the players now have and option to host a game or
connect to another player.
Of course, our game isn't realtime, so the player that runs as the server
has no extra benefits in form of faster ping times etc, as those issues
don't matter.
--
"You can't trample infidels when you're a tortoise. I mean, all you could
do is give them a meaningful look."
-- Terry Pratchett, Small Gods