|
@@ -8,12 +8,11 @@ namespace GFGGame
|
|
|
{
|
|
|
public class GameController
|
|
|
{
|
|
|
- public static void Start()
|
|
|
+
|
|
|
+ public static async ET.ETTask Start()
|
|
|
{
|
|
|
- LoginProxy.SayHi((LoginResult result) =>
|
|
|
- {
|
|
|
- CheckShowLoginView();
|
|
|
- });
|
|
|
+ await LoginController.CheckVersion();
|
|
|
+ CheckShowLoginView();
|
|
|
}
|
|
|
|
|
|
private static void CheckShowLoginView()
|
|
@@ -34,7 +33,7 @@ namespace GFGGame
|
|
|
{
|
|
|
if (doLogin)
|
|
|
{
|
|
|
- LoginProxy.LoginAsVisitor();
|
|
|
+ //LoginProxy.LoginAsVisitor();
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -45,7 +44,7 @@ namespace GFGGame
|
|
|
{
|
|
|
if (doLogin)
|
|
|
{
|
|
|
- LoginProxy.Login(account, password);
|
|
|
+ LoginController.Login(account, password, true).Coroutine();
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -53,52 +52,6 @@ namespace GFGGame
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- public static void OnLoginSuccess(LoginResult result)
|
|
|
- {
|
|
|
- ViewManager.Hide<LoginInputView>();
|
|
|
- ViewManager.Hide<RegisterView>();
|
|
|
- if (GameGlobal.isOfflineVisitor)
|
|
|
- {
|
|
|
- GameProxy.ReqRoleInfo(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);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public static void OnLoginFail(LoginResult result)
|
|
|
- {
|
|
|
- if (result.code == 107)
|
|
|
- {
|
|
|
- string promptStr = "您属于未成年人,已被纳入防沉迷系统。每日22时至次日8时,本游戏将无法为未成年人用户提供游戏服务。";
|
|
|
- Alert.Show(promptStr)
|
|
|
- .SetRightButton(true, "知道啦", (object data) =>
|
|
|
- {
|
|
|
-
|
|
|
- });
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ViewManager.Show<LoginInputView>();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public static void CheckSpecialAccount(string account)
|
|
|
{
|
|
|
GameGlobal.antiAddiction = !(account.IndexOf("sygfg") == 0);
|
|
@@ -107,81 +60,44 @@ namespace GFGGame
|
|
|
public static void ShowCreateRole()
|
|
|
{
|
|
|
ViewManager.Show(ViewName.CREATE_ROLE_VIEW);
|
|
|
- Alert.Show("是否跳过引导?如果您是第一次体验,建议不要跳过引导!")
|
|
|
- .SetLeftButton(true, "不用")
|
|
|
- .SetRightButton(true, "跳过", (obj) =>
|
|
|
- {
|
|
|
- GameGlobal.skipGuide = true;
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
- public static void PreEnterGame(GameResult result)
|
|
|
+ public static void PreEnterGame()
|
|
|
{
|
|
|
- RoleInfo roleInfo = null;
|
|
|
+ //RoleInfo roleInfo = null;
|
|
|
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);
|
|
|
- SkillDataManager.Instance.InitServerData(result.roleSkillList);
|
|
|
- SkillDataManager.Instance.SetDicPassivitySkillCfg();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- RoleDataManager.InitServerData(null);
|
|
|
- ItemDataManager.InitServerData(null);
|
|
|
- CustomSuitDataManager.InitServerData(0, null);
|
|
|
- StoryDataManager.InitServerData(null);
|
|
|
- GuideDataManager.InitServerData(null);
|
|
|
- DressUpMenuSuitDataManager.InitServerData(null);
|
|
|
- CardDataManager.InitServerData(null);
|
|
|
- SkillDataManager.Instance.InitServerData(null);
|
|
|
- SkillDataManager.Instance.SetDicPassivitySkillCfg();
|
|
|
-
|
|
|
- }
|
|
|
+ //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);
|
|
|
GetSuitItemController.enable = true;
|
|
|
- RoleDataHandler.StartUpdate();
|
|
|
+ //RoleDataHandler.StartUpdate();
|
|
|
|
|
|
GFGUIPackage.AddPackage(ResPathUtil.GetUIPackagePath("CommonGame"));
|
|
|
GFGUIPackage.AddPackage(ResPathUtil.GetUIPackagePath("Main"));
|
|
|
|
|
|
- if (GameGlobal.isOfflineVisitor)
|
|
|
- {
|
|
|
- Alert.Show("离线体验可以选择跳过引导并获取所有衣服。")
|
|
|
- .SetLeftButton(true, "跳过引导", (object data) =>
|
|
|
+ Alert.Show("是否跳过引导?如果您是第一次体验,建议不要跳过引导!")
|
|
|
+ .SetLeftButton(true, "不用", (obj) =>
|
|
|
{
|
|
|
- GameGlobal.skipGuide = true;
|
|
|
- GMController.GetAllDressUpItem();
|
|
|
EnterGame();
|
|
|
})
|
|
|
- .SetRightButton(true, "体验引导", (object data) =>
|
|
|
+ .SetRightButton(true, "跳过", (obj) =>
|
|
|
{
|
|
|
- GameGlobal.skipGuide = false;
|
|
|
+ GameGlobal.skipGuide = true;
|
|
|
EnterGame();
|
|
|
});
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (RoleDataManager.lvl >= 50)
|
|
|
- {
|
|
|
- GameGlobal.skipGuide = true;
|
|
|
- }
|
|
|
- EnterGame();
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public static void QuitToLoginView(bool logout)
|
|
@@ -194,9 +110,7 @@ namespace GFGGame
|
|
|
GameGlobal.skipGuide = false;
|
|
|
RoleDataHandler.StopUpdate();
|
|
|
CardDataManager.Clear();
|
|
|
- DecomposeDataManager.Instance.Clear();
|
|
|
PhotographDataManager.Instance.Clear();
|
|
|
- SkillDataManager.Instance.Clear();
|
|
|
if (logout)
|
|
|
{
|
|
|
Logout();
|
|
@@ -231,10 +145,10 @@ namespace GFGGame
|
|
|
else
|
|
|
{
|
|
|
StoryDataManager.currentChapter = 1;
|
|
|
- if (GameGlobal.isFirstEntry == true)
|
|
|
+ if (!StoryDataManager.CheckLevelPass(1, 1))
|
|
|
{
|
|
|
- // ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter, new object[] { ViewName.STORY_CHAPTER_LIST_VIEW, });
|
|
|
- StoryController.ShowPriorStoryDialog();
|
|
|
+ ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter, new object[] { ViewName.STORY_CHAPTER_LIST_VIEW, });
|
|
|
+ StoryController.ShowLevelView(StoryDataManager.currentChapter, 1);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -246,8 +160,8 @@ namespace GFGGame
|
|
|
|
|
|
private static void AfterEnterGame()
|
|
|
{
|
|
|
- GameProxy.ReqGetStoryScoreList();
|
|
|
- GameProxy.ReqGetStoryStarList();
|
|
|
+ //GameProxy.ReqGetStoryScoreList();
|
|
|
+ //GameProxy.ReqGetStoryStarList();
|
|
|
}
|
|
|
|
|
|
public static void PrepareUpdateTreasure()
|