예제 #1
0
void cActiveSkillObject::CastingState()
{
	if(gCurTime > mCastingTick)
	{
		Excute();

		mState = SKILL_STATE_END;
	}
}
예제 #2
0
void cActiveSkillObject::ProcessState()
{
	if(gCurTime > mProcessTick)
	{
		/// 실행
		Excute();

		mState = SKILL_STATE_END;
	}
}
예제 #3
0
void cActiveSkillObject::ProcessStart()
{
	switch(GetInfo().DelayType)
	{
		/// 발동 딜레이 없음
	case DELAY_NONE:
		{
			/// 스킬 종료 상태로 변경
			mState = SKILL_STATE_END;

			/// 스킬 실행
			Excute();
		}
		break;
		/// 시간형
	case DELAY_TIME:
		{
			mProcessTick = gCurTime + DWORD(GetInfo().DelayTime / mAttackSpeedRate);
			mState = SKILL_STATE_PROCESS;
		}
		break;
		/// 이동형
	case DELAY_SCOPE:
		{
			VECTOR3 oper;
			VECTOR3 tar;

			/// 시전자 위치
			GetOperator()->GetPosition( &oper );

			/// 타겟 위치
			tar.x = mSkillObjectInfo.mainTarget.cpTargetPos.wx;
			tar.z = mSkillObjectInfo.mainTarget.cpTargetPos.wz;

			const DWORD distance = ( DWORD )CalcDistanceXZ( &oper, &tar );
			mProcessTick = ( distance / GetInfo().DelayTime ) * 1000 + gCurTime;
			mState = SKILL_STATE_PROCESS;
		}
		break;
	}
}
예제 #4
0
/** 
 * @brief When timeout the Timer call this function.
 * 
 * @param timer The Navigate timer,watch the document load.
 * 
 * @return 
 */
NS_IMETHODIMP nsBrowserListener::Notify(nsITimer  *timer)
{
     LOG<<"timmer start:"<<running<<"count"<<timeCount<<"isScroll"<<isScrolled<<"\n";
     LOG<<"doc flag:"<<docStop<<" win flag"<<WinStop<<"\n";
     int breTime=(int)(interTime*(float)1000);
     if(running==NOT_RUN)
     {
	  if(brwStop)
	  {
	       LOG<<"stop browser set!\n";
	       timer->Cancel();
	       exit(1);
	  }else
	  {
	       if(docStop&&WinStop)
	       {
		    LOG<<"doc  fetched!\n";
		    if(scroolWait>0&&!isScrolled)
		    {
			 ScrollWin();
			 SetRunning(RUNNING);
			 isScrolled=true;
			 breTime=scroolWait*1000;
		    }else
		    {
			 //Init event stat.
			 SetEventWait(false);
			      
			 nsCOMPtr<nsIWebNavigation> nav = do_QueryInterface(mBro);
			 if(!browError)
			 {
			      //redirect the browser to the target
			      ReDirect(nav);
			      if(!isred)
			      {
				   Excute(nav);			      
			      }
			 }
			 //if the evenWait has set, do not change the web site.
			 if(evenWait||isred)
			 {
			      SetRunning(RUNNING);
			      breTime=1000;
			 }else
			 {
			      nsCString tmpUrl;
			      GetUrl(tmpUrl);
			      LOG<<tmpUrl.get()<<"\n";
			      
			      if(tmpUrl.Length()>0)
			      {
				   //init running stat and scrool stat.
				   SetRunning(RUNNING);
				   isScrolled=false;
				   //navigate the web site.
				   WebNav(nav,tmpUrl);
			      }else
			      {
				   StopBrows();
			      }
			 }
		    }    
	       }else
	       {
		    LOG<<"waite count set!\n";
		    if(timeCount>3)
		    {
			 docStop=true;
			 WinStop=true;
			 timeCount=0;
		    }else
		    {
			 timeCount++;
		    }
	       }
	  }
     }else
     {
	  LOG<<"set not run!\n";
	  timeCount=0;
	  SetRunning(NOT_RUN);
	  breTime=6000;
     }
     timeOut->Cancel();

     LOG<<"timmer stop:"<<running<<"inter time:"<<breTime<<"\n";
     timeOut->InitWithCallback(this, breTime, 0);


     return NS_OK;
}
예제 #5
0
bool CSQLiteHelper::RollBackTransaction()
{
    return Excute("rollback transaction");
}
예제 #6
0
bool CSQLiteHelper::CommitTransaction()
{
    return Excute("commit transaction");
}
예제 #7
0
//事务相关接口
bool CSQLiteHelper::BeginTransaction()
{
    return Excute("begin transaction");
}