Example #1
0
void LevelCompletion(void)
{
	WhiteOverlay->Position.x = GetCameraXPosition();
	BlackOverlay->Position.x = GetCameraXPosition();

	if (WhiteOverlay->Alpha > 1)
	{
		//Allow player to upgrade their player if upgrades are available
		if (UpgradeComplete)
		{
			//Continue onto the map
			if (BlackOverlay->Alpha > 1)
			{
				if(GetCurrentState() == GS_Level1)
					SetNextState(GS_Narr1);
				else
					SetNextState(GS_MapLevel);
			}
			else
				BlackOverlay->Alpha += GetDeltaTime();
		}
		else if (!UpgradeComplete)
			UpdateUpgradeScreenObjects();
	}
	else
		WhiteOverlay->Alpha += 2 * GetDeltaTime();
}
Example #2
0
//--------------------------------------------------------------------------------
//		Handle Events
//--------------------------------------------------------------------------------
void Title::HandleEvents(StateInfo& stateinfo, SDL_Event& event)
{
	//While there's events to handle
    while( SDL_PollEvent( &event ) )
    {
		switch(event.type)
		{
		//--------------------------------------------------------------------------------
		//		Windows events
		//--------------------------------------------------------------------------------
		case SDL_WINDOWEVENT:
			{
				switch(event.window.event)
				{
				case SDL_WINDOWEVENT_CLOSE:
					{
						//Quit the program
						SetNextState( stateinfo, STATE_EXIT );
						break;
					}
				}
				break;

			}	//End: case SDL_WINDOWEVENT:

		//--------------------------------------------------------------------------------
		//		Keybourd events
		//--------------------------------------------------------------------------------
		case SDL_KEYDOWN:
			{
				switch (event.key.keysym.sym)
				{
				case SDLK_ESCAPE :
					{
						//Quit the program
						SetNextState( stateinfo, STATE_EXIT );
						break;
					}
				case SDLK_s :
					{
						//Enter the game
						SetNextState(stateinfo, STATE_OVERWORLD);
						break;
					}
				case SDLK_f :
					{
						//Enter the game
						WINDOW->ToggleFullScreen();
						break;
					}
				}
				break;

			} //End: case SDL_KEYDOWN:

		} //End: switch(event.type)

	} //End: while( SDL_PollEvent( &event ) )

} //End: Title::HandleEvents()
Example #3
0
/*
 * Cancel hes been received, still waiting for response.
 * Do not fail if timeout
 */
