Ejemplo n.º 1
0
BOOL	Obj_Item::HeartBeat(UINT uTime/* =0  */)
{
	__ENTER_FUNCTION

		BOOL bResult = Obj_Static::HeartBeat( uTime );
	if ( !bResult )
		return FALSE;

	UpdateZone();

	if( m_RecycleTimer.CountingTimer(uTime) )
	{
		//回收操作
		//
		Recycle();
		return TRUE;
	}

	return	TRUE;

	__LEAVE_FUNCTION

		return	FALSE;

}
Ejemplo n.º 2
0
void CRateOfDeathHelper_Target::Update( const float elapsedTimeSeconds, const CRateOfDeathHelper_AttackerInfo& attacker )
{
	if ( m_pTargetActor == NULL )
	{
		return;
	}

	UpdateStance();
	UpdateIsInVehicle();
	UpdateZone( attacker );
	UpdateStayAliveTime( attacker );
	UpdateHealth( elapsedTimeSeconds );
}
Ejemplo n.º 3
0
BOOL	Obj_ItemBox::HeartBeat(UINT uTime/* =0  */)
{
	__ENTER_FUNCTION

	BOOL bResult = Obj_Static::HeartBeat( uTime );
	if ( !bResult )
		return FALSE;
	
	// temp code {
	UpdateZone();
	// }

	if( m_RecycleTimer.CountingTimer(uTime) )
	{
		//回收操作
		//
		Recycle();
		return TRUE;
	}
	
	if(m_LifeTimer.CountingTimer(uTime))
	{
		INT ItemBoxType		=	 GetType();
		
		_GROW_POINT_INFO*	pGET = g_GrowPointInfoTbl.Get(ItemBoxType);

			Assert(pGET);

		if(pGET->m_ScriptID>0)
		{
			_MY_TRY
			{
				if(getScene() && getScene()->GetGrowPointManager()->CallScriptRecycleFunc(pGET->m_ScriptID,GetOwner(),GetID(),getScene()->SceneID()))
				{	
					//可以Recycle
					Recycle();
				}
			}
			_MY_CATCH
			{
				//可以Recycle
				SaveCodeLog( ) ;
				Recycle();
			}
		}
Ejemplo n.º 4
0
Archivo: zone.c Proyecto: unxs0/unxsVZ
void ZoneCommands(pentry entries[], int x)
{
	if(!strcmp(gcPage,"Zone"))
	{
		ProcessZoneVars(entries,x);
		if(!strcmp(gcFunction,"Select Zone"))
		{
			SelectZone(1);
			htmlZone();
		}
		else if(!strcmp(gcFunction,"New"))
		{
		//	SelectZone();//No hidden fields when disabled
			sprintf(gcNewStep,"Confirm ");
			gcMessage="Modify data, review, then confirm. Any other action to cancel.";
			gcInputStatus[0]=0;
			SetZoneFieldsOn();
			cuSerial[0]=0;
			htmlZone();
		}
		else if(!strcmp(gcFunction,"Confirm New"))
		{
			if(ValidateZoneInput())				
				NewZone();

			if(strcmp(gcMessage,"Zone Created"))
			{
				sprintf(gcNewStep,"Confirm ");
				gcInputStatus[0]=0;
				SetZoneFieldsOn();
			}
			else
			{
				
				time_t luClock;
				unsigned uNameServer=0;

				time(&luClock);

				sprintf(gcInputStatus,"disabled");
				sscanf(cuNameServer,"%u",&uNameServer);
	
				if(uNameServer)
				{
					if(AdminSubmitJob("New",uNameServer,gcZone,0,luClock))
						htmlPlainTextError(mysql_error(&gMysql));
				}
				else
				{
					gcMessage="<blink>Error: </blink>Contact admin: uNameServer error";
				}
				SelectZone(1);
			}
			htmlZone();		
		}		
		else if(!strcmp(gcFunction,"Modify"))
		{
			SelectZone(1);//No hidden fields when disabled
			sprintf(gcModStep,"Confirm ");
			gcMessage="Modify data, review, then confirm. Any other action to cancel.";
			gcInputStatus[0]=0;
			SetZoneFieldsOn();
			if(uOwner!=uForClient)
			{
				uForClient=uOwner; //Don't mess zone ownership by mistake if loaded via another company
				sprintf(gcCustomer,"%s",ForeignKey("tClient","cLabel",uOwner));
			}
			htmlZone();
		}
		else if(!strcmp(gcFunction,"Confirm Modify"))
		{
			if(ValidateZoneInput())
				UpdateZone();
			
			if(strcmp(gcMessage,"Zone Modified"))
			{
				sprintf(gcModStep,"Confirm ");
				gcInputStatus[0]=0;
				SetZoneFieldsOn();				
			}
			else
			{
				time_t luClock;
				unsigned uNameServer=0;

				time(&luClock);

				sprintf(gcInputStatus,"disabled");
				sscanf(cuNameServer,"%u",&uNameServer);
				if(uNameServer)
				{
					if(AdminSubmitJob("Modify",uNameServer,gcZone,0,luClock))
						htmlPlainTextError(mysql_error(&gMysql));
				}
				else
				{
					gcMessage="<blink>Error: </blink>Contact admin: uNameServer error";
				}
				SelectZone(1);
			}
			htmlZone();
		}
		else if(!strcmp(gcFunction,"Delete"))
		{
			SelectZone(1);//No hidden fields when disabled
			sprintf(gcDelStep,"Confirm ");			
			htmlZone();
		}
		else if(!strcmp(gcFunction,"Confirm Delete"))
		{
			SelectZone(1);//No hidden fields when disabled
			SaveZone();
			DelZone();
			if(!strcmp(gcMessage,"Zone Deleted"))
			{
				time_t luClock;
				unsigned uNameServer=0;

				time(&luClock);

				sprintf(gcInputStatus,"disabled");
				sscanf(cuNameServer,"%u",&uNameServer);
				if(uNameServer)
				{
					if(AdminSubmitJob("Delete",uNameServer,gcZone,0,luClock))
						htmlPlainTextError(mysql_error(&gMysql));
				}
				else
				{
					gcMessage="<blink>Error: </blink>Contact admin: uNameServer error";
				}
			}
			htmlZone();
			
		}
		else if(!strcmp(gcFunction,"Bulk Import"))
		{
			htmlBulkOp();
		}
		else if(!strcmp(gcFunction,"Restore Zones"))
		{
			htmlRestoreZone();
		}
		else if(!strcmp(gcFunction,"Restore RRs"))
		{
			htmlRestoreResource(cuZone);
		}
		else if(!strcmp(gcFunction,"Zone Diagnostics"))
		{
			ZoneDiagnostics();
		}
		else if(gcZone[0])
		{
			SelectZone(1);
			htmlZone();
		}
		htmlZone();
	}

}//void ZoneCommands(pentry entries[], int x)