Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Multi server Capabilities

Kyle J. Kemp edited this page Oct 15, 2019 · 2 revisions

Rair should allow you to connect your server to a hub which would have a list of all current servers you can connect to. You should ideally be able to specify which hub you want to log on to, which would default to the official server.

Each server on a hub will communicate using the same lobby.

In a particular map, a link can be made to another server (using a hostname or IP). Stepping through the portal would initiate a process to join a different server.

If that server is in the current hub, nothing strange will happen (you'll talk in the same lobby, have the same characters available, etc).

If that server is NOT in the current hub, the following will happen:

  • a new account with the current username will be created on that server (and the current password hash), as well as an "origin" (if the account exists, some data will be synced, but some will not - like silver)
    • if the origin of the account does not match, a mismatch error will be thrown and the transfer will not happen
    • if the transfer does not happen, the user will be advised to make an account on that server or request the other one be deleted
  • all of the characters will be ported over (if they exist, they will be synced)
  • the current account will be logged in to that lobby (logged out of current)
  • the current character will be logged into the destination map,x,y (from the portal)

If the player is currently NOT in their origin server and they transfer, depending on settings, the data will transfer back to the original server.

Servers have to consent and manually create a portal to another server, so they should only create portals to servers they trust.

Each server will have the following options to control data flow. Export, import, and sync options should be able to be customized on a per-server basis, with global overrides, in case you want to provide exceptions to some servers, but not to others.

Server options

These options dictate some information about the server itself.

  • ORIGIN_NAME - the name of the hub/server. this will be used to track where accounts come from

Export options

These options dictate whether the server should export data when leaving or not.

  • EXPORT_ACCOUNT - whether or not the accounts should be exported when transferring servers
  • EXPORT_ACCOUNT_PURCHASES - whether or not account purchases should be exported when transferring servers
  • EXPORT_PLAYERS - whether or not the players should be exported when transferring servers (just character data; no gear/levels/skills)
  • EXPORT_PLAYER_GEAR - whether or not the player gear should be exported when transferring servers
  • EXPORT_PLAYER_LEVELS - whether or not the player level/skills should be exported when transferring servers

Import options

These options dictate whether the server should import data when joining or not. These options are absolute for a server - if there are exported players, but this server does not want them, it will not take them. Likewise, if the server is requesting players but they are not exported they are not added. The two servers must agree on what data is being transferred.

  • IMPORT_ACCOUNT - whether or not to import account data (if false, users cannot transfer to this server without making an account)
  • IMPORT_ACCOUNT_PURCHASES - whether or not this server should import account purchases (extra player slots should always be imported if IMPORT_PLAYERS is set)
  • IMPORT_PLAYERS - whether or not this server should import player data (character slot info; no gear/levels/skills)
  • IMPORT_PLAYER_GEAR - whether or not this server should import player gear
  • IMPORT_PLAYER_LEVELS - whether or not this server should import player levels/skills

Sync options

These options dictate what data comes back to the origin region after leaving. For these settings to matter, the origin server must export this data first. To note: all data is always sent on a transfer request, the options are also exported and then compared. This means that transferring maps will have a moderate data overhead, but this is necessary for these options to matter.

  • SYNC_ACCOUNT - redundant; of course the account exists on the origin
  • SYNC_ACCOUNT_PURCHASES - whether or not to bring account purchases back (dangerous; someone can go to a server, get "hacked" and come back with everything - requires trust!)
  • SYNC_PLAYERS - whether or not player data should be synced when coming back. This can be dangerous if someone joins another server, rerolls their character, then comes back to their origin server. In general, this will be redundant because those characters will already exist on the origin server.
  • SYNC_PLAYER_GEAR - whether or not to bring player gear back from the other server. This will overwrite whatever data they currently have with the new gear data. This option is most useful when you have multiple servers that act as a group, but are not in the same hub. You would want this to be false if you were joining a challenge or ladder server, where it is intended that gear is started from scratch. This could also be bad to have on if someone joins a server, gets stripped, and comes back but gets all their gear back.
  • SYNC_PLAYER_LEVELS - whether or not to bring the new player xp/skills back from the server. This will overwrite whatever levels and skills they have when they rejoin their origin server. This is most useful when you have multiple servers that act as a group, but are not in the same hub. You would want this to be false if you were joining a challenge or ladder server, where it is intended that levels/skills are started from scratch.
Clone this wiki locally