Пример #1
0
        public User(IConnection connection, int userID, string name, GameEngine engine, bool isIronPythonEnabled)
        {
            m_connection = connection;
            this.UserID = userID;
            this.Name = name;
            m_engine = engine;
            trace.Header = String.Format("User({0}/{1})", this.Name, this.UserID);

            if (isIronPythonEnabled)
            {
                // XXX creating IP engine takes some time. Do it in the background. Race condition with IP msg handlers
                m_ipStartTask = Task.Run(() =>
                {
                    m_ipRunner = new IPRunner(this, m_engine);
                    m_ipStartTask = null;
                });
            }
        }
Пример #2
0
        public User(IConnection connection, int userID, string name, GameEngine engine, bool isIronPythonEnabled)
        {
            m_connection = connection;
            this.UserID  = userID;
            this.Name    = name;
            m_engine     = engine;
            trace.Header = String.Format("User({0}/{1})", this.Name, this.UserID);

            if (isIronPythonEnabled)
            {
                // XXX creating IP engine takes some time. Do it in the background. Race condition with IP msg handlers
                m_ipStartTask = Task.Run(() =>
                {
                    m_ipRunner    = new IPRunner(this, m_engine);
                    m_ipStartTask = null;
                });
            }
        }
Пример #3
0
        void Construct()
        {
            trace.Header = String.Format("Player({0})", this.UserID);

            // XXX creating IP engine takes some time. Do it in the background. Race condition with IP msg handlers
            System.Threading.Tasks.Task.Factory.StartNew(delegate
            {
                m_ipRunner = new IPRunner(m_world, m_engine, this);
            });

            if (m_seeAll)
                m_changeHandler = new AdminChangeHandler(this);
            else
                m_changeHandler = new PlayerChangeHandler(this);
        }