Ejemplo n.º 1
0
        private static void OnGameFinish(Result <ExitStatus, TimeSpan, GameFinish> result)
        {
            MainApplication mainApplication = ClientAppUtils.GetMainApp();
            ISession        session         = ClientAppUtils.GetBackendSession();
            string          backendUrl      = ClientConfig.Config.BackendUrl;

            if (session?.Profile == null || mainApplication == null)
            {
                _gameCallBack(result);
                return;
            }

            ESideType?eSideType    = PrivateValueAccessor.GetPrivateFieldValue(mainApplication.GetType(), "esideType_0", mainApplication) as ESideType?;
            Profile   profile      = session.Profile;
            bool      isPlayerScav = false;

            if (eSideType != null && eSideType.GetValueOrDefault() == ESideType.Savage)
            {
                profile      = session.ProfileOfPet;
                isPlayerScav = true;
            }

            try
            {
                SaveLootUtil.SaveProfileProgress(backendUrl, session.GetPhpSessionId(), result.Value0, profile, isPlayerScav);
            }
            catch (Exception e)
            {
                Debug.LogError(e);
            }

            _gameCallBack(result);
        }
Ejemplo n.º 2
0
        private static void OnGameFinish(Result <ExitStatus, TimeSpan, GClass_GameFinish> result)
        {
            SessionInterface backend = ClientAppUtils.GetBackendSession();

            MainApplication mainApplication = MainAppUtils.GetMainApp();

            if (backend?.Profile == null || mainApplication == null)
            {
                _gameCallBack(result);
                return;
            }

            ESideType?eSideType    = PrivateValueAccessor.GetPrivateFieldValue(mainApplication.GetType(), "esideType_0", mainApplication) as ESideType?;
            Profile   profile      = backend.Profile;
            bool      isPlayerScav = false;

            if (eSideType != null && eSideType.GetValueOrDefault() == ESideType.Savage)
            {
                profile      = backend.ProfileOfPet;
                isPlayerScav = true;
            }

            try
            {
                CreatePlayerOwnerMonitor.Catched = false;
                ProfileSaveUtil.SaveProfileProgress(profile, result.Value0, backend.GetPhpSessionId(), isPlayerScav);
            }
            catch (Exception e)
            {
                Debug.LogError(e);
            }

            _gameCallBack(result);
        }
Ejemplo n.º 3
0
        public static string GetSessionId()
        {
            SessionInterface backend = GetBackendSession();

            return(backend?.Profile == null ? "-1" : backend.GetPhpSessionId());
        }
Ejemplo n.º 4
0
        public static string GetSessionId()
        {
            ISession backend = GetBackendSession();

            return((backend?.Profile == null) ? null : backend.GetPhpSessionId());
        }