Пример #1
0
        public void LoadPingTime()
        {
            string dbFolder = Path.Combine(Environment.CurrentDirectory, "Experiments", mConfig.ExperimentName);
            string file     = "LocalUserStatistics.db";

            CopyWebStatsDB();

            var viewerCfg = new ViewerConfig("MainWindow");

            string dbFile     = Path.Combine(dbFolder, file);
            var    connection = new SQLiteConnection("Data Source=" + dbFile + ";Version=3");

            connection.Open();

            SQLiteDataReader reader;

            //var dataCommand = new SQLiteCommand("SELECT avg_ping FROM stats_session_data WHERE name_f == '" + viewerCfg.LoginFirstName + "' AND name_l == '" + viewerCfg.LoginLastName + "';", connection);
            var dataCommand = new SQLiteCommand("SELECT * FROM stats_session_data WHERE name_f == '" + viewerCfg.LoginFirstName + "' AND name_l == '" + viewerCfg.LoginLastName + "';", connection);

            reader = dataCommand.ExecuteReader();
            while (reader.Read())
            {
                object[] row     = new object[100];
                int      columns = reader.GetValues(row);
                for (int i = 0; i < columns; i++)
                {
                    Console.Write(row[i] + ", ");
                }
                Console.WriteLine();
            }

            connection.Close();
        }
Пример #2
0
        public void Init(Frame frame)
        {
            mFrame  = frame;
            mConfig = new ViewerConfig(frame.Name);

            mViewerController = new ViewerController(mConfig.ViewerToggleHUDKey, mFrame.Name);
            if (mConfig.BackwardsCompatible)
            {
                mProxyController = new BackwardCompatibleController(frame);
            }
            else
            {
                mProxyController = new FullController(frame);
            }
            mProxyController.Offset = mConfig.Offset;

            mExitListener = new Action(mViewerController_Exited);

            mFrame.Core.DeltaUpdated           += new Action <Core, DeltaUpdateEventArgs>(Coordinator_DeltaUpdated);
            mFrame.Core.CameraUpdated          += new Action <Core, CameraUpdateEventArgs>(Coordinator_CameraUpdated);
            mFrame.Core.ControlModeChanged     += new Action <Core, ControlMode>(Coordinator_CameraModeChanged);
            mFrame.Core.EyeUpdated             += new Action <Core, EventArgs>(Coordinator_EyeUpdated);
            mFrame.Core.InitialisationComplete += new Action(Core_InitialisationComplete);
            mFrame.Core.Tick                  += new Action(CheckTimeoutThread);
            mFrame.Changed                    += new Action <Chimera.Frame, EventArgs>(mFrame_Changed);
            mFrame.MonitorChanged             += new Action <Chimera.Frame, Screen>(mFrame_MonitorChanged);
            mProxyController.OnClientLoggedIn += new EventHandler(mProxyController_OnClientLoggedIn);
            mProxyController.PositionChanged  += new Action <Vector3, Rotation>(mProxyController_PositionChanged);
            mViewerController.Exited          += mExitListener;
        }
Пример #3
0
        public void GetMostRecentSessionID()
        {
            string dbFolder = Path.Combine(Environment.CurrentDirectory, "Experiments", mConfig.ExperimentName);
            string file     = "LocalUserStatistics.db";

            CopyWebStatsDB();

            var viewerCfg = new ViewerConfig("MainWindow");

            string dbFile     = Path.Combine(dbFolder, file);
            var    connection = new SQLiteConnection("Data Source=" + dbFile + ";Version=3");

            connection.Open();

            SQLiteDataReader reader;

            //var dataCommand = new SQLiteCommand("SELECT avg_ping FROM stats_session_data WHERE name_f == '" + viewerCfg.LoginFirstName + "' AND name_l == '" + viewerCfg.LoginLastName + "';", connection);
            var dataCommand = new SQLiteCommand("SELECT session_id FROM stats_session_data WHERE name_f == '" + viewerCfg.LoginFirstName + "' AND name_l == '" + viewerCfg.LoginLastName + "';", connection);

            reader = dataCommand.ExecuteReader();
            object[] lastLine = new object[1];
            while (reader.Read())
            {
                int columns = reader.GetValues(lastLine);
            }

            mSessionID = UUID.Parse(lastLine[0].ToString());

            connection.Close();
        }
        public IOutput Create(string name)
        {
            ViewerConfig cfg = new ViewerConfig();
            if (name == cfg.MasterFrame && mPluginController != null && !mPluginAssigned) {
                mPluginAssigned = true;
                return mPluginController;
            }

            return new OpenSimController();
        }
