MemKey_GameRun.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <?php
  2. namespace loyalsoft;
  3. /**
  4. * 运行时游戏全局数据
  5. * @version
  6. * 1.0.0 Created at 2017-4-6. by --gwang
  7. * @author gwang (mail@wanggangzero.cn)
  8. * @copyright ? 2017-4-6, SJZ LoyalSoft Corporation & gwang. All rights reserved.
  9. */
  10. class MemKey_GameRun {
  11. /**
  12. * 主线关卡榜
  13. * @param int $zoneid
  14. * @return string
  15. */
  16. public static function Rank_MainGateIndex_Zone_zset($zoneid) {
  17. return "Rank_MainGateIndex_Zone$zoneid";
  18. }
  19. /**
  20. * 关卡战力榜
  21. * @param int $zoneid
  22. * @return string
  23. */
  24. public static function Rank_FightPower_Zone_zset($zoneid) {
  25. return "Rank_FightPower_Zone$zoneid";
  26. }
  27. /**
  28. * 主线关卡 的荣誉榜
  29. * @param int $zoneid
  30. * @return string
  31. */
  32. public static function RankReward_MainGateIndex_Zone_hash($zoneid) {
  33. return "RankReward_MainGateIndex_Zone$zoneid";
  34. }
  35. /**
  36. * 关卡战力 荣誉榜
  37. * @param int $zoneid
  38. * @return string
  39. */
  40. public static function RankReward_FightPower_Zone_hash($zoneid) {
  41. return "RankReward_FightPower_Zone$zoneid";
  42. }
  43. //
  44. // <editor-fold defaultstate="collapsed" desc="英雄">
  45. /**
  46. * 运行时数据 - 英雄评价内容
  47. * @param type $heroId
  48. * @return string
  49. */
  50. public static function HeroDiscusses_item_hash($heroId) {
  51. return "gamerun-herodiscuss-$heroId-item";
  52. }
  53. /**
  54. * 运行时数据 - 英雄评价内容的评分
  55. * @param int $heroId
  56. * @return string
  57. */
  58. public static function HeroDiscusses_score_zset($heroId) {
  59. return "gamerun-herodiscuss-$heroId-score";
  60. }
  61. /**
  62. * 运行时数据 - 英雄评价 - 玩家给英雄打分
  63. * @param int $heroId
  64. * @return string
  65. */
  66. public static function HeroDiscusses_userScore_normal($heroId) {
  67. return "gamerun-herodiscuss-$heroId-userscore";
  68. }
  69. // </editor-fold>
  70. /**
  71. * 运行时数据 - 订单编号 - 当前秒内的订单序号
  72. * @return type
  73. */
  74. public static function Game_OrderID_normal_int() {
  75. return "gamerun-orderId-" . now();
  76. }
  77. /**
  78. * 运行时数据 - 玩家记录集
  79. * @param int $zoneid 分区id
  80. * @param int $day tsDay
  81. * @return string
  82. */
  83. public static function Game_UserRecordByZone($zoneid, $day) {
  84. return "gamerun-dailyUserRecord-$day-zone$zoneid";
  85. }
  86. /**
  87. * 运行时数据 - 系统消息
  88. * @param int $zoneid
  89. * @return string
  90. */
  91. public static function Game_SysMsgByZone_zset($zoneid) {
  92. return "gamerun-sysmsg-zone$zoneid";
  93. }
  94. // <editor-fold defaultstate="collapsed" desc="世界Boss">
  95. //
  96. /**
  97. * 世界boss排行榜
  98. * @param type $zoneid
  99. * @return type
  100. */
  101. public static function Game_WorldBossRank($zoneid) {
  102. $dateHour = date('YmdH');
  103. return "gamerun-BossFight-byDateHour-zone$zoneid-$dateHour";
  104. }
  105. /**
  106. * 世界boss排行榜(指定bossID)
  107. * @param type $zoneid
  108. * @return type
  109. */
  110. public static function Game_WorldBoss_X_Rank($zoneid, $bossid) {
  111. $dateHour = date('YmdH');
  112. return "gamerun-BossFight-byDateHour-zone$zoneid-boss$bossid-$dateHour";
  113. }
  114. //
  115. // </editor-fold>
  116. // <editor-fold defaultstate="collapsed" desc=" 竞技场 ">
  117. /**
  118. * 运行时数据 - 竞技场 实时积分榜(总榜)
  119. * @param int $zoneid 分区id
  120. * @param int $season 赛季
  121. * @return string
  122. */
  123. public static function Game_PVPScoreByZoneSeason_zset($zoneid, $season) {
  124. return "gamerun-pvpScore-zone$zoneid-season$season";
  125. }
  126. /**
  127. * 运行时数据 - 竞技场 积分榜(某天)
  128. * 业务逻辑: 查询下昨天的榜, 根据榜单发放奖励
  129. * @param int $zoneid
  130. * @param int $day 天
  131. * @return string
  132. */
  133. public static function Game_PVPScoreByZone_zset_Day($zoneid, $day) {
  134. return "gamerun-pvpScore-zone$zoneid-day$day";
  135. }
  136. /**
  137. * 运行时数据 - 战斗力总榜
  138. * @param type $zoneid
  139. */
  140. public static function Game_FightPowerRank_zset($zoneid) {
  141. return "gamerun-rank-fpower-zone$zoneid";
  142. }
  143. /**
  144. * 运行时数据 - 战力突破记录
  145. * @param int $zoneid
  146. * @return type
  147. */
  148. public static function Game_Rank_FPowerBreakLog_hash($zoneid) {
  149. return "gamerun-rank-fpower-breaklog-zone$zoneid";
  150. }
  151. /**
  152. * 运行时数据 - 通关榜
  153. * @param type $zoneid
  154. * @return type
  155. */
  156. public static function Game_Rank_passgate_zset($zoneid) {
  157. return "gamerun-rank-passgate-zone$zoneid";
  158. }
  159. /**
  160. * 运行时数据 - 通关人数统计(达到100W人以后溢出)
  161. * {
  162. * 33=>99, (每一关从0增加到100W,统计100W个人以后溢出)
  163. * 32=>87,
  164. * }
  165. * @param type $zoneid
  166. * @return type
  167. */
  168. public static function Game_Rank_passgate_count_hash($zoneid) {
  169. return "gamerun-rank-passgate-count-zone$zoneid";
  170. }
  171. /**
  172. * 运行时数据 - 通关帮突破记录
  173. * @param type $zoneid
  174. * @return type
  175. */
  176. public static function Game_Rank_passage_BreachLog_hash($zoneid) {
  177. return "gamerun-rank-passgate-breaklog-zone$zoneid";
  178. }
  179. public static function Game_PaiMingFPowerRewardDeal_hash($zoneid) {
  180. return "gamerun-PaiMingFPowerRewardDeal_-zone$zoneid";
  181. }
  182. public static function Game_PaiMingFPowerRewardDealStart_hash($zoneid) {
  183. return "gamerun-PaiMingFPowerRewardDealStart_-zone$zoneid";
  184. }
  185. public static function Game_PaiMingLevelRewardDeal_hash($zoneid) {
  186. return "gamerun-PaiMingLevelRewardDeal_-zone$zoneid";
  187. }
  188. public static function Game_PaiMingLevelRewardDealStart_hash($zoneid) {
  189. return "gamerun-PaiMingLevelRewardDealStart_-zone$zoneid";
  190. }
  191. // </editor-fold>
  192. //
  193. /**
  194. * 运行时数据 - 每天的登录用户记录-byUId
  195. * @param type $zoneid
  196. * @param type $tsDay
  197. * @return type
  198. */
  199. static function DailyLoginUser_byUID_hash($zoneid, $tsDay = null) {
  200. if (!$tsDay) { # 检查是否默认参数
  201. $tsDay = totalDays();
  202. }
  203. return "gamerun-loginUser-byUid-zone$zoneid-day_$tsDay";
  204. }
  205. /**
  206. * 运行时数据 - 每天的登录用户记录-byLevel
  207. * @param type $zoneid
  208. * @param int $level 玩家等级
  209. * @param type $tsDay
  210. * @return type
  211. */
  212. static function DailyLoginUser_byLevel_hash($zoneid, $level, $tsDay = null) {
  213. if (!$tsDay) { # 检查是否默认参数
  214. $tsDay = totalDays();
  215. }
  216. return "gamerun-loginUser-byLevel-zone$zoneid-day_$tsDay-lvl_$level";
  217. }
  218. // ------ 统计分析 数据 ↓ ----
  219. // <editor-fold defaultstate="collapsed" desc=" 统计分析数据">
  220. /**
  221. * 统计数据 - 用户总数量 (int)
  222. * @return string
  223. */
  224. public static function Stat_UserCountByZone_int($zoneid) {
  225. return "stat-totalUserNum-zone$zoneid";
  226. }
  227. // <editor-fold defaultstate="collapsed" desc="商城">
  228. /**
  229. * 统计数据 - 每日商品销量 (zset)
  230. * @param type $zoneid
  231. * @return string
  232. */
  233. public static function stat_daily_ShopSales_zset($zoneid, $tsday) {
  234. return "stat-daily-shopsales-zone$zoneid-$tsday";
  235. }
  236. /**
  237. * 统计数据 - 每周商品销量 (zset)
  238. * @param type $zoneid
  239. * @param type $tsweek
  240. * @return string
  241. */
  242. public static function stat_weekly_ShopSales_zset($zoneid, $tsweek) {
  243. return "stat-weekly-shopsales-zone$zoneid-$tsweek";
  244. }
  245. /**
  246. * 统计数据 - 每月商品销量 (zset)
  247. * @param type $zoneid
  248. * @param type $tsmonth
  249. * @return string
  250. */
  251. public static function stat_monthly_ShopSales_zset($zoneid, $tsmonth) {
  252. return "stat-monthly-shopsales-zone$zoneid-$tsmonth";
  253. }
  254. /**
  255. * 消费日志 - 普通商城消费记录 (list1000)
  256. * @param type $zoneid
  257. * @return type
  258. */
  259. public static function log_ShopSales_list($zoneid) {
  260. return "log-shopsales-zone$zoneid";
  261. }
  262. // </editor-fold>
  263. public static function stat_daily_secretshopSales_zset($zoneid, $tsday) {
  264. return "stat-daily-secretshopsales-zone$zoneid-$tsday";
  265. }
  266. public static function stat_weekly_secretshopSalse_zset($zoneid, $tsweek) {
  267. return "stat-weekly-secretshopsales-zone$zoneid-$tsweek";
  268. }
  269. public static function stat_monthly_secretshopSales_zset($zoneid, $tsMonth) {
  270. return "stat-monthly-secretshopsales-zone$zoneid-$tsMonth";
  271. }
  272. /**
  273. *
  274. * 客户端上报日志
  275. * @param type $eventID
  276. * @return type
  277. */
  278. public static function stat_clientReportLog($eventID) {
  279. return "stat-reported-log-$eventID";
  280. }
  281. // </editor-fold>
  282. //
  283. }