MemKey_GameRun.php 8.0 KB

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