Multiplayer Interactive-Fiction Game-Design Blog



Download 8.87 Mb.
Page147/151
Date02.02.2017
Size8.87 Mb.
#15199
1   ...   143   144   145   146   147   148   149   150   151

DatabaseSave


Saves the database to disk.

Normally, the database is saved bit-by-bit to disk, so that users don't see multi-second pauses in game-play. However, this can be dangerous since if the server crashes, not all the data will be saved.

To ensure that all the data is saved, call DatabaseSave().

Parameter Name

Description

DatabaseName

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

If no database is specified then all of them will be saved.



Return value description

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


EmailSend


Sends E-mail from the sever.

Call this to send E-mail from the server.

It connects using SMTP to send the message.

Since this is an asynchronous function, and won't return success/failure, all the E-mail transmission and success information is automatically logged.

NOTE: This CAN'T send mail using SSL at the moment!

Parameter Name

Description

Domain

String of the domain that sending from, such as "bigpond.com".

SMTPServer

SMTP server, such as "mail.bigpond.com".

EmailTo

Email address of the person sending to, such as "Mike@mXac.com.au". This MUST be a valid E-mail address without extra spaces.

EmailFrom

Email address of the sender, such as "AutoSend@mXac.com.au". This MUST be a valid E-maill address without extra spaces.

NameFrom

String to display in the "from" field, such as "Interactive Fiction Automatic Mailer".

Subject

Subject string.

Message

Message text.

AuthUser

Some E-mail systems requires user authentication before they send E-mail. If your system need this, make sure to fill in AuthUser and AuthPassword. Otherwise, leave them as empty strings, "".

AuthPassword

Some E-mail systems requires user authentication before they send E-mail. If your system need this, make sure to fill in AuthUser and AuthPassword. Otherwise, leave them as empty strings, "".

Return value description

Returns TRUE, but this doesn't guarantee the mail has actually been sent since its an asnchronous process.


HelpArticle


Returns the resource (in a list) for a given online help article.

Returns the resource (in a list) for a given online help article. If the article does not exist then it returns NULL.



Parameter Name

Description

Actor

The actor looking in help. Some actors, either because of skills or access priviledges, won't be able to see some help topics.

ArticleName

String with the article's name. The name must be an exact match (except for case.)

Books

Controls what books of help will be searched.

If this is NULL, then only help articles in the default book, "", will be searched. (NULL will usually be passed in.)

If it's a string then only that book will be searched.

If it's a list of strings, then only those books whose string appears in the list will be kept.



Return value description

If the article cannot be found it returns NULL. Otherwise, it returns a list.

The first item is the MML text for the article, of the form "...".

The second item is the TOC directory, such as "major topic/minor topic". It might just be an empty string, like "". The third item the secondary TOC directory, if one exists.



HelpArticleMML


Returns the resource for a given online help article.

Returns the resource for a given online help article. If the article does not exist then it returns NULL.



Parameter Name

Description

Actor

The actor looking in help. Some actors, either because of skills or access priviledges, won't be able to see some help topics.

ArticleName

String with the article's name. The name must be an exact match (except for case.)

Books

Controls what books of help will be searched.

If this is NULL, then only help articles in the default book, "", will be searched. (NULL will usually be passed in.)

If it's a string then only that book will be searched.

If it's a list of strings, then only those books whose string appears in the list will be kept.



Return value description

MML text for the article, of the form "...". NULL if the article can't be found.

// get it

var vList = HelpArticle (Actor, ArticleName, Books);

if (!vList)

return NULL;


// make up the string for the up-option

// potentially show "up" option

var vUp = vList[1];

if (vUp.StringLength())

vUp = " \"" + ToStringMML(vUp) + "\"";
vUp = "

ToStringMML (ToString(sHelpContents) + vUp) +

"\">" +

ToStringMML (sHelpContentsUp) +

"
";
// find the ending MML in the list

var vRet = vList[0];

var vSearch = "";

var vFind = vRet.StringSearch (vSearch);


if (vFind >= 0)

vRet.StringInsert (vUp, vFind);


// add in back

var vBack;

if (Actor && IsList(Actor.pHelpHistory) && (Actor.pHelpHistory.ListNumber() >= 2)) {

vBack = "


ToStringMML (sHelpBackCommand) +

"\">" +

ToStringMML (sHelpBackShow) +

"
";

vFind = vRet.StringSearch (vSearch);

if (vFind >= 0)

vRet.StringInsert (vBack, vFind);

}

return vRet;



Download 8.87 Mb.

Share with your friends:
1   ...   143   144   145   146   147   148   149   150   151




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

    Main page