诸暨麻将添加redis
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

172 linhas
8.5 KiB

  1. #ifndef SERVER_RULE_HEAD_FILE
  2. #define SERVER_RULE_HEAD_FILE
  3. //////////////////////////////////////////////////////////////////////////////////
  4. //聊天规则
  5. #define SR_FORFEND_GAME_CHAT 0x00000001 //禁止公聊
  6. #define SR_FORFEND_ROOM_CHAT 0x00000002 //禁止公聊
  7. #define SR_FORFEND_WISPER_CHAT 0x00000004 //禁止私聊
  8. #define SR_FORFEND_WISPER_ON_GAME 0x00000008 //禁止私聊
  9. //高级规则
  10. #define SR_ALLOW_DYNAMIC_JOIN 0x00000010 //动态加入
  11. #define SR_ALLOW_OFFLINE_TRUSTEE 0x00000020 //断线代打
  12. #define SR_ALLOW_AVERT_CHEAT_MODE 0x00000040 //隐藏信息
  13. //游戏规则
  14. #define SR_RECORD_GAME_SCORE 0x00000100 //记录积分
  15. #define SR_RECORD_GAME_TRACK 0x00000200 //记录过程
  16. #define SR_DYNAMIC_CELL_SCORE 0x00000400 //动态底分
  17. #define SR_IMMEDIATE_WRITE_SCORE 0x00000800 //即时写分
  18. //房间规则
  19. #define SR_FORFEND_ROOM_ENTER 0x00001000 //禁止进入
  20. #define SR_FORFEND_GAME_ENTER 0x00002000 //禁止进入
  21. #define SR_FORFEND_GAME_LOOKON 0x00004000 //禁止旁观
  22. //银行规则
  23. #define SR_FORFEND_TAKE_IN_ROOM 0x00010000 //禁止取款
  24. #define SR_FORFEND_TAKE_IN_GAME 0x00020000 //禁止取款
  25. #define SR_FORFEND_SAVE_IN_ROOM 0x00040000 //禁止存钱
  26. #define SR_FORFEND_SAVE_IN_GAME 0x00080000 //禁止存款
  27. //其他规则
  28. #define SR_FORFEND_GAME_RULE 0x00100000 //禁止配置
  29. #define SR_FORFEND_LOCK_TABLE 0x00200000 //禁止锁桌
  30. #define SR_ALLOW_ANDROID_ATTEND 0x00400000 //允许陪玩
  31. #define SR_ALLOW_ANDROID_SIMULATE 0x00800000 //允许占位
  32. //////////////////////////////////////////////////////////////////////////////////
  33. //房间规则
  34. class CServerRule
  35. {
  36. //聊天规则
  37. public:
  38. //禁止公聊
  39. static bool IsForfendGameChat(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_GAME_CHAT)!=0; }
  40. //禁止公聊
  41. static bool IsForfendRoomChat(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_ROOM_CHAT)!=0; }
  42. //禁止私聊
  43. static bool IsForfendWisperChat(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_WISPER_CHAT)!=0; }
  44. //禁止私聊
  45. static bool IsForfendWisperOnGame(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_WISPER_ON_GAME)!=0; }
  46. //模式规则
  47. public:
  48. //动态加入
  49. static bool IsAllowDynamicJoin(DWORD dwServerRule) { return (dwServerRule&SR_ALLOW_DYNAMIC_JOIN)!=0; }
  50. //断线代打
  51. static bool IsAllowOffLineTrustee(DWORD dwServerRule) { return (dwServerRule&SR_ALLOW_OFFLINE_TRUSTEE)!=0; }
  52. //隐藏信息
  53. static bool IsAllowAvertCheatMode(DWORD dwServerRule) { return (dwServerRule&SR_ALLOW_AVERT_CHEAT_MODE)!=0; }
  54. //游戏规则
  55. public:
  56. //记录积分
  57. static bool IsRecordGameScore(DWORD dwServerRule) { return (dwServerRule&SR_RECORD_GAME_SCORE)!=0; }
  58. //记录过程
  59. static bool IsRecordGameTrack(DWORD dwServerRule) { return (dwServerRule&SR_RECORD_GAME_TRACK)!=0; }
  60. //动态底分
  61. static bool IsDynamicCellScore(DWORD dwServerRule) { return (dwServerRule&SR_DYNAMIC_CELL_SCORE)!=0; }
  62. //即时写分
  63. static bool IsImmediateWriteScore(DWORD dwServerRule) { return (dwServerRule&SR_IMMEDIATE_WRITE_SCORE)!=0; }
  64. //房间规则
  65. public:
  66. //禁止进入
  67. static bool IsForfendRoomEnter(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_ROOM_ENTER)!=0; }
  68. //禁止进入
  69. static bool IsForfendGameEnter(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_GAME_ENTER)!=0; }
  70. //禁止旁观
  71. static bool IsForfendGameLookon(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_GAME_LOOKON)!=0; }
  72. //银行规则
  73. public:
  74. //禁止取款
  75. static bool IsForfendTakeInRoom(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_TAKE_IN_ROOM)!=0; }
  76. //禁止取款
  77. static bool IsForfendTakeInGame(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_TAKE_IN_GAME)!=0; }
  78. //禁止存钱
  79. static bool IsForfendSaveInRoom(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_SAVE_IN_ROOM)!=0; }
  80. //禁止存钱
  81. static bool IsForfendSaveInGame(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_SAVE_IN_GAME)!=0; }
  82. //其他规则
  83. public:
  84. //禁止配置
  85. static bool IsForfendGameRule(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_GAME_RULE)!=0; }
  86. //禁止锁桌
  87. static bool IsForfendLockTable(DWORD dwServerRule) { return (dwServerRule&SR_FORFEND_LOCK_TABLE)!=0; }
  88. //允许陪玩
  89. static bool IsAllowAndroidAttend(DWORD dwServerRule) { return (dwServerRule&SR_ALLOW_ANDROID_ATTEND)!=0; }
  90. //允许占位
  91. static bool IsAllowAndroidSimulate(DWORD dwServerRule) { return (dwServerRule&SR_ALLOW_ANDROID_SIMULATE)!=0; }
  92. //聊天规则
  93. public:
  94. //禁止公聊
  95. static VOID SetForfendGameChat(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_GAME_CHAT:dwServerRule&=~SR_FORFEND_GAME_CHAT; }
  96. //禁止公聊
  97. static VOID SetForfendRoomChat(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_ROOM_CHAT:dwServerRule&=~SR_FORFEND_ROOM_CHAT; }
  98. //禁止私聊
  99. static VOID SetForfendWisperChat(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_WISPER_CHAT:dwServerRule&=~SR_FORFEND_WISPER_CHAT; }
  100. //禁止私聊
  101. static VOID SetForfendWisperOnGame(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_WISPER_ON_GAME:dwServerRule&=~SR_FORFEND_WISPER_ON_GAME; }
  102. //模式规则
  103. public:
  104. //动态加入
  105. static VOID SetAllowDynamicJoin(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_ALLOW_DYNAMIC_JOIN:dwServerRule&=~SR_ALLOW_DYNAMIC_JOIN; }
  106. //断线代打
  107. static VOID SetAllowOffLineTrustee(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_ALLOW_OFFLINE_TRUSTEE:dwServerRule&=~SR_ALLOW_OFFLINE_TRUSTEE; }
  108. //隐藏信息
  109. static VOID SetAllowAvertCheatMode(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_ALLOW_AVERT_CHEAT_MODE:dwServerRule&=~SR_ALLOW_AVERT_CHEAT_MODE; }
  110. //游戏规则
  111. public:
  112. //记录积分
  113. static VOID SetRecordGameScore(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_RECORD_GAME_SCORE:dwServerRule&=~SR_RECORD_GAME_SCORE; }
  114. //记录过程
  115. static VOID SetRecordGameTrack(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_RECORD_GAME_TRACK:dwServerRule&=~SR_RECORD_GAME_TRACK; }
  116. //动态底分
  117. static VOID SetDynamicCellScore(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_DYNAMIC_CELL_SCORE:dwServerRule&=~SR_DYNAMIC_CELL_SCORE; }
  118. //即时写分
  119. static VOID SetImmediateWriteScore(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_IMMEDIATE_WRITE_SCORE:dwServerRule&=~SR_IMMEDIATE_WRITE_SCORE; }
  120. //房间规则
  121. public:
  122. //禁止进入
  123. static VOID SetForfendRoomEnter(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_ROOM_ENTER:dwServerRule&=~SR_FORFEND_ROOM_ENTER; }
  124. //禁止进入
  125. static VOID SetForfendGameEnter(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_GAME_ENTER:dwServerRule&=~SR_FORFEND_GAME_ENTER; }
  126. //禁止旁观
  127. static VOID SetForfendGameLookon(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_GAME_LOOKON:dwServerRule&=~SR_FORFEND_GAME_LOOKON; }
  128. //银行规则
  129. public:
  130. //禁止取款
  131. static VOID SetForfendTakeInRoom(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_TAKE_IN_ROOM:dwServerRule&=~SR_FORFEND_TAKE_IN_ROOM; }
  132. //禁止取款
  133. static VOID SetForfendTakeInGame(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_TAKE_IN_GAME:dwServerRule&=~SR_FORFEND_TAKE_IN_GAME; }
  134. //禁止存钱
  135. static VOID SetForfendSaveInRoom(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_SAVE_IN_ROOM:dwServerRule&=~SR_FORFEND_SAVE_IN_ROOM; }
  136. //禁止存钱
  137. static VOID SetForfendSaveInGame(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_SAVE_IN_GAME:dwServerRule&=~SR_FORFEND_SAVE_IN_GAME; }
  138. //其他规则
  139. public:
  140. //禁止配置
  141. static VOID SetForfendGameRule(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_GAME_RULE:dwServerRule&=~SR_FORFEND_GAME_RULE; }
  142. //禁止锁桌
  143. static VOID SetForfendLockTable(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_FORFEND_LOCK_TABLE:dwServerRule&=~SR_FORFEND_LOCK_TABLE; }
  144. //允许陪玩
  145. static VOID SetAllowAndroidAttend(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_ALLOW_ANDROID_ATTEND:dwServerRule&=~SR_ALLOW_ANDROID_ATTEND; }
  146. //允许占位
  147. static VOID SetAllowAndroidSimulate(DWORD & dwServerRule, bool bEnable) { (bEnable==true)?dwServerRule|=SR_ALLOW_ANDROID_SIMULATE:dwServerRule&=~SR_ALLOW_ANDROID_SIMULATE; }
  148. };
  149. //////////////////////////////////////////////////////////////////////////////////
  150. #endif