stoneage8.5/石器时代8.5客户端最新源代码/石器源码/systeminc/chat.h
2020-06-22 17:49:02 +08:00

157 lines
4.1 KiB
C
Raw Blame History

/************************/
/* chat.h */
/************************/
#ifndef _CHAT_H_
#define _CHAT_H_
//cary 256 -> 260
#define STR_BUFFER_SIZE 260 // ???????????
#ifdef _NEW_RESOMODE
#ifdef _SA_LIAOTIAN_
#define MAX_CHAT_LINE 200 // 聊天行数限制
#else
#define MAX_CHAT_LINE 20 // 聊天行数限制
#endif
#else
#define MAX_CHAT_LINE 20 // 聊天行数限制
#endif
#define DEF_CHAT_LINE 20 // ??<3F><>???????
#define MAX_CHAT_HISTORY 64 // ???????????
#define DEF_VOICE 3 // ?????<3F>?<3F>??
#define MAX_VOICE 10 // ?????<3F>??<3F><>
#define NORMAL_TYPE 0
#define BLIND_TYPE 1
#define NUMBER_TYPE 2
#ifdef _SAHOOK //Syu ADD Hook程式
#define HOOK_TYPE 3
#endif
// <20>????????<3F><>
typedef struct{
char buffer[ STR_BUFFER_SIZE ]; // ??<3F>?<3F>???????
unsigned char len; // <20>??<3F>?
unsigned char lineLen; // ???<3F>??<3F>?
unsigned char lineDist; // ?????????????
unsigned char cnt; // ???<3F>???
unsigned char color; // <20>??<3F>
unsigned char cursor; //游标的位置
int x, y; // <20>????<3F>
int imeX, imeY; // ???<3F>???<3F><>?<3F>?<3F>
int fontPrio; // <20><>??<3F><>
BOOL filterFlag; // <20>???????????????
int hitFontNo; // <20><>?<3F>??<3F>?????????<3F><>??
}STR_BUFFER;
typedef struct _CHAT_BUFFER{
char buffer[ STR_BUFFER_SIZE + 1 ]; // ??<3F>?<3F>???????
unsigned char color;
#ifdef _MO_CHAT_EXPRESSION
int BmpNo;
int x;
_CHAT_BUFFER * NextChatBuffer;
#endif
#ifdef _FONT_SIZE
int fontsize;
#endif
}CHAT_BUFFER;
// ???????????<3F><>
typedef struct{
char str[ MAX_CHAT_HISTORY ][ STR_BUFFER_SIZE + 1 ]; // ??????????<3F>??
int newNo; // ?<3F>??????????<3F>?
int nowNo; // ????????????<3F>?
}CHAT_HISTORY;
// onlinegm问题输入纪录
typedef struct{
char str[115][STR_BUFFER_SIZE + 1 ];
int newNo;
int nowNo;
int addNo;
int lockNo;
BOOL color[115];
}INPUT_HISTORY;
// ???????????????????????
extern STR_BUFFER *pNowStrBuffer;
// ?????????
extern CHAT_BUFFER ChatBuffer[];
// <20><>?<3F>????????
extern STR_BUFFER MyChatBuffer;
// ??????????
extern int NowChatLine;
// ??????????
extern int NowMaxChatLine;
// ??<3F>?<3F>??
extern int NowMaxVoice;
/* 将单一字元储放至目前的输入String buffer
parameter: c: 字元 */
void StockStrBufferChar(char c);
/* 将双位元字元储放至目前的输入String buffer
parameter: lpc: 双位元的字元 */
void StockStrBufferDBChar(char *lpc);
/* ?????????????????????? */
void ChatBufferToFontBuffer( void );
void ChatProc( void );
void StockChatBufferLine( char *str, unsigned char color );
#ifdef _FONT_SIZE
void StockChatBufferLineExt( char *str, unsigned char color, int fontsize );
#endif
void ClearChatBuffer( void );
int GetStrLastByte( char *str );
int GetStrWidth( char *str );
void GetKeyInputFocus( STR_BUFFER *pStrBuffer );
/* ????????? **********************************************************/
void InitChat( void );
/* ???????? ************************************************************/
void ChatProc( void );
// ?????????<3F>䴓?? **************************************************/
void FlashKeyboardCursor( void );
void KeyboardLeft();
void KeyboardRight();
/* ???????? ************************************************************/
void KeyboardReturn( void );
// ?????? ***************************************************************/
void KeyboardBackSpace( void );
// ???????<3F>??<3F><> ****************************************************************/
BOOL SaveChatHistoryStr( int no );
// ???????<3F>??<3F>??? ****************************************************************/
BOOL LoadChatHistoryStr( void );
BOOL LoadReadSayShield( void );
BOOL LoadReadNameShield( void );
bool CheckSay( const char* strSay, const char szReplace = '*' );
bool CheckName( const char* strSay/*, char* word*/ );
// ?????????<3F>????????? ********************************************/
void GetClipboad( void );
// ??????????????????<3F>????? ***********************************/
void SetClipboad( void );
int GetCharByte( char c );
#ifdef _FRIENDCHANNEL //ROG ADD 好友频道
void StrToNowStrBuffer( char *str );
#endif
#ifdef __ONLINEGM
int StrToNowStrBuffer2( char *str );
#endif
#endif