MemKey_GameRun.php 9.3 KB

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