static void
StunState_Cancelled(STUN_TRANSACTION_DATA* trans,
                    STUN_SIGNAL            sig,
                    uint8_t*               payload)
{
  switch (sig)
  {
  case STUN_SIGNAL_BindResp:
  {
    StunRespStruct* pMsgIn = (StunRespStruct*)payload;
    StunMessage*    pResp  = &pMsgIn->stunRespMessage;

    StopTimer(trans, STUN_SIGNAL_TimerRetransmit);
    trans->ttl = pMsgIn->ttl;
    if ( StoreBindResp(trans, pResp) )
    {
      BindRespCallback(trans, (struct sockaddr*)&pMsgIn->srcAddr);
    }
    else
    {
      CallBack(trans, StunResult_MalformedResp);
    }
    trans->stats.BindRespReceived_AfterCancel++;
    SetNextState(trans, STUN_STATE_Idle);
    break;
  }

  case STUN_SIGNAL_BindRespError:
  {
    CallBack(trans, StunResult_BindFail);
    trans->stats.BindRespErrReceived++;
    SetNextState(trans, STUN_STATE_Idle);
    break;
  }

  case STUN_SIGNAL_TimerRetransmit:
  {
    CancelRetryTimeoutHandler(trans);
    break;
  }

  case STUN_SIGNAL_DeAllocate:
  {
    StopTimer(trans, STUN_SIGNAL_TimerRetransmit);
    SetNextState(trans, STUN_STATE_Idle);
    break;
  }
  case STUN_SIGNAL_Cancel:
    /* Ignore */
    break;

  default:
    StunAllState(trans, sig);
    break;
  }

} /* StunState_Cancelled() */
/*! Callback for Simple Descriptor Request */
static void ProcessServiceDiscovery(
    const EmberAfServiceDiscoveryResult *result) {
  // if we get a matche or a default response handle it
  // otherwise stop commissioning or go to the next incoming device
  if (emberAfHaveDiscoveryResponseStatus(result->status)) {
    EmberAfClusterList *discovered_clusters =
        (EmberAfClusterList *)result->responseData;

    // if our device requested to bind to server clusters (is_server parameter
    // during the SimpleCommissioningStart was FALSE) -> use inClusterList of
    // the incoming device's response
    // otherwise -> outClusterList (as our device has server clusters)
    const uint16_t *inc_clusters_arr = (dev_comm_session.is_server)
                                           ? discovered_clusters->outClusterList
                                           : discovered_clusters->inClusterList;
    // get correct lenght of the incoming clusters array
    const uint8_t inc_clusters_arr_len =
        (dev_comm_session.is_server) ? discovered_clusters->outClusterCount
                                     : discovered_clusters->inClusterCount;
    // init clusters skip mask length for further using
    InitRemoteSkipCluster(inc_clusters_arr_len);
    // check how much clusters our device wants to bind to
    uint8_t supported_clusters =
        CheckSupportedClusters(inc_clusters_arr, inc_clusters_arr_len);

    emberAfDebugPrintln("DEBUG: Supported clusters %d", supported_clusters);
    if (supported_clusters == 0) {
      // we should not do anything with that, just wait maybe another response
      // would come
      SetNextEvent(SC_EZEV_TIMEOUT);
      SetNextState(SC_EZ_WAIT_IDENT_RESP);
      emberEventControlSetDelayMS(
          StateMachineEvent, SIMPLE_COMMISSIONING_IDENTIFY_RESPONSE_WAIT_TIME());
    } else {
      // update our incoming device structure with information about clusters
      SetInDevicesClustersInfo(inc_clusters_arr, inc_clusters_arr_len,
                               supported_clusters);
      // Now we have all information about responded device's clusters
      // Start matching procedure for checking how much of them fit for our
      // device
      SetNextEvent(SC_EZEV_CHECK_CLUSTERS);
      SetNextState(SC_EZ_MATCH);
      emberEventControlSetActive(StateMachineEvent);
    }
  } else {
    // we should not do anything with that, just wait maybe another response
    // would come
    SetNextEvent(SC_EZEV_TIMEOUT);
    SetNextState(SC_EZ_WAIT_IDENT_RESP);
    emberEventControlSetDelayMS(
        StateMachineEvent, SIMPLE_COMMISSIONING_IDENTIFY_RESPONSE_WAIT_TIME());
  }
}
Example #5
0
void CArtefact::OnActiveItem ()
{
	SwitchState					(eShowing);
	inherited::OnActiveItem		();
	SetState					(eIdle);
	SetNextState				(eIdle);
}
Example #6
0
CWeaponKnife::CWeaponKnife()
{
	SetState				( eHidden );
	SetNextState			( eHidden );
	knife_material_idx		= (u16)-1;
	fHitImpulse_cur			= 0.0f;
}
/*! State Machine function */
void emberAfPluginSimpleCommissioningInitiatorStateMachineEventHandler(void) {
  emberEventControlSetInactive(StateMachineEvent);
  // That might happened that ZigBee state machine changed current network
  // So, it is important to switch to the proper network before commissioning
  // state machine might start
  EmberStatus status = emberAfPushNetworkIndex(dev_comm_session.network_index);
  if (status != EMBER_SUCCESS) {
    // TODO: Handle unavailability of switching network
  }
  emberAfDebugPrintln("DEBUG: State Machine");
  // Get state previously set by some handler
  CommissioningState_t cur_state = GetNextState();
  CommissioningEvent_t cur_event = GetNextEvent();
  for (size_t i = 0; i < TRANSIT_TABLE_SIZE(); ++i) {
    if ((cur_state == sm_transition_table[i].state ||
         SC_EZ_UNKNOWN == sm_transition_table[i].state) &&
        ((cur_event == sm_transition_table[i].event) ||
         SC_EZEV_UNKNOWN == sm_transition_table[i].event)) {
      // call handler which set the next_state on return and
      // next_event inside itself
      SetNextState((sm_transition_table[i].handler)());
      break;
    }
  }

  // Don't forget to pop Network Index
  status = emberAfPopNetworkIndex();
  // sanity check that network switched back properly
  EMBER_TEST_ASSERT(status == EMBER_SUCCESS);
}
/** @brief Identify Cluster Identify Query Response
 *
 *
 *
 * @param timeout   Ver.: always
 */
