Junior Spellweaver
- Joined
- Oct 20, 2013
- Messages
- 193
- Reaction score
- 56
I am currently working with someone and we are rebuilding the S.U.N Online Server files from here. You can download the entire source code there. Here is the
At the moment we are just trying to debug the servers to make them warning and error free, but I came across some files that are questionable. Keep in mind that I am not an expert in C++, I am mostly doing this to further my knowledge, and haven't worked on a project this large before.
Directory Path: ..\DBServer\DBServer\Database\common\GlobalDef.h
The project was looking fine (minus the errors and warnings) up until I came across GlobalDef.h. Can anyone tell me what exactly is going on with all of the defines at the beginning of this file? It doesn't correspond to DataBase.h which is the only one calling on it.
GlobalDef.h
Thank you.
You must be registered to see links
to current DBServer code.At the moment we are just trying to debug the servers to make them warning and error free, but I came across some files that are questionable. Keep in mind that I am not an expert in C++, I am mostly doing this to further my knowledge, and haven't worked on a project this large before.
Directory Path: ..\DBServer\DBServer\Database\common\GlobalDef.h
The project was looking fine (minus the errors and warnings) up until I came across GlobalDef.h. Can anyone tell me what exactly is going on with all of the defines at the beginning of this file? It doesn't correspond to DataBase.h which is the only one calling on it.
GlobalDef.h
Code:
#ifndef GLOBAL_DEF_HEAD_FILE
#define GLOBAL_DEF_HEAD_FILE
#pragma once
/////////////////////////////////////////////////////////////////////////////////////////
//³£Á¿¶¨Òå
/////////////////////////////////////////////////////////////////////////////////////////
//ÓÎÏ·±êʶ//ͨÓÃÓÎÏ·
#define ID_PLAZA 0 //´óÌü#define ID_SHOWHAND 1 //Ëó¹þ
#define ID_CHINA_CHESS 2 //ÏóÆå
#define ID_WEIQI 3 //ΧÆå
#define ID_HZMJ 4 // º¼ÖÝÂ齫
#define ID_CHESS 5 //¹ú¼ÊÏóÆå
#define ID_LAND 6 //¶·µØÖ÷
#define ID_SPARROW 7 //Â齫
#define ID_RUN_FAST 8 //Åܵÿì
#define ID_HOE 9 //³ú´óµØ//²âÊÔÓÎÏ·
#define ID_BACK_JACK 10 //ºÚ½Ü¿Ë
#define ID_UPGRADE 11 //ÍÏÀ»ú
#define ID_FOURENSIGN 12 //ËĹú¾üÆå
#define ID_THREELEAF 13 //Õ©½ð»¨
#define ID_UNCOVERPIG 14 //¹°Öí
#define ID_PAOPAI 15 //ÅÜÅÆ#define ID_FiveChess 16 // Îå×ÓÆå
#define ID_BWChess 17 // ºÚ°×Æå
#define ID_CrazyLand 18 // ·è¿ñ¶·µØÖ÷
#define ID_3V1Card 19 // Èý´òÒ»
#define ID_510KCard 20 // 510K
#define ID_SKCard 21 // Ë«¿Û
#define ID_XZMJ 22 // ÐÃÖÝÂ齫
#define ID_SCMJ 23 // ËÄ´¨Â齫
#define ID_2RenMJ 24 // 2ÈËÂ齫
#define ID_HBMJ 25 // ºþ±±Â齫
#define ID_DQMJ 26 // ´óÇìÂ齫
#define ID_SHMJ 27 // ÉϺ£Â齫
#define ID_TWMJ 28 // ̨ÍåÂ齫
#define ID_CSMJ 29 // ³¤É³Â齫
#define ID_LLK 30 // Á¬Á¬¿´
#define ID_DDP 31 // ¶Ô¶ÔÅö
#define ID_ELS 32 // ·è¿ñ¶íÂÞ˹
#define ID_MaZu 33 // Âê×æ
#define ID_WaJin 34 // ÍÚ½ð×Ó
#define ID_PaoPao 35 // ÅÝÅÝÁú
#define ID_Horse 36 // ÈüÂí
#define ID_Down100 37 // µØÓüÒ»°Ù²ã
#define ID_GXDSCard 38 // ¹ãÎ÷¶Àʳ
#define ID_XZUupdate 39 // ÐÃÖÝÍÏÀ»ú XZUpdate.exe
#define ID_GAME_XN 40 // ÏÆÅ£ GS_TS_LiftOx.exe
#define ID_GAME_81 41 // ÊØ°ÑÒ» DEightOne.exe
#define ID_GAME_BRIDGE 42 // ÇÅÅÆ Bridge.exe
#define ID_GAME_7KING 43 // ÆßÍõ SevenThree.exe
#define ID_GAME_NINE 44 // ÃðÊ® CNine.exe
#define ID_GAME_CLOSE_CARD 45 // ¹ØÅÆ NT_Close.exe
#define ID_GAME_GJ 46 // ¹»¼¶ GJ.exe
#define ID_GAME_DD 47 // ¶Ôµ÷ CF_DD.exe
#define ID_GAME_GOLD_COW 48 // ¶·Å£ GoldCow.exe
#define ID_GAME_LAND_LZ 49 // Àµ×Ó¶·µØÖ÷ land_laiziOne.exe
#define ID_GAME_240 50 // 240·Ö TwoForty.exe
#define ID_GAME_BH 51 // ±£»Ê BH.exe
#define ID_GAME_SDMJ 52 // ɽ¶«Â齫 SD_Mj.exe
#define ID_GAME_QZ_MJ 53 // ȪÖÝÂ齫
#define ID_GAME_BIG_2 54 // ´óÀ϶þ
#define ID_GAME_QZ_80 55 // ȪÖÝ80·Ö
#define ID_GAME_QZ_CDP 56 // ȪÖݳ´µØƤ
#define ID_GAME_QZ_YC 57 // ȪÖÝÓ²³Ô #define ID_GDMJ 95 //¹ã¶«Â齫
#define ID_TSWAKEN 96 //ÌìË®ÍÚ¿Ó
#define ID_TSMJ 97//ÌìË®Â齫
#define ID_WAKEN 98//ÍÚ¿Ó
#define ID_PKJ 99 //ÆË¿Ë»ú
#define ID_IQGame 101 //IQGame
/////////////////////////////////////////////////////////////////////////////////////////
//ºê¶¨Òå
#define MAX_CHAIR 8 //×î´óÓÎÏ·Õß
#define INVALID_TABLE ((WORD)(-1)) //ÎÞЧ×À×ÓºÅ
#define INVALID_CHAIR ((WORD)(-1)) //ÎÞЧÒÎ×ÓºÅ
#define MAIN_DLG_CLASSNAME TEXT("114PKGamePlaza") //´°¿Ú×¢²áÃû//¶Ë¿Ú¶¨Òå
#define PORT_LOGON_SERVER 9000 //µÇ½·þÎñÆ÷
#define PORT_CENTER_SERVER 9010 //ÖÐÐÄ·þÎñÆ÷//ÍøÂçÊý¾Ý¶¨Òå
#define SOCKET_VER 68 //Êý¾Ý°ü°æ±¾
#define SOCKET_PACKAGE 2046 //×î´óÍøÂç°ü
#define SOCKET_BUFFER (sizeof(CMD_Head)+SOCKET_PACKAGE+2*sizeof(DWORD))
///////////////////////////////////////////////////////////////////////////////////////////Êý¾Ý°ü½á¹¹ÐÅÏ¢
struct CMD_Info
{
WORD wDataSize; //Êý¾Ý´óС
BYTE cbCheckCode; //ЧÑé×Ö¶Î
BYTE cbMessageVer; //°æ±¾±êʶ
};
//Êý¾Ý°üÃüÁîÐÅÏ¢
struct CMD_Command
{
WORD wMainCmdID; //Ö÷ÃüÁîÂë
WORD wSubCmdID; //×ÓÃüÁîÂë
};
//Êý¾Ý°ü´«µÝ°üÍ·
struct CMD_Head
{
CMD_Info CmdInfo; //»ù´¡½á¹¹
CMD_Command CommandInfo; //ÃüÁîÐÅÏ¢
};
//ÍøÂçÊý¾Ý°ü»º³å
struct CMD_Buffer
{
CMD_Head Head; //Êý¾Ý°üÍ·
BYTE cbBuffer[SOCKET_PACKAGE]; //Êý¾Ý»º³å
};
//ÄÚºËÃüÁîÂë
#define MDM_KN_COMMAND 0 //ÄÚºËÃüÁî
#define SUB_KN_DETECT_SOCKET 1 //¼ì²âÃüÁî//¼ì²â½á¹¹ÐÅÏ¢
struct CMD_KN_DetectSocket
{
DWORD dwSendTickCount; //·¢ËÍʱ¼ä
DWORD dwRecvTickCount; //½ÓÊÕʱ¼ä
};
///////////////////////////////////////////////////////////////////////////////////////////IPC Êý¾Ý¶¨Òå
#define IPC_VER 0x0001 //IPC °æ±¾
#define IPC_IDENTIFIER 0x0001 //±êʶºÅÂë
#define IPC_PACKAGE 4096 //×î´ó IPC °ü
#define IPC_BUFFER (sizeof(IPC_Head)+IPC_PACKAGE) //»º³å³¤¶È//IPC Êý¾Ý°üÍ·
struct IPC_Head
{
WORD wVersion; //IPC °æ±¾
WORD wDataSize; //Êý¾Ý´óС
WORD wMainCmdID; //Ö÷ÃüÁîÂë
WORD wSubCmdID; //×ÓÃüÁîÂë
};//IPC »º³å½á¹¹
struct IPC_Buffer
{
IPC_Head Head; //Êý¾Ý°üÍ·
BYTE cbBuffer[IPC_PACKAGE]; //Êý¾Ý»º³å
};
////////////////////////////////////////////////////////////////////////////³¤¶Èºê¶¨Òå
#define TYPE_LEN 32 //ÖÖÀ೤¶È
#define KIND_LEN 32 //ÀàÐͳ¤¶È
#define STATION_LEN 32 //Õ¾µã³¤¶È
#define SERVER_LEN 32 //·¿¼ä³¤¶È
#define MODULE_LEN 32 //½ø³Ì³¤¶È//ÓÎÏ·ÀàÐÍ
#define GAME_GENRE_SCORE 0x0001 //µãÖµÀàÐÍ
#define GAME_GENRE_GOLD 0x0002 //½ð±ÒÀàÐÍ
#define GAME_GENRE_MATCH 0x0004 //±ÈÈüÀàÐÍ
#define GAME_GENRE_EDUCATE 0x0008 //ѵÁ·ÀàÐÍ//ÓÎÏ·ÀàÐͽṹ
struct tagGameType
{
WORD wSortID; //ÅÅÐòºÅÂë
WORD wTypeID; //ÖÖÀàºÅÂë
TCHAR szTypeName[TYPE_LEN]; //ÖÖÀàÃû×Ö
};//ÓÎÏ·Ãû³Æ½á¹¹
struct tagGameKind
{
WORD wSortID; //ÅÅÐòºÅÂë
WORD wTypeID; //ÀàÐͺÅÂë
WORD wKindID; //Ãû³ÆºÅÂë
DWORD dwMaxVersion; //×îа汾
DWORD dwOnLineCount; //ÔÚÏßÊýÄ¿
TCHAR szKindName[KIND_LEN]; //ÓÎÏ·Ãû×Ö
TCHAR szProcessName[MODULE_LEN]; //½ø³ÌÃû×Ö
};//ÓÎÏ·½ø³Ì½á¹¹
struct tagGameProcess
{
WORD wSortID; //ÅÅÐòºÅÂë
WORD wTypeID; //ÀàÐͺÅÂë
WORD wKindID; //Ãû³ÆºÅÂë
WORD wServerPort; //·¿¼ä¶Ë¿Ú
DWORD dwServerAddr; //·¿¼äµØÖ·
DWORD dwMaxVersion; //×îа汾
DWORD dwOnLineCount; //ÔÚÏßÊýÄ¿
TCHAR szKindName[KIND_LEN]; //ÓÎÏ·Ãû×Ö
TCHAR szProcessName[MODULE_LEN]; //½ø³ÌÃû×Ö
};//ÓÎÏ·Õ¾µã½á¹¹
struct tagGameStation
{
WORD wSortID; //ÅÅÐòºÅÂë
WORD wKindID; //Ãû³ÆºÅÂë
WORD wJoinID; //¹Ò½ÓºÅÂë
WORD wStationID; //Õ¾µãºÅÂë
TCHAR szStationName[STATION_LEN]; //Õ¾µãÃû³Æ
};//ÓÎÏ··¿¼äÁбí½á¹¹
struct tagGameServer
{
WORD wSortID; //ÅÅÐòºÅÂë
WORD wKindID; //Ãû³ÆºÅÂë
WORD wServerID; //·¿¼äºÅÂë
WORD wStationID; //Õ¾µãºÅÂë
WORD wServerPort; //·¿¼ä¶Ë¿Ú
DWORD dwServerAddr; //·¿¼äµØÖ·
DWORD dwOnLineCount; //ÔÚÏßÈËÊý
TCHAR szServerName[SERVER_LEN]; //·¿¼äÃû³Æ
};
////////////////////////////////////////////////////////////////////////////Óû§×´Ì¬¶¨Òå
#define US_NULL 0x00 //ûÓÐ״̬
#define US_FREE 0x01 //Õ¾Á¢×´Ì¬
#define US_SIT 0x02 //×øÏÂ״̬
#define US_READY 0x03 //ͬÒâ״̬
#define US_LOOKON 0x04 //ÅÔ¹Û״̬
#define US_PLAY 0x05 //ÓÎϷ״̬
#define US_OFFLINE 0x06 //¶ÏÏß״̬//³¤¶Èºê¶¨Òå
#define NAME_LEN 32 //Ãû×Ö³¤¶È
#define PASS_LEN 33 //ÃÜÂ볤¶È
#define GROUP_LEN 32 //ÉçÍų¤¶È//Óû§»ý·ÖÐÅÏ¢
struct tagUserScore
{
LONG lGold; //Óû§½ð±Ò
LONG lScore; //Óû§·ÖÊý
LONG lWinCount; //ʤÀûÅÌÊý
LONG lLostCount; //ʧ°ÜÅÌÊý
LONG lDrawCount; //ºÍ¾ÖÅÌÊý
LONG lFleeCount; //?ÏÏßÊýÄ?
LONG lExperience; //ÓÃ????Ñé
};//ÓÃ????Ì?ÐÅÏ?
struct tagUserStatus
{
WORD wTableID; //?À?ÓºÅÂë
WORD wChairID; //ÒÎ?ÓÎ?ÖÃ
WORD wNetDelay; //ÍøÂçÑÓÊ?
BYTE cbUserStatus; //ÓÃ????Ì?
};//ÓÃ???ù??ÐÅÏ??á??
struct tagUserInfoHead
{
//ÓÃ??ÊôÐÔ
WORD wFaceID; //Í?ÏñË?Òý
BYTE cbGender; //ÓÃ??ÐÔ?ð 0 =woman, 1 =man
BYTE cbMember; //?áÔ?µÈ??
DWORD dwUserID; //ÓÃ?? I D
DWORD dwGroupID; //ÉçÍÅË?Òý
DWORD dwUserRight; //ÓÃ??µÈ??
DWORD dwMasterRight; //?ÜÀíÈ?ÏÞ //ÓÃ????Ì?
WORD wTableID; //?À?ÓºÅÂë
WORD wChairID; //ÒÎ?ÓÎ?ÖÃ
WORD wNetDelay; //ÍøÂçÑÓÊ?
BYTE cbUserStatus; //ÓÃ????Ì? //ÓÃ???ý?Ö
tagUserScore UserScoreInfo; //?ý?ÖÐÅÏ?
};//ÓÃ??ÐÅÏ??á??
struct tagUserData
{
//ÓÃ??ÊôÐÔ
WORD wFaceID; //Í?ÏñË?Òý
BYTE cbGender; //ÓÃ??ÐÔ?ð 0 =woman, 1 =man
BYTE cbMember; //?áÔ?µÈ??
DWORD dwUserID; //ÓÃ?? I D
DWORD dwGroupID; //ÉçÍÅË?Òý
DWORD dwUserRight; //ÓÃ??µÈ??
DWORD dwMasterRight; //?ÜÀíÈ?ÏÞ
TCHAR szName[NAME_LEN]; //ÓÃ??Ãû?Ö
TCHAR szGroupName[GROUP_LEN]; //ÉçÍÅÃû?Ö //ÓÃ???ý?Ö
LONG lGold; //ÓÃ???ð?Ò
LONG lScore; //ÓÃ???ÖÊý
LONG lWinCount; //Ê?ÀûÅÌÊý
LONG lLostCount; //Ê??ÜÅÌÊý
LONG lDrawCount; //ºÍ?ÖÅÌÊý
LONG lFleeCount; //?ÏÏßÊýÄ?
LONG lExperience; //ÓÃ????Ñé //ÓÃ????Ì?
WORD wTableID; //?À?ÓºÅÂë
WORD wChairID; //ÒÎ?ÓÎ?ÖÃ
WORD wNetDelay; //ÍøÂçÑÓÊ?
BYTE cbUserStatus; //ÓÃ????Ì? //ÆäËûÐÅÏ?
BYTE cbCompanion; //ÓÃ???Øϵ
};////////////////////////////////////////////////////////////////////////////?úÆ?ÐòÁкÅ?á??
struct tagClientSerial
{
DWORD dwComputerID[3]; //?úÆ?ÐòÁÐ
};//ÅäÖÃ?º?å?á??
struct tagOptionBuffer
{
BYTE cbBufferLen; //Êý?Ý???È
BYTE cbOptionBuf[32]; //ÉèÖÃ?º?å
};/////////////////////////////////////////////////////////////////////////////////////////
/*
#define MAX_SCENE_NUM 10//?î?ó????Êý
#define ONE_SCENE_MAX_TEXT_NUM 15//Ã??ö????TEXT?î?óÊý//ÉùÒôÎÄ?Ö
typedef struct _SOUND_TEXT_ITEM
{
char showInfo[50];
char playSound[50];
}
SOUND_TEXT_ITEM;//????
typedef struct _SCENE_ITEM
{
int useTextInt;//ÒÑ??Ê?ÓõÄ?öÊý
char TypeName[50];
SOUND_TEXT_ITEM TextList[ONE_SCENE_MAX_TEXT_NUM];
}
SCENE_ITEM;
*/#endif
Thank you.