1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- namespace loyalsoft;
- // 所谓const是指游戏上线后就不再变动的变量
- /**
- * 游戏内常量
- * @author gwang email:wanggangzero@qq.com
- * @copyright © 2015-3-9, SJZ LoyalSoft Corporation & gwang. All rights reserved.
- */
- class GameConstants {
- // <editor-fold defaultstate="collapsed" desc=" 兑换码相关 ">
- /**
- * @var string 全平台后缀字符串
- */
- const AllPlatStr = "all";
- /**
- * 密码本
- * @return string
- */
- public static function GetCipherString() {
- switch (PLAT) {
- case 'tap': # android平台 20171101110403
- return "qh6jid4g598rfnwp37xyb2vetzuskcam";
- case 'web': # web平台
- return "zgyqfmpav4whex9td7nu2kj8b5ris36c";
- case 'ios': # ios平台
- return "m8hsn46efyuatvp972cdgz3qrxj5wibk";
- case 'dev': # android平台 20171101110403
- return "qh6jid4g598rfnwp37xyb2vetzuskcam";
- default : # 默认采用原文密码本
- return "abcdefghijkmnpqrstuvwxyz23456789";
- }
- }
- /**
- * 根据激活码拿到平台字符串,增加新的平台的时候需要对应修改常量配置
- * @param ActiveCode $code
- */
- public static function GetPlatStringByActivteCode($code) {
- if (isset(self::$platStr[$code->plat])) {
- return self::$platStr[$code->plat];
- }
- return "unknown";
- }
- /**
- * 平台字符串,这是和客户端的一个约定,所上的渠道咱们给他们加个字符串后缀,方便区分.
- * @var array(string)
- */
- private static $platStr = array(
- "all", # # 0 全平台
- "yyb", # # 1 腾讯
- "uc", # # 2 九游
- "xiaomi_yj", # # 3 小米
- "qh360", # # 4 360
- "baidu", # # 5 百度
- "huawei", # # 6 华为
- "lenove", # # 7 联想
- "oppo_yj", # # 8 OPPO(易接)
- "wandoujia", # # 9 豌豆荚
- "dangle_yj", # # 10 当乐(易接)
- "meizu_yj", # # 11 魅族(易接)
- "yijie", # # 12 安智(易接)
- "jinli", # # 13 金立
- "anysdk", # # 14 anysdk
- "vivo", # # 15 vivo
- "samsung", # # 16 三星()
- "x7sy", # # 17 小七手游
- "yile_yj", # # 18 以乐易接
- );
- // </editor-fold>
- }
- // <=> 元数据定义 <=>
- define("META_EXP", 0); # 指挥官经验
- define("META_GOLD_ITEMID", 1); # 金币物品id
- define("META_CASH_ITEMID", 2); # 宝石物品id
- define("META_tili_ITEMID", 3); # 体力的物品ID
- define('META_FriendShipPoit_ItemId', 4); # 友情点的物品ID
- define("META_PVPCOIN_ITEMID", 5); # PVP竞技币物品id
- define("META_ActivePoint_ITEMID", 6); # 每日任务活跃点物品id
- define("META_YUANBAOITEMID", 7); # 元宝物品ID
- define("META_RESPOINT_ITEMID", 8); #资源点
- // TODO: config the c-s offset data
- //define("OFFSET_TIMESPAN", -3); # 服务端相对于客户端的偏移时间戳
- define("OFFSET_MSGTIME", 30); # 客户端服务端时间戳偏移最大误差
- require_once __DIR__ . '/defines/const_' . PLAT . '.php'; # 引入个平台特定设置: and,ios,web
|