boolean emberAfIdentifyClusterIdentifyQueryResponseCallback(int16u timeout) {
  // TODO: !!! IMPORTANT !!! add  handling for several responses
  // now the state machine might be broken as we use only one global variable
  // for storing incoming connection information like Short ID and endpoint
  //
  // ignore broadcasts from yourself and from devices that are not
  // in the identifying state
  const EmberAfClusterCommand *const current_cmd = emberAfCurrentCommand();
  if (emberAfGetNodeId() != current_cmd->source && timeout != 0) {
    emberAfDebugPrintln("DEBUG: Got ID Query response");
    emberAfDebugPrintln("DEBUG: Sender 0x%2X", emberAfCurrentCommand()->source);
    // Queue is empty, so we can start commissioning process
    // otherwise we push it in the queue and will process later
    if (GetQueueSize() == 0) {
      // ID Query received -> go to the discover state for getting clusters info
      emberAfDebugPrintln("DEBUG: QUEUE IS EMPTY");
      SetNextState(SC_EZ_DISCOVER);
      SetNextEvent(SC_EZEV_CHECK_CLUSTERS);
      emberEventControlSetActive(StateMachineEvent);
    }
    // Store information about endpoint and short ID of the incoming response
    // for further processing in the Matching (SC_EZ_MATCH) state
    SetInConnBaseInfo(current_cmd->source,
                      current_cmd->apsFrame->sourceEndpoint);
    emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS);
  }

  return TRUE;
}
Example #9
0
static void
CancelRetryTimeoutHandler(STUN_TRANSACTION_DATA* trans)
{
  STUN_CLIENT_DATA* client = trans->client;
  uint32_t max;

  if (trans->stunBindReq.stuntrace)
  {
    max = STUNTRACE_MAX_RETRANSMITS;
  }
  else
  {
    max = STUNCLIENT_MAX_RETRANSMITS;
  }


  if ( (trans->retransmits < max)
       && (stunTimeoutList[trans->retransmits] != 0) ) /* can be 0 terminated if
                                                        * using fewer
                                                        * retransmits
                                                        **/
  {
    StartNextRetransmitTimer(trans);
    trans->retransmits++;
  }
  else
  {
    StunPrint(client->logUserData, client->Log_cb, StunInfoCategory_Trace,
              "<STUNCLIENT:%02d> Cancel complete", trans->inst);
    CallBack(trans, StunResult_CancelComplete);
    SetNextState(trans, STUN_STATE_Idle);
  }
}
Example #10
0
void CWeapon::SwitchState(u32 S)
{
	if (OnClient()) return;

#ifndef MASTER_GOLD
	if ( bDebug )
	{
		Msg("---Server is going to send GE_WPN_STATE_CHANGE to [%d], weapon_section[%s], parent[%s]",
			S, cNameSect().c_str(), H_Parent() ? H_Parent()->cName().c_str() : "NULL Parent");
	}
#endif // #ifndef MASTER_GOLD

	SetNextState		( S );
	if (CHudItem::object().Local() && !CHudItem::object().getDestroy() && m_pInventory && OnServer())	
	{
		// !!! Just single entry for given state !!!
		NET_Packet		P;
		CHudItem::object().u_EventGen		(P,GE_WPN_STATE_CHANGE,CHudItem::object().ID());
		P.w_u8			(u8(S));
		P.w_u8			(u8(m_sub_state));
		P.w_u8			(m_ammoType);
		P.w_u8			(u8(iAmmoElapsed & 0xff));
		P.w_u8			(m_set_next_ammoType_on_reload);
		CHudItem::object().u_EventSend		(P, net_flags(TRUE, TRUE, FALSE, TRUE));
	}
}
void CPolicyImporter::StateImportUserPrivKeyL()
    {
    LOG_("CPolicyImporter::StateImportUserPrivKeyL() entry");
    SetCurrState(EStateImportUserPrivKey);

    iCurrUserPrivKeyIndex++;

    if (iCurrUserPrivKeyIndex == iCurrUserPrivKeyList->Count())
        {
        GotoState(EStateImportPinAndPol);
        LOG_("CPolicyImporter::StateImportUserPrivKeyL() exit (all keys imported)");
        return;
        }

    delete iKeyFileData;
    iKeyFileData = NULL;
    iKeyFileData = iFileUtil.LoadFileDataL(iCurrUserPrivKeyList->At(iCurrUserPrivKeyIndex));
    CIkeData* data = iCurrIkeDataArray->At(iCurrIkeDataIndex);
    TPkiServiceStoreType storeType = GetStoreTypeL(data);
    iPkiService.SetStoreType(storeType);

    iPkiService.StoreKeypair(iCurrKeyId, *iKeyFileData, iStatus);

    SetNextState(EStateAfterImportUserPrivKey);
    SetActive();
    LOG_("CPolicyImporter::StateImportUserPrivKeyL() exit");
    }
