示例#1
0
        public override bool Init()
        {
            Log.Debug("SiloNetWork Init");
            var gameconfig = GameModuleManager.Instance.GetModule <ConfigManager>().GameConfig;

            m_ServerNetWork = new ServerNetWork(NetworkProtocol.TCP, gameconfig.NetWorkIp);
            m_ServerNetWork.MessagePacker = new Protobuf3Packer();


            var opCodeTypeBv = new OpCodeTypeBv();

            m_ServerNetWork.IOpCodeType = opCodeTypeBv;
            m_ServerNetWork.AddIBehaviour(opCodeTypeBv);


            var messageDispatherBv = new RpcMessageDispatherBv();

            m_ServerNetWork.AddIBehaviour(messageDispatherBv);
            m_ServerNetWork.IMessageDispatcher = messageDispatherBv;



            m_ServerNetWork.Init();


            //opCodeTypeBv.Load(GetType().Assembly);
            opCodeTypeBv.Load(typeof(IHall.IHello).Assembly);
            messageDispatherBv.Load(GetType().Assembly);



            return(base.Init());
        }
示例#2
0
        public override bool Init()
        {
            Log.Debug("SiloNetWork Init");
            m_ServerNetWork = new ServerNetWork(NetworkProtocol.TCP, "127.0.0.1:2010");
            m_ServerNetWork.MessagePacker = new Protobuf3Packer();


            var opCodeTypeBv = new OpCodeTypeBv();

            m_ServerNetWork.AddIBehaviour(opCodeTypeBv);

            var messageDispatherBv = new MessageDispatherBv();

            m_ServerNetWork.AddIBehaviour(messageDispatherBv);

            m_ServerNetWork.Init();


            //opCodeTypeBv.Load(GetType().Assembly);
            opCodeTypeBv.Load(typeof(IHall.IHello).Assembly);
            messageDispatherBv.Load(GetType().Assembly);



            return(base.Init());
        }