Пример #1
0
        private static void OnGameFinish(Result <ExitStatus, TimeSpan, GClass_GameFinish> result)
        {
            GInterface22    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);
        }
Пример #2
0
        public static GInterface22 GetBackendSession()
        {
            GInterface22 session = GetClientApp()?.GetClientBackEndSession();

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

            Debug.LogError("ClientAppUtils GetBackendSession() method. BackEndSession is null");
            return(null);
        }
Пример #3
0
        public static void Prefix(ISession backEnd, ESideType esideType_0, Result <ExitStatus, TimeSpan, MatchInfo> result)
        {
            bool    isPlayerScav = false;
            string  backendUrl   = ClientConfig.Config.BackendUrl;
            var     session      = backEnd.Session;
            Profile profile      = backEnd.Session.Profile;

            if (esideType_0 == ESideType.Savage)
            {
                profile      = backEnd.Session.ProfileOfPet;
                isPlayerScav = true;
            }

            SaveLootUtil.SaveProfileProgress(backendUrl, session.GetPhpSessionId(), result.Value0, profile, isPlayerScav);
        }
Пример #4
0
        public static void Prefix(GInterface22 ____backEnd, ESideType ___esideType_0, Result <ExitStatus, TimeSpan, GClass1240> result)
        {
            string backendUrl = GClass266.Config.BackendUrl;

            var session = ____backEnd.Session;

            bool isPlayerScav = false;

            var profile = ____backEnd.Session.Profile;

            if (___esideType_0 == ESideType.Savage)
            {
                profile      = ____backEnd.Session.ProfileOfPet;
                isPlayerScav = true;
            }

            SaveLootUtil.SaveProfileProgress(backendUrl, session.GetPhpSessionId(), result.Value0, profile, isPlayerScav);
        }
Пример #5
0
        public static string GetSessionId()
        {
            GInterface22 backend = GetBackendSession();

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