Esempio n. 1
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);
    }
Esempio n. 2
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);
        }
    }
Esempio n. 3
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);
    }
Esempio n. 4
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);
        }
    }
Esempio n. 5
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);
        }
    }
Esempio n. 6
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);
    }
Esempio n. 7
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);
        }
    }
Esempio n. 8
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);
    }
Esempio n. 9
0
    public static void GetListTableByGameID(short _gameId, short _indexBegin, short _numberTableGet, 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 (messageGetListTableByGameId == null)
        {
            messageGetListTableByGameId = new MessageSending(CMD_ONEHIT.Game_RoomTable_GetListTable_By_gameid);
        }
        else
        {
            messageGetListTableByGameId.ClearData();
        }

        messageGetListTableByGameId.writeshort(_gameId);
        messageGetListTableByGameId.writeshort(_indexBegin);
        messageGetListTableByGameId.writeshort(_numberTableGet);

                #if TEST
        string _tmp = string.Empty;
        _tmp += _gameId + "|" + _indexBegin + "|" + _numberTableGet;
        Debug.Log(">>>CMD GetListTableByGameID : " + messageGetListTableByGameId.getCMD() + "|" + _tmp);
                #endif

        NetworkGlobal.instance.StartOnehit(messageGetListTableByGameId, _serverDetail, _onFinished);
    }
Esempio n. 10
0
    public static void Forward_Bonus_AndroidInstall_Commit(string _packageName, 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_Forward_Bonus_AndroidInstall_Commit == null)
        {
            message_Forward_Bonus_AndroidInstall_Commit = new MessageSending(CMD_ONEHIT.GameMission_AndroidInstall_Commit);
        }
        else
        {
            message_Forward_Bonus_AndroidInstall_Commit.ClearData();
        }
        message_Forward_Bonus_AndroidInstall_Commit.writeByte((byte)DataManager.instance.userData.databaseId);
        message_Forward_Bonus_AndroidInstall_Commit.writeLong(DataManager.instance.userData.userId);
        message_Forward_Bonus_AndroidInstall_Commit.writeString(_packageName);

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

        NetworkGlobal.instance.StartOnehit(message_Forward_Bonus_AndroidInstall_Commit, _onFinished);
    }
Esempio n. 11
0
    public void SendChatInTable(string _message)
    {
        if (messageSendingChat == null)
        {
            messageSendingChat = new MessageSending(CMD_REALTIME.C_GAMEPLAY_CHAT_IN_TABLE);
        }
        else
        {
            messageSendingChat.ClearData();
        }
        messageSendingChat.writeString(_message);
        string _tmp = string.Empty;

        _tmp += _message;

#if TEST
        Debug.Log(">>>CMD Chat : " + messageSendingChat.getCMD() + "|" + _tmp);
#endif
        NetworkGlobal.instance.SendMessageRealTime(messageSendingChat);
    }
Esempio n. 12
0
    public static void LoginWithDeviceID(long _userId, 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 (messageLoginWithDeviceID == null)
        {
            messageLoginWithDeviceID = new MessageSending(CMD_ONEHIT.Game_login_0_device_account);
        }
        else
        {
            messageLoginWithDeviceID.ClearData();
        }
        string _deviceId = SystemInfo.deviceUniqueIdentifier;

        messageLoginWithDeviceID.writeLong(_userId);
        messageLoginWithDeviceID.writeString(_deviceId);
        messageLoginWithDeviceID.writeString(SystemInfo.deviceModel);

                #if TEST
        Debug.Log(">>>CMD LoginWithDeviceID : " + messageLoginWithDeviceID.getCMD() + "|" + _userId + "|" + _deviceId + "|" + SystemInfo.deviceModel);
                #endif

        NetworkGlobal.instance.StartOnehit(messageLoginWithDeviceID, _onFinished);
    }
