123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- <?php
- namespace loyalsoft;
- /**
- * 运行时游戏全局数据
- * @version
- * 1.0.0 Created at 2017-4-6. by --gwang
- * @author gwang (mail@wanggangzero.cn)
- * @copyright ? 2017-4-6, SJZ LoyalSoft Corporation & gwang. All rights reserved.
- */
- class MemKey_GameRun {
- //
- // <editor-fold defaultstate="collapsed" desc="英雄">
- /**
- * 运行时数据 - 英雄评价内容
- * @param type $heroId
- * @return string
- */
- public static function HeroDiscusses_item_hash($heroId) {
- return "gamerun-herodiscuss-$heroId-item";
- }
- /**
- * 运行时数据 - 英雄评价内容的评分
- * @param int $heroId
- * @return string
- */
- public static function HeroDiscusses_score_zset($heroId) {
- return "gamerun-herodiscuss-$heroId-score";
- }
- /**
- * 运行时数据 - 英雄评价 - 玩家给英雄打分
- * @param int $heroId
- * @return string
- */
- public static function HeroDiscusses_userScore_normal($heroId) {
- return "gamerun-herodiscuss-$heroId-userscore";
- }
- // </editor-fold>
- /**
- * 运行时数据 - 订单编号 - 当前秒内的订单序号
- * @return type
- */
- public static function Game_OrderID_normal_int() {
- return "gamerun-orderId-" . now();
- }
- /**
- * 运行时数据 - 玩家记录集
- * @param int $zoneid 分区id
- * @param int $day tsDay
- * @return string
- */
- public static function Game_UserRecordByZone($zoneid, $day) {
- return "gamerun-dailyUserRecord-$day-zone$zoneid";
- }
- /**
- * 运行时数据 - 系统消息
- * @param int $zoneid
- * @return string
- */
- public static function Game_SysMsgByZone_zset($zoneid) {
- return "gamerun-sysmsg-zone$zoneid";
- }
- // <editor-fold defaultstate="collapsed" desc="世界Boss">
- //
- /**
- * 世界boss排行榜
- * @param type $zoneid
- * @return type
- */
- public static function Game_WorldBossRank($zoneid) {
- $dateHour = date('YmdH');
- return "gamerun-BossFight-byDateHour-zone$zoneid-$dateHour";
- }
- /**
- * 世界boss排行榜(指定bossID)
- * @param type $zoneid
- * @return type
- */
- public static function Game_WorldBoss_X_Rank($zoneid, $bossid) {
- $dateHour = date('YmdH');
- return "gamerun-BossFight-byDateHour-zone$zoneid-boss$bossid-$dateHour";
- }
- //
- // </editor-fold>
- // <editor-fold defaultstate="collapsed" desc=" 竞技场 ">
- /**
- * 运行时数据 - 竞技场 实时积分榜(总榜)
- * @param int $zoneid 分区id
- * @param int $season 赛季
- * @return string
- */
- public static function Game_PVPScoreByZoneSeason_zset($zoneid, $season) {
- return "gamerun-pvpScore-zone$zoneid-season$season";
- }
- /**
- * 运行时数据 - 竞技场 积分榜(某天)
- * 业务逻辑: 查询下昨天的榜, 根据榜单发放奖励
- * @param int $zoneid
- * @param int $day 天
- * @return string
- */
- public static function Game_PVPScoreByZone_zset_Day($zoneid, $day) {
- return "gamerun-pvpScore-zone$zoneid-day$day";
- }
- /**
- * 运行时数据 - 战斗力总榜
- * @param type $zoneid
- */
- public static function Game_FightPowerRank_zset($zoneid) {
- return "gamerun-rank-fpower-zone$zoneid";
- }
- /**
- * 运行时数据 - 战力突破记录
- * @param int $zoneid
- * @return type
- */
- public static function Game_Rank_FPowerBreakLog_hash($zoneid) {
- return "gamerun-rank-fpower-breaklog-zone$zoneid";
- }
- /**
- * 运行时数据 - 通关榜
- * @param type $zoneid
- * @return type
- */
- public static function Game_Rank_passgate_zset($zoneid) {
- return "gamerun-rank-passgate-zone$zoneid";
- }
- /**
- * 运行时数据 - 通关人数统计(达到100W人以后溢出)
- * {
- * 33=>99, (每一关从0增加到100W,统计100W个人以后溢出)
- * 32=>87,
- * }
- * @param type $zoneid
- * @return type
- */
- public static function Game_Rank_passgate_count_hash($zoneid) {
- return "gamerun-rank-passgate-count-zone$zoneid";
- }
- /**
- * 运行时数据 - 通关帮突破记录
- * @param type $zoneid
- * @return type
- */
- public static function Game_Rank_passage_BreachLog_hash($zoneid) {
- return "gamerun-rank-passgate-breaklog-zone$zoneid";
- }
- public static function Game_PaiMingFPowerRewardDeal_hash($zoneid) {
- return "gamerun-PaiMingFPowerRewardDeal_-zone$zoneid";
- }
- public static function Game_PaiMingFPowerRewardDealStart_hash($zoneid) {
- return "gamerun-PaiMingFPowerRewardDealStart_-zone$zoneid";
- }
- public static function Game_PaiMingLevelRewardDeal_hash($zoneid) {
- return "gamerun-PaiMingLevelRewardDeal_-zone$zoneid";
- }
- public static function Game_PaiMingLevelRewardDealStart_hash($zoneid) {
- return "gamerun-PaiMingLevelRewardDealStart_-zone$zoneid";
- }
- // </editor-fold>
- //
- /**
- * 运行时数据 - 每天的登录用户记录-byUId
- * @param type $zoneid
- * @param type $tsDay
- * @return type
- */
- static function DailyLoginUser_byUID_hash($zoneid, $tsDay = null) {
- if (!$tsDay) { # 检查是否默认参数
- $tsDay = totalDays();
- }
- return "gamerun-loginUser-byUid-zone$zoneid-day_$tsDay";
- }
- /**
- * 运行时数据 - 每天的登录用户记录-byLevel
- * @param type $zoneid
- * @param int $level 玩家等级
- * @param type $tsDay
- * @return type
- */
- static function DailyLoginUser_byLevel_hash($zoneid, $level, $tsDay = null) {
- if (!$tsDay) { # 检查是否默认参数
- $tsDay = totalDays();
- }
- return "gamerun-loginUser-byLevel-zone$zoneid-day_$tsDay-lvl_$level";
- }
- // ------ 统计分析 数据 ↓ ----
- // <editor-fold defaultstate="collapsed" desc=" 统计分析数据">
- /**
- * 统计数据 - 用户总数量 (int)
- * @return string
- */
- public static function Stat_UserCountByZone_int($zoneid) {
- return "stat-totalUserNum-zone$zoneid";
- }
- // <editor-fold defaultstate="collapsed" desc="商城">
- /**
- * 统计数据 - 每日商品销量 (zset)
- * @param type $zoneid
- * @return string
- */
- public static function stat_daily_ShopSales_zset($zoneid, $tsday) {
- return "stat-daily-shopsales-zone$zoneid-$tsday";
- }
- /**
- * 统计数据 - 每周商品销量 (zset)
- * @param type $zoneid
- * @param type $tsweek
- * @return string
- */
- public static function stat_weekly_ShopSales_zset($zoneid, $tsweek) {
- return "stat-weekly-shopsales-zone$zoneid-$tsweek";
- }
- /**
- * 统计数据 - 每月商品销量 (zset)
- * @param type $zoneid
- * @param type $tsmonth
- * @return string
- */
- public static function stat_monthly_ShopSales_zset($zoneid, $tsmonth) {
- return "stat-monthly-shopsales-zone$zoneid-$tsmonth";
- }
- /**
- * 消费日志 - 普通商城消费记录 (list1000)
- * @param type $zoneid
- * @return type
- */
- public static function log_ShopSales_list($zoneid) {
- return "log-shopsales-zone$zoneid";
- }
- // </editor-fold>
- public static function stat_daily_secretshopSales_zset($zoneid, $tsday) {
- return "stat-daily-secretshopsales-zone$zoneid-$tsday";
- }
- public static function stat_weekly_secretshopSalse_zset($zoneid, $tsweek) {
- return "stat-weekly-secretshopsales-zone$zoneid-$tsweek";
- }
- public static function stat_monthly_secretshopSales_zset($zoneid, $tsMonth) {
- return "stat-monthly-secretshopsales-zone$zoneid-$tsMonth";
- }
- /**
- *
- * 客户端上报日志
- * @param type $eventID
- * @return type
- */
- public static function stat_clientReportLog($eventID) {
- return "stat-reported-log-$eventID";
- }
- // </editor-fold>
- //
- }
|