Exemplo n.º 1
0
    public static void SendMessageJoinToMiniGame(IMiniGameInfo _gameInfo)
    {
        if (!_gameInfo.isSubGame)
        {
            Debug.LogError(">>> " + _gameInfo.gameType.ToString() + " không phải subgame");
            return;
        }

        switch (_gameInfo.gameType)
        {
        case IMiniGameInfo.Type.DragonTigerCasino:
            messageJoinToMiniGame = new MessageSending(CMD_REALTIME.C_MINIGAME_LONGHO_JOIN_GAME);
            break;

        case IMiniGameInfo.Type.Koprok:
            messageJoinToMiniGame = new MessageSending(CMD_REALTIME.C_MINIGAME_BAUCUA_JOIN_GAME);
            break;

        default:
            messageJoinToMiniGame = null;
            Debug.LogError(">>> Chưa setup API game " + _gameInfo.gameType.ToString());
            break;
        }
        if (messageJoinToMiniGame != null)
        {
            NetworkGlobal.instance.SendMessageRealTime(messageJoinToMiniGame);
        }
    }
Exemplo n.º 2
0
 protected virtual void OnMessageSending(string message)
 {
     if (MessageSending != null)
     {
         MessageSending.Invoke(message);
     }
 }
Exemplo n.º 3
0
        public void deleteMessageSending(int id)
        {
            MessageSending MessageSending = MessageSendingRepository.GetById(id);

            MessageSendingRepository.Delete(MessageSending);
            SaveChange();
        }
Exemplo n.º 4
0
    public void SendMessageAddBet(byte _indexBet, short _indexChip, long _goldAdd)
    {
        if (messageSendingAddBet == null)
        {
            messageSendingAddBet = new MessageSending(CMD_REALTIME.C_GAMEPLAY_ADDBET);
        }
        else
        {
            messageSendingAddBet.ClearData();
        }

        messageSendingAddBet.writeByte(_indexBet);
        messageSendingAddBet.writeshort(_indexChip);
        messageSendingAddBet.writeLong(_goldAdd);

        string _tmp = string.Empty;

        _tmp += _indexBet + "|" + _indexChip + "|" + _goldAdd;

                #if TEST
        Debug.Log(">>>CMD AddBet : " + messageSendingAddBet.getCMD() + "|" + _tmp);
                #endif

        NetworkGlobal.instance.SendMessageRealTime(messageSendingAddBet);
    }
Exemplo n.º 5
0
    public OneHitGame(MessageSending _messageSending)
    {
        serverName    = "listIpForOneHit";
        listIpConnect = new List <IpDetail>();
        List <IpDetail> _newListIpConnect = new List <IpDetail>();

        for (int i = 0; i < DataManager.instance.subServerData.listIpForOneHit.Count; i++)
        {
            _newListIpConnect.Add(DataManager.instance.subServerData.listIpForOneHit[i]);
        }
        _newListIpConnect.Sort(delegate(IpDetail _ipDetailSau, IpDetail _ipDetailTruoc)  // y.CompareTo(x) = -1 là dịch về phía sau
        {
            // -1 là dịch về phía trước
            if (_ipDetailTruoc.timeDelay == -1)
            {
                return(1);
            }

            if (_ipDetailSau.timeDelay > _ipDetailTruoc.timeDelay)
            {
                return(1);
            }
            else if (_ipDetailSau.timeDelay == _ipDetailTruoc.timeDelay)
            {
                if (_ipDetailSau.countConnectionError > _ipDetailTruoc.countConnectionError)
                {
                    return(1);
                }
                else if (_ipDetailSau.countConnectionError == _ipDetailTruoc.countConnectionError)
                {
                    return(0);
                }
                else
                {
                    return(-1);
                }
            }
            else
            {
                return(-1);
            }
        });
        for (int i = 0; i < _newListIpConnect.Count; i++)
        {
            if (!_newListIpConnect[i].beingError)
            {
                // Debug.Log(">>> Khong Loi: " + _newListIpConnect[i][i].ip + ":" + _newListIpConnect[i].port_onehit);
                listIpConnect.Add(_newListIpConnect[i]);
            }
        }
        for (int i = 0; i < _newListIpConnect.Count; i++)
        {
            if (_newListIpConnect[i].beingError)
            {
                // Debug.Log(">>> Loi: " + _newListIpConnect[i][i].ip + ":" + _newListIpConnect[i].port_onehit);
                listIpConnect.Add(_newListIpConnect[i]);
            }
        }
        messageSending = _messageSending;
    }
