Multiplayer Interactive-Fiction Game-Design Blog



Download 8.87 Mb.
Page143/151
Date02.02.2017
Size8.87 Mb.
#15199
1   ...   139   140   141   142   143   144   145   146   ...   151

ConnectionsLimit


Limit the number of connections available on the shard.

Call this function to limit the number of connections available on the shard.

This limit will also be shown to players wondering how full the world is.

This function is automatically called based on gSafetyMaximumUsersConnected.



Parameter Name

Description

Number

Limit, from 1 to (around) 2000.

Return value description

TRUE if changed. FALSE if the number is too high/low.


DatabaseBackup


Backs up the database.

You can use this function to make nightly backups of the database.

This first saves the database (essentially callying DatabaseSave()), and then copies all the database files to a backup directory.

Parameter Name

Description

Directory

Name of the directory where to backup to, such as "c:\\my backups\\monday".

Return value description

Returns TRUE if the database was backed up, FALSE if there was an error.


DatabaseObjectAdd


Adds a new object to the database.

This adds the given object to the database (so it will be backed up to disk). It immediately checks out the added object.

Once an object has been added you will need to call DatabaseObjectCheckIn() when it's finished being used, before it's deleted.

Parameter Name

Description

DatabaseName

Name of the database. This cannot contain any spaces, and must be made up of letters, numbers (except the fist character), and underscores.

Object

Object to be added to the database.

Return value description

Returns TRUE if the object was added, FALSE if it couldn't be added (perhaps because it already exists in the database).


DatabaseObjectCheckIn


Checks in an object to the database.

This checks in an object that was checked out. Every time DatabaseObjectCheckOut() is called to create an object, a call to DatabaseObjectCheckIn() must be called when the object is finished being used (just before it's deleted).

Calls to DatabaseObjectCheckIn() deletes the object from the virtual machine unless a parameter (DontDelete) is set.

The checked in object will (eventually) be saved to disk. To force a checked-in object to be saved right away, call DatabaseSave(); this can be a slow call since it will save everything in the database.



Parameter Name

Description

DatabaseName

Name of the database. This cannot contain any spaces, and must be made up of letters, numbers (except the fist character), and underscores.

Object

Object which is to be checked in.

DontSave

(Optional) If set to TRUE then the checked-in object won't be saved, which means any changes to it will be lost. If FALSE (or not specified) the object will be saved.

DontDelete

(Optional) If set to TRUE then the checked-in object won't be deleted after it's checked in. If FALSE (or not specified) then the object is automatically deleted from the virtual machine after it's saved to the database.

Return value description

Returns TRUE if the object was checked in, FALSE if it couldn't be checked in (perhaps because the object is not checked out).


DatabaseObjectCheckOut


Checks out an object from the database.

Call this function to load an object from the database into the current virtual machine. Once an object is checked out you will need to check it in before the object is destroyed.

For example: If a monster (aka: object) is in a seldom-visited room then keeping it saved to disk until a player enters the room will save memory on the server. When the player enters the room, the monster would be checked-out. (The object ID can be gotten by calling DatabaseObjectQuery() to find all checked-in objects within the room.)

Parameter Name

Description

DatabaseName

Name of the database. This cannot contain any spaces, and must be made up of letters, numbers (except the fist character), and underscores.

Object

Object which is to be checked out.

Return value description

Returns TRUE if the object was added, FALSE if it couldn't be checked out (perhaps because the object is already checked out).



Download 8.87 Mb.

Share with your friends:
1   ...   139   140   141   142   143   144   145   146   ...   151




The database is protected by copyright ©ininet.org 2024
send message

    Main page