[crossfire] Map cache

Brendan Lally brenlally at gmail.com
Fri Aug 26 15:33:53 CDT 2005


On 8/26/05, Anton Oussik <
     
     antonoussik at gmail.com
     
     > wrote:
>
     
        2) If  the thing goes down (and it will go down) all other computers
     
     >
     
      participating in running the server would become orphaned. If the
     
     >
     
      server is modified in a more flexible fashion one node going down
     
     >
     
      should not be critical to all the clients not currently on maps
     
     >
     
      governed by that server.
     
     This would in game terms, correspond to an excuse in the map files 
'I'm sorry guv'ner but I can't sail out to $FOO, there's a terrible
storm blowing up that no ship'd survive.'

>
     
      This is the scheme I propose for a distributed set of servers:
     
     >
     
      First server to come up runs like an ordinary server.
     
     >
     
      All other servers connect to an already known server, get a list of
     
     >
     
      servers and their loads.
     
     >
     
      A new server then takes half of the maps governed by the busyest
     
     >
     
      server (servers would need to somehow measure how busy they are,
     
     >
     
      either themselves or by election by other servers) and associates
     
     >
     
      itself with all exits to the server, and transfers all players that
     
     >
     
      are now governed by the new server.
     
     
The easiest way to do have one central server, that is functionally a
glorified jabber server and (ab)use the region field. The central
server would have a list of all the other servers and which regions
they provide. At anyone time it would have a server that would be the
one dealing with each area. If it went down (or even just started
responding slowly). Another server would be told to start serving the
additional maps. The central server would have all players connect to
it first, and once login had succeded, they would be told which server
to go to. Probably creation would be on the master server
(HallOfSelection and Nexus). Since all players connected to the
central server first, it would be the only one that would need to do
passwords, and the only one to need to have the save files. The player
and all objects that they carry with them could be transferred between
the servers. All shouts would go from the local server, to the central
server, and there to every other server. Tells would be routed
similarly.

For the individual servers, whenever a local player tried to enter a
new map, you check the region header, and if it is a different one
report to a central server. The central server would keep a list of
which server is responsible for which area and it would say 'ok to
send player though that exit' (the player would enter a 'limbo' area),
their old server would send the player data (the fields from the
player struct,  and all their inventory, etc, all compressed and sent
in one go) to the central server, where it would be saved (to avoid
too much data loss if a server is unstable, and to help track down
abuse) and sent on to the new server. The old server would be told the
new server's adress, who would tell the client. The client would
connect to the new server in a seperate thread, and drop the
connection to the old server soon after (after they have moved off the
entrance probably).

Getting around firewalling issues that would raise is a whole different problem.
 
In these circumstances, map transitions may occasionally be slow, but
the other players wouldn't notice except that their shouts may lag
occasionally (much like irc really).

This however would require rewriting most of the server.

    
    


More information about the crossfire mailing list