Пример #1
0
    //兑换回调
    public void receiveGift(MessageHandle msg)
    {
        if (msg.msgEvent == msg_event.dialogOK)
        {
            ExchangeSample sample = (msg.msgInfo as Exchange).getExchangeSample();

            string need = "";
            if (sample.conditions[0].Length > 0)
            {
                for (int i = 0; i < sample.conditions[0].Length; i++)
                {
                    need += sample.conditions [0][i].getName() + "x" + msg.msgNum * sample.conditions[0] [i].num + "\n";
                }
            }


            string target = sample.getExhangeItemName() + "x " + msg.msgNum * sample.num;
            string info   = LanguageConfigManager.Instance.getLanguage("s0130", need, target);

            UiManager.Instance.openDialogWindow <MessageWindow> ((win) => {
                win.dialogCloseUnlockUI = false;
                win.initWindow(2, LanguageConfigManager.Instance.getLanguage("s0094"), LanguageConfigManager.Instance.getLanguage("s0093"), info, sureExchange);
            });
            tmpMsg = msg;
        }
    }
Пример #2
0
        public async Task UpdateNotification(Deployment deployment)
        {
            if (deployment == null)
            {
                throw new ArgumentNullException(nameof(deployment));
            }

            var deploymentNotificationDao = await _deploymentNotificationRepository.Query()
                                            .FirstOrDefaultAsync(x => x.DeploymentId == deployment.Id);

            if (deploymentNotificationDao != null)
            {
                var handle = new MessageHandle(deploymentNotificationDao.SlackMessageId);

                try
                {
                    _log.LogInformation("Submitting {@DeploymentUpdate} notification change to slack {@MessageHandle}. ", deployment, handle);
                    var notification = _deploymentNotificationBuilder.BuildNotification(deployment);
                    var newHandle    = await _slackClient.UpdateMessageAsync(handle, notification);

                    // NotificationHandles.TryUpdate(deployment.Id, newHandle, handle);
                }
                catch (Exception e)
                {
                    _log.LogError(e, "Failed to submit {@DeploymentUpdate} notification {@MessageHandle}", deployment, handle);
                }
            }
            else
            {
                _log.LogCritical("We received an UpdateNotification operation for deployment {DeploymentId} of {Image}:{Tag} but didn't find it in Db",
                                 deployment.Id,
                                 deployment.ImageRepository,
                                 deployment.TargetTag);
            }
        }
Пример #3
0
 private void dtpTime_ValueChanged(object sender, EventArgs e)
 {
     if (!_bClearForm)
     {
         string grade = "4";
         if (chkLunar.Checked)
         {
             try
             {
                 ChineseCalendarInfo cCalendar = ChineseCalendarInfo.FromLunarDate(dtpTime.Value, false);
                 tooltipTime.SetToolTip(dtpTime, "对应太阳历:" + cCalendar.SolarDate.ToShortDateString());
                 grade = BusAdminDaily.CalculateGrade(cCalendar.SolarDate.Add(new TimeSpan(dtpTime.Value.Hour, dtpTime.Value.Minute, dtpTime.Value.Second)));
             }
             catch (Exception ex)
             {
                 MessageHandle.MessageError("错误:" + ex.Message + "!", "错误信息");
                 dtpTime.Focus();
             }
         }
         else
         {
             grade = BusAdminDaily.CalculateGrade(dtpTime.Value);
         }
         cboLevel.SelectedValue = grade;
         if (grade == "4")
         {
             MessageHandle.MessageWarnning("事务时间已过期!", "警告信息");
             dtpTime.Focus();
         }
     }
 }
Пример #4
0
    private void windowBack(MessageHandle msg)
    {
        UiManager.Instance.openDialogWindow <PvpUseWindow> ((win) => {
            win.initInfo(atract, null);
        });
//		updateWindow ();
    }
Пример #5
0
 private void btnAbandonModifyDefault_Click(object sender, EventArgs e)
 {
     if (MessageHandle.MessageAsk("确定要放弃该操作?", "确定放弃") == DialogResult.OK)
     {
         LoadDefault();
     }
 }
