示例#1
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);
        }
示例#2
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;
        }
示例#3
0
        //взять этот за основу НУЖЕН НОВЫЙ КОНСТРУКТОР!!!!
        public GameClient(IPEndPoint localEP, IRoomOwner owner = null)
        {
            this.miliseconds  = 500;
            this.adresee_list = new Dictionary <string, IAddresssee>();
            this.tcp          = new TcpClient(localEP);
            this.package      = new Package();

            IReciever _Reciever = new ReceiverUdpClientBased(localEP);

            base.RegisterDependcy(_Reciever);
            base.Sender = new SenderUdpClientBased(Reciever);

            IEngine _Engine = new ClientEngine();

            // Нужно будет прописать создание клиентского Engine
            //IEngine _Engine =  (new ServerEngineFabric()).CreateEngine(SrvEngineType.srvManageEngine);
            base.RegisterDependcy(_Engine);

            //entity = _engine.Entity;

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

            base.RegisterDependcy(_MessageQueue);
        }