void CPolicyImporter::StateImportPeerCertL()
    {
    LOG_("CPolicyImporter::StateImportOtherCaCertL() entry");
    SetCurrState(EStateImportPeerCert);

    iCurrOtherCaCertIndex++;

    if (iCurrOtherCaCertIndex == iCurrOtherCaCertList->Count())
        {
        GotoState(EStateImportUserPrivKey);
        LOG_("CPolicyImporter::StateImportOtherCaCertL() exit (all intermediate CAs imported)");
        return;
        }

    delete iCertFileData;
    iCertFileData = NULL;
    iCertFileData = iFileUtil.LoadFileDataL(iCurrOtherCaCertList->At(iCurrOtherCaCertIndex));
    CIkeData* data = iCurrIkeDataArray->At(iCurrIkeDataIndex);
    TPkiServiceStoreType storeType = GetStoreTypeL(data);
    iPkiService.SetStoreType(storeType);

    iPkiService.StoreCertificateL(EPKICACertificate, KDefaultKeySize, EPKIRSA, *iCertFileData,
                                  &iPkiOpContext, iStatus);

    SetNextState(EStateAfterImportPeerCert);
    SetActive();
    LOG_("CPolicyImporter::StateImportOtherCACertL() exit");
    }
void CPolicyImporter::StateImportCaCertL()
    {
    LOG_("CPolicyImporter::StateImportCaCertL() entry");
    SetCurrState(EStateImportCaCert);

    iCurrCaCertIndex++;

    if (iCurrCaCertIndex == iCurrCaCertList->Count())
        {
        GotoState(EStateImportPeerCert);
        LOG_("CPolicyImporter::StateImportCaCertL() exit (all CA certs imported)");
        return;
        }

    delete iCertFileData;
    iCertFileData = NULL;
    iCertFileData = iFileUtil.LoadFileDataL(iCurrCaCertList->At(iCurrCaCertIndex));

    iPkiService.StoreCertificateL(EPKICACertificate, KDefaultKeySize, EPKIRSA, *iCertFileData,
                                  &iPkiOpContext, iStatus);

    SetNextState(EStateAfterImportCaCert);
    SetActive();
    LOG_("CPolicyImporter::StateImportCaCertL() exit");
    }
