cross-realm function for a existing server architecture

Started by
2 comments, last by bearaway 12 years ago
Hello,evevrybody.
We have a mmorpg that developed for more than 4 years named "weapons of the god". in the last few month, we keep developping the version 2.0 of this game, and we want to add WoW like cross-realm functions to it.i have some thought that i want to shared with you and get your suggestions.
first, i want to talk about the existing server architecture. for every server group, threre is(are):
1. one ws (world server): a intenal server for other servers in the group to connect, provide world-scope game logics(guild, team, world-chat...)
2.several cs(cell server):each cs servers a set of map instances. most of the game logic run on cs, like skill,buff,quest,ai...
3.one dp(db proxy):every other server send dp database request to load and save object data.
4.one db: a mysql server
5.one ls(login server):provide login checks.
6.two fep(front end proxy)s:accept client connections, provide some secure to these connectins.one fep connects to ws, CSs connect to each fep, so feps transfer client packets to desired server(ws,cs,or ls).it is ws`s job to determine which cs fep should transfer a client session`s packets to.

one big server group contains several such server groups. server groups in the same big group share a common account database, and each server group has a diffrent character database.

our desired cross-realm function means:
1.players in the same big group(possibly in diffrent server groups) can be transfered to the same cross-realm server group.
2.they do PVP there, uses items and skills to make some achievements(get new items,buffs,titles...)
3.players are thransfered back to their original server group. and all the achievements they got in the cross-ream server group are still valid.

i have to plans to implement this, every plan use a new gait server.
there is only only one gait server in a big group, it accepts connections from WSs in every server group(including the cross-realm group). when each ws-gait connection is established, ws send some information to gait, including:
1.db connection information
2.server group id

then gait connect every db in server groups, its major fuction is to transfer data for players between character databases. after player data are thransfered:
plan A:client closes connection to the original group`s fep and then re-establish connection to the cross-realm group`s fep.this plan maybe is easy to implement but we must have a strong solution to ensure that connections to the cross-realm are legal. after data transfer, we can generate some visa like object, including a serial id, hash it to db and give the client the unhashed serial id. another problem is the cross-realm process is not seamless. re-establish connection is maybe not client friendly.

plan B:there is no fep in the cross-realm group, every cs in it connect other group`s feps.and every other group`s fep connect to the cross-realm group`s WS. when datatransfer is finished, the original client-fep connection is still alive, just mark it a cross-ream flag.
problem with this plan is the cs in the cross-ream group now must connect a lot of feps, bottleneck.

now you guys have experience in cross-relm implement? i like your suggestions, thanks a lot.
Advertisement
As far as I know the usual way to implement this is to physically move the player's records from one database into another. There may be alternatives but they are increasingly complicated for decreasing benefit.

Are you interested in "permanent transfers" between servers, or more of a "visiting/guesting" feature? Guesting is a totally different matter than permanent transfers. I must confess I found it really hard to follow your description with all the abbreviations, sorry...

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

What I would do would be to augment the "player id" concept, and have it contain "home world" as part of the ID.
Then you can have a "id to database server" resolver which runs a transaction for a particular user ID on the right database.
If visiting is "rare" then you can have something like a single proxy server where "non-local" requests are sent to, and that proxy connects to all databases.
If visiting is common, then connect to each database from each server. At some point, that will run out of database connections, but I doubt you're at that scale :-)

Also: once you have the id -> database mapping, you can easily shard/partition by ID for horizontal scalability. However, transactions that include multiple players become a lot harder; you have to put all the items into escrow first, and then use worker items in a reliable work queue to complete the transaction. Unless you pay big bucks for a cross-database transaction monitor system, like DB/2 Enterprise.
enum Bool { True, False, FileNotFound };

As far as I know the usual way to implement this is to physically move the player's records from one database into another. There may be alternatives but they are increasingly complicated for decreasing benefit.

Are you interested in "permanent transfers" between servers, or more of a "visiting/guesting" feature? Guesting is a totally different matter than permanent transfers. I must confess I found it really hard to follow your description with all the abbreviations, sorry...


i am interested in a "visiting/guesting" feature. players from all common server groups can visit one cross-realm group (with some total number restrictions), this is our current requirement.

let "home world" ID be part of the player ID is a greate concept, l like it.

This topic is closed to new replies.

Advertisement