예제 #1
0
    //---------------------------------------------------------------------
    public EcEngine(ref EcEngineSettings settings, IEcEngineListener listener)
    {
        mInstance = this;
        mListener = listener;
        Settings  = settings;

        mEntityMgr = new EntityMgr(1, "Client");

        mEntityMgr.regComponent <ClientAutoPatcher <DefAutoPatcher> >();
        mEntityMgr.regComponent <ClientNode <DefNode> >();
        mEntityMgr.regComponent <ClientSuperSocket <DefSuperSocket> >();

        mEntityMgr.regEntityDef <EtAutoPatcher>();
        mEntityMgr.regEntityDef <EtNode>();
        mEntityMgr.regEntityDef <EtSuperSocket>();

        EtNode = mEntityMgr.createEntity <EtNode>(null, null);
        var co_node = EtNode.getComponent <ClientNode <DefNode> >();

        CoSuperSocket = co_node.CoSuperSocket;

        // 通知业务层初始化
        if (mListener != null)
        {
            mListener.init(mEntityMgr, EtNode);
        }
    }
예제 #2
0
파일: EcEngine.cs 프로젝트: yinlei/GF.Core
    //---------------------------------------------------------------------
    public EcEngine(ref EcEngineSettings settings, IEcEngineListener listener)
    {
        mInstance = this;
        mListener = listener;
        Settings = settings;

        mEntityMgr = new EntityMgr(1, "Client");

        mEntityMgr.regComponent<ClientAutoPatcher<DefAutoPatcher>>();
        mEntityMgr.regComponent<ClientNode<DefNode>>();
        mEntityMgr.regComponent<ClientSuperSocket<DefSuperSocket>>();

        mEntityMgr.regEntityDef<EtAutoPatcher>();
        mEntityMgr.regEntityDef<EtNode>();
        mEntityMgr.regEntityDef<EtSuperSocket>();

        EtNode = mEntityMgr.createEntity<EtNode>(null, null);
        var co_node = EtNode.getComponent<ClientNode<DefNode>>();
        CoSuperSocket = co_node.CoSuperSocket;

        // 通知业务层初始化
        if (mListener != null)
        {
            mListener.init(mEntityMgr, EtNode);
        }
    }
예제 #3
0
    //---------------------------------------------------------------------
    public EcEngine(ref EcEngineSettings settings, IEcEngineListener listener)
    {
        mInstance = this;
        mListener = listener;
        Settings  = settings;

        mEntityMgr = new EntityMgr(1, "Client");

        mEntityMgr.setRpcSessionFactory(new RpcSessionFactoryTcpClient());

        //mEntityMgr.regComponent<ClientAutoPatcher<DefAutoPatcher>>();
        //mEntityMgr.regComponent<ClientNode<DefNode>>();

        //mEntityMgr.regEntityDef<EtAutoPatcher>();
        //mEntityMgr.regEntityDef<EtNode>();

        //EtNode = mEntityMgr.createEntity<EtNode>(null, null);
        //var co_node = EtNode.getComponent<ClientNode<DefNode>>();

        //// 通知业务层初始化
        //if (mListener != null)
        //{
        //    mListener.init(mEntityMgr, EtNode);
        //}
    }
예제 #4
0
파일: EcEngine.cs 프로젝트: yinlei/Fishing
    //---------------------------------------------------------------------
    public EcEngine(ref EcEngineSettings settings, IEcEngineListener listener)
    {
        mInstance = this;
        mListener = listener;
        Settings = settings;

        mEntityMgr = new EntityMgr(1, "Client");

        mEntityMgr.setRpcSessionFactory(new RpcSessionFactoryTcpClient());

        mEntityMgr.regComponent<ClientAutoPatcher<DefAutoPatcher>>();
        mEntityMgr.regComponent<ClientNode<DefNode>>();

        mEntityMgr.regEntityDef<EtAutoPatcher>();
        mEntityMgr.regEntityDef<EtNode>();

        EtNode = mEntityMgr.createEntity<EtNode>(null, null);
        var co_node = EtNode.getComponent<ClientNode<DefNode>>();

        // 通知业务层初始化
        if (mListener != null)
        {
            mListener.init(mEntityMgr, EtNode);
        }
    }