protected void HubLuckyGameResult(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.LUCKY_GAME_RESULT, msg.Arguments);
     }
 }
 protected void HubLobbyInfo(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.LOBBY_INFO, msg.Arguments);
     }
 }
 protected void HubJoinGame(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.JOIN_GAME, msg.Arguments);
     }
 }
 protected void HubError(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.ERROR_2, msg.Arguments);
     }
 }
 protected void HubNotifyEvent(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.NOTIFY_EVENT, msg.Arguments);
     }
 }
 protected void HubEndRound(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.END_ROUND, msg.Arguments);
     }
 }
 protected void HubShowResult(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.SHOW_RESULT, msg.Arguments);
     }
 }
 protected void HubUpdateBetting(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.UPDATE_BETTING, msg.Arguments);
     }
 }
 protected void HubSessionInfo(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.SESSION_INFO, msg.Arguments);
     }
 }
Exemplo n.º 10
0
        /// <summary>
        /// Called when the client receives an order to call a hub-function.
        /// </summary>
        void IHub.OnMethod(MethodCallMessage msg)
        {
            // Merge the newly received states with the old one
            MergeState(msg.State);

            if (OnMethodCall != null)
            {
                try
                {
                    OnMethodCall(this, msg.Method, msg.Arguments);
                }
                catch (Exception ex)
                {
                    HTTPManager.Logger.Exception("Hub - " + this.Name, "IHub.OnMethod - OnMethodCall", ex);
                }
            }

            OnMethodCallCallbackDelegate callback;

            if (MethodTable.TryGetValue(msg.Method, out callback) && callback != null)
            {
                try
                {
                    callback(this, msg);
                }
                catch (Exception ex)
                {
                    HTTPManager.Logger.Exception("Hub - " + this.Name, "IHub.OnMethod - callback", ex);
                }
            }
            else
            {
                HTTPManager.Logger.Warning("Hub - " + this.Name, string.Format("[Client] {0}.{1} (args: {2})", this.Name, msg.Method, msg.Arguments.Length));
            }
        }
 protected void HubChangeState(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.CHANGE_STATE, msg.Arguments);
     }
 }
Exemplo n.º 12
0
 protected void HubResultBet(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.RESULT_HILO_SET_BET, msg.Arguments);
     }
 }
Exemplo n.º 13
0
 protected void HubGetAccountInfoHiLo(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.RESULT_ACCOUNT_INFO_HILO, msg.Arguments);
     }
 }
Exemplo n.º 14
0
 protected void HubUpdateJackpot(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.JACKPOT_HILO, msg.Arguments);
     }
 }
Exemplo n.º 15
0
 protected void HubBoLuot(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.BO_LUOT, msg.Arguments);
     }
 }
 protected void HubBetSuccess(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.BET_SUCCESS_B, msg.Arguments);
     }
 }
Exemplo n.º 17
0
 protected void HubAskBaoSam(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.ASK_BAO_SAM, msg.Arguments);
     }
 }
Exemplo n.º 18
0
        /// <summary>
        /// Calls a method according to MethodCall.
        /// </summary>
        /// <param name="methodCall">Description of the call.</param>
        /// <returns></returns>
        private MethodResultMessage CallMethod(MethodCallMessage request)
        {
            object returnValue = null;

            try
            {
                returnValue = InvokeMethod(request.MethodCall);
            }
            catch (BridgeException bridgeEx)
            {
                return(CreateMethodReturn(ReturnType.Exception, bridgeEx, request.CallId));
            }

            MethodResultMessage returnMsg = null;

            if (returnValue == null)
            {
                returnMsg = CreateMethodReturn(ReturnType.Void, null, request.CallId);
            }
            else
            {
                returnMsg = CreateMethodReturn(ReturnType.Object, returnValue, request.CallId);
            }

            return(returnMsg);
        }
Exemplo n.º 19
0
 protected void HubStartActionTimer(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.START_ACTION_TIMER, msg.Arguments);
     }
 }
Exemplo n.º 20
0
    private void HandleShowPrize(Hub hub, MethodCallMessage methodCall)
    {
        SetRoomState(5);
        var data   = methodCall.Arguments;
        var prizes = JsonConvert.DeserializeObject <ShowPrize>(BestHTTP.JSON.Json.Encode(data[0]));

        for (int i = 0; i < players.Count; i++)
        {
            var player = players[i];
            if (player.gameObject.activeSelf && _bacayData.Players[player.AccountIdString].Status == 1)
            {
                var result = FindPrizeByAccountId(prizes, player.AccountId);
                player.ShowPrize(result, texWin, texLose);
                if (player.AccountId == accountIdNumber)
                {
                    var audio = result.Change < 0 ? _config.audioThua : _config.audioThang;
                    AudioAssistant.Instance.PlaySoundGame(_config.gameId, audio);
                    if (result.IsChickenKiller)
                    {
                        AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioThangDam);
                    }
                }

                if (result.Change > 0)
                {
                    MoveChip(roomState.transform.position, player.transform.position, timeToMoveChip, 0f);
                }

                if (result.IsChickenKiller)
                {
                    MoveChip(feedChecken.transform.position, player.transform.position, timeToMoveChip, 0f);
                }
            }
        }
    }
Exemplo n.º 21
0
 protected void HubUpdateAccount(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.UPDATE_ACCOUNT, msg.Arguments);
     }
 }
Exemplo n.º 22
0
    private void HandleStartGame(Hub hub, MethodCallMessage methodCall)
    {
        SetRoomState(1);
        var data = methodCall.Arguments;

        _bacayData = JsonConvert.DeserializeObject <SRSBacay>(BestHTTP.JSON.Json.Encode(data[0]));
        var time = JsonConvert.DeserializeObject <BacayServerTime>(BestHTTP.JSON.Json.Encode(data[1]));

        for (int pos = 0; pos < _bacayData.Positions.Count; pos++)
        {
            var accountId = _bacayData.Positions[pos];
            if (accountId > 0)
            {
                var playerData = _bacayData.Players[Convert.ToString(accountId)];
                var player     = ShowPLayer(playerData, pos, false);
                player.ShowStart(time);
            }
            else
            {
                HidePlayer(pos);
            }
        }
        feedChecken.transform.parent.gameObject.SetActive(false);
        register.gameObject.SetActive(false);
        resign.gameObject.SetActive(false);
        noResign.gameObject.SetActive(false);
        HideBetOption();
    }
Exemplo n.º 23
0
 protected void HubRecieveMessage(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.RECIEVE_MESSAGE, msg.Arguments);
     }
 }
Exemplo n.º 24
0

        
Exemplo n.º 25
0
 protected void HubForceLogout(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.FORCE_LOGOUT, msg.Arguments);
     }
 }
Exemplo n.º 26
0
 protected void HubUpdateConnectionStatus(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.UPDATE_CONNECTION_STATUS, msg.Arguments);
     }
 }
Exemplo n.º 27
0
 protected void HubBuyManual(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.BUY_MANUAL, msg.Arguments);
     }
 }
Exemplo n.º 28
0
 protected void HubDanhBai(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.DANH_BAI, msg.Arguments);
     }
 }
Exemplo n.º 29
0
 protected void HubPlayerJoin(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.PLAYER_JOIN, msg.Arguments);
     }
 }
 protected void HubResultSpin(Hub hub, MethodCallMessage msg)
 {
     if (OnSRSHubEvent != null)
     {
         OnSRSHubEvent.Invoke(SRSConst.RESULT_SPIN_VB, msg.Arguments);
     }
 }