Пример #6
0
 private void heroEat(MessageHandle msg)
 {
     if (msg.buttonID == MessageHandle.BUTTON_RIGHT)
     {
         heroEat(totalPveMax - UserManager.Instance.self.getPvEPoint());
     }
 }
Пример #7
0
 void useBack(MessageHandle msg)
 {
     if (msg.msgEvent == msg_event.dialogOK)
     {
         useProp(msg.msgNum);
     }
 }
Пример #8
0
 //去充值
 private void gotoShop(MessageHandle msg)
 {
     if (msg.buttonID == MessageHandle.BUTTON_RIGHT)
     {
         UiManager.Instance.openWindow <rechargeWindow> ();
     }
 }
Пример #9
0
    /** 执行经验转化 */
    private void  DoExchangeExp()
    {
        StarSoulManager manager = StarSoulManager.Instance;
        string          str     = StarSoulManager.Instance.getExchangeExpStateString();

        if (string.IsNullOrEmpty(str))
        {
            MaskWindow.UnlockUI();
            return;
        }
        bool isState = manager.isStarSoulStateByChangeDic(EquipStateType.LOCKED);

        if (isState)
        {
            UiManager.Instance.openDialogWindow <MessageWindow> ((win) => {
                win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0094"), null, LanguageConfigManager.Instance.getLanguage("StarSoulWindow_storeContent_changeState"), null);
            });
            return;
        }
        bool isQuality = manager.isStarSoulQualityByChangeDic(QualityType.EPIC);

        if (isQuality)
        {
            UiManager.Instance.openDialogWindow <MessageWindow> ((win) => {
                win.initWindow(2, LanguageConfigManager.Instance.getLanguage("s0094"), LanguageConfigManager.Instance.getLanguage("s0093"), LanguageConfigManager.Instance.getLanguage("StarSoulWindow_storeContent_changeQuality"), doExchangeQualityBack);
            });
            return;
        }
        MessageHandle msg = new MessageHandle();

        msg.buttonID = MessageHandle.BUTTON_RIGHT;
        // 与服务器通讯
        doExchangeQualityBack(msg);
    }
Пример #10
0
    private void building(MessageHandle msg)
    {
        if (msg.buttonID == MessageHandle.BUTTON_LEFT || buildSample == null)
        {
            MaskWindow.UnlockUI();
            return;
        }

        buildLevel = instance.getBuildLevel(buildSample.sid.ToString());

        //建筑存在就升级没有就创建
        if (buildLevel > 0)
        {
            GuildUpgradeBuildFPort fport = FPortManager.Instance.getFPort("GuildUpgradeBuildFPort") as GuildUpgradeBuildFPort;
            fport.access(buildSample.sid.ToString(), buildSample.costs[buildLevel], () => {
                GuildManagerment.Instance.updateGuildInfo(() => {
                    content.updateAllItems();
                    updateInfo(buildSample);
                });
            });
        }
        else
        {
            GuildCreateBuildFPort fport = FPortManager.Instance.getFPort("GuildCreateBuildFPort") as GuildCreateBuildFPort;
            fport.access(buildSample.sid.ToString(), buildSample.costs[buildLevel], () => {
                GuildManagerment.Instance.updateGuildInfo(() => {
                    content.updateAllItems();
                    updateInfo(buildSample);
                });
            });
        }
    }
Пример #11
0
 public void msgBack(MessageHandle msg)
 {
     if (HeroRoadManagerment.Instance.isOpenHeroRoad(sample.prizes))
     {
         UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("HeroRoad_open"));
     }
 }
Пример #12
0
    public GameObject stars;                   //星星

    public void buy(MessageHandle msg)
    {
//		if (msg.msgEvent == msg_event.dialogCancel)
//			return;
//		goods = msg.msgInfo as Goods;
        if (intoType == ContentShopGoods.TEHUI_SHOP)
        {
            if (UserManager.Instance.self.getRMB() < goods.getCostPrice())
            {
                UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                    win.dialogCloseUnlockUI = false;
                    win.initWindow(2, Language("s0094"), Language("s0324"), LanguageConfigManager.Instance.getLanguage("s0158"), (msg1) => {
                        if (msg1.msgEvent == msg_event.dialogOK)
                        {
                            UiManager.Instance.openWindow <rechargeWindow>();
                        }
                        else
                        {
                            MaskWindow.UnlockUI();
                        }
                    });
                });
            }
            else
            {
                BuyGoodsFPort fport = FPortManager.Instance.getFPort("BuyGoodsFPort") as BuyGoodsFPort;
                fport.buyGoods(goods.sid, 1, buyCallBack);               //(msg.msgInfo as Goods).sid, msg.msgNum, buyCallBack);
            }
        }
    }
