Пример #1
0
        // 선물을 선택한후의 다음처리.
        private void OnPresentSelected(string strUri, string strID)
        {
            GiveInfo giveInfo = new GiveInfo();

            giveInfo.UserId    = Main_Pan._UserInfo.Id;
            giveInfo.PresentId = strID;

            Main_Pan._ClientEngine.Send(NotifyType.Request_Give, giveInfo);
        }
Пример #2
0
 public GiveScalarDialog(App game, GiveType type, int otherPlayer, string template = "dialogGiveScalar")
     : base(game, template)
 {
     this._otherPlayer           = otherPlayer;
     this._type                  = type;
     this._give                  = new GiveInfo();
     this._give.InitiatingPlayer = game.LocalPlayer.ID;
     this._give.ReceivingPlayer  = this._otherPlayer;
     this._give.Type             = type;
 }
Пример #3
0
 protected override void OnPanelMessage(string panelName, string msgType, string[] msgParams)
 {
     if (msgType == "button_clicked")
     {
         if (panelName == "btnFinishRequest")
         {
             this._app.GameDatabase.GetPlayerInfo(this._app.LocalPlayer.ID);
             PlayerInfo playerInfo = this._app.GameDatabase.GetPlayerInfo(this._app.LocalPlayer.ID);
             this._app.GameDatabase.UpdatePlayerSavings(playerInfo.ID, playerInfo.Savings - (double)this._give.GiveValue);
             this._app.GameDatabase.InsertGive(this._give);
             this._app.UI.CloseDialog((Dialog)this, true);
         }
         else
         {
             if (!(panelName == "btnCancel"))
             {
                 return;
             }
             this._give = (GiveInfo)null;
             this._app.UI.CloseDialog((Dialog)this, true);
         }
     }
     else if (msgType == "slider_value")
     {
         if (!(panelName == "sldValue"))
         {
             return;
         }
         this._give.GiveValue = float.Parse(msgParams[0]);
         this._app.UI.SetText("txtValue", msgParams[0]);
     }
     else
     {
         if (!(msgType == "text_changed"))
         {
             return;
         }
         int result;
         if (int.TryParse(msgParams[0], out result))
         {
             this._give.GiveValue = Math.Max(this.MinValue, Math.Min((float)result, this.MaxValue));
             this._app.UI.SetSliderValue("sldValue", (int)this._give.GiveValue);
             this._app.UI.SetText("txtValue", ((int)this._give.GiveValue).ToString());
         }
         else
         {
             if (!(msgParams[0] == string.Empty))
             {
                 return;
             }
             this._give.GiveValue = this.MinValue;
             this._app.UI.SetSliderValue("sldValue", (int)this._give.GiveValue);
         }
     }
 }
Пример #4
0
        public void OnReceive(NotifyType type, Socket socket, BaseInfo baseInfo)
        {
            switch (type)
            {
            case NotifyType.Reply_Error:            // 서버로부터 통신오류응답이 온경우.
            {
            }
            break;

            case NotifyType.Reply_StringChat:
            {
                StringInfo strInfo = (StringInfo)baseInfo;
                AddMessageToHistoryTextBox(strInfo);
            }
            break;

            case NotifyType.Reply_RoomDetail:
            {
                m_roomDetailInfo = (RoomDetailInfo)baseInfo;
                ShowUserList(m_roomDetailInfo);
            }
            break;

            case NotifyType.Reply_VoiceChat:
            {
                VoiceInfo voiceInfo = (VoiceInfo)baseInfo;
                ReceiveVoiceInfo(voiceInfo.Data);
            }
            break;

            case NotifyType.Reply_VideoChat:
            {
                VideoInfo videoInfo = (VideoInfo)baseInfo;
                ReceiveVideo(videoInfo.Data);
            }
            break;

            case NotifyType.Reply_Give:
            {
                GiveInfo giveInfo = (GiveInfo)baseInfo;
                SendPresent(giveInfo.PresentId);
            }
            break;
            }
        }