Multi-server game

Discussion in 'PHP' started by G3n3s!s, Jan 22, 2011.

  1. #1
    Hey. I'm currently working on Multi-server game and I would like to create centralised registrations.

    Something like this.

    • I have 5 servers
    • users register
    • They want to join one server, so they click joIn and it will "register" him with same acc details to one server
    • user can do same thing to every server (they can join)

    I am asking, how should I do that?

    Just create DB table `users_global`

    and then have same tables for different servers just with different prefixes and then move user from users_global to s1_users ?

    Or could you suggest me better "style" of joining users to another servers with centralised DB (users) ?
     
    G3n3s!s, Jan 22, 2011 IP
  2. SimThePhpCoder

    SimThePhpCoder Well-Known Member

    Messages:
    949
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #2
    simple switch would work selecting the db server based on url. ;]
     
    SimThePhpCoder, Jan 23, 2011 IP
  3. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #3
    I am asking how to "move" or "re-register" that user on certaily server (same DB with different prefix)
     
    G3n3s!s, Jan 24, 2011 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    By "server" do you mean a web server? App server? Data server?

    Why are you wanting 5 instances of the game?

    To avoid concurrency issues, hold the user details in a central DB and just note which servers they are "registered" with on it rather than copying anything across anywhere.
     
    AstarothSolutions, Jan 24, 2011 IP
  5. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #5
    server = game server.
    Each dedicated server can handle 3 servers for example.

    Why 5 instances of game?

    1. each server can have different mods/speed
    2. each server has limited number of users
    3. Is it better to save 500 000 battle notifications rather than 100 000? no ;)
     
    G3n3s!s, Jan 24, 2011 IP
  6. Alex Roxon

    Alex Roxon Active Member

    Messages:
    424
    Likes Received:
    11
    Best Answers:
    7
    Trophy Points:
    80
    #6
    How about you just have a single database server. If all of the servers are on a single network, you can have 5 servers set up to specifically handle the game, and a dedicated server to handle the data. A very easy solution to implement, and yet quite effective.
     
    Alex Roxon, Jan 24, 2011 IP
  7. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    #7
    mirror your user database. 1 master = registration takes place
     
    gapz101, Jan 25, 2011 IP