private static void OnGameFinish(Result <ExitStatus, TimeSpan, GClass_GameFinish> result)
        {
            GInterface24    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(backend.Profile, result.Value0, backend.GetPhpSessionId(), isPlayerScav);
            }
            catch (Exception e)
            {
                Debug.LogError(e);
            }

            _gameCallBack(result);
        }
Ejemplo n.º 2
0
        public static GInterface24 GetBackendSession()
        {
            GInterface24 session = GetClientApp()?.GetClientBackEndSession();

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

            Debug.LogError("ClientAppUtils GetBackendSession() method. BackEndSession is null");
            return(null);
        }
Ejemplo n.º 3
0
        public static string GetSessionId()
        {
            GInterface24 backend = GetBackendSession();

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