Exemplo n.º 6
0
    public void SetReadyGame(bool boolean)
    {
        MessageSending readygame = new MessageSending(CMD_REALTIME.C_GAMEPLAY_READY);

        readygame.writeBoolean(boolean);
        NetworkGlobal.instance.SendMessageRealTime(readygame);
    }
Exemplo n.º 7
0
    public void SetBetInGame(string arg0)
    {
        MessageSending mgs = new MessageSending(CMD_REALTIME.C_GAMEPLAY_SETBET);

        mgs.writeLong(Convert.ToInt64(arg0));
        NetworkGlobal.instance.SendMessageRealTime(mgs);
    }
Exemplo n.º 8
0
        /// <summary>
        /// 添加批次概览信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddMsgSendingInfo(MessageSending model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(
                "insert into MessageSending (BatchId,AccIdSet,AccIdCount,ChannelSet,ActionType,ActionMark,Remark,CreateTime) " +
                "Values(@BatchId,@AccIdSet,@AccIdCount,@ChannelSet,@ActionType,@ActionMark,@Remark,@CreateTime)");

            try
            {
                int reVal = DapperHelper.Execute(strSql.ToString(), new
                {
                    BatchId    = model.BatchId,
                    AccIdSet   = model.AccIdSet,
                    AccIdCount = model.AccIdCount,
                    ChannelSet = model.ChannelSet,
                    ActionType = 0,
                    ActionMark = 0,
                    Remark     = model.Remark,
                    CreateTime = DateTime.Now
                });

                return(reVal);
            }
            catch (Exception ex)
            {
                Logger.Error("插入批次" + model.BatchId + "概览详情出错", ex);
                return(0);
            }
        }
Exemplo n.º 9
0
    public void EventMove(int eventMove)
    {
        short          cmd = Convert.ToInt16(eventMove);
        MessageSending mgs = new MessageSending(cmd);

        NetworkGlobal.instance.SendMessageRealTime(mgs);
    }
    public void CallSpell(int spell)
    {
#if TEST
        Debug.Log("spell" + spell);
#endif
        MessageSending mgs = new MessageSending((short)spell);
        NetworkGlobal.instance.SendMessageRealTime(mgs);
    }
Exemplo n.º 11
0
 /// <summary>
 /// Raises <see cref="MessageSending"/> event.
 /// </summary>
 protected virtual void OnMessageSending(RequestMessage message)
 {
     if (MessageSending != null)
     {
         var e = new MessageEventArgs(message);
         MessageSending?.Invoke(this, e);
     }
 }
Exemplo n.º 12
0
    public void SetChoiceHeroAnhSpell(int hero, int spell)
    {
        MessageSending changecharacter = new MessageSending(CMD_REALTIME.C_XHCD_CHANGE_CHARACTER);

        changecharacter.writeByte((byte)hero);
        changecharacter.writeByte((byte)spell);
        NetworkGlobal.instance.SendMessageRealTime(changecharacter);
    }