Пример #5
0
        public IOutput Create(string name)
        {
            ViewerConfig cfg = new ViewerConfig();

            if (name == cfg.MasterFrame && mPluginController != null && !mPluginAssigned)
            {
                mPluginAssigned = true;
                return(mPluginController);
            }

            return(new OpenSimController());
        }
        internal ProxyControllerBase(Frame frame)
        {
            mFrame = frame;

            ThisLogger = LogManager.GetLogger("OpenSim." + mFrame.Name + "Proxy");
            mViewerConfig = new ViewerConfig(frame.Name);
            if (mViewerConfig.UseThread) {
                if (CameraThread == null)
                    CameraThread = new ProxyControllerPacketThread(frame.Core, this);
                else
                    CameraThread.AddController(this);
            }

            mAgentUpdateListener = new PacketDelegate(mProxy_AgentUpdatePacketReceived);
            mObjectUpdateListener = new PacketDelegate(mProxy_ObjectUpdatePacketReceived);
        }
        public static void ReplaceSettingsFile(ViewerConfig viewerConfig, string file, ExperimentalConfig config, ILog Logger)
        {
            string filename = Path.GetFileName(file);
            try {
                File.Copy(file, Path.Combine(config.UserSettingsFolder, filename), true);
                Logger.Info("Copied " + file + " to " + config.UserSettingsFolder + ".");
            } catch (IOException e) {
                Logger.Fatal("Unable to copy settings file from stored directory (" + Path.GetDirectoryName(config.SettingsFile) + ") to user settings folder (" + config.UserSettingsFolder + ").", e);
                Environment.Exit(-1);
            }

            if (viewerConfig.ViewerArguments.Contains("--settings")) {
                viewerConfig.ViewerArguments.Replace(@"--settings .*xml", "--settings " + filename);
                //viewerConfig.ViewerArguments = Regex.Replace(viewerConfig.ViewerArguments, @"--settings .*xml", "--settings " + filename);
            } else
                viewerConfig.ViewerArguments += " --settings " + filename;
        }
Пример #8
0
        internal ProxyControllerBase(Frame frame)
        {
            mFrame = frame;

            ThisLogger    = LogManager.GetLogger("OpenSim." + mFrame.Name + "Proxy");
            mViewerConfig = new ViewerConfig(frame.Name);
            if (mViewerConfig.UseThread)
            {
                if (CameraThread == null)
                {
                    CameraThread = new ProxyControllerPacketThread(frame.Core, this);
                }
                else
                {
                    CameraThread.AddController(this);
                }
            }

            mAgentUpdateListener  = new PacketDelegate(mProxy_AgentUpdatePacketReceived);
            mObjectUpdateListener = new PacketDelegate(mProxy_ObjectUpdatePacketReceived);
        }