Esempio n. 13
0
    public static void SendMessageCreatePassAndJoinTable(short _gameId, string _passwordTable)
    {
        if (messageCreatePassAndJoinTable == null)
        {
            messageCreatePassAndJoinTable = new MessageSending(CMD_REALTIME.C_TABLE_CREATE_PASSWORD_TABLE);
        }
        else
        {
            messageCreatePassAndJoinTable.ClearData();
        }

        messageCreatePassAndJoinTable.writeshort(_gameId);
        messageCreatePassAndJoinTable.writeString(_passwordTable);
        messageCreatePassAndJoinTable.writeByte((byte)DataManager.instance.userData.databaseId);
        messageCreatePassAndJoinTable.writeLong(DataManager.instance.userData.userId);

        switch (DataManager.instance.userData.databaseId)
        {
        case UserData.DatabaseType.DATABASEID_DEVICE:
            messageCreatePassAndJoinTable.writeString(DataManager.instance.userData.deviceId);
            messageCreatePassAndJoinTable.writeString(SystemInfo.deviceModel);
            break;

        case UserData.DatabaseType.DATABASEID_BIGXU:
            messageCreatePassAndJoinTable.writeString(DataManager.instance.userData.username);
            messageCreatePassAndJoinTable.writeString(DataManager.instance.userData.password);
            break;

        case UserData.DatabaseType.DATABASEID_FACEBOOK:
            messageCreatePassAndJoinTable.writeString(DataManager.instance.userData.tokenFBIdOfBusiness);
            break;
        }

                #if TEST
        string _tmp = string.Empty;
        _tmp += _gameId + "|" + "|" + _passwordTable;
        Debug.Log(">>>CMD CreatePassAndJoinTable : " + messageCreatePassAndJoinTable.getCMD() + "|" + _tmp);
                #endif

        NetworkGlobal.instance.SendMessageRealTime(messageCreatePassAndJoinTable);
    }
Esempio n. 14
0
    public void SendMessageSetBet(long _goldBet)
    {
        if (messageSendingSetBet == null)
        {
            messageSendingSetBet = new MessageSending(CMD_REALTIME.C_GAMEPLAY_SETBET);
        }
        else
        {
            messageSendingSetBet.ClearData();
        }

        messageSendingSetBet.writeLong(_goldBet);

                #if TEST
        string _tmp = string.Empty;
        _tmp += _goldBet;
        Debug.Log(">>>CMD SetBet : " + messageSendingSetBet.getCMD() + "|" + _tmp);
                #endif

        NetworkGlobal.instance.SendMessageRealTime(messageSendingSetBet);
    }
Esempio n. 15
0
    public static void SendMessageSetParent(short _parentSessionId)
    {
        if (messageSetParent == null)
        {
            messageSetParent = new MessageSending(CMD_REALTIME.C_GAMEPLAY_SET_PARENT);
        }
        else
        {
            messageSetParent.ClearData();
        }

        messageSetParent.writeshort(_parentSessionId);

                #if TEST
        string _tmp = string.Empty;
        _tmp += _parentSessionId;
        Debug.Log(">>>CMD SendMessageSetParent : " + messageSetParent.getCMD() + "|" + _tmp);
                #endif

        NetworkGlobal.instance.SendMessageRealTime(messageSetParent);
    }
Esempio n. 16
0
    public static void SendMessageCallBotUno(byte _numBot)
    {
        if (messageCallBotUno == null)
        {
            messageCallBotUno = new MessageSending(CMD_REALTIME.C_GAMEPLAY_INVITE_ROBOT);
        }
        else
        {
            messageCallBotUno.ClearData();
        }

        messageCallBotUno.writeByte(_numBot);

                #if TEST
        string _tmp = string.Empty;
        _tmp += _numBot;
        Debug.Log(">>>CMD SendMessageCallBotUno : " + messageCallBotUno.getCMD() + "|" + _tmp);
                #endif

        NetworkGlobal.instance.SendMessageRealTime(messageCallBotUno);
    }
Esempio n. 17
0
    public void SendMessageSitDown(byte _indexChair)
    {
        if (messageSendingSitDown == null)
        {
            messageSendingSitDown = new MessageSending(CMD_REALTIME.C_GAMEPLAY_SITDOWN);
        }
        else
        {
            messageSendingSitDown.ClearData();
        }

        messageSendingSitDown.writeByte(_indexChair);

                #if TEST
        string _tmp = string.Empty;
        _tmp += _indexChair;
        Debug.Log(">>>CMD SitDown : " + messageSendingSitDown.getCMD() + "|" + _tmp);
                #endif

        NetworkGlobal.instance.SendMessageRealTime(messageSendingSitDown);
    }
Esempio n. 18
0
    public static void BigxuAccount_ForgotPassword(string _email, string _userName, string _newPass, 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_ForgotPassword == null)
        {
            message_BigxuAccount_ForgotPassword = new MessageSending(CMD_ONEHIT.Game_Forward_BigxuAccount_Backup_By_EmailSecurity);
        }
        else
        {
            message_BigxuAccount_ForgotPassword.ClearData();
        }
        message_BigxuAccount_ForgotPassword.writeString(_email);
        message_BigxuAccount_ForgotPassword.writeString(_userName);
        message_BigxuAccount_ForgotPassword.writeString(_newPass);

                #if TEST
        string _tmp = _email + "|" + _userName + "|" + _newPass;
        Debug.Log(">>>CMD BigxuAccount_ForgotPassword : "******"|" + _tmp);
                #endif

        NetworkGlobal.instance.StartOnehit(message_BigxuAccount_ForgotPassword, _onFinished);
    }