Пример #13
0
    public void goToLimitSoulHuntWindow(MessageHandle msg)
    {
        if (msg.buttonID == MessageHandle.BUTTON_RIGHT)
        {
            return;
        }

        UiManager.Instance.openWindow <NoticeWindow> ((win) => {
            if (isSoulHuntActiveForLIMITSOULHUNT_1() && !isSoulHuntActiveForLIMITSOULHUNT_2())
            {
                win.entranceId = NoticeSampleManager.Instance.getNoticeSampleBySid(CommandConfigManager.Instance.getKuaFuSoulHunt()).entranceId;
                win.updateSelectButton(CommandConfigManager.Instance.getKuaFuSoulHunt());
            }
            else if (!isSoulHuntActiveForLIMITSOULHUNT_1() && isSoulHuntActiveForLIMITSOULHUNT_2())
            {
                win.entranceId = NoticeSampleManager.Instance.getNoticeSampleBySid(CommandConfigManager.Instance.getBenDiSoulHunt()).entranceId;
                win.updateSelectButton(CommandConfigManager.Instance.getBenDiSoulHunt());
            }
            else if (isSoulHuntActiveForLIMITSOULHUNT_1() && isSoulHuntActiveForLIMITSOULHUNT_2())
            {
                win.entranceId = NoticeSampleManager.Instance.getNoticeSampleBySid(CommandConfigManager.Instance.getKuaFuSoulHunt()).entranceId;
                win.updateSelectButton(CommandConfigManager.Instance.getKuaFuSoulHunt());
            }
        });
    }
Пример #14
0
 private void loginOut(MessageHandle msg)
 {
     if (GameManager.Instance != null)
     {
         GameManager.Instance.OnLostConnect(false);
     }
 }
Пример #15
0
 private void btnDel_All_Click(object sender, EventArgs e)
 {
     if (dgvAll.SelectedRows.Count > 0)
     {
         DataGridViewSelectedRowCollection selectedRows = dgvAll.SelectedRows;
         if (selectedRows[0].Cells["colRemindFlag_ALL"].Value.ToString() == "未处理" && MessageHandle.MessageAsk("注意:该日程还没执行!\n确定要删除该日程事务?", "确定删除") == DialogResult.OK)
         {
             BusAdminDaily.DeleteDailyById(selectedRows[0].Cells[0].Value.ToString());
             if (_dailyEntity != null && _dailyEntity.ID == selectedRows[0].Cells[0].Value.ToString())
             {
                 _dailyEntity = null;
                 ClearForm();
             }
             dgvAll.Rows.Remove(selectedRows[0]);
             MessageHandle.MessageInfo("恭喜,删除成功!", "提示信息");
         }
         else if (selectedRows[0].Cells["colRemindFlag_ALL"].Value.ToString() == "已处理" && MessageHandle.MessageAsk("确定要删除该日程事务?", "确定删除") == DialogResult.OK)
         {
             BusAdminDaily.DeleteDailyById(selectedRows[0].Cells[0].Value.ToString());
             if (_dailyEntity != null && _dailyEntity.ID == selectedRows[0].Cells[0].Value.ToString())
             {
                 _dailyEntity = null;
                 ClearForm();
             }
             dgvAll.Rows.Remove(selectedRows[0]);
             MessageHandle.MessageInfo("恭喜,删除成功!", "提示信息");
         }
     }
 }
Пример #16
0
 /// <summary>
 /// 打开VIP窗口
 /// </summary>
 private void openVipWindow(MessageHandle msg)
 {
     if (msg.buttonID == MessageHandle.BUTTON_RIGHT)
     {
         UiManager.Instance.openWindow <VipWindow> ();
     }
 }
