Skip to content
shlainn edited this page Sep 14, 2010 · 1 revision

The following description is a short summary of what happens from starting PseuWoW until it is connected to the world server. It is not very accurate not to make things too complicated, but gives a basic overview about the most important parts.

  • main() spawns a new PseuInstanceRunnable() thread. This thread creates a new PseuInstance; its Init() function is called.
    • The instance's DefScriptPackage is created; it loads the script file _startup.def from the main directory and executes the "_startup" function - if not explicitly defined it is simply the whole text defined in _startup.def.
    • The script itself loads all *.def files in the ./scripts/ directory.
    • If those scripts have an #onload block, these blocks will also be executed now.
      • By loading __core_internal.def, all Files:conf are read in, converted into DefScript variables, and finally converted to PseuWoW's internal configuration values (see ''PseuInstanceConf'' class in ''PseuWoW.h'').
      • The file ''database_loader.def'' attaches itself to the end of the ''_startup'' function - as soon as all scripts are loaded this makes PseuWoW load all databases.
    • The plaintext database files (.scp) are read and compressd into .scc files in the ./cache/ directory. If the plaintext files have not been changed, the compressed scc file is loaded without recompressing the data, which saves time.
  • After loading the scripts, it creates the GUI, starts the CLI, and sets up the remote controller, if enabled.
  • If PseuInstance::Init() was successful up to this point, PseuInstance::Run() is called.
    • After giving the GUI some time to start up, the connection process is initialized.
      • PseuWoW tries to connect to the realm server, and sends an Authcodes:AUTH_LOGON_CHALLENGE packet.
      • The server answers if it accepted the connection or if there was an error. If there was no error, a few packets are exchanged containing data of the [http://srp.stanford.edu/ SRP-6 protocol].
      • If the authentication was successful, a sessionkey is calculated and the server sends the Authcodes:REALM_LIST, which contains a list of reachable realms (their IPs/hostnames, port and name).
      • PseuWoW opens a Resources:Protocol_World specified in the realm list.
  • Once connected, the realm session is destroyed, the connection to the realm server closed, and the world server connected to immediately sends a Opcodes:SMSG_AUTH_CHALLENGE, again containing the seed of an authentication. The sessionkey is used in the following client-side calculation, to ensure that only well authenticated clients can connect.
  • PseuWoW sends its response, and if authenticating went well up to this point, PseuWoW sends Opcodes::CMSG_PLAYER_LOGIN to the server.
  • The server then responds with a few initial packets containing the world state, the spell list, all objects around the player and other stuff to PseuWoW.
  • We are now logged in and ready for action!

Clone this wiki locally