Exemplo n.º 13
0
    public void CheatBai()
    {
        MessageSending _messageSending = new MessageSending(CMD_REALTIME.C_GAMEPLAY_ADMIN_CHEAT);

        for (int i = 0; i < cheatCard_Global.Count; i++)
        {
            CardDetail _cardDetail = GetCardDetail(cheatCard_Global[i]);
            _messageSending.writeByte((byte)_cardDetail.cardId);
        }
        for (int i = 0; i < cheatCard_Player_00.Count; i++)
        {
            CardDetail _cardDetail = GetCardDetail(cheatCard_Player_00[i]);
            _messageSending.writeByte((byte)_cardDetail.cardId);
        }
        for (int i = 0; i < cheatCard_Player_01.Count; i++)
        {
            CardDetail _cardDetail = GetCardDetail(cheatCard_Player_01[i]);
            _messageSending.writeByte((byte)_cardDetail.cardId);
        }
        for (int i = 0; i < cheatCard_Player_02.Count; i++)
        {
            CardDetail _cardDetail = GetCardDetail(cheatCard_Player_02[i]);
            _messageSending.writeByte((byte)_cardDetail.cardId);
        }
        for (int i = 0; i < cheatCard_Player_03.Count; i++)
        {
            CardDetail _cardDetail = GetCardDetail(cheatCard_Player_03[i]);
            _messageSending.writeByte((byte)_cardDetail.cardId);
        }
        for (int i = 0; i < cheatCard_Player_04.Count; i++)
        {
            CardDetail _cardDetail = GetCardDetail(cheatCard_Player_04[i]);
            _messageSending.writeByte((byte)_cardDetail.cardId);
        }
        for (int i = 0; i < cheatCard_Player_05.Count; i++)
        {
            CardDetail _cardDetail = GetCardDetail(cheatCard_Player_05[i]);
            _messageSending.writeByte((byte)_cardDetail.cardId);
        }
        for (int i = 0; i < cheatCard_Player_06.Count; i++)
        {
            CardDetail _cardDetail = GetCardDetail(cheatCard_Player_06[i]);
            _messageSending.writeByte((byte)_cardDetail.cardId);
        }
        for (int i = 0; i < cheatCard_Player_07.Count; i++)
        {
            CardDetail _cardDetail = GetCardDetail(cheatCard_Player_07[i]);
            _messageSending.writeByte((byte)_cardDetail.cardId);
        }
        for (int i = 0; i < cheatCard_Player_08.Count; i++)
        {
            CardDetail _cardDetail = GetCardDetail(cheatCard_Player_08[i]);
            _messageSending.writeByte((byte)_cardDetail.cardId);
        }

        NetworkGlobal.instance.SendMessageRealTime(_messageSending);
    }
Exemplo n.º 14
0
    public static void IAP_Android(SubServerDetail _serverDetail, byte _screenPurchase, string _productId, string _tokenPurchase, System.Action <MessageReceiving, int> _onFinished)
    {
        if (CoreGameManager.instance.giaLapNgatKetNoi)
        {
            if (_onFinished != null)
            {
                _onFinished(null, 1);
            }
            return;
        }
        if (CoreGameManager.instance.giaLapMangChapChon)
        {
            if (Random.Range(0, 100) < CoreGameManager.instance.giaLapTyLeRotMang)
            {
                if (_onFinished != null)
                {
                    _onFinished(null, 1);
                }
                return;
            }
        }
        if (messageIAP_Android == null)
        {
            messageIAP_Android = new MessageSending(CMD_ONEHIT.GamePurchase_inapp_android);
        }
        else
        {
            messageIAP_Android.ClearData();
        }

        messageIAP_Android.writeByte((byte)DataManager.instance.userData.databaseId);
        messageIAP_Android.writeLong(DataManager.instance.userData.userId);
        messageIAP_Android.writeByte(_screenPurchase);
        messageIAP_Android.writeString(Application.identifier);
        messageIAP_Android.writeString(_productId);
        messageIAP_Android.writeString(_tokenPurchase);

                #if TEST
        string _tmp = DataManager.instance.userData.databaseId + "|"
                      + DataManager.instance.userData.userId + "|"
                      + _screenPurchase + "|"
                      + Application.identifier + "|"
                      + _productId + "|"
                      + _tokenPurchase;
        Debug.Log(">>>CMD IAP_Android : " + messageIAP_Android.getCMD() + "|" + _tmp);
                #endif

        if (_serverDetail == null)
        {
            NetworkGlobal.instance.StartOnehit(messageIAP_Android, _onFinished);
        }
        else
        {
            NetworkGlobal.instance.StartOnehit(messageIAP_Android, _serverDetail, _onFinished);
        }
    }
    public void EventMove(int eventMove)
    {
        if (BOL_Manager.instance.CanPlayMusicAndSfx())
        {
            MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click);
        }
        short          cmd = Convert.ToInt16(eventMove);
        MessageSending mgs = new MessageSending(cmd);

        NetworkGlobal.instance.SendMessageRealTime(mgs);
    }
