void KGatewaytest::TestUserLoginPaysysNeedMibaoPaysysNoRespond() // caseID: { int nResult = false; int nRetCode = false; char szTestCaseDscribe[] = "// caseID????:,测试Paysys返回登陆账号密码正确,需要密保验证时,客户端已经输入密保矩阵,但paysys不返回验证结果,Client玩家收到密保密码错误"; KG_RETURN_RESULT Result; KGLogPrintf(KGLOG_INFO, "caseID????:\n"); FillTestUserLoginInfo(KG_USER_MIBAO, ACTION_SUCCESS, AccountUserLoginInfo, PASSPODMODE_ZPMATRIX, ACTION_SUCCESS, false, false, ACTION_FAILED, true); nRetCode = InitTestEnvironment(true, true, true, 1, m_GatewayTestConfig.ForecastConfig.nTestPoint); KGLOG_PROCESS_ERROR(nRetCode); m_GatewayTestConfig.PaysysManagerConfig.nNotRespondSubProtocol = AccountUserPasspodVerify; nRetCode = m_pClientController->FillOperate( 3, onConnectToGateway, onHandShake, onAccountVerify //onMibaoVerify ); KGLOG_PROCESS_ERROR(nRetCode); nRetCode = m_pClientController->Run(); KGLOG_PROCESS_ERROR(nRetCode); Idle(70); nRetCode = m_pPaysys->SetAccountVerifyRespondType(AccountUserPasspodVerifyRet, PASSPODMODE_ZPMATRIX, ACTION_FAILED); KGLOG_PROCESS_ERROR(nRetCode); nRetCode = m_pClientController->AddOperateToClient(0, 1, onMibaoVerify); KGLOG_PROCESS_ERROR(nRetCode); Idle(70); nRetCode = m_pClientController->GetReturnResult(0, &Result); KGLOG_PROCESS_ERROR(nRetCode); nRetCode = memcmp(&Result, &(m_GatewayTestConfig.ForecastConfig), sizeof(Result)); KGLOG_PROCESS_ERROR(!nRetCode); nResult = true; Exit0: UnInitTestEnvironment(); #ifdef WIN32 { KG_CASE_INFO(szTestCaseDscribe, ""); KG_CPPUNIT_ASSERT(nResult); } #else { //InsertInfo(CASEPURPOSE, (szTestCaseDscribe)); //InsertInfo(PRECONDITION, ("")); CPPUNIT_ASSERT(nResult); } #endif }
void KGatewaytest::TestUserLoginPaysysNeedTokenSucceed() // caseID:24735 { int nResult = false; int nRetCode = false; char szTestCaseDscribe[] = "// caseID:24735:,测试Paysys正常登陆,GameCenter返回Client玩家不在线,玩家设置了令牌密保,输入令牌密码正确,玩家收到密码正确提示"; KG_RETURN_RESULT Result; KGLogPrintf(KGLOG_INFO, "caseID:24735\n"); FillTestUserLoginInfo(KG_USER_MIBAO, ACTION_SUCCESS, AccountUserLoginInfo, PASSPODMODE_ZPTOKEN, ACTION_SUCCESS, false, false, ACTION_SUCCESS, true); nRetCode = InitTestEnvironment(true, true, true, 1, m_GatewayTestConfig.ForecastConfig.nTestPoint); KGLOG_PROCESS_ERROR(nRetCode); nRetCode = m_pClientController->FillOperate( 3, onConnectToGateway, onHandShake, onAccountVerify //onMibaoVerify ); KGLOG_PROCESS_ERROR(nRetCode); nRetCode = m_pClientController->Run(); KGLOG_PROCESS_ERROR(nRetCode); Idle(70); //nRetCode = m_pPaysys->SetAccountVerifyRespondType(AccountUserPasspodVerifyRet, PASSPODMODE_ZPTOKEN, ACTION_SUCCESS); //KGLOG_PROCESS_ERROR(nRetCode); nRetCode = m_pClientController->AddOperateToClient(0, 1, onMibaoVerify); KGLOG_PROCESS_ERROR(nRetCode); Idle(70); nRetCode = m_pClientController->GetReturnResult(0, &Result); KGLOG_PROCESS_ERROR(nRetCode); nRetCode = memcmp(&Result, &(m_GatewayTestConfig.ForecastConfig), sizeof(Result)); KGLOG_PROCESS_ERROR(!nRetCode); nResult = true; Exit0: UnInitTestEnvironment(); #ifdef WIN32 { KG_CASE_INFO(szTestCaseDscribe, ""); KG_CPPUNIT_ASSERT(nResult); } #else { //InsertInfo(CASEPURPOSE, (szTestCaseDscribe)); //InsertInfo(PRECONDITION, ("")); CPPUNIT_ASSERT(nResult); } #endif }
void KGatewaytest::TestUserLoginPaysysNeedMibaoClientDisConnectedReConnect() // caseID:24738 { int nResult = false; int nRetCode = false; char szTestCaseDscribe[] = "// caseID:24738,测试Paysys正常登陆,GameCenter返回Client玩家不在线,玩家设置了密保卡,但玩家不输入密保密码就断线,重登"; int nAccountLockedState = false; KGLogPrintf(KGLOG_INFO, "caseID:24738\n"); FillTestUserLoginInfo(KG_USER_MIBAO, ACTION_SUCCESS, AccountUserLoginInfo, PASSPODMODE_ZPMATRIX, ACTION_SUCCESS, false, false, ACTION_SUCCESS, true); nRetCode = InitTestEnvironment(true, true, true, 1, m_GatewayTestConfig.ForecastConfig.nTestPoint); KGLOG_PROCESS_ERROR(nRetCode); nRetCode = m_pClientController->FillOperate( 3, onConnectToGateway, onHandShake, onAccountVerify //onDisConnect ); KGLOG_PROCESS_ERROR(nRetCode); nRetCode = m_pClientController->Run(); KGLOG_PROCESS_ERROR(nRetCode); Idle(70); //nRetCode = m_pPaysys->SetAccountVerifyRespondType(AccountUserPasspodVerifyRet, PASSPODMODE_ZPMATRIX, ACTION_SUCCESS); //KGLOG_PROCESS_ERROR(nRetCode); Idle(70); nRetCode = m_pClientController->AddOperateToClient(0, 4, onDisConnect, onConnectToGateway, onHandShake,onAccountVerify); KGLOG_PROCESS_ERROR(nRetCode); Idle(70); nRetCode = m_pClientController->CheckTheAccountLockedOrNot(0, &nAccountLockedState); KGLOG_PROCESS_ERROR(nRetCode); KGLOG_PROCESS_ERROR(!nAccountLockedState); nResult = true; Exit0: UnInitTestEnvironment(); #ifdef WIN32 { KG_CASE_INFO(szTestCaseDscribe, ""); KG_CPPUNIT_ASSERT(nResult); } #else { //InsertInfo(CASEPURPOSE, (szTestCaseDscribe)); //InsertInfo(PRECONDITION, ("")); CPPUNIT_ASSERT(nResult); } #endif }
void KGatewaytest::TestUserLoginPaysysNeedTokenClientDisConnectedReConnectPaysysNoRespond() // caseID:24740 { int nResult = false; int nRetCode = false; char szTestCaseDscribe[] = "// caseID:24740,测试Paysys正常登陆,GameCenter返回Client玩家不在线,玩家设置了令牌密保,但玩家输入密保密码,但paysys不返回验证结果,玩家断线重登"; int nAccountLockedState = false; KGLogPrintf(KGLOG_INFO, "caseID:24740\n"); FillTestUserLoginInfo(KG_USER_MIBAO, ACTION_SUCCESS, AccountUserLoginInfo, PASSPODMODE_ZPTOKEN, ACTION_SUCCESS, false, false, ACTION_SUCCESS, true); nRetCode = InitTestEnvironment(true, true, true, 1, m_GatewayTestConfig.ForecastConfig.nTestPoint); KGLOG_PROCESS_ERROR(nRetCode); nRetCode = m_pClientController->FillOperate( 3, onConnectToGateway, onHandShake, onAccountVerify //onMibaoVerify ); KGLOG_PROCESS_ERROR(nRetCode); nRetCode = m_pClientController->Run(); KGLOG_PROCESS_ERROR(nRetCode); Idle(70); nRetCode = m_pPaysys->SetNotHandleProtocol(74);//B2P_PLAYER_PASSPOD_VERIFY = 74 KGLOG_PROCESS_ERROR(nRetCode); nRetCode = m_pClientController->AddOperateToClient(0, 5, onMibaoVerify, onDisConnect, onConnectToGateway, onHandShake, onAccountVerify); KGLOG_PROCESS_ERROR(nRetCode); Idle(70); nRetCode = m_pClientController->CheckTheAccountLockedOrNot(0, &nAccountLockedState); KGLOG_PROCESS_ERROR(nRetCode); KGLOG_PROCESS_ERROR(!nAccountLockedState); nResult = true; Exit0: UnInitTestEnvironment(); #ifdef WIN32 { KG_CASE_INFO(szTestCaseDscribe, ""); KG_CPPUNIT_ASSERT(nResult); } #else { //InsertInfo(CASEPURPOSE, (szTestCaseDscribe)); //InsertInfo(PRECONDITION, ("")); CPPUNIT_ASSERT(nResult); } #endif }
signed char GetInput(void) { signed char ret = 0; ClearUI_Event = 1; while (ClearUI_Event) Idle(); while (ret == 0) { bLock_UI_Event = 1; ret = UI_Event; bLock_UI_Event = 0; Idle(); } return ret; }
void Transceiver::StopListen() { if (Connected()){ if (timer.Cycle()<(_helloCycle+20)) //check 1min Idle(); if (timer.Cycle()>_helloCycle+100) //after 5min without knock Deconnect(); } else { if (timer.Cycle() >(_KnockCycle+60)){ // check 3 min DBGINFO("StopListen"); Idle(); } } }
/*keybord function @param[in] key, the type of the key @param[in] x,y : the current position of the mouse */ void Keyboard(unsigned char key, int x, int y) { int mod = glutGetModifiers(); //the state(Shift,Ctrl,Alt) switch(key){ case '\033': // the ASCII code of ESC OnExitApp(); break; case ' ': //idle Idle(); break; case 's': //animation ON/OFF SwitchIdle(-1); break; case 'F': //Fullscreen SwitchFullScreen(); break; default: //drawing flag { int idx = 0; while(RX_DRAW_STR[2*idx]!="-1"&&(int)RX_DRAW_STR[2*idx+1][0]!=key) idx++; if(RX_DRAW_STR[2*idx]!="-1"){ g_iDraw=(0x01<<idx); } } break; } glutPostRedisplay(); }
void GlueMapWindow::OnPaintBuffer(Canvas &canvas) { #ifdef ENABLE_OPENGL ExchangeBlackboard(); EnterDrawThread(); /* update terrain, topography, ... */ if (Idle()) /* still dirty: schedule a redraw to load more data */ data_timer.Schedule(500); else data_timer.Cancel(); #endif MapWindow::OnPaintBuffer(canvas); DrawMapScale(canvas, GetClientRect(), render_projection); if (IsPanning()) DrawPanInfo(canvas); #ifdef ENABLE_OPENGL LeaveDrawThread(); #endif }
static void Key( unsigned char key, int x, int y ) { const GLfloat step = 3.0; (void) x; (void) y; switch (key) { case 'a': Anim = !Anim; if (Anim) glutIdleFunc(Idle); else glutIdleFunc(NULL); break; case 's': Idle(); break; case 'z': Zrot -= step; break; case 'Z': Zrot += step; break; case ' ': Init(); break; case 27: exit(0); break; } glutPostRedisplay(); }
int main(int argc, char* argv[]) { BYTE Buttons; printf("Example2: ByteIO\n"); #ifdef OnOSX signal(SIGINT, Quit); // Trap Control+C function Quit on Mac #endif if (!InitializeForByteIO()) { printf("\nFT232R cable found\n"); // Configure Buttons to be input WriteI2CByte(0xFF, ConfigurationRegister, ButtonsAddress); // Setup Buttons(InputPortRegister) as the default register WriteI2CByte(0xAA, InputPortRegister, ButtonsAddress); // Configure Lights to be output WriteI2CByte(0, ConfigurationRegister, LightsAddress); WriteI2CByte(0, ConfigurationRegister, DigitLSB); for (int i=0; i<100; i++) { Buttons = ReadI2CByte(ButtonsAddress); printf("\rButtons = %2.2X", Buttons); // BYTE Answer = (Buttons & 0xF) * ((Buttons>>4) & 0xF); WriteI2CByte(Buttons, OutputPortRegister, LightsAddress); WriteI2CByte(SevenSegmentLookup[i&0xf], OutputPortRegister, DigitLSB); Idle(1000); } } Quit(); }
void quit() { char string[StringSize]; my_log("POLYGLOT *** QUIT ***\n"); if (Init) { stop_search(); engine_send(Engine,"quit"); // wait for the engine to quit #ifndef _WIN32 while (true) { engine_get(Engine,string,sizeof(string)); // HACK: calls exit() on receiving EOF } #else Idle500msecs();// while(peek_engine_get(Engine,string,StringSize)) Idle(); #endif uci_close(Uci); } exit(EXIT_SUCCESS); }
/*..........................................................................*/ void QF_onIdle(void) { /* entered with interrupts disabled, NOTE01 */ LED_ON (IDLE_LED); /* blink the IDLE LED, see NOTE02 */ LED_OFF(IDLE_LED); #ifdef Q_SPY QF_INT_ENABLE(); /* enable interrupts, see NOTE01 */ while (U2STAbits.UTXBF == 0U) { /* TX Buffer not full? */ uint16_t b; QF_INT_DISABLE(); b = QS_getByte(); QF_INT_ENABLE(); if (b == QS_EOD) { /* End-Of-Data reached? */ break; /* break out of the loop */ } U2TXREG = (uint8_t)b; /* stick the byte to TXREG for transmission */ } #elif defined NDEBUG __asm__ volatile("disi #0x0001"); Idle(); /* transition to Idle mode, see NOTE03 */ #else QF_INT_ENABLE(); /* enable interrupts, see NOTE01 */ #endif }
void WorkerThread::Run(Thread*, void*) { // set the thread-local-storage pointer to "this" LocalWorkerThread_ = this; //ThisThread_.reset( (const_cast<Worker *>(this)) ); // TODO: Fix this. // infinitely loop for(;;) { // go idle Idle(); // check to see if the pool wants to exit // - if so, break out of the loop if( Pool_->IsDone_ ) break; // loop and check to see if the pool thinks there is work to be done while(Pool_->CurrentCompletion_ != nullptr) { // do work Work(nullptr); // -> null is passed to designate that this is not a call from within a task // check to see if the pool wants to exit // - if so, break out of the loop if(Pool_->IsDone_) break; } } // release the thread-local-storage LocalWorkerThread_ = nullptr; //ThisThread_.release(); // TODO: Fix this. }
/*----------------------------------------------------------------------------- * main */ int main(void) { uint8_t ret; int sioHdl; /* set clock prescaler to 2 (set clock to 7.3928 MHz) */ CLKPR = 1 << CLKPCE; CLKPR = 1; /* get module address from EEPROM */ sMyAddr = eeprom_read_byte((const uint8_t *)MODUL_ADDRESS); GetClientListFromEeprom(); PortInit(); TimerInit(); ButtonInit(); PwmInit(); ApplicationInit(); SioInit(); SioRandSeed(sMyAddr); /* sio for bus interface */ sioHdl = SioOpen("USART1", eSioBaud9600, eSioDataBits8, eSioParityNo, eSioStopBits1, eSioModeHalfDuplex); SioSetIdleFunc(sioHdl, IdleSio1); SioSetTransceiverPowerDownFunc(sioHdl, BusTransceiverPowerDown); BusTransceiverPowerDown(true); BusInit(sioHdl); spBusMsg = BusMsgBufGet(); /* warten for full operation voltage */ while (!POWER_GOOD); /* enable ints before RestorePwm() */ ENABLE_INT; TimerStart(); RestorePwm(); /* ext int for power fail: INT0 low level sensitive */ EICRA &= ~((1 << ISC01) | (1 << ISC00)); EIMSK |= (1 << INT0); ApplicationStart(); /* Hauptschleife */ while (1) { Idle(); ret = BusCheck(); ProcessBus(ret); CheckButton(); PwmCheck(); ApplicationCheck(); CheckEvent(); } return 0; }
Enemy::Enemy(double x, double y, const std::string &name): PE::Ai(x, y, name) { speed = 50.0; stateMachine.addState(Idle(stateMachine, *this)); stateMachine.changeState(IDLE_ID); SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Debug", "initStateMachine done", NULL); }
void Transceiver::StopListenBroadcast() { if (Connected()&& (timer.Cycle()<(_helloCycle+20)) ) //check 3min { Idle(); // timer.setStage(IMTimer::IDDLESTAGE); } }
// vrati proces jehoz aktivni faze bude zahajena po potlaceni tohoto procesu CProcess* CProcess::NextEv() { if (Idle()) return NULL; // proces nema zaznam o udalosti if (event->Suc() == NULL) return NULL; // udalost procesu nema naslednika return ((CEventNotice*)event->Suc())->proc; }
void WriteBits(UCHAR Value) { DWORD BytesWritten; FT_Status = FT_Write(FT_Handle, &Value, 1, &BytesWritten); if (FT_Status != FT_OK) { printf("\nFT_Write error (%d), Cable disconnected?\n", FT_Status); Idle(2000); // Display error message for 2 seconds Quit(); } }
void CHostageImprov::__MAKE_VHOOK(OnReset)() { m_moveFlags = 0; m_moveType = Stopped; m_moveLimit = Running; m_vel.x = 0; m_vel.y = 0; m_actualVel = Vector(0, 0, 0); m_checkNearbyTerroristTimer.Invalidate(); m_lastKnownArea = NULL; m_hasKnownGoodPos = false; m_hasPriorKnownGoodPos = false; m_isTerroristNearby = false; m_isCrouching = false; SetMoveAngle(m_hostage->pev->angles.y); m_moveGoal = m_hostage->m_vStart; ClearLookAt(); ClearFaceTo(); m_blinkTimer.Invalidate(); m_blinkCounter = 0; m_hostage->SetBoneController(2, 0); m_hostage->SetBoneController(3, 0); m_hostage->SetBoneController(4, 0); m_path.Invalidate(); m_chatterTimer.Invalidate(); m_visiblePlayerCount = 0; m_isDelayedChatterPending = 0; m_animateState.Reset(); m_didFidget = 0; m_lastSawCT.Start(); m_lastSawT.Start(); m_scaredTimer.Invalidate(); m_jumpTimer.Invalidate(); m_hasJumped = false; m_isFriendInTheWay = false; m_aggression = RANDOM_FLOAT(0, 1); StandUp(); m_behavior.Reset(this); Idle(); }
void CPROC UpdateAllButton(uintptr_t psv, PCONTROL pcButton) { PCLIENT pc; ConnectToRelay( &pc ); if( pc ) { SendTCP( pc, "UPDATE ", 8 ); while( pc ) Idle(); } }
void CPROC GetMasterStatusButton(uintptr_t psv, PCONTROL pcButton) { PCLIENT pc; ConnectToRelay( &pc ); if( pc ) { SendTCP( pc, "MASTER??", 8 ); while( pc ) Idle(); } }
void CPROC GetUserButton(uintptr_t psv, PCONTROL pcButton) { PCLIENT pc; ConnectToRelay( &pc ); if( pc ) { SendTCP( pc, "LISTUSER", 8 ); while( pc ) Idle(); } }
/*----------------------------------------------------------------------------- * program start */ int main(void) { int sioHandle; uint8_t windThreshold1; uint8_t windThreshold2; MCUSR = 0; wdt_disable(); /* get module address from EEPROM */ sMyAddr = eeprom_read_byte((const uint8_t *)MODUL_ADDRESS); windThreshold1 = eeprom_read_byte((const uint8_t *)WIND_THRESHOLD1); windThreshold2 = eeprom_read_byte((const uint8_t *)WIND_THRESHOLD2); GetClientListFromEeprom(); PortInit(); TimerInit(); SioInit(); sioHandle = SioOpen("USART0", eSioBaud9600, eSioDataBits8, eSioParityNo, eSioStopBits1, eSioModeHalfDuplex); SioSetIdleFunc(sioHandle, IdleSio); SioSetTransceiverPowerDownFunc(sioHandle, BusTransceiverPowerDown); BusTransceiverPowerDown(true); BusInit(sioHandle); spRxBusMsg = BusMsgBufGet(); /* enable global interrupts */ ENABLE_INT; SendStartupMsg(); /* wait for controller startup delay for sending first state telegram */ DELAY_S(STARTUP_DELAY); while (1) { Idle(); ProcessSwitch(); ProcessBus(); if (sWind >= windThreshold1) { sWindSwitch |= 0x01; } else { sWindSwitch &= ~0x01; } if (sWind >= windThreshold2) { sWindSwitch |= 0x02; } else { sWindSwitch &= ~0x02; } } return 0; /* never reached */ }
void CPROC RequestWinnersButton(uintptr_t psv, PCONTROL pcButton) { PCLIENT pc; ConnectToRelay( &pc ); if( pc ) { SendTCP( pc, "WINNERS?", 8 ); while( pc ) Idle(); } }
func Blocked(object clonk) { AddEffect("Blocked", this, 1, 1, this); Sound("Ball::ball_blocked", false, 20); SetRDir(20); var objectangle = Angle(clonk->GetX(), clonk->GetY(), GetX(), GetY()); //var tangle = 2* ( (objectangle + 90)%360 - entryangle) + entryangle; SetVelocity(objectangle, Speed); Idle(); }
UCHAR ReadBits(void) { UCHAR Value; DWORD BytesRead; FT_Status = FT_Read(FT_Handle, &Value, 1, &BytesRead); if (FT_Status != FT_OK) { printf("\nFT_Read error (%d), Cable disconnected?\n", FT_Status); Idle(2000); // Display error message for 2 seconds Quit(); } return ~Value; }
void vApplicationIdleHook(void) { /* * **configUSE_IDLE_HOOK must be set to 1** * Esta funcion se ejecuta cuando el procesador * no esta siendo utilizado por otra tarea */ ClrWdt(); Idle(); }
UcciCommEnum BootLine(void) { char szLineStr[SE_LINE_INPUT_MAX_CHAR]; pipeOpen(); while (!pipeInputReadLine(szLineStr)) { Idle(); } if (StrEqv(szLineStr, "ucci")) { return UCCI_COMM_UCCI; } else { return UCCI_COMM_UNKNOWN; } }
UcciCommEnum BootLine(void) { char szLineStr[LINE_INPUT_MAX_CHAR]; pipeStdHandle.Open(); while (!pipeStdHandle.LineInput(szLineStr)) { Idle(); } if (strcmp(szLineStr, "ucci") == 0) { return UCCI_COMM_UCCI; } else { return UCCI_COMM_NONE; } }
AUI_ERRCODE aui_UI::Idle( aui_Region *recurse ) { if ( !recurse ) { ListPos position = m_childList->GetTailPosition(); for ( sint32 i = m_childList->L(); i; i-- ) { aui_Region *window = m_childList->GetPrev( position ); window->Idle(); ListPos childPosition = window->ChildList()->GetHeadPosition(); for ( sint32 j = window->ChildList()->L(); j; j-- ) Idle( window->ChildList()->GetNext( childPosition ) ); if ( m_childListChanged ) { m_childListChanged = FALSE; return AUI_ERRCODE_OK; } } } else { recurse->Idle(); ListPos childPosition = recurse->ChildList()->GetHeadPosition(); for ( sint32 j = recurse->ChildList()->L(); j; j-- ) Idle( recurse->ChildList()->GetNext( childPosition ) ); } return AUI_ERRCODE_OK; }