Example #14
0
BOOL CWeapon::net_Spawn		(CSE_Abstract* DC)
{
	m_fRTZoomFactor					= m_zoom_params.m_fScopeZoomFactor;
	BOOL bResult					= inherited::net_Spawn(DC);
	CSE_Abstract					*e	= (CSE_Abstract*)(DC);
	CSE_ALifeItemWeapon			    *E	= smart_cast<CSE_ALifeItemWeapon*>(e);

	//iAmmoCurrent					= E->a_current;
	iAmmoElapsed					= E->a_elapsed;
	m_flagsAddOnState				= E->m_addon_flags.get();
	m_ammoType						= E->ammo_type;
	SetState						(E->wpn_state);
	SetNextState					(E->wpn_state);
	
	m_DefaultCartridge.Load(m_ammoTypes[m_ammoType].c_str(), m_ammoType);
	if(iAmmoElapsed) 
	{
		m_fCurrentCartirdgeDisp = m_DefaultCartridge.param_s.kDisp;
		for(int i = 0; i < iAmmoElapsed; ++i) 
			m_magazine.push_back(m_DefaultCartridge);
	}

	UpdateAddonsVisibility();
	InitAddons();

	m_dwWeaponIndependencyTime = 0;

	VERIFY((u32)iAmmoElapsed == m_magazine.size());
	m_bAmmoWasSpawned		= false;


	return bResult;
}
Example #15
0
CWeaponKnife::CWeaponKnife() : CWeapon("KNIFE") 
{
	m_attackStart			= false;
	SetState				( eHidden );
	SetNextState			( eHidden );
	knife_material_idx		= (u16)-1;
	SetSlot					(KNIFE_SLOT);
}
void CPolicyImporter::GotoState(TInt aState)
    {
    LOG_1("-> CPolicyImporter::GotoState() STATE %d", aState);
    SetNextState(aState);
    SetActive();
    TRequestStatus* status = &iStatus;
    User::RequestComplete(status, KErrNone);
    LOG_("<- CPolicyImporter::GotoState()");
    }
Example #17
0
RandomGoComponent::RandomGoComponent():
	M5StateMachine(CT_RandomGoComponent),
	m_speed(1),
	m_rotateSpeed(1),
	m_findState(this),
	m_rotateState(this),
	m_goState(this)
{
	SetNextState(&m_findState);
}
Example #18
0
	void StateEditorMode::Resume(){
		editorOverLayController_->Resize();
		SetStateDirection(EnumDLL::STATEDIRECTION::NA);
		SetNextState(NULL);

		//Resize menus
		//I dont have a resize menu type function atm
		//i could just destroy and remake
		//But then my remake doesnt have adjustments based on screen size as of yet
	}
Example #19
0
void CArtefact::OnHiddenItem ()
{
	if(IsGameTypeSingle())
		SwitchState(eHiding);
	else
		SwitchState(eHidden);

	inherited::OnHiddenItem		();
	SetState					(eHidden);
	SetNextState				(eHidden);
}
bool CStateWaitingForCommand::Execute(DWORD dwCommand)
{
	switch (dwCommand)
	{
	case -1:
		if (!Initialize())
			return false;
		break;
	case eCSStopRecording:
	case eCSStartRecording:
		SetNextState(eStateRecording);
		break;
	case eCSShutdown:
		SetNextState(eStateShuttingDown);
		break;
	default:
		// don't crash... but display the incorrect msg for debugging
		DebugTell(_T("CStateWaitingForCommand[%d]::Execute: Unknown command %d"),m_pRM->m_nRoomId,dwCommand);
		break;
	}
	return true;
}
Example #21
0
	void StateEditorMode::KeyPress(){
		if(GetEvent()->type == ALLEGRO_EVENT_KEY_UP)
		{
			switch(GetEvent()->keyboard.keycode)
			{
				case ALLEGRO_KEY_ESCAPE:						
					SetStateDirection(EnumDLL::STATEDIRECTION::PUSH);
					SetNextState(new StateEditorMenu());
					break;
			}
		}
		editorOverLayController_->KeyBoardActivity(GetEvent());
	}
