Пример #1
0
        protected override void OnClientDisconnect(object sender, EventArgs e)
        {
            HomeProxy home = (HomeProxy)sender;

            if (home.ID != 0)
            {
                Console.WriteLine("Gs {0} disconnected from Provider", home.ID);
            }
        }
Пример #2
0
 protected override void OnListen()
 {
     while (true)
     {
         Socket              rcli     = TCP.AcceptSocket();
         NetIORemoteClient   remote   = new NetIORemoteClient(rcli);
         NetIOProviderClient provider = new NetIOProviderClient(CIPE);
         HomeProxy           home     = new HomeProxy(0, remote, provider);
         home.OnDisconnect += OnClientDisconnect;
         home.OnGsSendUser += OnGsSendUser;
         home.Connect();
     }
 }
Пример #3
0
    public override void Execute(INotification notification)
    {
        HomeProxy homeProxy = Facade.RetrieveProxy(HomeProxy.NAME) as HomeProxy;

        if (notification.Type == "GetHouse")
        {
            Order order = notification.Body as Order;

            foreach (var item in order.menus)
            {
                if (item.iselected)
                {
                    if (homeProxy.GetHouse(item.id) == null)
                    {
                        Debug.LogError("对不起您要住的房间客满");
                    }
                    else
                    {
                        HomeItem home = homeProxy.GetHouse(item.id);
                        home.state = 1;
                        SendNotification(OrderSystemEvent.ReFreshHouseitem, home);
                    }
                }
            }
        }
        if (notification.Type == "Plus")
        {
            HomeItem home = (HomeItem)notification.Body;
            home.state++;
            SendNotification(OrderSystemEvent.ReFreshHouseitem, home);
        }
        if (notification.Type == "Over")
        {
            HomeItem home = (HomeItem)notification.Body;
            home.state = 0;
            SendNotification(OrderSystemEvent.ReFreshHouseitem, home);
        }
    }
Пример #4
0
 public override void OnRegister()
 {
     base.OnRegister();
     _homeProxy = Facade.RetrieveProxy(HomeProxy.NAME) as HomeProxy;
 }
Пример #5
0
        public override void Process()
        {
            HomeProxy home = (HomeProxy)Session;

            home.SendToUser(RoleID, this.Marshal());
        }
Пример #6
0
 public G14FFHomeSceneElements(Octets os, HomeProxy home) : base(0x14ff, os, home)
 {
 }