Пример #17
0
 public void update(MessageHandle msg)
 {
     if (intoType == RMBSHOP)
     {
         //如果 达到可买的最大值 需要刷新商品列表
         (fatherWindow as ShopWindow).UpdateContent();
         if (goods.getNowBuyNum() >= goods.getGoodsMaxBuyCount())
         {
             (fatherWindow as ShopWindow).UpdateContent();
             return;
         }
     }
     else if (intoType == GUILDSHOP)
     {
         //刷新工会商品列表
         (fatherWindow as GuildShopWindow).updateShop();
     }
     else if (intoType == SUPERDRAWSHOP)
     {
         //刷新超级奖池兑换列表
         (fatherWindow as SuperDrawShopWindow).updateShop();
     }
     else if (intoType == GODSWARSHOP)
     {
         //刷新战争商店兑换列表
         (fatherWindow as GodsWarShopWindow).updateShop();
     }
     else if (intoType == HEROSYMBOL_SHOP)
     {
         (fatherWindow as HuiJiShopWindow).updateShop();
     }
     else if (intoType == MERIT_SHOP)
     {
         (fatherWindow as MeritShopWindow).updateInfo();
         if (goods.getNowBuyNum() >= goods.getGoodsMaxBuyCount())
         {
             (fatherWindow as MeritShopWindow).reloadShop();
             return;
         }
     }
     else if (intoType == STARSOUL_DEBRIS_SHOP)
     {
         (fatherWindow as StarSoulDebrisShopWindow).updateInfo();
         if (goods.getNowBuyNum() >= goods.getGoodsMaxBuyCount())
         {
             (fatherWindow as StarSoulDebrisShopWindow).reloadShop();
             return;
         }
     }
     else if (intoType == LASTBATTLESHOP)
     {
         (fatherWindow as LastBattleShopWindow).updateInfo();
     }
     else if (intoType == STARSHOP)
     {
         (fatherWindow as StarShopWindow).updateInfo();
     }
     updateGoods(goods, shopUpdate, intoType);
 }
Пример #18
0
    // ===========================================================

    public int RegisterMessageHandleWithId(string messageType, ulong id, MessageHandle handle)
    {
        if (m_useNewMsgDis)
        {
            return(this.RegMsgWithId(messageType, id, handle));
        }
        return(0);
    }
Пример #19
0
 /**更新奖励物品信息 */
 private void M_onMessageHandler(MessageHandle msg)
 {
     if (msg.buttonID == MessageHandle.BUTTON_LEFT)
     {
         return;
     }
     SweepManagement.Instance.initSweepAwardInfo();
 }
Пример #20
0
 /// <summary>
 /// 关闭购买提示窗口
 /// </summary>
 /// <param name="msg">Message.</param>
 private void closeBuyCard_MessageWindown(MessageHandle msg)
 {
     if (msg.buttonID == MessageHandle.BUTTON_RIGHT)
     {
         NoticeMonthCardFPort sp = FPortManager.Instance.getFPort("NoticeMonthCardFPort") as NoticeMonthCardFPort;
         sp.access_buy(onBuyCmp, tempSid);
     }
 }
Пример #21
0
 private void recharge(MessageHandle msg)
 {
     if (msg.buttonID == MessageHandle.BUTTON_LEFT)
     {
         return;
     }
     UiManager.Instance.openWindow <rechargeWindow>();
 }
Пример #22
0
 public int RegisterMessageHandle(string messageType, MessageHandle handle)
 {
     if (m_useNewMsgDis)
     {
         return(this.RegMsg(messageType, handle));
     }
     return(0);
 }