Esempio n. 19
0
    public static void GetSplashData_IOS(short _languageId, string _packageName, 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 (messageGetSplashData_IOS == null)
        {
            messageGetSplashData_IOS = new MessageSending(CMD_ONEHIT.SPLASH_IOS);
        }
        else
        {
            messageGetSplashData_IOS.ClearData();
        }

        messageGetSplashData_IOS.writeshort(_languageId);
        messageGetSplashData_IOS.writeString(_packageName);

                #if TEST
        string _tmp = string.Empty;
        _tmp += _languageId + "|" + _packageName;
        Debug.Log(">>>CMD GetSplashData_IOS : " + messageGetSplashData_IOS.getCMD() + "|" + _tmp);
                #endif
        NetworkGlobal.instance.StartOnehit(messageGetSplashData_IOS, _onFinished);
    }
Esempio n. 20
0
    public static void SendMessagePlayNowMiniGame(short _gameId)
    {
        if (messagePlayNowMiniGame == null)
        {
            messagePlayNowMiniGame = new MessageSending(CMD_REALTIME.C_TABLE_JOIN_TO_MINIGAME_STATE);
        }
        else
        {
            messagePlayNowMiniGame.ClearData();
        }

        messagePlayNowMiniGame.writeshort(_gameId);
        messagePlayNowMiniGame.writeByte((byte)DataManager.instance.userData.databaseId);
        messagePlayNowMiniGame.writeLong(DataManager.instance.userData.userId);
        switch (DataManager.instance.userData.databaseId)
        {
        case UserData.DatabaseType.DATABASEID_DEVICE:
            messagePlayNowMiniGame.writeString(DataManager.instance.userData.deviceId);
            messagePlayNowMiniGame.writeString(SystemInfo.deviceModel);
            break;

        case UserData.DatabaseType.DATABASEID_BIGXU:
            messagePlayNowMiniGame.writeString(DataManager.instance.userData.username);
            messagePlayNowMiniGame.writeString(DataManager.instance.userData.password);
            break;

        case UserData.DatabaseType.DATABASEID_FACEBOOK:
            // messagePlayNowMiniGame.writeString (Facebook.Unity.AccessToken.CurrentAccessToken.TokenString);
            messagePlayNowMiniGame.writeString(DataManager.instance.userData.tokenFBIdOfBusiness);
            break;
        }

                #if TEST
        string _tmp = string.Empty;
        _tmp += _gameId;
        Debug.Log(">>>CMD PlayNowMiniGame : " + messagePlayNowMiniGame.getCMD() + "|" + _tmp);
                #endif

        NetworkGlobal.instance.SendMessageRealTime(messagePlayNowMiniGame);
    }
Esempio n. 21
0
    public static void ChooseAvatar(UserData.DatabaseType _databaseid, long _userid, sbyte _avatarId, 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 (messageChooseAvatar == null)
        {
            messageChooseAvatar = new MessageSending(CMD_ONEHIT.Game_Change_Avatarid);
        }
        else
        {
            messageChooseAvatar.ClearData();
        }
        messageChooseAvatar.writeByte((byte)_databaseid);
        messageChooseAvatar.writeLong(_userid);
        messageChooseAvatar.writeByte((byte)_avatarId);
        string _tmp = _databaseid + "|" + _userid + "|" + _avatarId;

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

        NetworkGlobal.instance.StartOnehit(messageChooseAvatar, _onFinished);
    }
Esempio n. 22
0
    public static void LoginWithFacebookAccount(long _userId, string _fbToken, 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 (messageLoginWithFacebookAccount == null)
        {
            messageLoginWithFacebookAccount = new MessageSending(CMD_ONEHIT.Game_login_2_facebookid);
        }
        else
        {
            messageLoginWithFacebookAccount.ClearData();
        }

        messageLoginWithFacebookAccount.writeLong(_userId);
        messageLoginWithFacebookAccount.writeString(_fbToken);

                #if TEST
        Debug.Log(">>>CMD LoginWithFacebookAccount : " + messageLoginWithFacebookAccount.getCMD() + "|" + _userId + "|" + _fbToken);
                #endif

        NetworkGlobal.instance.StartOnehit(messageLoginWithFacebookAccount, _onFinished);
    }
Esempio n. 23
0
    public static void RegisterLocalAccount(string _userName, string _pass, 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 (messageRegisterLocalAccount == null)
        {
            messageRegisterLocalAccount = new MessageSending(CMD_ONEHIT.Game_Forward_BigxuAccount_Register);
        }
        else
        {
            messageRegisterLocalAccount.ClearData();
        }
        messageRegisterLocalAccount.writeString(_userName);
        messageRegisterLocalAccount.writeString(_pass);

                #if TEST
        Debug.Log(">>>CMD Register : " + messageRegisterLocalAccount.getCMD() + "|" + _userName + "|" + _pass);
                #endif

        NetworkGlobal.instance.StartOnehit(messageRegisterLocalAccount, _onFinished);
    }