Example #22
0
void GameCompletion(void)
{
	BlackOverlay->Position.x = GetCameraXPosition();

	//Continue onto the map
	if (BlackOverlay->Alpha > 1)
	{
		// Change to narrative
		SetNextState(GS_Narr2);
	}
	else
		BlackOverlay->Alpha += GetDeltaTime();

}
Example #23
0
CWeapon::CWeapon()
{
	SetState				(eHidden);
	SetNextState			(eHidden);
	m_sub_state				= eSubstateReloadBegin;
	m_bTriStateReload		= false;
	SetDefaults				();

	m_Offset.identity		();
	m_StrapOffset.identity	();

	m_iAmmoCurrentTotal		= 0;
	m_BriefInfo_CalcFrame	= 0;

	iAmmoElapsed			= -1;
	iMagazineSize			= -1;
	m_ammoType				= 0;

	eHandDependence			= hdNone;

	m_zoom_params.m_fCurrentZoomFactor			= g_fov;
	m_zoom_params.m_fZoomRotationFactor			= 0.f;
	m_zoom_params.m_pVision						= NULL;
	m_zoom_params.m_pNight_vision				= NULL;

	m_pCurrentAmmo			= NULL;

	m_pFlameParticles2		= NULL;
	m_sFlameParticles2		= NULL;


	m_fCurrentCartirdgeDisp = 1.f;

	m_strap_bone0			= 0;
	m_strap_bone1			= 0;
	m_StrapOffset.identity	();
	m_strapped_mode			= false;
	m_can_be_strapped		= false;
	m_ef_main_weapon_type	= u32(-1);
	m_ef_weapon_type		= u32(-1);
	m_UIScope				= NULL;
	m_set_next_ammoType_on_reload = undefined_ammo_type;
	m_crosshair_inertion	= 0.f;
	m_activation_speed_is_overriden	=	false;
	m_cur_scope				= NULL;
	m_bRememberActorNVisnStatus = false;
}
void CPolicyImporter::StateAttachCertificateL()
    {
    LOG_("CPolicyImporter::StateAttachCertificateL() entry");
    SetCurrState(EStateAttachCertificate);

    iCurrIkeDataIndex++;

    if (iCurrIkeDataIndex == iCurrIkeDataArray->Count())
        {
        // Import the next private key, if present
        GotoState(EStateImportUserPrivKey);
        return;
        }

    CIkeData* ikeData = iCurrIkeDataArray->At(iCurrIkeDataIndex);
    HBufC* fileName(NULL);
    TPkiServiceStoreType storeType = GetStoreTypeL(ikeData);
    iPkiService.SetStoreType(storeType);

    fileName = iFileUtil.MakeFileName(iImportDir, ikeData->iPrivKey.iData).AllocLC();

    if (fileName->CompareF(iCurrUserPrivKeyList->At(iCurrUserPrivKeyIndex)) == 0)
        {
        CleanupStack::PopAndDestroy(fileName);
        fileName = NULL;

        fileName = iFileUtil.MakeFileName(iImportDir, ikeData->iOwnCert.iData).AllocLC();

        delete iCertFileData;
        iCertFileData = NULL;
        iCertFileData = iFileUtil.LoadFileDataL(*fileName);

        iPkiService.AttachCertificateL(iCurrKeyId, KDefaultKeySize, EPKIRSA, *iCertFileData,
                                       &iPkiOpContext, iStatus);

        SetNextState(EStateAfterAttachCertificate);
        SetActive();
        }
    else
        {
        // Attach the next certificate, if present
        GotoState(EStateAttachCertificate);
        }
    CleanupStack::PopAndDestroy(fileName); // fileName
    LOG_("CPolicyImporter::StateAttachCertificateL() exit");
    }
