void MTTMatchState::setVisible(bool bVisible)
	{
        m_bIsVisible = bVisible;
		
		PlayVisibleSound(bVisible);
		if (bVisible)
		{
			GameDialog::setVisible(bVisible);
			if(g_globaMttGameInfo.m_isGameStart)
			{
				SendClientRequest(ClientRequest::kCallMttMatchRankList) ;
				showDataLoading(m_uCurSelectIndex==PaimingBtn && g_globaMttGameInfo.m_isGameStart);
				m_bRequestData = true;
			}

			Tools::callScaleAction(this);
			//SendClientRequest(ClientRequest::kGetActivityInfo);
		}
		else
		{
			GameDialog::setVisible(bVisible);
			SendClientRequest(ClientRequest::kOptMTTHallBgLayer);
			//callHideAction() ;
		}
	}
// ---------------------------------------------------------------------------
// RVoIPAudioSession::GetSupportedEncodersL
// ---------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::GetSupportedEncoders(
        const TMMFPrioritySettings aPriority, RArray<TUint32>& aEncoders,
        TInt& aFrameSize)
    {
    TRACE_PRN_FN_ENT;

    TMMFPrioritySettingsPckg pckg;
    pckg() = aPriority;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPSetEncoderPriority, args);

    TVoIPMsgBufPckg pckg1;
    TIpcArgs args1(&pckg1);
    err = SendClientRequest(EVoIPGetSupportedEncodersCount, args1);
    TInt count = 0;
    aFrameSize = 0;

    if (err == KErrNone)
        {
        count = pckg1().iInt;
        aFrameSize = pckg1().iUint; //for 10/20ms frame detection
        err = pckg1().iStatus;
        }

    if (count > 0 && err == KErrNone)
        {
        TRAP(err, PopulateArrayL(EVoIPGetSupportedEncoders, aEncoders, count));
        }

    TRACE_PRN_FN_EXT;
    return err;
    }
void DealApplyFamily::onMenuItemSelect(cocos2d::Ref* ref,int index)
{

	int con = m_pMenuItemAutoBuyJetton2Max->getSelectedIndex() ;
		Json::Value param;
		param["user_id"] =m_uid;
		param["group_id"] = m_fid;
	if (index ==0)
	{
		setVisible(false) ;
		param["add"] = 1;
		param["mid"] =m_mid ;
		SendClientRequest(ClientRequest::kDealApplyFamily, param);

	}
	if (index ==1)
	{
		setVisible(false) ;
		if (con==0)
		{
				param["add"] =3;
		}
		else
		{
			param["add"] = 2;
		}
		param["mid"] =m_mid ;
		SendClientRequest(ClientRequest::kDealApplyFamily, param);
	}
	
}
// -----------------------------------------------------------------------------
// RVoIPAudioSession::OpenRingTonePlayer
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::OpenRingTonePlayer(const RFile& aFileHandle)
    {
    TIpcArgs args;
    aFileHandle.TransferToServer(args, 0, 1); //0=Fs, 1==file handle
    TInt err = SendClientRequest(EVoIPOpenRingTonePlayerFromRFile, args);
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::PopulateArrayL
// -----------------------------------------------------------------------------
//
void RVoIPAudioSession::PopulateArrayL(
        TVoIPAudioClientServerRequest aRequest, RArray<TUint32>& aDecoders,
        TInt aCount)
    {
    HBufC8* buf = HBufC8::NewLC(aCount * sizeof(TUint32));
    TPtr8 ptr = buf->Des();
    TIpcArgs args;
    args.Set(0, &ptr);
    TInt err = SendClientRequest(aRequest, args);

    if (err == KErrNone)
        {
        RDesReadStream stream(ptr);
        CleanupClosePushL(stream);
        aDecoders.Reset();

        for (TInt i = 0; i < aCount; i++)
            {
            aDecoders.Append(stream.ReadUint32L());
            }

        CleanupStack::PopAndDestroy(&stream);
        }

    CleanupStack::PopAndDestroy(buf);
    }
Beispiel #6
0
void AllotFund::onMenuItemSelect(cocos2d::Ref* ref,int index)
{


	if (index ==0)
	{

		if (m_edit_fund ==0)
		{
			PopTipWithBt1("请输入正确的金额","确定",nullptr) ;
			return ;
		}
		setVisible(false) ;

		Json::Value param;
		param["clubid"] = g_globalMyFamilyInfo.m_familyID ;
		param["uid"] = m_uid ;
		param["fund"] = m_edit_fund ;
		param["uname"] = m_uname ;
		param["clubname"] = g_globalMyFamilyInfo.m_familyName ;
		//SendClientRequest(ClientRequest::kCallAllotFunToRole, param);
		SendClientRequest(ClientRequest::kCallUpdatePlayerCash, param);
	}
	if (index ==1)
	{
		setVisible(false) ;

	}

}
// -----------------------------------------------------------------------------
// RVoIPAudioSession::GetMaxGain
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::GetMaxGain()
    {
    TPckgBuf<TInt> pckg;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPGetMaxGain, args);
    return (err == KErrNone) ? pckg() : err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::GetSupportedBitRatesL
// -----------------------------------------------------------------------------
//
EXPORT_C void RVoIPAudioSession::GetSupportedBitRatesL(RArray<TUint>& aArray)
    {
    TRACE_PRN_FN_ENT;

    TInt brCount = 0;
    TVoIPMsgBufPckg pckg;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPGetSupportedBitratesCount, args);
    if (err == KErrNone)
        {
        brCount = pckg().iInt;
        err = pckg().iStatus;
        }

    if (err != KErrNone)
        {
        User::Leave(err);
        }

    TRACE_PRN_N1(_L("BRCount [%d]"), brCount);

    if (brCount > 0)
        {
        HBufC8* buf = HBufC8::NewLC(brCount * sizeof(TUint));
        TPtr8 ptr = buf->Des();
        TIpcArgs args1;
        args1.Set(0, &ptr);
        err = SendClientRequest(EVoIPGetSupportedBitrates, args1);
        if (err == KErrNone)
            {
            RDesReadStream stream(ptr);
            CleanupClosePushL(stream); // stream on cleanup
            aArray.Reset();

            for (TInt i = 0; i < brCount; i++)
                {
                aArray.Append(stream.ReadUint32L());
                }

            CleanupStack::PopAndDestroy(&stream);
            }

        CleanupStack::PopAndDestroy(buf);
        }

    TRACE_PRN_FN_EXT;
    }