Esempio n. 24
0
    public static void GetListCampagneInstallAndroid(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_GetList_CampagneInstallAndroid == null)
        {
            message_GetList_CampagneInstallAndroid = new MessageSending(CMD_ONEHIT.GameDatabase_Android_GetCampagneInstall);
        }
        else
        {
            message_GetList_CampagneInstallAndroid.ClearData();
        }

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

        NetworkGlobal.instance.StartOnehit(message_GetList_CampagneInstallAndroid, _onFinished);
    }
Esempio n. 25
0
    public static void BetToWin(long _bet
                                , List <BetToWinValueDetail> _listBetToWinInfo
                                , List <long> _listBetToWinValue
                                , 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_BetToWin == null)
        {
            message_BetToWin = new MessageSending(CMD_ONEHIT.Game_BetToWin_NoAchievement);
        }
        else
        {
            message_BetToWin.ClearData();
        }
        message_BetToWin.writeLong(_bet);
        message_BetToWin.writeshort((short)_listBetToWinInfo.Count);
        for (int i = 0; i < _listBetToWinInfo.Count; i++)
        {
            message_BetToWin.writeInt(_listBetToWinInfo[i].weight);
            message_BetToWin.writeLong(_listBetToWinValue[i]);
        }
        message_BetToWin.writeByte((byte)DataManager.instance.userData.databaseId);
        message_BetToWin.writeLong(DataManager.instance.userData.userId);
        switch (DataManager.instance.userData.databaseId)
        {
        case UserData.DatabaseType.DATABASEID_DEVICE:
            message_BetToWin.writeString(DataManager.instance.userData.deviceId);
            // message_BetToWin.writeString (SystemInfo.deviceModel);
            break;

        case UserData.DatabaseType.DATABASEID_BIGXU:
            message_BetToWin.writeString(DataManager.instance.userData.username);
            message_BetToWin.writeString(DataManager.instance.userData.password);
            break;

        case UserData.DatabaseType.DATABASEID_FACEBOOK:
            message_BetToWin.writeString(DataManager.instance.userData.tokenFBIdOfBusiness);
            break;

        default:
                        #if TEST
            Debug.LogError(">>> Lỗi databaseId: " + DataManager.instance.userData.databaseId);
                        #endif
            break;
        }

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

        NetworkGlobal.instance.StartOnehit(message_BetToWin, _onFinished);
    }
Esempio n. 26
0
    public void SendDATA(List <HeroInfomation> listhero, 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 (SetDataInfo == null)
        {
            SetDataInfo = new MessageSending(CMD_ONEHIT.TEST_SETUP_BOL);
        }
        else
        {
            SetDataInfo.ClearData();
        }
        Debug.Log("read " + listhero.Count);
        for (int i = 0; i < listhero.Count; i++)
        {
            SetDataInfo.writeshort(listhero[i].damgeAttack1);      //damge1
            SetDataInfo.writeshort(listhero[i].damgeAttack2);      //damge2
            SetDataInfo.writeshort(listhero[i].max_hp);            //maxHp
            SetDataInfo.writeshort(listhero[i].max_mana);          //maxMana
            SetDataInfo.writeshort(listhero[i].max_shield);        //maxShield
            SetDataInfo.writeshort(listhero[i].manaOfSkill1);      //manaofskill1
            SetDataInfo.writeshort(listhero[i].manaOfSkill2);      //manaofskill2
            SetDataInfo.writeshort(listhero[i].manaOfUltimate);    //manaofultimate
            SetDataInfo.writeshort(listhero[i].delayOfSkill1);     //delayskill1
            SetDataInfo.writeshort(listhero[i].delayOfSkill2);     //delayskill2
            SetDataInfo.writeshort(listhero[i].delayOfUltimate);   //delayultimate
            Debug.Log(
                listhero[i].damgeAttack1 + "|" +
                listhero[i].damgeAttack2 + "|" +
                listhero[i].max_hp + "|" +
                listhero[i].max_mana + "|" +
                listhero[i].max_shield + "|" +
                listhero[i].manaOfSkill1 + "|" +
                listhero[i].manaOfSkill2 + "|" +
                listhero[i].manaOfUltimate + "|" +
                listhero[i].delayOfSkill1 + "|" +
                listhero[i].delayOfSkill2 + "|" +
                listhero[i].delayOfUltimate
                );
        }
#if TEST
        Debug.Log(">>>CMD Register : " + SetDataInfo.getCMD());
        Debug.Log(Debugs.ColorString("Send Sucessfull", Color.red));
#endif
        NetworkGlobal.instance.StartOnehit(SetDataInfo, _onFinished);
    }