Exemplo n.º 16
0
 public void createMessageSending(MessageSending obj)
 {
     try
     {
         MessageSendingRepository.Add(obj);
         SaveChange();
     }
     catch
     {
     }
 }
Exemplo n.º 17
0
 private async Task dispatchSendingHandler(Message message)
 {
     if (MessageSending == null)
     {
         return;
     }
     foreach (var handler in MessageSending.GetInvocationList())
     {
         await((IrcClientMessageEventHandler)handler)(this, message);
     }
 }
Exemplo n.º 18
0
        private void OnMessageEntered(string messageText, ref bool sendToOthers)
        {
            if (!sendToOthers)
            {
                return;
            }
            var consumed = false;

            MessageSending?.Invoke(messageText, ref consumed);
            sendToOthers = !consumed;
        }
        public void SendMessage(IPTZMessage message)
        {
            MessageSending?.Invoke(this, message.DataBytes);
            _logger.LogInfoMessage($"Send message. Data: {BitConverter.ToString(message.DataBytes)}");
            var sendResult = _serialPort.SendMessage(message.DataBytes);

            if (!sendResult)
            {
                _logger.LogError($"Send message fail.");
            }
        }
Exemplo n.º 20
0
        static void Main(string[] args)
        {
            WSResponce respObject = new WSResponce();
            string     response   = respObject.GetFormattedXml(CurrentUrl);

            Console.WriteLine(response);
            Console.WriteLine("__________________________");
            ComposeMessage newMessage      = new ComposeMessage();
            MessageSending messageTemplate = new MessageSending();

            messageTemplate.SendMessage(newMessage.CreateMessage(response));
            Console.ReadLine();
        }
Exemplo n.º 21
0
        public ViewerData()
        {
            Winner = -1;

            SendMessageCommand = new CustomCommand(item =>
            {
                MessageSending?.Invoke(PrintedText);
                PrintedText = "";
            })
            {
                CanBeExecuted = false
            };
        }
Exemplo n.º 22
0
    public static void GetUserDetail(sbyte _databaseid, long _userid, List <short> _listGameId, System.Action <MessageReceiving, int> _onFinished)
    {
        if (CoreGameManager.instance.giaLapNgatKetNoi)
        {
            if (_onFinished != null)
            {
                _onFinished(null, 1);
            }
            return;
        }
        if (CoreGameManager.instance.giaLapMangChapChon)
        {
            if (Random.Range(0, 100) < CoreGameManager.instance.giaLapTyLeRotMang)
            {
                if (_onFinished != null)
                {
                    _onFinished(null, 1);
                }
                return;
            }
        }
        if (messageGetUserDetail == null)
        {
            messageGetUserDetail = new MessageSending(CMD_ONEHIT.Game_Global_Get_BasePlayerInfo_And_FullAchievement_ByUserid);
        }
        else
        {
            messageGetUserDetail.ClearData();
        }
        string _tmp = string.Empty;

        messageGetUserDetail.writeByte((byte)_databaseid);
        messageGetUserDetail.writeLong(_userid);
        messageGetUserDetail.writeshort((short)_listGameId.Count);
        _tmp += _databaseid + "|" + _userid + "|" + _listGameId.Count + "|";
        for (int i = 0; i < _listGameId.Count; i++)
        {
            messageGetUserDetail.writeshort(_listGameId[i]);
            _tmp += _listGameId [i] + "_";
            if (i + 1 < _listGameId.Count)
            {
                _tmp += "_";
            }
        }

                #if TEST
        Debug.Log(">>>CMD GetUserDetail : " + messageGetUserDetail.getCMD() + "|" + _tmp);
                #endif

        NetworkGlobal.instance.StartOnehit(messageGetUserDetail, _onFinished);
    }
