Nuclide
Software Development Kit for id Tech
Message of the Day

Server set message of the day, display to clients. More...

Macros

#define MOTD_LINES   32
 Hard-limit to how many lines are allowed within a message of the day. More...
 

Functions

void MOTD_LoadDefault (void)
 Called on the server to load the default 'message of the day' file. More...
 
void MOTD_LoadFromFile (string)
 Called on the server to load a specific 'message of the day' file. More...
 
void MOTD_Init (void)
 Called by CSQC_Init() on the client game and by initents() on the server game to set up a networked 'message of the day'. More...
 
string MOTD_GetTextBody (void)
 Returns the full text body of the 'message of the day' that is on the server. More...
 
int MOTD_GetLineCount (void)
 Returns how many individual lines are present in the message of the day. More...
 

Detailed Description

Server set message of the day, display to clients.

Message of the Day (MOTD) System

Any multiplayer game has the capability of setting a Message of the Day, MotD for short.

Those are usually bits of information about the game server, how to contact the administrator or more.

A NSGameRules based class can usually call MOTD_LoadDefault() on the server to load the message from the default file location located under gamedir/motd.txt. The default location can be changed by adjusting the console variable motdfile.

The client game then receives the MotD using MOTD_GetTextBody(), in addition to MOTD_GetLineCount() for figuring out how many lines of text the message takes up.

Macro Definition Documentation

◆ MOTD_LINES

#define MOTD_LINES   32

Hard-limit to how many lines are allowed within a message of the day.

Function Documentation

◆ MOTD_GetLineCount()

int MOTD_GetLineCount ( void  )

Returns how many individual lines are present in the message of the day.

◆ MOTD_GetTextBody()

string MOTD_GetTextBody ( void  )

Returns the full text body of the 'message of the day' that is on the server.

Can be retrieved by clients via the motd console command.

◆ MOTD_Init()

void MOTD_Init ( void  )

Called by CSQC_Init() on the client game and by initents() on the server game to set up a networked 'message of the day'.

◆ MOTD_LoadDefault()

void MOTD_LoadDefault ( void  )

Called on the server to load the default 'message of the day' file.

◆ MOTD_LoadFromFile()

void MOTD_LoadFromFile ( string  fileName)

Called on the server to load a specific 'message of the day' file.