123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <?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 {
- /**
- * 运行时数据 - 英雄评价内容
- * @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";
- }
- /**
- * 运行时数据 - 订单编号 - 当前秒内的订单序号
- * @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";
- }
- /**
- * 运行时数据 - pvp蝉联信息
- * @param int $zoneid
- */
- static function Game_PVP_Chanlian_normal($zoneid) {
- return "gamerun-pvp-chanlian-zone$zoneid";
- }
- /**
- * 运行时数据 - pvp蝉联历史冠军数据
- * @param type $zoneid
- * @return type
- */
- static function Game_PVP_Chanlian_History_hash($zoneid) {
- return "gamerun-pvp-chanlian-history-zone$zoneid";
- }
- /**
- * 运行时数据 - pvp实时积分榜(总榜)
- * @param int $zoneid
- * @return string
- */
- public static function Game_PVPScoreByZone_zset($zoneid) {
- return "gamerun-pvpScore-zone$zoneid";
- }
- /**
- * 运行时数据 - pvp实时积分榜(当前)
- * 当前和上周都是作为总榜的记录存在,
- * @param int $zoneid
- * @return string
- */
- public static function Game_PVPScoreByZone_zset_curWeek($zoneid) {
- $week = TimeUtil::tsWeek();
- return "gamerun-pvpScore-zone$zoneid-$week";
- }
- /**
- * 运行时数据 - pvp积分榜(上周)
- * 当前和上周都是作为总榜的记录存在,
- * @param int $zoneid
- * @return string
- */
- public static function Game_PVPScoreByZone_zset_lastWeek($zoneid) {
- $week = TimeUtil::tsWeek() - 1;
- return "gamerun-pvpScore-zone$zoneid-$week";
- }
- /**
- * 运行时数据 - pvp 每周排行榜发放记录 [tsweek,...]
- * @param int $zoneid
- * @return string
- */
- public static function Game_PVPRankRewardRecord_set($zoneid) {
- return "gamerun-pvpRewardRecord-zone$zoneid";
- }
- /**
- * 运行时数据 - pvp 每周领取排行榜奖励的玩家记录 [tsweek,...]
- * @param int $zoneid
- * @param int $tsweek Description
- * @return string
- */
- public static function Game_PVPRankRewardRecord_byWeek_str($zoneid, $tsweek) {
- return "gamerun-pvpRewardRecord-zone$zoneid-$tsweek";
- }
- /**
- * 运行时数据 - 战斗力总榜
- * @param type $zoneid
- */
- public static function Game_FightPowerRank_zset($zoneid) {
- return "gamerun-fightpower-zone$zoneid";
- }
- /**
- * 运行时数据 - 每天的登录用户记录-byUId
- * @param type $zoneid
- * @param type $tsDay
- * @return type
- */
- static function DailyLoginUser_byUID_hash($zoneid, $tsDay = null) {
- if (!$tsDay) { # 检查是否默认参数
- $tsDay = tsDay();
- }
- 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 = tsDay();
- }
- return "gamerun-loginUser-byLevel-zone$zoneid-day_$tsDay-lvl_$level";
- }
- // ------ 统计分析 数据 ↓ ----
- /**
- * 统计数据 - 用户总数量 (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";
- }
- /**
- * 神秘商城 - 消费日志 ()list1000)
- * @param type $zoneid
- * @return string
- */
- public static function log_secretshopSales_list($zoneid) {
- return "log-secretshopsales-zone$zoneid";
- }
- /**
- * 日志 xtype 记录 (lsit1000)
- * @param type $type
- * @return string
- */
- public static function log_x($type) {
- $typename = strval(new enum_LogLevel($type));
- return "log-" . $typename;
- }
- }
|