Example #25
0
void GameApp::DoTransition(int trans, int tostate, float dur, bool animonly)
{
    TransitionBase * tb = NULL;
    GameState * toState = NULL;
    if (options[Options::TRANSITIONS].number != 0)
    {
        if (tostate != GAME_STATE_NONE)
            SetNextState(tostate);
        return;
    }

    if (tostate > GAME_STATE_NONE && tostate < GAME_STATE_MAX)
        toState = mGameStates[tostate];

    if (mGameStates[GAME_STATE_TRANSITION])
    {
        tb = (TransitionBase*) mGameStates[GAME_STATE_TRANSITION];
        if (toState)
            tb->to = toState; //Additional calls to transition merely update the destination.
        return;
    }

    if (dur < 0)
        dur = DEFAULT_DURATION; // Default to this value.
    switch (trans)
    {
    case TRANSITION_FADE_IN:
        tb = NEW TransitionFade(this, mCurrentState, toState, dur, true);
        break;
    case TRANSITION_FADE:
    default:
        tb = NEW TransitionFade(this, mCurrentState, toState, dur, false);
    }
    if (tb)
    {
        tb->bAnimationOnly = animonly;
        mGameStates[GAME_STATE_TRANSITION] = tb;
        mGameStates[GAME_STATE_TRANSITION]->Start();
        SetCurrentState(tb); //The old current state is ended inside our transition.
    }
    else if (toState)
    { //Somehow failed, just do standard SetNextState behavior
        mNextState = toState;
    }
}
void CAccountManagerPropertiesPage::OnPageChanged( wxWizardExEvent& /*event*/ )
{
//    if (event.GetDirection() == false) return;
 
    CWizardAttach* pWA = ((CWizardAttach*)GetParent());
    wxASSERT(m_pTitleStaticCtrl);
    wxASSERT(m_pPleaseWaitStaticCtrl);
    wxASSERT(m_pProgressIndicator);
    wxASSERT(pWA);

    if (!pWA->m_strProjectName.IsEmpty()) {
        wxString str;

        // %s is the project name
        //    i.e. 'BOINC', 'GridRepublic'
        str.Printf(_("Communicating with %s."), pWA->m_strProjectName.c_str());

        m_pTitleStaticCtrl->SetLabel(
            str
        );
    } else {
        m_pTitleStaticCtrl->SetLabel(
            _("Communicating with server.")
        );
    }

    m_pPleaseWaitStaticCtrl->SetLabel(
        _("Please wait...")
    );

    SetProjectPropertiesSucceeded(false);
    SetProjectPropertiesURLFailure(false);
    SetProjectPropertiesCommunicationFailure(false);
    SetProjectAccountCreationDisabled(false);
    SetProjectClientAccountCreationDisabled(false);
    SetNetworkConnectionNotDetected(false);
    SetTermsOfUseRequired(true);
    SetCredentialsAlreadyAvailable(false);
    SetNextState(ACCTMGRPROP_INIT);

    CAccountManagerPropertiesPageEvent TransitionEvent(wxEVT_ACCOUNTMANAGERPROPERTIES_STATECHANGE, this);
    AddPendingEvent(TransitionEvent);

    Fit();
}
Example #27
0
static void
CommonRetryTimeoutHandler(STUN_TRANSACTION_DATA* trans,
                          StunResult_T           stunResult,
                          const char*            errStr,
                          STUN_STATE             FailedState)
{
  STUN_CLIENT_DATA* client = trans->client;

  uint32_t max;

  if (trans->stunBindReq.stuntrace)
  {
    max = STUNTRACE_MAX_RETRANSMITS;
  }
  else
  {
    max = STUNCLIENT_MAX_RETRANSMITS;
  }

  if ( (trans->retransmits < max)
       && (stunTimeoutList[trans->retransmits] != 0) ) /* can be 0 terminated if
                                                        * using fewer
                                                        * retransmits
                                                        **/
  {
    char peer [SOCKADDR_MAX_STRLEN] = {0,};
    sockaddr_toString( (struct sockaddr*) &trans->stunBindReq.serverAddr, peer,
                       sizeof (peer), true );

    StunPrint(client->logUserData, client->Log_cb, StunInfoCategory_Trace,
              "<STUNCLIENT:%02d> Retrans %s Retry: %d to %s",
              trans->inst, errStr, trans->retransmits + 1, peer);
    RetransmitLastReq(trans, &trans->stunBindReq.serverAddr);
    StartNextRetransmitTimer(trans);
    trans->retransmits++;
    trans->stats.Retransmits++;
  }
  else
  {
    CallBack(trans, stunResult);
    SetNextState(trans, FailedState);
    trans->stats.Failures++;
  }
}
void CProjectProcessingPage::OnPageChanged( wxWizardExEvent& event ) {
    if (event.GetDirection() == false) return;
 
    wxASSERT(m_pTitleStaticCtrl);
    wxASSERT(m_pProgressIndicator);

    m_pTitleStaticCtrl->SetLabel(
        _("Communicating with project\nPlease wait...")
    );

    SetProjectCommunitcationsSucceeded(false);
    SetProjectUnavailable(false);
    SetProjectAccountAlreadyExists(false);
    SetNextState(ATTACHPROJECT_INIT);
 
    CProjectProcessingPageEvent TransitionEvent(wxEVT_PROJECTPROCESSING_STATECHANGE, this);
    AddPendingEvent(TransitionEvent);

    Fit();
}
Example #29
0
void TPZDarcyAnalysis::AssembleNextStep(TPZAnalysis *an)
{
    fcmeshdarcy->LoadSolution(falphaAtnplusOne);
    TPZBuildMultiphysicsMesh::TransferFromMultiPhysics(fmeshvec, fcmeshdarcy);
    SetNextState();
    an->Assemble();
    fResidualAtnplusOne = an->Rhs();
    
    // #ifdef PZDEBUG
    //     #ifdef LOG4CXX
    //         if(logger->isDebugEnabled())
    //         {
    //             std::stringstream sout;
    //             fResidualAtnplusOne.Print("fResidualAtnplusOne = ", sout,EMathematicaInput);
    //             LOGPZ_DEBUG(logger,sout.str())
    //         }
    //     #endif
    // #endif
    
}
void CAccountManagerProcessingPage::OnPageChanged( wxWizardExEvent& event )
{
    if (event.GetDirection() == false) return;
 
    CWizardAttach* pWA = ((CWizardAttach*)GetParent());
    
    wxASSERT(m_pTitleStaticCtrl);
    wxASSERT(m_pPleaseWaitStaticCtrl);
    wxASSERT(m_pProgressIndicator);
    wxASSERT(pWA);
        
    if (!pWA->m_strProjectName.IsEmpty()) {
        wxString str;

        // %s is the project name
        //    i.e. 'BOINC', 'GridRepublic'
        str.Printf(_("Communicating with %s."), pWA->m_strProjectName.c_str());

        m_pTitleStaticCtrl->SetLabel(
            str
        );
    } else {
        m_pTitleStaticCtrl->SetLabel(
            _("Communicating with server.")
        );
    }

    m_pPleaseWaitStaticCtrl->SetLabel(
        _("Please wait...")
    );

    SetProjectCommunicationsSucceeded(false);
    SetProjectUnavailable(false);
    SetProjectAccountAlreadyExists(false);
    SetNextState(ATTACHACCTMGR_INIT);
 
    CAccountManagerProcessingPageEvent TransitionEvent(wxEVT_ACCOUNTMANAGERPROCESSING_STATECHANGE, this);
    AddPendingEvent(TransitionEvent);

    Fit();
}