init
This commit is contained in:
285
Servers/游戏组件/上饶打炸/消息定义/CMD_Game.h
Normal file
285
Servers/游戏组件/上饶打炸/消息定义/CMD_Game.h
Normal file
@@ -0,0 +1,285 @@
|
||||
#ifndef CMD_GAME_HEAD_FILE
|
||||
#define CMD_GAME_HEAD_FILE
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//服务定义
|
||||
|
||||
//游戏属性
|
||||
#define KIND_ID 430 //游戏 I D
|
||||
#define GAME_NAME TEXT("上饶打炸") //游戏名字
|
||||
|
||||
//组件属性
|
||||
#define GAME_PLAYER 4 //游戏人数
|
||||
#define VERSION_SERVER PROCESS_VERSION(6,0,3) //程序版本
|
||||
#define VERSION_CLIENT PROCESS_VERSION(6,0,3) //程序版本
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//数目定义
|
||||
|
||||
#define MAX_COUNT 27 //最大数目
|
||||
#define FULL_COUNT 108 //全牌数目
|
||||
|
||||
#define MAX_NO_JOKER_COUNT 26 //最大数目
|
||||
#define NO_JOKER_COUNT 104 //全牌数目
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//数值掩码
|
||||
#define MASK_COLOR 0xF0 //花色掩码
|
||||
#define MASK_VALUE 0x0F //数值掩码
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//游戏结束类型;
|
||||
enum GAME_END_TYPE
|
||||
{
|
||||
GAME_END_NULL, //NULL;
|
||||
GAME_END_ONE_WIN, //单扣;
|
||||
GAME_END_TWO_WIN, //双扣;
|
||||
GAME_END_DRAW, //平扣;
|
||||
GAME_END_NO_BOMB, //平扣;
|
||||
GAME_END_8_BOMB, //平扣;
|
||||
};
|
||||
|
||||
//状态定义
|
||||
|
||||
//游戏状态
|
||||
#define GAME_SCENE_FREE GAME_STATUS_FREE //等待开始;
|
||||
#define GAME_SCENE_SEND GAME_STATUS_PLAY //发牌状态;
|
||||
#define GAME_SCENE_CALL_SCORE (GAME_STATUS_PLAY+1) //叫分状态;
|
||||
#define GAME_SCENE_CALL_CARD (GAME_STATUS_PLAY+2) //叫牌状态;
|
||||
#define GAME_SCENE_PLAY (GAME_STATUS_PLAY+3) //游戏进行;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//命令定义
|
||||
|
||||
#define SUB_S_GAME_START 100 //游戏函数
|
||||
#define SUB_S_OUT_CARD 101 //用户出牌
|
||||
#define SUB_S_PASS_CARD 102 //用户放弃
|
||||
#define SUB_S_GAME_END 103 //游戏结束
|
||||
#define SUB_S_TRUSTEE 104 //用户托管
|
||||
#define SUB_S_CALL_SCORE 105 //用户叫分;
|
||||
#define SUB_S_BANKER_INFO 106 //庄家信息;
|
||||
#define SUB_S_RANKING 107 //排名;
|
||||
|
||||
//空闲状态
|
||||
struct CMD_S_StatusFree
|
||||
{
|
||||
SCORE lCellScore; //单元积分
|
||||
WORD wBankerUser; //庄家用户
|
||||
};
|
||||
|
||||
//发牌状态;
|
||||
struct CMD_S_StatusSendCard
|
||||
{
|
||||
//游戏信息;
|
||||
LONG lCellScore; //单元积分;
|
||||
WORD wCurrentUser; //当前玩家;
|
||||
|
||||
BYTE cbHandCardCount[GAME_PLAYER]; //扑克数目;
|
||||
BYTE cbHandCardData[MAX_COUNT]; //手上扑克;
|
||||
bool bUserTrustee[GAME_PLAYER]; //托管标志;
|
||||
};
|
||||
|
||||
//叫分状态;
|
||||
struct CMD_S_StatusCallScore
|
||||
{
|
||||
//游戏信息;
|
||||
LONG lCellScore; //单元积分;
|
||||
WORD wCurrentUser; //当前玩家;
|
||||
|
||||
BYTE cbScoreInfo[GAME_PLAYER]; //叫分信息;
|
||||
BYTE cbHandCardCount[GAME_PLAYER]; //扑克数目;
|
||||
BYTE cbHandCardData[MAX_COUNT]; //手上扑克;
|
||||
bool bUserTrustee[GAME_PLAYER]; //托管标志;
|
||||
};
|
||||
|
||||
//游戏状态
|
||||
struct CMD_S_StatusPlay
|
||||
{
|
||||
//游戏变量
|
||||
SCORE lCellScore; //单元积分
|
||||
WORD wCurrentUser; //当前玩家
|
||||
WORD wFriendChairID; //伙伴;
|
||||
|
||||
//庄家用户
|
||||
WORD wBankerUser; //庄家用户
|
||||
bool bCallCard; //是否叫牌;
|
||||
|
||||
//胜利信息
|
||||
WORD wWinCount; //胜利人数
|
||||
WORD wWinOrder[GAME_PLAYER]; //胜利列表
|
||||
bool bTrustee[GAME_PLAYER]; //是否托管
|
||||
|
||||
//出牌信息
|
||||
WORD wTurnWiner; //胜利玩家
|
||||
bool isLastCard; //最后一手牌;
|
||||
int cbTurnCardType; //出牌类型
|
||||
BYTE cbTurnCardCount; //出牌数目
|
||||
BYTE cbTurnCardData[MAX_COUNT]; //出牌数据
|
||||
//BYTE cbMagicCardData[MAX_COUNT]; //变幻扑克
|
||||
|
||||
//扑克信息
|
||||
BYTE cbHandCardData[MAX_COUNT]; //手上扑克
|
||||
BYTE cbHandCardCount[GAME_PLAYER]; //扑克数目
|
||||
BYTE cbPartnerCardData[MAX_COUNT]; //合作者扑克
|
||||
};
|
||||
|
||||
//发送扑克
|
||||
struct CMD_S_GameStart
|
||||
{
|
||||
WORD wCurrentUser; //当前玩家
|
||||
SCORE lCellScore; //单元积分
|
||||
bool bHasJoker; //是否有王
|
||||
BYTE cbCardCount[GAME_PLAYER]; //扑克牌数量;
|
||||
BYTE cbCardData[MAX_COUNT]; //扑克列表
|
||||
bool bTrustee[GAME_PLAYER]; //是否托管
|
||||
};
|
||||
|
||||
//录像开始;
|
||||
struct CMD_Record_GameStart
|
||||
{
|
||||
WORD wStartUser; //开始玩家;
|
||||
WORD wCurrentUser; //当前玩家;
|
||||
};
|
||||
|
||||
//用户叫分;
|
||||
struct CMD_S_CallScore
|
||||
{
|
||||
WORD wCurrentUser; //当前玩家;
|
||||
WORD wCallScoreUser; //叫分玩家;
|
||||
BYTE cbCallScore; //叫分;
|
||||
};
|
||||
|
||||
//庄家信息;
|
||||
struct CMD_S_BankerInfo
|
||||
{
|
||||
WORD wBankerUser; //庄家玩家;
|
||||
WORD wCurrentUser; //当前玩家;
|
||||
bool bCallCard; //是否叫牌;
|
||||
WORD wFriendChairID[GAME_PLAYER]; //伙伴玩家;
|
||||
BYTE cbFirendCardData; //定伙伴牌;
|
||||
};
|
||||
|
||||
//用户出牌
|
||||
struct CMD_S_OutCard
|
||||
{
|
||||
bool isLastCard; //最后一手牌;
|
||||
int cbCardType; //出牌类型
|
||||
BYTE cbCardCount; //出牌数目
|
||||
WORD wCurrentUser; //当前玩家
|
||||
WORD wOutCardUser; //出牌玩家
|
||||
BYTE cbCardData[MAX_COUNT]; //扑克列表
|
||||
};
|
||||
|
||||
//放弃出牌
|
||||
struct CMD_S_PassCard
|
||||
{
|
||||
BYTE cbTurnOver; //一轮结束
|
||||
WORD wCurrentUser; //当前玩家
|
||||
WORD wPassCardUser; //放弃玩家
|
||||
};
|
||||
|
||||
//排名;
|
||||
struct CMD_S_Ranking
|
||||
{
|
||||
WORD wChairID; //坐位号;
|
||||
BYTE cbRanking; //排名;
|
||||
};
|
||||
|
||||
//游戏结束
|
||||
struct CMD_S_GameEnd
|
||||
{
|
||||
bool isPrivateEnd; //私人场结束;
|
||||
GAME_END_TYPE iGameEndType; //结束类型;
|
||||
WORD wFriendChairID[GAME_PLAYER]; //伙伴玩家;
|
||||
|
||||
//游戏成绩
|
||||
SCORE lGameScore[GAME_PLAYER]; //游戏积分
|
||||
SCORE lBombScore[GAME_PLAYER]; //游戏积分
|
||||
SCORE lAllScore[GAME_PLAYER]; //游戏积分
|
||||
|
||||
//扑克信息
|
||||
BYTE cbCardCount[GAME_PLAYER]; //扑克数目
|
||||
BYTE cbCardData[GAME_PLAYER][MAX_COUNT]; //扑克列表
|
||||
|
||||
//排名信息
|
||||
WORD wWinOrder[GAME_PLAYER];
|
||||
};
|
||||
|
||||
//用户托管
|
||||
struct CMD_S_Trustee
|
||||
{
|
||||
bool bTrustee; //是否托管
|
||||
WORD wChairID; //托管用户
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//命令定义
|
||||
#define SUB_C_OUT_CARD 1 //用户出牌
|
||||
#define SUB_C_PASS_CARD 2 //用户放弃
|
||||
#define SUB_C_TRUSTEE 3 //用户托管
|
||||
#define SUB_C_CALL_SCORE 4 //用户叫分;
|
||||
|
||||
//用户叫分;
|
||||
struct CMD_C_CallScore
|
||||
{
|
||||
BYTE cbCallScore; //叫分数目;
|
||||
};
|
||||
|
||||
//用户出牌
|
||||
struct CMD_C_OutCard
|
||||
{
|
||||
bool isLastCard; //是不是最后一手牌;
|
||||
int cbCardType; //牌类型
|
||||
BYTE cbCardCount; //出牌数目
|
||||
BYTE cbCardData[MAX_COUNT]; //扑克数据
|
||||
};
|
||||
|
||||
//用户托管
|
||||
struct CMD_C_Trustee
|
||||
{
|
||||
bool bTrustee; //是否托管
|
||||
};
|
||||
|
||||
enum eDZRuleEnum
|
||||
{
|
||||
eDZRuleEnum_CardAA = 1 << 0, //AA;
|
||||
eDZRuleEnum_NO_JOKER = 1 << 1, //不带王;
|
||||
eDZRuleEnum_MINGBIAN = 1 << 2, //明边;
|
||||
eDZRuleEnum_TO_TWO = 1 << 3, //只打二游;
|
||||
eDZRuleEnum_NO_BOMB = 1 << 4, //无炸摊牌;
|
||||
eDZRuleEnum_LOTTERY_7 = 1 << 5, //开奖7;
|
||||
eDZRuleEnum_LOTTERY_10 = 1 << 6, //开奖10;
|
||||
eDZRuleEnum_LOTTERY_J = 1 << 7, //开奖J;
|
||||
eDZRuleEnum_LOTTERY_K = 1 << 8, //开奖K;
|
||||
eDZRuleEnum_EIGHT_BOMB = 1 << 9, //八炸摊牌;
|
||||
};
|
||||
|
||||
// 游戏解散结构
|
||||
struct CMD_S_Private_End_Info
|
||||
{
|
||||
WORD wMainChairID; // 房主
|
||||
BYTE cbFinishCout; // 完成局数
|
||||
SCORE lAllScore[GAME_PLAYER]; // 总成绩
|
||||
SCORE lDetails[GAME_PLAYER][16]; // 成绩明细(目前开房最大16局)
|
||||
|
||||
void StreamValue(DataStream& kData, bool bSend)
|
||||
{
|
||||
if (bSend)
|
||||
{
|
||||
kData.pushValue(this, sizeof(CMD_S_Private_End_Info));
|
||||
}
|
||||
else
|
||||
{
|
||||
kData.popValue(this, sizeof(CMD_S_Private_End_Info));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user