Info_PrivateState.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <?php
  2. namespace loyalsoft;
  3. /**
  4. * Description of Info_PrivateState
  5. * 私有状态标志字
  6. */
  7. class Info_PrivateState extends Object_ext {
  8. // ------------字段声明-------------
  9. /**
  10. * @var int 武器/言灵的uid,递增
  11. */
  12. public $currentId = 0;
  13. /**
  14. *
  15. * @var int 物品的背包格子的上限 目前和李宁协商的结果是:抽奖可以超上限,物品合成可以超上限,任务奖励可以超上限,只有战斗时候会有限制超过上限,如果继续战斗的话,战斗的奖励品将不会获取.
  16. */
  17. public $maxItemNum = 100;
  18. /**
  19. *
  20. * @var int 物品背包格子的数量.
  21. */
  22. public $ItemNum = 0;
  23. /**
  24. * 上次获取体力的时间戳
  25. * @var int
  26. */
  27. public $TiliTime;
  28. /**
  29. * 登录天数
  30. * @var array[12345,12347,...]
  31. */
  32. #[ArrayType]
  33. public $LoginDays = array();
  34. /**
  35. * @var array[1,2,3,4,5,6,7] 7日签到领取数据
  36. */
  37. #[ArrayType]
  38. public $day7_drawed = array();
  39. /**
  40. * @var array 兑换码使用记录
  41. */
  42. #[ArrayType]
  43. public $usedTokens = array();
  44. /**
  45. * @var int 在线礼包累计时长
  46. */
  47. public $onlineGiftts = 0;
  48. /**
  49. * @var [int] 当前在线礼包ID(每天清空)
  50. */
  51. #[ArrayType]
  52. public $onlineGiftIDs = array();
  53. /**
  54. * @var array 全服注册礼包领取记录
  55. */
  56. #[ArrayType]
  57. public $drawedRegGift = array();
  58. /**
  59. * @var boolean 首付礼包是否领取
  60. */
  61. public $firstPayGift = false;
  62. /**
  63. * @var array 每日领取的体力奖励记录
  64. */
  65. #[ArrayType]
  66. public $dailyDrawedTiliGift = array();
  67. /**
  68. * 排行榜, 战力突破奖领取记录
  69. * @var array
  70. */
  71. #[ArrayType]
  72. public $RankFpowerRewardRec = array();
  73. /**
  74. * 排行榜, 通关记录突破奖励领取记录----改成了玩家等级榜
  75. * @var type
  76. */
  77. #[ArrayType]
  78. public $RankPassGateRewardRec = array();
  79. /**
  80. * @var int 上次检查被挑战记录的时间戳
  81. */
  82. public $lastCheckDefLog_ts = 0;
  83. /**
  84. * 角标通知缓存
  85. * @var array[int]
  86. */
  87. #[ArrayType]
  88. public $cornerSignNotifications = array();
  89. /**
  90. * 已解锁建筑
  91. * @var array[int]
  92. */
  93. #[ArrayType]
  94. public $unlockedBuild = array();
  95. /**
  96. * 已经解锁得npc
  97. * @var type
  98. */
  99. #[ArrayType]
  100. public $unlockNpc = array();
  101. /**
  102. * @var int 无尽塔的当前进度
  103. */
  104. public $endlessTower = 1;
  105. /**
  106. * @var int[] 无尽塔的特殊奖励领取记录, 只增不减
  107. */
  108. #[ArrayType]
  109. public $endlessTower_rewarded = array();
  110. /**
  111. * @var stdClass 材料副本每日挑战记录
  112. */
  113. public $materialDailyChallengeRecord;
  114. /**
  115. * @var stdClass 任务卡追踪信息 { "1":2345,"2":0,"3":0,"4":0 }
  116. */
  117. public $taskCardTracing;
  118. /**
  119. * 背包扩容次数
  120. * @var type
  121. */
  122. public $expandNum = 0;
  123. /**
  124. * 每日购买体力次数记录,每日重置
  125. */
  126. public $buyTiliNum = 0;
  127. /**
  128. * 任务兼容处理索引
  129. * @var type
  130. */
  131. public $taskJianRong_index = 0;
  132. /**
  133. * 原地复活次数
  134. */
  135. public $battleReviveNum = 0;
  136. /**
  137. * 在线礼包领取时间记录
  138. * @var type
  139. */
  140. public $onlineGiftClearTs = 0;
  141. /**
  142. * 出生点
  143. * @var type
  144. */
  145. public $bornPlace = 0;
  146. /**
  147. * 悬赏任务完成个数记录
  148. * @var type
  149. */
  150. public $shopTaskCompleteNum = 0;
  151. public $tiliRecord = 0;
  152. /**
  153. * 每天累计时间,每日重置
  154. * @var type
  155. */
  156. public $onlineTs = 0;
  157. /**
  158. * 删档测试处理字段
  159. * @var type
  160. */
  161. public $deltest = 1;
  162. /**
  163. * 已领取的等级奖励礼包id
  164. * @var array
  165. */
  166. #[ArrayType]
  167. public $gettedLevelGiftIds = array();
  168. // <editor-fold defaultstate="collapsed" desc=" 初始化 ">
  169. /**
  170. * 玩家注册时初始化, 用于给各个字段赋默认初始值
  171. */
  172. public function initialize() {
  173. $this->maxItemNum = GameConfig::primordial_data()->User_Private_MaxItem_num; # Ps.默认100;
  174. $this->TiliTime = now();
  175. my_default_Obj($this->taskCardTracing);
  176. }
  177. public function fixArray() {
  178. $class = new \ReflectionClass(__CLASS__); # 建立这个类的反射对象
  179. $properties = $class->getProperties(); # 拉取所有静态属性
  180. foreach ($properties as $p) {
  181. isEditor() and $p = new \ReflectionProperty();
  182. $attrs = $p->getAttributes("loyalsoft\ArrayType");
  183. if (count($attrs) > 0) {
  184. $v = self::ConsureArr($p->getValue($this));
  185. $p->setValue($this, $v);
  186. }
  187. }
  188. // $this->LoginDays = self::ConsureArr($this->LoginDays);
  189. // $this->day7_drawed = self::ConsureArr($this->day7_drawed);
  190. // $this->RankFpowerRewardRec = self::ConsureArr($this->RankFpowerRewardRec);
  191. // $this->RankPassGateRewardRec = self::ConsureArr($this->RankPassGateRewardRec);
  192. // $this->onlineGiftIDs = self::ConsureArr($this->onlineGiftIDs);
  193. // $this->unlockedBuild = self::ConsureArr($this->unlockedBuild);
  194. // $this->unlockNpc = self::ConsureArr($this->unlockNpc);
  195. // $this->cornerSignNotifications = self::ConsureArr($this->cornerSignNotifications);
  196. // $this->endlessTower_rewarded = self::ConsureArr($this->endlessTower_rewarded);
  197. }
  198. private static function ConsureArr($mix) {
  199. if (is_array($mix)) {
  200. return $mix;
  201. }
  202. return (array) $mix;
  203. }
  204. /**
  205. * 添加已经解锁得npc
  206. * @param type $npcId
  207. */
  208. public function addUnlockNpc($npcId) {
  209. if (!in_array($npcId, $this->unlockNpc)) {
  210. $this->unlockNpc[] = $npcId;
  211. }
  212. }
  213. // </editor-fold>
  214. }