コード例 #1
0
ファイル: User.cs プロジェクト: tomba/dwarrowdelf
        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
ファイル: User.cs プロジェクト: jaenudin86/dwarrowdelf
        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
ファイル: Player.cs プロジェクト: Fulborg/dwarrowdelf
        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);
        }