Пример #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);
        }
Пример #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);
        }
Пример #3
0
        public static ISession GetBackendSession()
        {
            ISession session = GetClientApp()?.GetClientBackEndSession();

            if (session == null)
            {
                return(null);
            }

            return(session);
        }
Пример #4
0
        public static SessionInterface GetBackendSession()
        {
            SessionInterface session = GetClientApp()?.GetClientBackEndSession();

            if (session != null)
            {
                return(session);
            }

            Debug.LogError("ClientAppUtils GetBackendSession() method. BackEndSession is null");
            return(null);
        }
Пример #5
0
        public static string GetSessionId()
        {
            SessionInterface backend = GetBackendSession();

            return(backend?.Profile == null ? "-1" : backend.GetPhpSessionId());
        }
Пример #6
0
        public static string GetSessionId()
        {
            ISession backend = GetBackendSession();

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