MemKey_GameRun.php 8.4 KB

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