Exemplo n.º 23
0
    public static void TESTIAP(SubServerDetail _serverDetail, System.Action <MessageReceiving, int> _onFinished)
    {
        // gửi sbyte databaseid
        // long userid
        if (CoreGameManager.instance.giaLapNgatKetNoi)
        {
            if (_onFinished != null)
            {
                _onFinished(null, 1);
            }
            return;
        }
        if (CoreGameManager.instance.giaLapMangChapChon)
        {
            if (Random.Range(0, 100) < CoreGameManager.instance.giaLapTyLeRotMang)
            {
                if (_onFinished != null)
                {
                    _onFinished(null, 1);
                }
                return;
            }
        }
        if (messageTestIAP_Android == null)
        {
            messageTestIAP_Android = new MessageSending(CMD_ONEHIT.TEST_ADD_GOLD);
        }
        else
        {
            messageTestIAP_Android.ClearData();
        }

        messageTestIAP_Android.writeByte((byte)DataManager.instance.userData.databaseId);
        messageTestIAP_Android.writeLong(DataManager.instance.userData.userId);

                #if TEST
        string _tmp = DataManager.instance.userData.databaseId + "|"
                      + DataManager.instance.userData.userId;
        Debug.Log(">>>CMD IAP_Android : " + messageTestIAP_Android.getCMD() + "|" + _tmp);
                #endif

        if (_serverDetail == null)
        {
            NetworkGlobal.instance.StartOnehit(messageTestIAP_Android, _onFinished);
        }
        else
        {
            NetworkGlobal.instance.StartOnehit(messageTestIAP_Android, _serverDetail, _onFinished);
        }
    }
    public void Standup()
    {
        if (Time.time >= timeDelay)
        {
            timeDelay = Time.time + timeBetween;
            MessageSending mgs = new MessageSending(CMD_REALTIME.C_GAMEPLAY_STANDUP);
            NetworkGlobal.instance.SendMessageRealTime(mgs);
        }
        else
        {
#if TEST
            Debug.Log("chưa den lúc nhấn" + Time.time);
#endif
        }
    }
Exemplo n.º 25
0
        public ActionResult SendMessage(string nameInput, string mailInput, string phoneInput, string subjectInput, string messageInput)
        {
            MessageSending messageInfo = new MessageSending();

            messageInfo.name    = nameInput;
            messageInfo.email   = mailInput;
            messageInfo.phone   = phoneInput;
            messageInfo.subject = subjectInput;
            messageInfo.message = messageInput;
            messageInfo.time    = DateTime.Now;

            _messageSendingService.createMessageSending(messageInfo);

            return(RedirectToAction("Index", "Home", new { contactValue = "successful" }));
        }
    public void Sitdown(byte positionChair)
    {
        if (Time.time >= timeDelay)
        {
            timeDelay = Time.time + timeBetween;
            MessageSending mgs = new MessageSending(CMD_REALTIME.C_GAMEPLAY_SITDOWN);
            mgs.writeByte(positionChair);
            NetworkGlobal.instance.SendMessageRealTime(mgs);
        }
        else
        {
#if TEST
            Debug.Log("chưa den lúc nhấn" + Time.time);
#endif
        }
    }
Exemplo n.º 27
0
    public static void GetGoldSubsidy(SubServerDetail _serverDetail, System.Action <MessageReceiving, int> _onFinished)
    {
        if (CoreGameManager.instance.giaLapNgatKetNoi)
        {
            if (_onFinished != null)
            {
                _onFinished(null, 1);
            }
            return;
        }
        if (CoreGameManager.instance.giaLapMangChapChon)
        {
            if (Random.Range(0, 100) < CoreGameManager.instance.giaLapTyLeRotMang)
            {
                if (_onFinished != null)
                {
                    _onFinished(null, 1);
                }
                return;
            }
        }
        if (messageGetGoldSubsidy == null)
        {
            messageGetGoldSubsidy = new MessageSending(CMD_ONEHIT.GameBonus_Get_Gold_Subsidy);
        }
        else
        {
            messageGetGoldSubsidy.ClearData();
        }
        messageGetGoldSubsidy.writeByte((byte)DataManager.instance.userData.databaseId);
        messageGetGoldSubsidy.writeLong(DataManager.instance.userData.userId);

                #if TEST
        string _tmp = DataManager.instance.userData.databaseId + "|" + DataManager.instance.userData.userId;
        Debug.Log(">>>CMD GetGoldSubsidy : " + messageGetGoldSubsidy.getCMD() + "|" + _tmp);
                #endif

        if (_serverDetail == null)
        {
            NetworkGlobal.instance.StartOnehit(messageGetGoldSubsidy, _onFinished);
        }
        else
        {
            NetworkGlobal.instance.StartOnehit(messageGetGoldSubsidy, _serverDetail, _onFinished);
        }
    }
