Esempio n. 1
0
        public GameRoom(string id, IPEndPoint localEP, IRoomOwner owner, IEngine engine = null) : base(id, localEP, owner)
        {
            Room_Type = RoomType.rtGameRoom;

            Reciever = new ReceiverUdpClientBased(localEP);
            base.RegisterDependcy(Reciever);

            Sender = new SenderUdpClientBased(Reciever);

            IEngine _Engine;

            if (engine != null)
            {
                _Engine = engine;
            }
            else
            {
                _Engine = (new ServerEngineFabric()).CreateEngine(SrvEngineType.srvGameEngine);
            }
            base.RegisterDependcy(_Engine);

            MessageQueue = (new MessageQueueFabric()).CreateMessageQueue(MsgQueueType.mqByTimerProcc);
            base.RegisterDependcy(MessageQueue);

            //OnRoomNetProcessorStarted += this.Engine.OnNetProcStarted_EventHandler;
        }
Esempio n. 2
0
        public ManagingRoom(string id, IPEndPoint localEP, IRoomOwner owner, IEngine engine = null) : base(id, localEP, owner)
        {
            Room_Type = RoomType.rtMngRoom;

            IReciever _Reciever = new ReceiverUdpClientBased(localEP);

            base.RegisterDependcy(_Reciever);

            Sender = new SenderUdpClientBased(Reciever);

            IEngine _Engine;

            if (engine != null)
            {
                _Engine = engine;
            }
            else
            {
                _Engine = (new ServerEngineFabric()).CreateEngine(SrvEngineType.srvManageEngine);
            }
            base.RegisterDependcy(_Engine);

            IMessageQueue _MessageQueue = (new MessageQueueFabric()).CreateMessageQueue(MsgQueueType.mqOneByOneProcc);

            base.RegisterDependcy(_MessageQueue);
        }