Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

MsgBoards Namespace Reference

Message boards handling. More...


Enumerations

enum  PostType { LOCALPOST = 0, REGIONALPOST, GLOBALPOST }
 different types of user posts More...

enum  QuestType { ESCORTQUEST = 0xFF, BOUNTYQUEST = 0xFE, ITEMQUEST = 0xFD, QTINVALID = 0x0 }
 different types of QUESTS Added for Quests (ESCORTS)<br/> Reason for starting high and counting down, is that I store the entire user posted message as is (which includes the message type). The message type for a user post is 0x05 and I also use this field to determine whether the post is marked for deletion (0x00). In order to allow for the maximum number of different quest types, I opted to start high and count down. More...


Functions

void MsgBoardGetPostType (NXWSOCKET s)
void MsgBoardSetPostType (NXWSOCKET s, PostType nPostType)
void MsgBoardOpen (int s)
void MsgBoardList (int s)
int MsgBoardGetMaxMsgSN (int msgType, int autoPost=0)
int MsgBoardPost (int s, int msgType, int autoPost)
void MsgBoardOpenPost (int s)
void MsgBoardRemovePost (int s)
bool MsgBoardRemoveGlobalPostBySerial (SERIAL nPostSerial)
void MsgBoardEvent (int s)
int MsgBoardPostQuest (int serial, QuestType questType)
void MsgBoardQuestEscortCreate (int npcIndex)
void MsgBoardQuestEscortArrive (P_CHAR pc, P_CHAR pc_k)
void MsgBoardQuestEscortDelete (int npcIndex)
void MsgBoardQuestEscortRemovePost (int npcIndex)
void MsgBoardMaintenance (void)
void MsgBoardEvent (NXWSOCKET s)
int MsgBoardPostQuest (NXWSOCKET s, QuestType nQuestType)
void MsgBoardQuestEscortCreate (NXWSOCKET s)
bool MsgBoardRemoveGlobalPostBySerial (int nPostSerial)

Variables

char g_strScriptTemp [1024]
UI08 postAcked [MAXCLIENT][MAXPOSTS][5]
 List of message serial numbers ACK'd by client.

UI32 postCount [MAXCLIENT]
 Total number of posts sent to client.

UI32 postAckCount [MAXCLIENT]
 Total number of ACK's received by client.

UI08 msg [MAXBUFFER]
 Char array for messages to client. Message body (when entering body of post) can hold a maximum of 1975 chars (approx).

UI08 msg2Post [MAXBUFFER] = "\x71\xFF\xFF\x05\x40\x00\x00\x19\x00\x00\x00\x00"
 Buffer to be used when posting messages.

const UI32 MAXPOSTS = 128
 Maximum number of posts per board.

const UI32 MAXENTRIES = 256
 maximum number of entries in a ESCORTS list in the MSGBOARD.sSCP file


Detailed Description

Message boards handling.

Author:
Akron
Since:
0.82r3
Todo:
rewrite functions


Enumeration Type Documentation

enum MsgBoards::PostType
 

different types of user posts

Enumeration values:
LOCALPOST 
REGIONALPOST 
GLOBALPOST 

enum MsgBoards::QuestType
 

different types of QUESTS Added for Quests (ESCORTS)<br/> Reason for starting high and counting down, is that I store the entire user posted message as is (which includes the message type). The message type for a user post is 0x05 and I also use this field to determine whether the post is marked for deletion (0x00). In order to allow for the maximum number of different quest types, I opted to start high and count down.

Enumeration values:
ESCORTQUEST 
BOUNTYQUEST 
ITEMQUEST 
QTINVALID 


Function Documentation

void MsgBoardEvent NXWSOCKET    s
 

void MsgBoardEvent int    s
 

int MsgBoardGetMaxMsgSN int    msgType,
int    autoPost = 0
 

Parameters:
msgType  Type of post (LOCAL, REGIONAL, GLOBAL)
autoPost  if true, message posted by a user (default); else message posted by system
Returns:
0 if failed to get maximum serial numbero, 1 if found and updated maximum serial number
Used during posting operation to determine the current maximum message serial number used on the board. It then increments the number and updates the bbi file. The new message serial number is returned.

void MsgBoards::MsgBoardGetPostType NXWSOCKET    s
 

Parameters:
s  player socket Used to retrieve the current post type in order to tell the user what type of mode they are in.

void MsgBoardList int    s
 

Parameters:
s  player serial number After Bulletin Board is displayed and client ACK's all posted items this is called to send the details of the posted item to the Bulletin Board so that it can be listed on the board.

void MsgBoards::MsgBoardMaintenance void   
 

void MsgBoardOpen int    s
 

Parameters:
s  player serial number Called when player dbl-clicks on a Message Board thereby requesting a list of messages posted on the board.

void MsgBoardOpenPost int    s
 

int MsgBoardPost int    s,
int    msgType,
int    autoPost
 

int MsgBoardPostQuest NXWSOCKET    s,
QuestType    nQuestType
 

int MsgBoardPostQuest int    serial,
QuestType    questType
 

void MsgBoards::MsgBoardQuestEscortArrive P_CHAR    pc,
P_CHAR    pc_k
 

void MsgBoardQuestEscortCreate NXWSOCKET    s
 

void MsgBoardQuestEscortCreate int    npcIndex
 

void MsgBoards::MsgBoardQuestEscortDelete int    nNPCIndex
 

void MsgBoards::MsgBoardQuestEscortRemovePost int    nNPCIndex
 

bool MsgBoardRemoveGlobalPostBySerial int    nPostSerial
 

bool MsgBoardRemoveGlobalPostBySerial SERIAL    nPostSerial
 

void MsgBoardRemovePost int    s
 

void MsgBoards::MsgBoardSetPostType NXWSOCKET    s,
PostType    nPostType
 

Parameters:
s  character
nPostType  type of post
Used to set the postType for the current user (Typically a GM) There is a local array that holds each players curreny posting type. Using the command to set the post type updates the value in the array for that player so that they can post different types of messages.


Variable Documentation

char MsgBoards::g_strScriptTemp[ 1024 ]
 

Note:
xan -> do not move in headers, plz

const UI32 MsgBoards::MAXENTRIES = 256
 

maximum number of entries in a ESCORTS list in the MSGBOARD.sSCP file

const UI32 MsgBoards::MAXPOSTS = 128
 

Maximum number of posts per board.

Buffer Size = 2560<br/> Therefore 0x3c max size = 2560 - 5 (0x3c header info) = 2550<br/> 2550 / 19 (item segment size per msg) = 134<br/> Round down to 128 messages allowable on a message board (better safe than sorry)

UI08 MsgBoards::msg[MAXBUFFER]
 

Char array for messages to client. Message body (when entering body of post) can hold a maximum of 1975 chars (approx).

UI08 MsgBoards::msg2Post[MAXBUFFER] = "\x71\xFF\xFF\x05\x40\x00\x00\x19\x00\x00\x00\x00"
 

Buffer to be used when posting messages.

UI32 MsgBoards::postAckCount[MAXCLIENT]
 

Total number of ACK's received by client.

UI08 MsgBoards::postAcked[MAXCLIENT][MAXPOSTS][5]
 

List of message serial numbers ACK'd by client.

UI32 MsgBoards::postCount[MAXCLIENT]
 

Total number of posts sent to client.

SourceForge.net Logo