Пример #23
0
    public const int STARSHOP       = 27;       // 星屑商店//

    public void buy(MessageHandle msg)
    {
        if (msg.msgEvent == msg_event.dialogCancel)
        {
            return;
        }
        goods = msg.msgInfo as Goods;
        if (intoType == RMBSHOP)
        {
            BuyGoodsFPort fport = FPortManager.Instance.getFPort("BuyGoodsFPort") as BuyGoodsFPort;
            fport.buyGoods((msg.msgInfo as Goods).sid, msg.msgNum, buyCallBack);
        }
        else if (intoType == GUILDSHOP)
        {
            GuildShopBuyFPort fport = FPortManager.Instance.getFPort("GuildShopBuyFPort") as GuildShopBuyFPort;
            fport.access((msg.msgInfo as Goods).sid, msg.msgNum, buyCallBack);
        }
        else if (intoType == MERIT_SHOP)
        {
            BuyGoodsFPort fport = FPortManager.Instance.getFPort("BuyGoodsFPort") as BuyGoodsFPort;
            fport.buyGoods((msg.msgInfo as Goods).sid, msg.msgNum, buyCallBack);
        }
        else if (intoType == STARSOUL_DEBRIS_SHOP)
        {
            BuyGoodsFPort fport = FPortManager.Instance.getFPort("BuyGoodsFPort") as BuyGoodsFPort;
            fport.buyGoods((msg.msgInfo as Goods).sid, msg.msgNum, ShopType.STARSOUL_DEBRIS, buyCallBack);
        }
        else if (intoType == LADDER_HEGOMENOY)
        {
            BuyGoodsFPort fport = FPortManager.Instance.getFPort("BuyGoodsFPort") as BuyGoodsFPort;
            fport.buyGoods((msg.msgInfo as Goods).sid, msg.msgNum, ShopType.LADDER_HEGOMONEY, buyLadderBack);
        }
        else if (intoType == SUPERDRAWSHOP)
        {
            BuyGoodsFPort fport = FPortManager.Instance.getFPort("BuyGoodsFPort") as BuyGoodsFPort;
            fport.buyGoods((msg.msgInfo as Goods).sid, msg.msgNum, ShopType.SUPERDRAW_SHOP, buyCallBack);
        }
        else if (intoType == GODSWARSHOP)
        {
            BuyGoodsFPort fport = FPortManager.Instance.getFPort("BuyGoodsFPort") as BuyGoodsFPort;
            fport.buyGoods((msg.msgInfo as Goods).sid, msg.msgNum, ShopType.GODSWAR_SHOP, buyCallBack);
        }
        else if (intoType == HEROSYMBOL_SHOP)
        {
            BuyGoodsFPort fport = FPortManager.Instance.getFPort("BuyGoodsFPort") as BuyGoodsFPort;
            fport.buyGoods((msg.msgInfo as Goods).sid, msg.msgNum, ShopType.HEROSYMBOL_SHOP, buyCallBack);
        }
        else if (intoType == LASTBATTLESHOP)
        {
            BuyGoodsFPort fport = FPortManager.Instance.getFPort("BuyGoodsFPort") as BuyGoodsFPort;
            fport.buyGoods((msg.msgInfo as Goods).sid, msg.msgNum, ShopType.JUNGONG_SHOP, buyCallBack);
        }
        else if (intoType == STARSHOP)
        {
            BuyGoodsFPort fport = FPortManager.Instance.getFPort("BuyGoodsFPort") as BuyGoodsFPort;
            fport.buyGoods((msg.msgInfo as Goods).sid, msg.msgNum, ShopType.STAR_SHOP, buyCallBack);
        }
    }
Пример #24
0
 public void Subscribe(int msgType, MessageHandle msgHandle)
 {
     if (null != msgHandle)
     {
         MessageHandle rawList;
         handlers.TryGetValue(msgType, out rawList);
         handlers[msgType] = rawList + msgHandle;
     }
 }
Пример #25
0
 /** 去商店 */
 void gotoShop(MessageHandle msg)
 {
     if (msg.buttonID == MessageHandle.BUTTON_RIGHT)
     {
         UiManager.Instance.openWindow <ShopWindow> ((ShopWindow win) => {
             win.setCallBack(null);
         });
     }
 }
Пример #26
0
        //注册委托
        public AccountManager()
        {
            //用户管理
            MessageHandle.RegisterHandle <ReqUserLogin>(Controller.UserController.Instance.ReqUserLoginHandle);
            MessageHandle.RegisterHandle <ReqUserRegister>(Controller.UserController.Instance.ReqUserRegisterHandle);

            //部门管理
            MessageHandle.RegisterHandle <ReqDepartmentEdit>(Controller.DepartmentController.Instance.ReqDepartmentEditHandle);
        }
