|
@@ -57,29 +57,22 @@ namespace GFGGame
|
|
|
{
|
|
|
ViewManager.Hide<LoginInputView>();
|
|
|
ViewManager.Hide<RegisterView>();
|
|
|
- if (GameGlobal.isOfflineVisitor)
|
|
|
+ User user = result.user;
|
|
|
+ GameGlobal.userId = user.id;
|
|
|
+ GameGlobal.userAge = user.age;
|
|
|
+ if (GameGlobal.isVisitor)
|
|
|
{
|
|
|
- GameProxy.ReqRoleInfo(GameGlobal.userId);
|
|
|
+ PlayerPrefs.SetFloat(GameConst.VISITOR_ID_KEY, GameGlobal.userId);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- User user = result.user;
|
|
|
- GameGlobal.userId = user.id;
|
|
|
- GameGlobal.userAge = user.age;
|
|
|
- if (GameGlobal.isVisitor)
|
|
|
- {
|
|
|
- PlayerPrefs.SetFloat(GameConst.VISITOR_ID_KEY, GameGlobal.userId);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- PlayerPrefs.SetString(GameConst.ACCOUNT_LAST_LOGIN_KEY, user.account);
|
|
|
- PlayerPrefs.SetString(GameConst.PASSWORD_LAST_LOGIN_KEY, user.password);
|
|
|
- }
|
|
|
- GameController.CheckSpecialAccount(user.account);
|
|
|
- LocalCache.SetBool(GameConst.LAST_LOGIN_IS_VISITOR_KEY, GameGlobal.isVisitor);
|
|
|
- PlayerPrefs.Save();
|
|
|
- GameProxy.ReqRoleInfo(GameGlobal.userId);
|
|
|
+ PlayerPrefs.SetString(GameConst.ACCOUNT_LAST_LOGIN_KEY, user.account);
|
|
|
+ PlayerPrefs.SetString(GameConst.PASSWORD_LAST_LOGIN_KEY, user.password);
|
|
|
}
|
|
|
+ GameController.CheckSpecialAccount(user.account);
|
|
|
+ LocalCache.SetBool(GameConst.LAST_LOGIN_IS_VISITOR_KEY, GameGlobal.isVisitor);
|
|
|
+ PlayerPrefs.Save();
|
|
|
+ GameProxy.ReqRoleInfo(GameGlobal.userId);
|
|
|
}
|
|
|
|
|
|
public static void OnLoginFail(LoginResult result)
|
|
@@ -121,62 +114,31 @@ namespace GFGGame
|
|
|
GetSuitItemController.enable = false;
|
|
|
DressUpMenuSuitDataManager.InitData();
|
|
|
DressUpMenuItemDataManager.InitData();
|
|
|
- if (!GameGlobal.isOfflineVisitor)
|
|
|
- {
|
|
|
- roleInfo = result.roleInfo;
|
|
|
- bool rerult = AntiAddictionController.CheckAntiAddiction(roleInfo.onlineTimeSecs, roleInfo.onlineDurationSecs, roleInfo.onlineDurationSecsDay);
|
|
|
- if (rerult)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- ServerDataManager.SetServerTime(roleInfo.serverTime);
|
|
|
- RoleDataManager.InitServerData(roleInfo);
|
|
|
- ItemDataManager.InitServerData(result.roleItemList);
|
|
|
- CustomSuitDataManager.InitServerData(roleInfo.suitIndex, result.roleSuitList);
|
|
|
- StoryDataManager.InitServerData(roleInfo);
|
|
|
- GuideDataManager.InitServerData(result.roleGuideList);
|
|
|
- DressUpMenuSuitDataManager.InitServerData(result.systemSuitList);
|
|
|
- CardDataManager.InitServerData(result.roleCardList);
|
|
|
- }
|
|
|
- else
|
|
|
+ roleInfo = result.roleInfo;
|
|
|
+ bool rerult = AntiAddictionController.CheckAntiAddiction(roleInfo.onlineTimeSecs, roleInfo.onlineDurationSecs, roleInfo.onlineDurationSecsDay);
|
|
|
+ if (rerult)
|
|
|
{
|
|
|
- RoleDataManager.InitServerData(null);
|
|
|
- ItemDataManager.InitServerData(null);
|
|
|
- CustomSuitDataManager.InitServerData(0, null);
|
|
|
- StoryDataManager.InitServerData(null);
|
|
|
- GuideDataManager.InitServerData(null);
|
|
|
- DressUpMenuSuitDataManager.InitServerData(null);
|
|
|
- CardDataManager.InitServerData(null);
|
|
|
+ return;
|
|
|
}
|
|
|
+ ServerDataManager.SetServerTime(roleInfo.serverTime);
|
|
|
+ RoleDataManager.InitServerData(roleInfo);
|
|
|
+ ItemDataManager.InitServerData(result.roleItemList);
|
|
|
+ CustomSuitDataManager.InitServerData(roleInfo.suitIndex, result.roleSuitList);
|
|
|
+ StoryDataManager.InitServerData(roleInfo);
|
|
|
+ GuideDataManager.InitServerData(result.roleGuideList);
|
|
|
+ DressUpMenuSuitDataManager.InitServerData(result.systemSuitList);
|
|
|
+ CardDataManager.InitServerData(result.roleCardList);
|
|
|
GetSuitItemController.enable = true;
|
|
|
RoleDataHandler.StartUpdate();
|
|
|
|
|
|
GFGUIPackage.AddPackage(ResPathUtil.GetUIPackagePath("CommonGame"));
|
|
|
GFGUIPackage.AddPackage(ResPathUtil.GetUIPackagePath("Main"));
|
|
|
|
|
|
- if (GameGlobal.isOfflineVisitor)
|
|
|
+ if (RoleDataManager.lvl >= 50)
|
|
|
{
|
|
|
- Alert.Show("离线体验可以选择跳过引导并获取所有衣服。")
|
|
|
- .SetLeftButton(true, "跳过引导", (object data) =>
|
|
|
- {
|
|
|
- GameGlobal.skipGuide = true;
|
|
|
- GMController.GetAllDressUpItem();
|
|
|
- EnterGame();
|
|
|
- })
|
|
|
- .SetRightButton(true, "体验引导", (object data) =>
|
|
|
- {
|
|
|
- GameGlobal.skipGuide = false;
|
|
|
- EnterGame();
|
|
|
- });
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (RoleDataManager.lvl >= 50)
|
|
|
- {
|
|
|
- GameGlobal.skipGuide = true;
|
|
|
- }
|
|
|
- EnterGame();
|
|
|
+ GameGlobal.skipGuide = true;
|
|
|
}
|
|
|
+ EnterGame();
|
|
|
}
|
|
|
|
|
|
public static void QuitToLoginView(bool logout)
|