123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?php
- namespace loyalsoft;
- /**
- * Description of MemKey_Guild
- *
- * @author cyzhao
- */
- class MemKey_Guild {
- //
- // <editor-fold defaultstate="collapsed" desc=" 辅助方法 ">
- //
- /**
- * @return bool 是否使用短名称
- */
- private static function bUseShort() {
- // return true; # 全部启用
- return match (PLAT) {
- Enum_Plat::dev_gwang => false, # dev时不使用
- default => true,
- };
- }
- /**
- * key前缀
- * @param int $zoneid 分区id
- * @param string $uid
- * @return string
- */
- private static function Key_($zoneid, $uid) {
- return self::bUseShort() ? 'u-' . $uid . '-' . $zoneid : 'user-' . $uid . '-zone' . $zoneid;
- }
- // </editor-fold>
- /**
- * 获取玩家公会信息
- * @param type $zoneid
- * @return string
- */
- public static function getUserGuildInfo_hash($uid, $zoneid) {
- return self::Key_($zoneid, $uid) . "-guild";
- }
- /**
- * 公会列表缓存
- * @param type $page
- * @param type $zoneid
- * @return type
- */
- public static function guildListCache($page, $zoneid) {
- return "cache-guild-list" . "-zone" . $zoneid . $page;
- }
- // /**
- // * 推荐公会列表缓存
- // * @return string
- // */
- // static function guildRecommendationCache($zoneid) {
- // return "cache-guild-recommendation" . "-zone" . $zoneid;
- // }
- //
- // /**
- // * 推荐公会队列
- // * @return string
- // */
- // static function constGuildRecommendationQueue($zoneid) {
- // return "guild-recommendation-queue" . "-zone" . $zoneid;
- // }
- /**
- * 获取公会信息
- */
- static function getGuildInfo_hash($gid, $zoneid) {
- return "guild-" . $gid . "-zone" . $zoneid;
- }
- /**
- * 获取当前最大公会ID,
- * @return string
- */
- static function constGetCurrentMaxGuildID($zoneid) {
- return "guild-currentmaxid" . "-zone" . $zoneid;
- }
- // /**
- // * 【哈希】捐献请求记录
- // * @return string
- // */
- // static function CacheGuildDonate($guildId, $zoneid) {
- // return "guild-donate-" . $guildId . "-zone" . $zoneid;
- // }
- //
- // /**
- // * 【LIST】捐献者记录
- // * @return string
- // */
- // static function UserDonateRecordList($guildId, $index, $zoneid) {
- // return "guild-donor-" . $guildId . "-" . $index . "-zone" . $zoneid;
- // }
- //
- // /**
- // * 【LIST】除了捐献之外的日志
- // * @return string
- // */
- // static function constGuildJournal($guildId, $zoneid) {
- // return "guild-journal-" . $guildId . "-zone" . $zoneid;
- // }
- }
|