Пример #9
0
        public void LoadPingTime()
        {
            string dbFolder = Path.Combine(Environment.CurrentDirectory, "Experiments", mConfig.ExperimentName);
            string file = "LocalUserStatistics.db";

            CopyWebStatsDB();

            var viewerCfg = new ViewerConfig("MainWindow");

            string dbFile = Path.Combine(dbFolder, file);
            var connection = new SQLiteConnection("Data Source=" + dbFile + ";Version=3");
            connection.Open();

            SQLiteDataReader reader;

            //var dataCommand = new SQLiteCommand("SELECT avg_ping FROM stats_session_data WHERE name_f == '" + viewerCfg.LoginFirstName + "' AND name_l == '" + viewerCfg.LoginLastName + "';", connection);
            var dataCommand = new SQLiteCommand("SELECT * FROM stats_session_data WHERE name_f == '" + viewerCfg.LoginFirstName + "' AND name_l == '" + viewerCfg.LoginLastName + "';", connection);
            reader = dataCommand.ExecuteReader();
            while (reader.Read()) {
                object[] row = new object[100];
                int columns = reader.GetValues(row);
                for (int i = 0; i < columns; i++)
                    Console.Write(row[i] + ", ");
                Console.WriteLine();
            }

            connection.Close();
        }
Пример #10
0
        public void GetMostRecentSessionID()
        {
            string dbFolder = Path.Combine(Environment.CurrentDirectory, "Experiments", mConfig.ExperimentName);
            string file = "LocalUserStatistics.db";
            CopyWebStatsDB();

            var viewerCfg = new ViewerConfig("MainWindow");

            string dbFile = Path.Combine(dbFolder, file);
            var connection = new SQLiteConnection("Data Source=" + dbFile + ";Version=3");
            connection.Open();

            SQLiteDataReader reader;

            //var dataCommand = new SQLiteCommand("SELECT avg_ping FROM stats_session_data WHERE name_f == '" + viewerCfg.LoginFirstName + "' AND name_l == '" + viewerCfg.LoginLastName + "';", connection);
            var dataCommand = new SQLiteCommand("SELECT session_id FROM stats_session_data WHERE name_f == '" + viewerCfg.LoginFirstName + "' AND name_l == '" + viewerCfg.LoginLastName + "';", connection);
            reader = dataCommand.ExecuteReader();
            object[] lastLine = new object[1];
            while (reader.Read()) {
                int columns = reader.GetValues(lastLine);
            }

            mSessionID = UUID.Parse(lastLine[0].ToString());

            connection.Close();
        }
Пример #11
0
        public void Init(Frame frame)
        {
            mFrame = frame;
            mConfig = new ViewerConfig(frame.Name);

            mViewerController = new ViewerController(mConfig.ViewerToggleHUDKey, mFrame.Name);
            if (mConfig.BackwardsCompatible)
                mProxyController = new BackwardCompatibleController(frame);
            else
                mProxyController = new FullController(frame);
            mProxyController.Offset = mConfig.Offset;

            mExitListener = new Action(mViewerController_Exited);

            mFrame.Core.DeltaUpdated += new Action<Core, DeltaUpdateEventArgs>(Coordinator_DeltaUpdated);
            mFrame.Core.CameraUpdated += new Action<Core, CameraUpdateEventArgs>(Coordinator_CameraUpdated);
            mFrame.Core.ControlModeChanged += new Action<Core, ControlMode>(Coordinator_CameraModeChanged);
            mFrame.Core.EyeUpdated += new Action<Core, EventArgs>(Coordinator_EyeUpdated);
            mFrame.Core.InitialisationComplete += new Action(Core_InitialisationComplete);
            mFrame.Changed += new Action<Chimera.Frame, EventArgs>(mFrame_Changed);
            mFrame.MonitorChanged += new Action<Chimera.Frame, Screen>(mFrame_MonitorChanged);
            mProxyController.OnClientLoggedIn += new EventHandler(mProxyController_OnClientLoggedIn);
            mProxyController.PositionChanged += new Action<Vector3, Rotation>(mProxyController_PositionChanged);
            mViewerController.Exited += mExitListener;
        }
Пример #12
0
 public FullController(Frame frame)
     : base(frame)
 {
     mAllowFly = new ViewerConfig().AllowFly;
 }