// ---------------------------------------------------------------------------
// RVoIPAudioSession::PlayDTMFTone
// ---------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::PlayDTMFTone(const TDesC& aTones)
    {
    TTonesMsgBufPckg pckg;
    pckg().iFileName = aTones;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPPlayDTMFTone, args);
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::BufferEmptied
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::BufferEmptied(TPtr8 aBuffer)
    {
    TVoIPMsgBufPckg pckg;
    pckg().iInt = aBuffer.Size();
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPBufferEmptied, args);
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::OpenRingTonePlayer
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::OpenRingTonePlayer(const TDesC& aFileName)
    {
    TTonesMsgBufPckg pckg;
    pckg().iFileName = aFileName;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPOpenRingTonePlayerFromFile, args);
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::SetEncoder
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::SetEncoder(const TUint32 aEncoder)
    {
    TPckgBuf<TUint32> pckg;
    pckg() = aEncoder;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPSetEncoder, args);
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::OpenRingTonePlayer
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::OpenRingTonePlayer(const TDesC8& aDesData)
    {
    TPtrC8 ptr(aDesData);
    TIpcArgs args;
    args.Set(0, &ptr);
    TInt err = SendClientRequest(EVoIPOpenRingTonePlayerFromDes, args);
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::Close
// -----------------------------------------------------------------------------
//
EXPORT_C void RVoIPAudioSession::Close()
    {
    TRACE_PRN_FN_ENT;

    SendClientRequest(EVoIPSessionClose, TIpcArgs(TIpcArgs::ENothing));
    RSessionBase::Close();

    TRACE_PRN_FN_EXT;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::SetAudioDevice
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::SetAudioDevice(
        const CVoIPAudioDownlinkStream::TVoIPOutputDevice aDevice)
    {
    TPckgBuf<TUint> pckg;
    pckg() = TUint(aDevice);
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPSetAudioDevice, args);
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::ConfigureJitterBuffer
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::ConfigureJitterBuffer(
        const TVoIPJBConfig& aJbConfig)
    {
    TPckgBuf<TVoIPJBConfig> pckg;
    pckg() = aJbConfig;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPConfigJitterBuffer, args);
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::SetMode
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::SetMode(
        const CVoIPFormatIntfc::TILBCCodecMode aMode)
    {
    TPckgBuf<CVoIPFormatIntfc::TILBCCodecMode> pckg;
    pckg() = aMode;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPSetIlbcCodecMode, args);
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::OpenUplink
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::OpenUplink(
        const TMMFPrioritySettings aPriority)
    {
    TMMFPrioritySettingsPckg pckg;
    pckg() = aPriority;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPOpenUplink, args);
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::BufferFilled
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::BufferFilled(TPtr8 aBuffer,
        const TUint aBufferSequence)
    {
    TVoIPMsgBufPckg pckg;
    pckg().iInt = aBuffer.Size();
    pckg().iUint = aBufferSequence;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPBufferFilled, args);
    return err;
    }
//报名&退赛 回调函数
void MTTMatchState::OnMenuSignUp(cocos2d::Ref* pSend)
{
	if (pSend == m_menuSignUp)//报名按钮回调
	{
		Json::Value param;
		param["id"] = g_globaMttGameInfo.m_curMttTable.m_tableID;
		SendClientRequest(ClientRequest::kMttMatchSiginUp, param);
	}
	else if (pSend == m_menuCalcelSign)//退赛按钮回调
	{
		Json::Value param;
		param["id"] = g_globaMttGameInfo.m_curMttTable.m_tableID;
		SendClientRequest(ClientRequest::kMttMatchQuit, param);

	}
	else if (pSend == m_menuEnterGame)//进入比赛回调
	{
        g_pGameFrame->doJoinMttMatch(g_globaMttGameInfo.m_curMttTable.m_tableID, 0);
	}
}
// -----------------------------------------------------------------------------
// RVoIPAudioSession::FrameModeRequiredForErrorConcealment
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::FrameModeRequiredForEC(TBool& aMode)
    {
    TVoIPMsgBufPckg pckg;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPFrameModeRqrdForEC, args);
    if (err == KErrNone)
        {
        aMode = pckg().iBool;
        err = pckg().iStatus;
        }
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::GetPLC
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::GetPLC(TBool& aPlc)
    {
    TVoIPMsgBufPckg pckg;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPGetPlc, args);
    if (err == KErrNone)
        {
        aPlc = pckg().iBool;
        err = pckg().iStatus;
        }
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::GetBitRate
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::GetBitRate(TUint& aBitrate)
    {
    TVoIPMsgBufPckg pckg;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPGetBitrate, args);
    if (err == KErrNone)
        {
        aBitrate = pckg().iUint;
        err = pckg().iStatus;
        }

    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::GetMode
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::GetMode(
        CVoIPFormatIntfc::TG711CodecMode& aMode)
    {
    TVoIPMsgBufPckg pckg;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPGetG711CodecMode, args);
    if (err == KErrNone)
        {
        aMode = (CVoIPFormatIntfc::TG711CodecMode) pckg().iUint;
        err = pckg().iStatus;
        }
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::GetVolume
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::GetVolume()
    {
    TInt vol = 0;
    TVoIPMsgBufPckg pckg;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPGetVolume, args);
    if (err == KErrNone)
        {
        vol = pckg().iInt;
        err = pckg().iStatus;
        }

    return (err == KErrNone) ? vol : err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::GetAudioDevice
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::GetAudioDevice(
        CVoIPAudioDownlinkStream::TVoIPOutputDevice& aDevice)
    {
    TVoIPMsgBufPckg pckg;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPGetAudioDevice, args);
    if (err == KErrNone)
        {
        aDevice = (CVoIPAudioDownlinkStream::TVoIPOutputDevice) pckg().iUint;
        err = pckg().iStatus;
        }

    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::GetGain
// -----------------------------------------------------------------------------
//
EXPORT_C TInt RVoIPAudioSession::GetGain()
    {
    TInt gain = 0;
    TVoIPMsgBufPckg pckg;
    TIpcArgs args(&pckg);
    TInt err = SendClientRequest(EVoIPGetGain, args);
    if (err == KErrNone)
        {
        gain = pckg().iInt;
        err = pckg().iStatus;
        }

    return (err == KErrNone) ? gain : err;
    }
Beispiel #28
0
void ActionBar::onMenuItemQuickRaisePartPort(cocos2d::Ref *pItem,cocos2d::ui::TouchEventType type)
{
	if (type == TouchEventType::TOUCH_EVENT_ENDED)
	{
		for (int i = 0; i < 3; i++)
		{
			if (pItem == m_pMenuItemRaisePartPot[i])
			{
				Json::Value msg;
				msg["betJettonNum"] = m_dRaisePartPot[i];
				msg["betType"] = 2;
				msg["mangTag"] = 0;
				SendClientRequest(ClientRequest::kAddScore, msg);
				break;
			}
		}
	}

}
Beispiel #29
0
void GameRecord::menuProfitSort(cocos2d::Ref* pSender)
{
    m_btProfitSort->setEnabled(false);
    m_btTimeSort->setEnabled(true);

    m_uCurPage = 1;
    m_uSortType = 1;
     if (g_globalGameRecord.m_vecPageIdx[1].size() == 0)
     {
         Json::Value param;
         param["page"] = 0;
         param["sortType"] = 2;
         param["countPerPage"] = GameRecordPerPage;
         SendClientRequest(ClientRequest::kGetGamePlayBackList, param);
     }
     else
     {
         UpdataRecordView(1, 0);
     }
}
Beispiel #30
0
void SngRule::setVisible(bool bVisible)
{
	//GameDialog::setVisible(bVisible) ;
    PlayVisibleSound(bVisible);
	if (bVisible)
	{
     /*   auto actScale = Spawn::create(ScaleTo::create(0.2, 1.0), FadeIn::create(0.2), nullptr);
        runAction(Sequence::create(CallFunc::create([this](){setOpacity(0);setScale(0);GameDialog::setVisible(true);}), actScale, nullptr));*/
		GameDialog::setVisible(bVisible) ;
		Tools::callScaleAction(this) ;
	}
	else
	{
		SendClientRequest(ClientRequest::kOptSNGHallBgLayer);
		callHideAction() ;
		/*  auto actScale = Spawn::create(ScaleTo::create(0.2, 0.618), FadeOut::create(0.2), nullptr);
		runAction(Sequence::create(actScale, CallFunc::create([this](){GameDialog::setVisible(false);}), nullptr));*/
	}

}