Ejemplo n.º 1
0
    private void SetTransform(int i)
    {
        index = i;
        ReplayRecord replayRecord = replayRecords[index];

        transform.position = replayRecord.position;
    }
Ejemplo n.º 2
0
 public ReplayVars(ReplayRecord replay)
 {
     movementVector = replay.movementVector;
     inputs         = replay.inputs;
     switches       = replay.switches;
     bag            = replay.bag;
 }
Ejemplo n.º 3
0
    /**
     * @brief Returns the related {@link ReplayRecord}.
     **/
    public ReplayRecord Load()
    {
        if (replayRecord == null)
        {
            replayRecord = ReplayUtils.GetReplayRecord(fileFullName);
        }

        return(replayRecord);
    }
Ejemplo n.º 4
0
    public static void SaveReplay(ReplayRecord replayRecord, string saveName)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Path.Combine(Application.persistentDataPath, "replay-" + saveName + ".clg");
        FileStream      stream    = new FileStream(path, FileMode.Create);

        ReplayVars data = new ReplayVars(replayRecord);

        formatter.Serialize(stream, data);
        stream.Close();
    }
        /// <summary>
        /// CheckForReplay method implementation
        /// </summary>
        public bool Check(List <string> servernames, ReplayRecord record)
        {
            bool tempresult = false;

            try
            {
                lock (_lock)
                {
                    tempresult = _manager.AddToReplay(record);
                    if (tempresult)
                    {
                        if ((record.MustDispatch) && (servernames != null))
                        {
                            foreach (string fqdn in servernames)
                            {
                                ReplayClient replaymanager = new ReplayClient();
                                try
                                {
                                    replaymanager.Initialize(fqdn);
                                    IReplay client = replaymanager.Open();

                                    try
                                    {
                                        record.MustDispatch = false;
                                        tempresult          = client.Check(servernames, record);
                                    }
                                    catch (Exception e)
                                    {
                                        _log.WriteEntry(string.Format("Error on Check Remote Service method : {0} => {1}.", fqdn, e.Message), EventLogEntryType.Error, 1011);
                                    }
                                    finally
                                    {
                                        replaymanager.Close(client);
                                    }
                                }
                                catch (Exception e)
                                {
                                    _log.WriteEntry(string.Format("Error on Check Remote Service method : {0} => {1}.", fqdn, e.Message), EventLogEntryType.Error, 1011);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                _log.WriteEntry(string.Format("Error on Check Service method : {0}.", e.Message), EventLogEntryType.Error, 1010);
            }
            return(tempresult);
        }
Ejemplo n.º 6
0
    /**
     * @brief Returns a instance of {@from ReplayRecord} saved in the provided file location.
     **/
    public static ReplayRecord GetReplayRecord(string fileFullName)
    {
        ReplayRecord replay = null;

        #if !UNITY_WEBPLAYER
        try {
            byte[] replayContent = File.ReadAllBytes(fileFullName);
            replay = ReplayRecord.GetReplayRecord(replayContent);
        } catch (Exception) {
        }
        #endif

        return(replay);
    }
        /// <summary>
        /// AddToReplay method implementation
        /// </summary>
        internal bool AddToReplay(ReplayRecord record)
        {
            bool exist = false;

            try
            {
                if (record.ReplayLevel == ReplayLevel.Disabled)
                {
                    return(true);
                }
                else if (record.ReplayLevel == ReplayLevel.Intermediate)
                {
                    lock (_lock)
                    {
                        exist = _lst.Exists(s => (s.UserName.ToLower().Equals(record.UserName.ToLower())) && (s.Code == record.Code) && (!s.UserIPAdress.Equals(record.UserIPAdress)));
                        if (!exist)
                        {
                            _lst.Add(record);
                        }
                        return(!exist);
                    }
                }
                else if (record.ReplayLevel == ReplayLevel.Full)
                {
                    lock (_lock)
                    {
                        exist = _lst.Exists(s => (s.UserName.ToLower().Equals(record.UserName.ToLower())) && (s.Code == record.Code));
                        if (!exist)
                        {
                            _lst.Add(record);
                        }
                        return(!exist);
                    }
                }
            }
            catch (Exception ex)
            {
                _log.WriteEntry(string.Format("error on replay registration method : {0}.", ex.Message), EventLogEntryType.Error, 1012);
            }
            return(false);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Continue method iplementation
        /// </summary>
        public static bool Check(List <string> computers, ReplayRecord record)
        {
            ReplayClient manager = new ReplayClient();

            manager.Initialize();
            try
            {
                IReplay client = manager.Open();
                try
                {
                    return(client.Check(computers, record));
                }
                finally
                {
                    manager.Close(client);
                }
            }
            finally
            {
                manager.UnInitialize();
            }
        }
Ejemplo n.º 9
0
 public void Add(ReplayRecord rep)
 {
     replayRecords.Add(rep);
 }
Ejemplo n.º 10
0
 public void Ekle(ReplayRecord rec)
 {
     replay_records.Add(rec);
 }
Ejemplo n.º 11
0
 public void Add(ReplayRecord rec)
 {
     m_replayRecords.Add(rec);
 }