|
@@ -82,12 +82,12 @@ class UserProc {
|
|
|
* 6016 拉取其他玩家的信息.
|
|
|
*/
|
|
|
public static function UserOtherPlayerInfo() {
|
|
|
-
|
|
|
$zoneId = req()->zoneid;
|
|
|
list($other_uid) = req()->paras;
|
|
|
-
|
|
|
- $info = UserProc::getUserInfo($zoneId, $other_uid);
|
|
|
- return Resp::ok($info);
|
|
|
+ $usrInfo = new UserInfoMo();
|
|
|
+ $g = UserProc::getUserGame($zoneId, $other_uid);
|
|
|
+ $usrInfo->game = $g;
|
|
|
+ return Resp::ok($usrInfo);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -382,12 +382,14 @@ class UserProc {
|
|
|
*/
|
|
|
public static function loginUserInfo() {
|
|
|
$userInfo = UserProc::getUserInfo(req()->zoneid, req()->uid); # 取玩家信息
|
|
|
- if ($userInfo == null) { # 新用户, -> 6006创建账号
|
|
|
+ $game = UserProc::getUserGame(req()->zoneid, req()->uid);
|
|
|
+ if ($game == null) { # 新用户, -> 6006创建账号
|
|
|
$ret = array(
|
|
|
'isNewUser' => true
|
|
|
);
|
|
|
return Resp::ok($ret);
|
|
|
} else { # 2.如果玩家已存在,则处理普通登录流程
|
|
|
+ req()->game = $game;
|
|
|
req()->userInfo = $userInfo; # 给Req挂载userInfo
|
|
|
UserProc::checkContidays(); # 连续登录,状态检查
|
|
|
PayProc::m_refreshChargeOrders(); # 刷新订单, 多平台版本
|
|
@@ -399,6 +401,8 @@ class UserProc {
|
|
|
ShopProc::resetDaliySpecialPackages(); #每日特惠领奖每日重置
|
|
|
self::checkMissOrder(); #校验是否有漏单
|
|
|
UserProc::updateUserInfo(); # 这一步回存操作只有在 userInfo正常存在的情况下才进行
|
|
|
+ $userInfo = new UserInfoMo();
|
|
|
+ $userInfo->game = $game;
|
|
|
$resp = Resp::ok($userInfo); # 设置返回值
|
|
|
// self::backupUserInfo(); # 数据回写
|
|
|
|
|
@@ -500,6 +504,7 @@ class UserProc {
|
|
|
$game->baseInfo->firstLogin = now();
|
|
|
$userInfo = new UserInfoMo();
|
|
|
req()->userInfo = $userInfo; # 更新Req的userinfo,
|
|
|
+ req()->game = $game;
|
|
|
#Ps 6006是没有获得到Userinfo到Req中的
|
|
|
UserProc::checkContidays(1); # 每日状态检查
|
|
|
// UserProc::fetchFromInteract($mem, $req); # 从interact拉取数据,Ps.初始化的过程应该还拉取不到什么有效数据
|
|
@@ -569,12 +574,37 @@ class UserProc {
|
|
|
return $usrInfo;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 玩家数据
|
|
|
+ * @param type $zoneid
|
|
|
+ * @param type $uid
|
|
|
+ * @return Data_UserGame
|
|
|
+ */
|
|
|
+ public static function getUserGame($zoneid, $uid) {
|
|
|
+ $key = MemKey_User::Info_hash($zoneid, $uid);
|
|
|
+ $a = new Data_UserGame();
|
|
|
+ if (null == $a->readDataFromMem($key)) { # ps.下面这一段代码和经常删号会有冲突,因此关闭了 --gwang 2022.2.28
|
|
|
+// $collection = "ylsj2019.userInfoBack";
|
|
|
+// $cursor = gMongo()->find($collection, ['key' => $key]);
|
|
|
+// if ($cursor && $cursor->valid()) {
|
|
|
+// foreach ($cursor as $v) {
|
|
|
+// $a->LoadFrom($v->value); # 加载
|
|
|
+// $a->updateDataFull($key); # 反向写回redis
|
|
|
+// break; # 其实是只有一条
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+ return null;
|
|
|
+// }
|
|
|
+ }
|
|
|
+ return new Data_UserGame($a);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 更新用户数据(设置标志位,最后统一更新-gwang 2017.07.18)
|
|
|
*/
|
|
|
public static function updateUserInfo() {
|
|
|
my_Assert(req(), "req()为空");
|
|
|
- my_Assert(req()->userInfo, "[" . req()->cmd . "] 玩家数据正在被清空!" . req()->uid);
|
|
|
+ my_Assert(req()->game, "[" . req()->cmd . "] 玩家数据正在被清空!" . req()->uid);
|
|
|
req()->userInfoChanged = TRUE; # 设置回写标志位
|
|
|
}
|
|
|
|