Exemplo n.º 28
0
    public void SendMessageStandUp()
    {
        if (messageSendingStandUp == null)
        {
            messageSendingStandUp = new MessageSending(CMD_REALTIME.C_GAMEPLAY_STANDUP);
        }
        else
        {
            messageSendingStandUp.ClearData();
        }

                #if TEST
        Debug.Log(">>>CMD StandUp : " + messageSendingStandUp.getCMD());
                #endif

        NetworkGlobal.instance.SendMessageRealTime(messageSendingStandUp);
    }
Exemplo n.º 29
0
    public static void InviteFriend_SearchParentInfo(SubServerDetail _serverDetail, short _parentSessionId, System.Action <MessageReceiving, int> _onFinished)
    {
        if (CoreGameManager.instance.giaLapNgatKetNoi)
        {
            if (_onFinished != null)
            {
                _onFinished(null, 1);
            }
            return;
        }
        if (CoreGameManager.instance.giaLapMangChapChon)
        {
            if (Random.Range(0, 100) < CoreGameManager.instance.giaLapTyLeRotMang)
            {
                if (_onFinished != null)
                {
                    _onFinished(null, 1);
                }
                return;
            }
        }
        if (messageInviteFriend_SearchParentInfo == null)
        {
            messageInviteFriend_SearchParentInfo = new MessageSending(CMD_ONEHIT.GameGlobal_GetMiniInfo_BySessionid);
        }
        else
        {
            messageInviteFriend_SearchParentInfo.ClearData();
        }
        messageInviteFriend_SearchParentInfo.writeshort(_parentSessionId);

                #if TEST
        string _tmp = _parentSessionId.ToString();
        Debug.Log(">>>CMD InviteFriend_SearchParentInfo : " + messageInviteFriend_SearchParentInfo.getCMD() + "|" + _tmp);
                #endif

        if (_serverDetail == null)
        {
            NetworkGlobal.instance.StartOnehit(messageInviteFriend_SearchParentInfo, _onFinished);
        }
        else
        {
            NetworkGlobal.instance.StartOnehit(messageInviteFriend_SearchParentInfo, _serverDetail, _onFinished);
        }
    }
Exemplo n.º 30
0
    public static void BigxuAccount_SetEmailSecurity(string _email, System.Action <MessageReceiving, int> _onFinished)
    {
        if (CoreGameManager.instance.giaLapNgatKetNoi)
        {
            if (_onFinished != null)
            {
                _onFinished(null, 1);
            }
            return;
        }
        if (CoreGameManager.instance.giaLapMangChapChon)
        {
            if (Random.Range(0, 100) < CoreGameManager.instance.giaLapTyLeRotMang)
            {
                if (_onFinished != null)
                {
                    _onFinished(null, 1);
                }
                return;
            }
        }
        if (message_BigxuAccount_SetEmailSecurity == null)
        {
            message_BigxuAccount_SetEmailSecurity = new MessageSending(CMD_ONEHIT.Game_Forward_BigxuAccount_SetEmailSecurity);
        }
        else
        {
            message_BigxuAccount_SetEmailSecurity.ClearData();
        }
        message_BigxuAccount_SetEmailSecurity.writeLong(DataManager.instance.userData.userId);
        message_BigxuAccount_SetEmailSecurity.writeString(DataManager.instance.userData.username);
        message_BigxuAccount_SetEmailSecurity.writeString(DataManager.instance.userData.password);
        message_BigxuAccount_SetEmailSecurity.writeString(_email);

                #if TEST
        string _tmp = DataManager.instance.userData.userId + "|"
                      + DataManager.instance.userData.username + "|"
                      + DataManager.instance.userData.password + "|"
                      + _email;
        Debug.Log(">>>CMD BigxuAccount_SetEmailSecurity : " + message_BigxuAccount_SetEmailSecurity.getCMD() + "|" + _tmp);
                #endif

        NetworkGlobal.instance.StartOnehit(message_BigxuAccount_SetEmailSecurity, _onFinished);
    }