Пример #27
0
    private void intoBack(MessageHandle msg)
    {
        GuildGetInfoFPort fport = FPortManager.Instance.getFPort("GuildGetInfoFPort") as GuildGetInfoFPort;

        fport.access(() => {
            win.destoryWindow();
            GuildManagerment.Instance.openWindow();
        });
    }
Пример #28
0
 public Task <SubscriptionHandle> SubscribeToAllAsync(
     Func <AnonymousMessage, MessageHandle, Task> messageCallback,
     Func <SubscriptionHandle, Task> onSubscriptionEnd,
     MessageHandle since = default,
     CancellationToken cancellationToken = default
     )
 {
     return(@delegate.SubscribeToAllAsync(messageCallback, onSubscriptionEnd, since, cancellationToken));
 }
Пример #29
0
 void over(MessageHandle msg)
 {
     if (msg.buttonID == MessageHandle.BUTTON_LEFT)
     {
         MaskWindow.UnlockUI();
         return;
     }
     finishSweep();
 }
Пример #30
0
 public Task SubscribeToConnectionAsync(string connectionId,
                                        Func <AddressedMessage, MessageHandle, Task> messageCallback,
                                        Func <string, Task> onSubscriptionEnd,
                                        MessageHandle since = default,
                                        CancellationToken cancellationToken = default
                                        )
 {
     return(@delegate.SubscribeToConnectionAsync(connectionId, messageCallback, onSubscriptionEnd, since, cancellationToken));
 }
Пример #31
0
 //Class constructor
 //takes for arguments:
 //
 //'messageCallbacks': An array containing definitions of the MessageHandle delegate,
 //one for each client, therefore, the lenght of this array will determine the amount
 //of client connections the server will receive.
 //
 //'newConnectionCallback': A definition of the ConnectionHandle delegate. This method
 //should take care of every client connection received.
 //
 //'PORT': Is number of port the server will be listening to for new connections.
 public Server(MessageHandle[] messageCallbacks, ConnectionHandle newConnectionCallback, int PORT)
 {
     this.messageCallbacks = messageCallbacks;
     this.newConnectionCallback = newConnectionCallback;
     server = new TcpListener(PORT);
     totalClients = messageCallbacks.Length;
     serverThread = new Thread(Run);
     serverThread.IsBackground = true;
     isOnline = false;
 }
Пример #32
0
        //Class Constructor
        //Takes for arguments:
        //'messageCallback': A delegate of a method to call when this socket receives a message
        //'client': A socket connected to the client
        //'clientID': A unique ID asigned by the server
        public Client(MessageHandle messageCallback, TcpClient client, int clientID)
        {
            this.messageCallback = messageCallback;
            this.client = client;
            this.clientID = clientID;

            connectionLocker = new object();

            netStream = client.GetStream();
            this.client.ReceiveBufferSize = 512;

            readingThread = new Thread(Reader);
            writingThread = new Thread(Writer);
            readingThread.IsBackground = true;
            writingThread.IsBackground = true;
            readingThread.Start();
            writingThread.Start();
        }
Пример #33
0
 /// <summary>
 /// 트랜지션 계열의 메세지일 경우 현재 트랜지션 메세지 핸들을 세팅
 /// </summary>
 /// <param name="msg"></param>
 void CheckAndSetTransitionMessageHandle(ref Message msg)
 {
     var type	= msg.type;
     if (type == Message.Type.ManualProgress || type == Message.Type.NaturalProgress || type == Message.Type.StepTo)
     {
         m_transitionMsgHandle	= msg.handle;
         //Debug.LogWarning("transition message in : " + type);
     }
 }
Пример #34
0
 /// <summary>
 /// Transition Message Handle의 트랜지션 콜백을 실행하고 레퍼런스를 지움
 /// </summary>
 void CallTransitionMessageHandle()
 {
     if (m_transitionMsgHandle != null)
     {
         //Debug.Log("calling transition message handle callback");
         m_transitionMsgHandle.CallTransition();
         m_transitionMsgHandle	= null;
     }
 }