HEUAccess

From HEWIKI
Jump to: navigation, search

He server.png Documentation on this page is intended for customers of HeroEngine managing their own server(s).

See also UACCESS Protocol

HEUAccess is a "stub" solution to a licensee's authentication system. This program is a simple application that implements the authentication interface and provides a simple text-file based means of managing accounts. Ultimately, you will replace this with some other custom application that implements the authentication interface that binds this with your own billing and account management system.

The default location for the data files is in C:\heuacces\.

Contents

Server Configuration File

HEUAccess requires a configuration file which instructs the program on which IP and port to listen.

The file should be named server.cfg, and some example contents are:

GROUP=server
LISTENIP=0.0.0.0
LISTENPORT=7561
END_GROUP

Adding Users

HEUAccess reads a text file to populate its list of valid users. The file contains lists of accounts and properties of those accounts. This is an example account:

ACCOUNT=ACCOUNT-NAME
NAME=My Account Name
SUBSCRIPTIONS=HE,OFFICE,OTHER
AUTHORIZATIONS = _IsAllowedToUseHeroBlade,1,_IsAllowedToModifyScripts,1,_IsAllowedToUseRepositoryBrowser,1
PASSWORD=insecure
END_ACCOUNT

To add a new account, put a new account section into the accounts.dat file. Then restart HEUAccess to resource the file.

Account Atributes

All attributes are followed by an '=' character and then the value. Spaces are not allowed

ACCOUNT This is the account name entered when logging in.

NAME The full name of the user the account is for.

SUBSCRIPTIONS List of product IDs that the account has access to.

AUTHORIZATIONS List of authorizations used by the engine, and by users, to allow or prohibit access to sections of functionality.

PASSWORD The plaintext password used when logging in.

END_ACCOUNT This keyword does not have a value. It ends the account entry.


Altering HEUAccess to Allow Test Accounts to Authenticate

In function dataHasArrivedHandler(), find the section of code beginning with if (cmdType = "A" ), and alter it as follows.

     if(cmdType == "A") //Authenticate user
     {
       if (cmd[1].ToUpper().StartsWith("TEST"))
       {
         user.Send("A\t" + cmd[1] + "\tKEY\tABC123\t1\t" + cmd[1] + "\n");
         return;
       }
       if(cmd.Length != 4)
       {
         user.Send("?");
         return;
       }

Further in this function, add a code snipped after the section beginning with else if(msg.StartsWith("S\tN\t"))

     else if(msg.StartsWith("S\tN\t")) //Check subscription
     {
       if (cmd[2].ToUpper().StartsWith("TEST"))
       {
         user.Send("S\t" + cmd[2] + "\tINTERNAL\n");
         return;
       }
       string disabled = accounts.GetConfigValue(cmd[2], "DISABLED", true);

And finally, add a code snippet to return the subscription string required by the world to be tested, after the line else if(msg.StartsWith("S\tK\t")). You will need to change the 'HETEST' imbedded in this code snippet to the appropriate subscription string.

     else if(msg.StartsWith("S\tK\t")) //Get all subscriptions on account
     {
       if (cmd[2].ToUpper().StartsWith("TEST"))
       {
         user.Send("S\t" + cmd[2] + "\tHETEST\t0\tSubscription for the testing world\n");
         return;
       }
       string disabled = accounts.GetConfigValue(cmd[2], "DISABLED", true);

Configuring a World to Use an Alternate HEUAccess

 GROUP=server
 LISTENIP=0.0.0.0
 LISTENPORT=7561
 END_GROUP

 <FireStorm>
   <masterControlTransport>tcp:mastercontrol.eval.heroengine.net:62455</masterControlTransport>
   <minimumCycleTime>20</minimumCycleTime>
   <PostOfficeLogRate>200</PostOfficeLogRate>
   <defaultInactivityLimitMillis>2001000</defaultInactivityLimitMillis>
   <defaultWriteTimeoutMillis>60000</defaultWriteTimeoutMillis>
   <accesscontrolUsername>he_access@evaldb.heroengine.net/hedb.world</accesscontrolUsername>
   <accesscontrolPassword>password</accesscontrolPassword>
   <uaccessProductID>OFFICE</uaccessProductID>
   <uaccessTransport>tcp:localhost:7561</uaccessTransport>
   <serviceUsername>FS_SERVICE@evaldb.heroengine.net/hedb.world</serviceUsername>
   <servicePassword>password</servicePassword>
 </FireStorm>

MasterControlConsoleEditConfigsUaccessTransport.gif


Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox