Ejemplo n.º 1
0
        public void init(Settings settings)
        {
            uint cTs = Main.getCurrentTimestamp();

            if (tsStart == 0)
                tsStart = cTs;
            tsEnd = cTs;

            tsSessionStarts.Add(cTs);
            sessionIdx = tsSessionStarts.Count - 1;

            Park.ParkSessionData parkDataSession = new Park.ParkSessionData();
            parkDataSession.tsStart = tsSessionStarts[tsSessionStarts.Count - 1];
            parkDataSession.setIdx(guid, tsSessionStarts.Count - 1);

            parkDataSession.init(guid, settings);

            sessions.Add(tsSessionStarts.Count - 1, parkDataSession);
        }
Ejemplo n.º 2
0
        public void init(Settings settings)
        {
            uint cTs = Main.getCurrentTimestamp();

            if (tsStart == 0)
            {
                tsStart = cTs;
            }
            tsEnd = cTs;

            tsSessionStarts.Add(cTs);
            sessionIdx = tsSessionStarts.Count - 1;

            Park.ParkSessionData parkDataSession = new Park.ParkSessionData();
            parkDataSession.tsStart = tsSessionStarts[tsSessionStarts.Count - 1];
            parkDataSession.setIdx(guid, tsSessionStarts.Count - 1);

            parkDataSession.init(guid, settings);

            sessions.Add(tsSessionStarts.Count - 1, parkDataSession);
        }
Ejemplo n.º 3
0
        protected override bool setObjByKey(string handle, string key, object obj)
        {
            bool success = base.setObjByKey(handle, key, obj);

            switch (key)
            {
                case "guid":
                    guid = obj.ToString();
                    if (guid.Length == 0) success = false;
                    break;
                case "time":
                    time = Convert.ToUInt32(obj);
                    break;
                case "names":
                    List<object> dNames = obj as List<object>;
                    if (dNames.Count > 0)
                        foreach (object name in dNames) names.Add(name.ToString());
                    break;
                case "files":
                    List<object> dFiles = obj as List<object>;
                    if (dFiles.Count > 0)
                        foreach (object file in dFiles) files.Add(file.ToString());
                    break;
                case "autoSavesCount":
                    autoSavesCount = Convert.ToUInt32(obj);
                    break;
                case "quickSavesCount":
                    quickSavesCount = Convert.ToUInt32(obj);
                    break;
                case "sessionIdxs":
                    List<object> sessionIdxs = obj as List<object>;
                    sessions = new Dictionary<int, Park.ParkSessionData>();
                    foreach (object sIdx in sessionIdxs)
                    {
                        if (ignoreSessionsOnFirstLoad == false &&
                            (currentSessionOnly == false || (sessionIdx == Convert.ToInt32(sIdx))))
                        {
                            Park.ParkSessionData nSession = new Park.ParkSessionData();
                            nSession.setIdx(guid, Convert.ToInt32(sIdx));
                            sessions.Add(nSession.idx, nSession);
                        }
                        else
                        {
                            sessions.Add(Convert.ToInt32(sIdx), null);
                        }
                    }
                    if (sessions.Count == 0) success = false;
                    break;
            }
            return success;
        }
Ejemplo n.º 4
0
        protected override bool setObjByKey(string handle, string key, object obj)
        {
            bool success = base.setObjByKey(handle, key, obj);

            switch (key)
            {
            case "guid":
                guid = obj.ToString();
                if (guid.Length == 0)
                {
                    success = false;
                }
                break;

            case "time":
                time = Convert.ToUInt32(obj);
                break;

            case "names":
                List <object> dNames = obj as List <object>;
                if (dNames.Count > 0)
                {
                    foreach (object name in dNames)
                    {
                        names.Add(name.ToString());
                    }
                }
                break;

            case "files":
                List <object> dFiles = obj as List <object>;
                if (dFiles.Count > 0)
                {
                    foreach (object file in dFiles)
                    {
                        files.Add(file.ToString());
                    }
                }
                break;

            case "autoSavesCount":
                autoSavesCount = Convert.ToUInt32(obj);
                break;

            case "quickSavesCount":
                quickSavesCount = Convert.ToUInt32(obj);
                break;

            case "sessionIdxs":
                List <object> sessionIdxs = obj as List <object>;
                sessions = new Dictionary <int, Park.ParkSessionData>();
                foreach (object sIdx in sessionIdxs)
                {
                    if (ignoreSessionsOnFirstLoad == false &&
                        (currentSessionOnly == false || (sessionIdx == Convert.ToInt32(sIdx))))
                    {
                        Park.ParkSessionData nSession = new Park.ParkSessionData();
                        nSession.setIdx(guid, Convert.ToInt32(sIdx));
                        sessions.Add(nSession.idx, nSession);
                    }
                    else
                    {
                        sessions.Add(Convert.ToInt32(sIdx), null);
                    }
                }
                if (sessions.Count == 0)
                {
                    success = false;
                }
                break;
            }
            return(success);
        }