HE Admin

From HEWIKI
Revision as of 15:23, 10 April 2012 by HE-ALEX (Talk | contribs)
Jump to: navigation, search

This page documents an upcoming feature and is not currently deployed to any customer world.

HE Admin is a system that is designed to allow certain accounts to successfully login to a world in the event of a catastrophic failure during the game-specific login process.

Contents

Overview

During the development of a product it is expected that the clean engine login process will be extended to provide game-specific functionality. If a problem in the game-specific HSL code for the login process prevents developers from logging in, HE Admin will enable a developer to successfully login using a specifically defined administrator account and fix the problem. HE Admin can do this because it uses a simpler login process that skips as much game-specific HSL code as possible.

What problem(s) does this solve?

What problem(s) does this not solve?

Concepts

Which accounts are administrators?

A player account will be considered an administrator if the player account class is a _playerAccountAdministrator or if the player connection is a _playerConnectionAdministrator or if the account name is one of the account names recognized as an administrator account. When the clean engine login process starts, if the name of the account that's logging in is an administrator account name then the player account root node will be created as a _playerAccountAdministrator.

HE Admin versus Clean Engine Login process

In clean engine, if you login with a normal account you will be sent to the Character Selection Area where you can either select an existing character or create a new one. When you create a new character you are sent to Character Creation area and are prompted to name your new character. After your new character has been created you are sent to the Starting Area. If you login with an HE Admin account, as soon as you enter the Character Selection Area the normal Character Selection and Character Creation processes are bypassed and a custom HE Admin character creation process happens. In the HE Admin character creation process the character class is created from the prototype HE_CharacterPrototype and the character appearance node is created with the specification character_sample. As soon as the character has been successfully created it's name is set to "ADMIN" concatenated with the AccountID. For example if the AccountID is 12345 the character name would be "ADMIN12345". Every time an HE Admin account connects to the world a new account root node is created. This happens because when an HE Admin account disconnects from the world the account root node is destroyed. An HE Admin account's root node will always be destroyed when it's disconnected from the world and all hard associated persisted nodes in the Account Character Tree will be destroyed as well.

Usage

If you plan on doing any development that will interact with or extend from the clean engine login process it would be a good idea to determine how you will go about using HE Admin. The following examples aren't the only way to use the HE Admin system, but they are safe ways that don't involve changing clean engine HSL scripts.

Example 1: The HE-Admin account

In order to ensure that we can access a world to provide support, the most basic exercising of this system is the administrator account (he-admin) used by the HeroEngine team to provide support. By default in clean engine HE Admin code, this is the only account that will always be treated as an administrator.

Example 2: Overriding Admin checking functions

It is also possible to provide game-specific implementations of _IsAdminAccount() and _IsAdminAccountName() by implementing HE_IsAdminAccount() and HE_IsAdminAccountName() in a class glommed on to $ACCOUNT. The following will detail how to accomplish this:

// Method called on the $ACCOUNT node to determine admin status given a set of data
method HE_IsAdminAccount( data as NodeRef )
// Used by $ACCOUNT
// Parameters:
//   data - $ACCOUNT is passed as this parameter, $ACCOUNT._adminAccountID will hold the ID to check admin status for
// Return(s):
//   data._adminStatus - boolean indicating if $ACCOUNT._adminAccountID is an admin account or not
//   data._adminHandled - boolean indicating whether or not the clean engine processing should be used
  where data is kindof _Account
    data._adminHandled = false
  .
.
 
// Method called on the $ACCOUNT node to determine admin status given a set of data
method HE_IsAdminAccountName( data as NodeRef )
// Used by $ACCOUNT
// Parameters:
//   data - $ACCOUNT is passed as this parameter, $ACCOUNT._adminAccountName will hold the name to check admin status for
// Return(s):
//   data._adminStatus - boolean indicating if $ACCOUNT._adminAccountName is an admin account or not
//   data._adminHandled - boolean indicating whether or not the clean engine processing should be used
  where data is kindof _Account
    data._adminHandled = false
  .
.

Reference

The following clean engine functions are used to test whether an account is an HE Admin account. These functions are located in _AccountClassMethods which is the HSL class used for $ACCOUNT.

// Determines admin status of the provided account ID
unique method _IsAdminAccount( accountID as ID ) as Boolean
 
// Determines admin status of the provided account name
unique method _IsAdminAccountName( accountName as String ) as Boolean

See also

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox