您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetStartTime函数代码示例

51自学网 2021-06-01 21:15:26
  C++
这篇教程C++ GetStartTime函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetStartTime函数的典型用法代码示例。如果您正苦于以下问题:C++ GetStartTime函数的具体用法?C++ GetStartTime怎么用?C++ GetStartTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetStartTime函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Update

void BattlegroundRL::Update (uint32 diff){    Battleground::Update(diff);    if (GetStatus() == STATUS_IN_PROGRESS)    {        if (GetStartTime() >= 47 * MINUTE * IN_MILLISECONDS)          // after 47 minutes without one team losing, the arena closes with no winner and no rating change        {            UpdateArenaWorldState();            CheckArenaAfterTimerConditions();        }    }}
开发者ID:814077430,项目名称:ArkCORE,代码行数:13,


示例2: Update

void BattlegroundDS::Update(uint32 diff){    Battleground::Update(diff);    if (GetStatus() == STATUS_IN_PROGRESS)    {        if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)    // after 47 minutes without one team losing, the arena closes with no winner and no rating change        {            UpdateArenaWorldState();            CheckArenaAfterTimerConditions();        }    }    if (getWaterFallTimer() < diff)    {        if (GetBgMap(false))            if (isWaterFallActive())            {                setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)                    SpawnBGObject(i, getWaterFallTimer());                setWaterFallActive(false);            }            else            {                setWaterFallTimer(BG_DS_WATERFALL_DURATION);                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)                    SpawnBGObject(i, RESPAWN_IMMEDIATELY);                setWaterFallActive(true);            }    }    else        setWaterFallTimer(getWaterFallTimer() - diff);    if (GetStatus() == STATUS_IN_PROGRESS)    {        if(m_knockback < diff && m_knockbackCheck)        {            for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); itr++)            {                Player * plr = sObjectMgr->GetPlayer(itr->first);                if (plr->GetTeam() == ALLIANCE && plr->GetDistance2d(1214, 765) <= 50 && plr->GetPositionZ() > 10)                    KnockBackPlayer(plr, 6.15f, 50.00f, 7.00f);                if (plr->GetTeam() == HORDE && plr->GetDistance2d(1369, 817) <= 50 && plr->GetPositionZ() > 10)                    KnockBackPlayer(plr, 3.10f, 50.00f, 7.00f);                plr->RemoveAurasDueToSpell(48018);            }            m_knockbackCheck = false;        } else m_knockback -= diff;    }}
开发者ID:fragiami,项目名称:ZoneLimit,代码行数:51,


示例3: GetStartTime

BOOL CMAPIAppointment::GetStartTime(CString& strStartTime, LPCTSTR szFormat){	SYSTEMTIME tm;	if(GetStartTime(tm)) 	{		TCHAR szTime[256];		if(!szFormat) szFormat=_T("MM/dd/yyyy hh:mm:ss tt");		GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szFormat, szTime, 256);		GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, &tm, szTime, szTime, 256);		strStartTime=szTime;		return TRUE;	}	return FALSE;}
开发者ID:DenSumy,项目名称:MapiEx,代码行数:14,


示例4: InitializeObjects

void BattlegroundNA::InitializeObjects(){    ObjectGUIDsByType.resize(BG_NA_OBJECT_MAX);    if (GetStatus() == STATUS_IN_PROGRESS)    {        if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)    // after 47 minutes without one team losing, the arena closes with no winner and no rating change        {            UpdateArenaWorldState();            CheckArenaAfterTimerConditions();        }    }    for (uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_4; ++i)        SpawnGameObject(i, RESPAWN_IMMEDIATELY);}
开发者ID:TrueWoW,项目名称:TrinityCore,代码行数:15,


示例5: CheckMaxTime

void CheckMaxTime()	{	if (0 == g_ulMaxSecs.get())		return;	time_t Now = time(0);	time_t ElapsedSecs = Now - GetStartTime();	if (ElapsedSecs <= (time_t) g_ulMaxSecs.get())		return;	Log("Max time %s exceeded, elapsed seconds = %ul/n",	  MaxSecsToStr(), ElapsedSecs);	SaveCurrentAlignment();	exit(EXIT_Success);	}
开发者ID:Wyss,项目名称:mauve-py,代码行数:16,


示例6: GetStartTime

void ThreadProc::run (void){    GetStartTime ();    SocketReBuild();    for(;!gameOver;)    {        if(!IsWorkinPermit())        {            msleep(10);            continue;        }        GoGoStatusMachineRecv();        DelaySRTime();        GoGoStatusMachineSend ();        OverTimeProc ();    }}
开发者ID:crazybun,项目名称:FreshTerminalOperatingTools,代码行数:18,


示例7: ReadOptionsDirectTimeRange

void ReadOptionsDirectTimeRange(struct options_direct *opts,struct input *X){  if(opts->t_start_flag==0)    {      opts->t_start = GetStartTime(X);      opts->t_start_flag=1;      mexWarnMsgIdAndTxt("STAToolkit:ReadOptionsTimeRange:missingParameter","Missing parameter start_time. Extracting from input: %f./n",opts->t_start);    }  if(opts->t_end_flag==0)    {      opts->t_end = GetEndTime(X);      opts->t_end_flag=1;      mexWarnMsgIdAndTxt("STAToolkit:ReadOptionsTimeRange:missingParameter","Missing parameter end_time. Extracting from input: %f./n",opts->t_end);    }  if((opts->t_start)>(opts->t_end))      mexErrMsgIdAndTxt("STAToolkit:ReadOptionsTimeRange:badRange","Lower limit greater than upper limit for start_time and end_time./n");}
开发者ID:Field-Lab,项目名称:matlab,代码行数:19,


示例8: CRC32_Init

unsigned int CPhonemeTag::ComputeDataCheckSum(){	CRC32_t crc;	CRC32_Init( &crc );	// Checksum the text	CRC32_ProcessBuffer( &crc, m_szPhoneme, Q_strlen( m_szPhoneme ) );	int phonemeCode = GetPhonemeCode();	CRC32_ProcessBuffer( &crc, &phonemeCode, sizeof( int ) );	// Checksum timestamps	float startTime = GetStartTime();	float endTime = GetEndTime();	CRC32_ProcessBuffer( &crc, &startTime, sizeof( float ) );	CRC32_ProcessBuffer( &crc, &endTime, sizeof( float ) );	CRC32_Final( &crc );	return ( unsigned int )crc;}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:20,


示例9: return

bool TimedObject::OverlapWith(TimedObject* other){	if(other == NULL)		return false;		TimedObject *first, *second;    	if(GetStartTime() <= other->GetStartTime())     {		first = this;		second = other;	}     else     {		first = other;		second = this;	}	    	return (first->GetEndTime() >= second->GetStartTime());}
开发者ID:AIDman,项目名称:Kaldi,代码行数:20,


示例10: PostUpdateImpl

void BattlegroundDS::PostUpdateImpl(uint32 diff){        if (GetStartTime() >= 75*IN_MILLISECONDS)        {            for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++)            {                Player *plr = ObjectAccessor::FindPlayer(itr->first);                if (plr && plr->isAlive() && plr->GetPositionX() < 1260 && plr->GetPositionY() >755 && plr->GetPositionY() < 775 && plr->GetPositionZ() > 13)                {                    KnockBackPlayer(plr, 6.15f, 50.00f, 5.00f);                    plr->RemoveAurasDueToSpell(48018);                }                 if (plr && plr->isAlive() && plr->GetPositionX() > 1330 && plr->GetPositionY() >805 && plr->GetPositionY() < 825 && plr->GetPositionZ() > 13)                {                    KnockBackPlayer(plr, 3.10f, 50.00f, 5.00f);                    plr->RemoveAurasDueToSpell(48018);                }            }        }        if (getWaterFallTimer() < diff)        {            if (isWaterFallActive())            {                setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)                    SpawnBGObject(i, getWaterFallTimer());                setWaterFallActive(false);            }            else            {                setWaterFallTimer(BG_DS_WATERFALL_DURATION);                for (uint32 i = BG_DS_OBJECT_WATER_1; i <= BG_DS_OBJECT_WATER_2; ++i)                    SpawnBGObject(i, RESPAWN_IMMEDIATELY);                setWaterFallActive(true);            }        }        else            setWaterFallTimer(getWaterFallTimer() - diff);}
开发者ID:FirstCore,项目名称:FunCore,代码行数:40,


示例11: GetStartTime

void UMovieSceneSubSection::TrimSection( float TrimTime, bool bTrimLeft ){	if ( !IsTimeWithinSection( TrimTime ) )	{		return;	}	float InitialStartTime = GetStartTime();	float InitialStartOffset = StartOffset;	UMovieSceneSection::TrimSection( TrimTime, bTrimLeft );	// If trimming off the left, set the offset of the shot	if ( bTrimLeft )	{		float NewStartOffset = ( TrimTime - InitialStartTime ) / TimeScale;		NewStartOffset += InitialStartOffset;		// Ensure start offset is not less than 0		StartOffset = FMath::Max( NewStartOffset, 0.f );	}}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:22,


示例12: QDialog

//---------------------------------------------------------------------------satpassdialog::satpassdialog(PList *_satList, QWidget *parent) :    QDialog(parent),    m_ui(new Ui::satpassdialog){ TSat *sat; int i, flags; double daynum = GetStartTime(QDateTime::currentDateTime().toUTC());;    m_ui->setupUi(this);    setLayout(m_ui->gridLayout);    mw = (MainWindow *) parent;    satList = _satList;    flags = 0;    for(i=0; i<satList->Count; i++) {        sat = (TSat *) satList->ItemAt(i);        sat->daynum = daynum;        sat->Calc();        if(sat->IsGeostationary() || sat->Decayed(0))            continue;        m_ui->satListWidget->addItem(sat->name);        flags |= sat->isActive() ? 1:0;    }    m_ui->activeSatBtn->setVisible(flags ? true:false);    m_ui->dateEdit->setDate(QDate::currentDate());    if(flags)        on_activeSatBtn_clicked();    else if(m_ui->satListWidget->count())        on_satListWidget_currentItemChanged(m_ui->satListWidget->item(0), NULL);    else        QMessageBox::critical(this, "No satellites found!", "Click menu Satellite->Keplerian elements to download.");}
开发者ID:poes-weather,项目名称:poes-usrp,代码行数:39,


示例13: assert

bool C4TableGraph::DumpToFile(const StdStrBuf &rszFilename,                              bool fAppend) const {  assert(!!rszFilename);  // nothing to write?  if (!fWrapped && !iBackLogPos) return false;  // try append if desired; create if unsuccessful  CStdFile out;  if (fAppend)    if (!out.Append(rszFilename.getData())) fAppend = false;  if (!fAppend) {    if (!out.Create(rszFilename.getData())) return false;    // print header    out.WriteString("t/tv/n/r");  }  // write out current timeframe  int iEndTime = GetEndTime();  StdStrBuf buf;  for (int iWriteTime = GetStartTime(); iWriteTime < iEndTime; ++iWriteTime) {    buf.Format("%d/t%d/n/r", (int)iWriteTime, (int)GetValue(iWriteTime));    out.WriteString(buf.getData());  }  return true;}
开发者ID:ev1313,项目名称:yaC,代码行数:23,


示例14: Update

void BattlegroundNA::Update(uint32 diff){    Battleground::Update(diff);    if(GetStatus() == STATUS_IN_PROGRESS)    {        if(GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)    // after 47 minutes without one team losing, the arena closes with no winner and no rating change        {            UpdateArenaWorldState();            CheckArenaAfterTimerConditions();        }        if(m_uiTeleport < diff)        {            for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)            {                Player* pPlayer = sObjectMgr->GetPlayer(itr->first);                if(pPlayer && pPlayer->GetPositionZ() < 10)                    pPlayer->TeleportTo(pPlayer->GetMapId(), 4056.513f, 2921.693f, 13.932f, pPlayer->GetOrientation(), false);            }            m_uiTeleport = 1000;        } else m_uiTeleport -= diff;    }}
开发者ID:FreedomEmu,项目名称:FreedomEmu,代码行数:24,


示例15: GetMangosString

void BattleGround::EndBattleGround(uint32 winner){    this->RemoveFromBGFreeSlotQueue();    uint32 loser_rating = 0;    uint32 winner_rating = 0;    WorldPacket data;    Player *Source = NULL;    const char *winmsg = "";    if(winner == ALLIANCE)    {        winmsg = GetMangosString(LANG_BG_A_WINS);        PlaySoundToAll(SOUND_ALLIANCE_WINS);                // alliance wins sound        SetWinner(WINNER_ALLIANCE);    }    else if(winner == HORDE)    {        winmsg = GetMangosString(LANG_BG_H_WINS);        PlaySoundToAll(SOUND_HORDE_WINS);                   // horde wins sound        SetWinner(WINNER_HORDE);    }    else    {        SetWinner(3);    }    SetStatus(STATUS_WAIT_LEAVE);    m_EndTime = 0;    for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)    {        Player *plr = sObjectMgr.GetPlayer(itr->first);        if(!plr)        {            sLog.outError("BattleGround: Player (GUID: %u) not found!", GUID_LOPART(itr->first));            continue;        }        // should remove spirit of redemption        if(plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))            plr->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);        if(!plr->isAlive())        {            plr->ResurrectPlayer(1.0f);            plr->SpawnCorpseBones();        }        else        {            //needed cause else in av some creatures will kill the players at the end            plr->CombatStop();            plr->getHostileRefManager().deleteReferences();        }        uint32 team = itr->second.Team;        if(!team) team = plr->GetTeam();        if(team == winner)        {            if(!Source)                Source = plr;            RewardMark(plr,ITEM_WINNER_COUNT);            RewardQuestComplete(plr);        }        else            RewardMark(plr,ITEM_LOSER_COUNT);        plr->CombatStopWithPets(true);        BlockMovement(plr);        sBattleGroundMgr.BuildPvpLogDataPacket(&data, this);        plr->GetSession()->SendPacket(&data);        uint32 bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(GetTypeID());        sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetTeam(), plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime());        plr->GetSession()->SendPacket(&data);    }    // inform invited players about the removal    sBattleGroundMgr.m_BattleGroundQueues[BattleGroundMgr::BGQueueTypeId(GetTypeID())].BGEndedRemoveInvites(this);    if(Source)    {        ChatHandler(Source).FillMessageData(&data, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, Source->GetGUID(), winmsg);        SendPacketToAll(&data);    }}
开发者ID:magomags,项目名称:mangoszero,代码行数:93,


示例16: WaveClip

bool WaveClip::ClearAndAddCutLine(double t0, double t1){   if (t0 > GetEndTime() || t1 < GetStartTime())      return true; // time out of bounds         WaveClip *newClip = new WaveClip(mSequence->GetDirManager(),                                    mSequence->GetSampleFormat(),                                    mRate);   double clip_t0 = t0;   double clip_t1 = t1;   if (clip_t0 < GetStartTime())      clip_t0 = GetStartTime();   if (clip_t1 > GetEndTime())      clip_t1 = GetEndTime();   if (!newClip->CreateFromCopy(clip_t0, clip_t1, this))      return false;   newClip->SetOffset(clip_t0-mOffset);   // Sort out cutlines that belong to the new cutline   WaveClipList::compatibility_iterator nextIt;   for (WaveClipList::compatibility_iterator it = mCutLines.GetFirst(); it; it=nextIt)   {      nextIt = it->GetNext();      WaveClip* clip = it->GetData();      double cutlinePosition = mOffset + clip->GetOffset();      if (cutlinePosition >= t0 && cutlinePosition <= t1)      {         clip->SetOffset(cutlinePosition - newClip->GetOffset() - mOffset);         newClip->mCutLines.Append(clip);         mCutLines.DeleteNode(it);      } else      if (cutlinePosition >= t1)      {         clip->Offset(clip_t0-clip_t1);      }   }      // Clear actual audio data   sampleCount s0, s1;   TimeToSamplesClip(t0, &s0);   TimeToSamplesClip(t1, &s1);      if (GetSequence()->Delete(s0, s1-s0))   {      // Collapse envelope      GetEnvelope()->CollapseRegion(t0, t1);      if (t0 < GetStartTime())         Offset(-(GetStartTime() - t0));      MarkChanged();      mCutLines.Append(newClip);      return true;   } else   {      delete newClip;      return false;   }}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:62,


示例17: GetStartTime

double NoteTrack::GetEndTime(){   return GetStartTime() + (mSeq ? mSeq->get_real_dur() : 0.0);}
开发者ID:dannyflax,项目名称:audacity,代码行数:4,


示例18: Update

void BattlegroundDS::Update(uint32 diff){    Battleground::Update(diff);    if(GetStatus() != STATUS_IN_PROGRESS)        return;    if(GetStatus() == STATUS_IN_PROGRESS)    {        if(GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)    // after 47 minutes without one team losing, the arena closes with no winner and no rating change        {            UpdateArenaWorldState();            CheckArenaAfterTimerConditions();        }    }    if(getPipeKnockBackCount() < BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT)    {        if(getPipeKnockBackTimer() < diff)        {            for(uint32 i = BG_DS_NPC_PIPE_KNOCKBACK_1; i <= BG_DS_NPC_PIPE_KNOCKBACK_2; ++i)                if(Creature* waterSpout = GetBgMap()->GetCreature(BGArrayForCreatures[i]))                    waterSpout->CastSpell(waterSpout, BG_DS_SPELL_FLUSH, true);            setPipeKnockBackCount(getPipeKnockBackCount() + 1);            setPipeKnockBackTimer(BG_DS_PIPE_KNOCKBACK_DELAY);        }        else            setPipeKnockBackTimer(getPipeKnockBackTimer() - diff);    }    //if(!m_knockback && m_teleport)    //{    //    if(m_teleport <= diff)    //    {    //        for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)    //        {    //            Player* plr = ObjectAccessor::FindPlayer(itr->first);    //            if(!plr)    //                continue;    //            if(plr->GetPositionZ() > 13.0f)    //                HandlePlayerUnderMap(plr);    //        }    //        m_teleport = 5 * IN_MILLISECONDS;    //    }    //    else    //        m_teleport -= diff;    //}    if(getWaterFallTimer() < diff)    {        switch(getWaterFallStatus())        {        case BG_DS_WATERFALL_STATUS_OFF: // Add the water            DoorClose(BG_DS_OBJECT_WATER_2);            setWaterFallTimer(BG_DS_WATERFALL_WARNING_DURATION);            setWaterFallStatus(BG_DS_WATERFALL_STATUS_WARNING);            break;        case BG_DS_WATERFALL_STATUS_WARNING: // Active collision and start knockback timer            if(GameObject* gob = GetBgMap()->GetGameObject(BGArrayForObjects[BG_DS_OBJECT_WATER_1]))                gob->SetGoState(GO_STATE_READY);            setWaterFallTimer(BG_DS_WATERFALL_DURATION);            setWaterFallStatus(BG_DS_WATERFALL_STATUS_ON);            setWaterFallKnockbackTimer(BG_DS_WATERFALL_KNOCKBACK_TIMER);            break;        case BG_DS_WATERFALL_STATUS_ON: // Remove collision and water            // turn off collision            if(GameObject* gob = GetBgMap()->GetGameObject(BGArrayForObjects[BG_DS_OBJECT_WATER_1]))                gob->SetGoState(GO_STATE_ACTIVE);            DoorOpen(BG_DS_OBJECT_WATER_2);            setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));            setWaterFallStatus(BG_DS_WATERFALL_STATUS_OFF);            break;        }    }    else        setWaterFallTimer(getWaterFallTimer() - diff);}
开发者ID:Darkelmo,项目名称:MythCore,代码行数:80,


示例19: handlePacket

void Session::handlePacket(Packet* packet){    isActive=true;    lastUpdate=GetStartTime();    unsigned char ID=packet->buffer[0];    if(status == STATE_CONNECTING_2 || status == STATE_CONNECTED)    {        packet->decode();        if(ID>=0x80 && ID<=0x8f)        {            if(DATA_PACKET_4* datapk=dynamic_cast<DATA_PACKET_4*>(packet))            {                int SeqNum=datapk->seqNumber;                ACKQueue.push_back(SeqNum);                std::vector<EncapsulatedPacket> packets=datapk->packets;                for(auto iter=packets.cbegin(); iter!=packets.cend(); iter++)                    handleEncapsulatedPacketRoute(*iter);            }        }    }    else if(ID>0x00 && ID<0x80)    {        packet->decode();        if(OPEN_CONNECTION_REQUEST_1* pk_=dynamic_cast<OPEN_CONNECTION_REQUEST_1*>(packet))        {            //  std::cout<<"received a OPEN_CONNECTION_REQUEST_1 packet from ("<<address<<":"<<port<<")"<<std::endl;            OPEN_CONNECTION_REPLY_1 reply;            reply.mtuSize=pk_->mtuSize;            reply.serverId=Manager->getID();            reply.encode();            sendPacket(reply);            status=STATE_CONNECTING_1;        }        else        {            if((status==STATE_CONNECTING_1 ))                if(OPEN_CONNECTION_REQUEST_2* pk=dynamic_cast<OPEN_CONNECTION_REQUEST_2*>(packet) )                {                    id=pk->clientID;                    if(pk->serverPort == Manager->getPort())                    {                        mtuSize=std::max(abs(pk->mtuSize),1464);                        OPEN_CONNECTION_REPLY_2 replyt;                        replyt.mtuSize=mtuSize;                        replyt.serverId=Manager->getID();                        replyt.clientAddress=address;                        replyt.clientPort=port;                        replyt.encode();                        sendPacket(replyt);                        status=STATE_CONNECTING_2;                    }                }        }    }}
开发者ID:K099,项目名称:ZhyCore,代码行数:72,


示例20: GetTrinityString

void BattleGround::EndBattleGround(uint32 winner){    this->RemoveFromBGFreeSlotQueue();    uint32 almost_winning_team = HORDE;    uint32 loser_rating = 0;    uint32 winner_rating = 0;    WorldPacket data;    Player *Source = NULL;    const char *winmsg = "";    if(winner == ALLIANCE)    {        winmsg = GetTrinityString(LANG_BG_A_WINS);        PlaySoundToAll(SOUND_ALLIANCE_WINS);                // alliance wins sound        SetWinner(WINNER_ALLIANCE);    }    else if(winner == HORDE)    {        winmsg = GetTrinityString(LANG_BG_H_WINS);        PlaySoundToAll(SOUND_HORDE_WINS);                   // horde wins sound        SetWinner(WINNER_HORDE);    }    else    {        SetWinner(3);    }    SetStatus(STATUS_WAIT_LEAVE);    m_EndTime = 0;    for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)    {        Player *plr = objmgr.GetPlayer(itr->first);        if(!plr)        {            sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first);            continue;        }        // should remove spirit of redemption        if(plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))            plr->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);        if(!plr->isAlive())        {            plr->ResurrectPlayer(1.0f);            plr->SpawnCorpseBones();        }        uint32 team = itr->second.Team;        if(!team) team = plr->GetTeam();        if(team == winner)        {            if(!Source)                Source = plr;            RewardMark(plr,ITEM_WINNER_COUNT);            UpdatePlayerScore(plr, SCORE_BONUS_HONOR, 20);            RewardQuest(plr);        }        else if(winner !=0)        {        RewardMark(plr,ITEM_LOSER_COUNT);        }    else if(winner == 0)    {        if(sWorld.getConfig(CONFIG_PREMATURE_BG_REWARD))    // We're feeling generous, giving rewards to people who not earned them ;)        {    //nested ifs for the win! its boring writing that, forgive me my unfunniness                        if(almost_winning_team == team)                    //player's team had more points                RewardMark(plr,ITEM_WINNER_COUNT);            else                RewardMark(plr,ITEM_LOSER_COUNT);            // if scores were the same, each team gets 1 mark.        }    }        plr->CombatStopWithPets(true);        BlockMovement(plr);        sBattleGroundMgr.BuildPvpLogDataPacket(&data, this);        plr->GetSession()->SendPacket(&data);        uint32 bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(GetTypeID());        sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetTeam(), plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime());        plr->GetSession()->SendPacket(&data);    }    // inform invited players about the removal    sBattleGroundMgr.m_BattleGroundQueues[sBattleGroundMgr.BGQueueTypeId(GetTypeID())].BGEndedRemoveInvites(this);    if(Source)    {        ChatHandler(Source).FillMessageData(&data, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, Source->GetGUID(), winmsg);        SendPacketToAll(&data);//.........这里部分代码省略.........
开发者ID:mynew,项目名称:TrinityCore-1,代码行数:101,


示例21: GetMangosString

void BattleGround::EndBattleGround(uint32 winner){    WorldPacket data;    Player *Source = NULL;    const char *winmsg = "";    if(winner == ALLIANCE)    {        winmsg = GetMangosString(LANG_BG_A_WINS);        PlaySoundToAll(SOUND_ALLIANCE_WINS);                // alliance wins sound        SetWinner(WINNER_ALLIANCE);    }    else    {        winmsg = GetMangosString(LANG_BG_H_WINS);        PlaySoundToAll(SOUND_HORDE_WINS);                   // horde wins sound        SetWinner(WINNER_HORDE);    }    SetStatus(STATUS_WAIT_LEAVE);    m_EndTime = 0;    for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)    {        Player *plr = objmgr.GetPlayer(itr->first);        if(!plr)        {            sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first);            continue;        }        if(!plr->isAlive())        {            plr->ResurrectPlayer(1.0f);            plr->SpawnCorpseBones();        }        if(plr->GetTeam() == winner)        {            if(!Source)                Source = plr;            RewardMark(plr,ITEM_WINNER_COUNT);            UpdatePlayerScore(plr, SCORE_BONUS_HONOR, 20);            RewardQuest(plr);        }        else        {            RewardMark(plr,ITEM_LOSER_COUNT);        }        plr->CombatStopWithPets(true);        BlockMovement(plr);        sBattleGroundMgr.BuildPvpLogDataPacket(&data, this);        plr->GetSession()->SendPacket(&data);        sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetTeam(), plr->GetBattleGroundQueueIndex(m_TypeID), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime());        plr->GetSession()->SendPacket(&data);    }    if(Source)    {        ChatHandler(Source).FillMessageData(&data, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, Source->GetGUID(), winmsg);        SendPacketToAll(&data);    }}
开发者ID:yunishaa,项目名称:mangos-112,代码行数:71,


示例22: Update

void BattlegroundRV::Update(uint32 diff){    Battleground::Update(diff);    if (GetStatus() == STATUS_IN_PROGRESS)    {        if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)    // after 47 minutes without one team losing, the arena closes with no winner and no rating change        {            UpdateArenaWorldState();            CheckArenaAfterTimerConditions();        }        // bochki        if (!fencesopened)        {            if (fencestimer < diff)            {                fencesopened = true;            }            else                fencestimer -= diff;        }    }    if (getTimer() < diff)    {        uint32 i;        if (GetBgMap())            switch(getState())            {                case BG_RV_STATE_OPEN_FENCES:                {                    setTimer(BG_RV_PILAR_TO_FIRE_TIMER);                    setState(BG_RV_STATE_CLOSE_FIRE);                    break;                }                case BG_RV_STATE_CLOSE_FIRE:                    for (i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i)                        DoorClose(i);                    setTimer(BG_RV_FIRE_TO_PILAR_TIMER);                    setState(BG_RV_STATE_OPEN_PILARS);                    break;                case BG_RV_STATE_OPEN_PILARS:                    pillarsopened=true;                    for (i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i)                        DoorOpen(i);                    setTimer(BG_RV_PILAR_TO_FIRE_TIMER);                    setState(BG_RV_STATE_OPEN_FIRE);                    break;                case BG_RV_STATE_OPEN_FIRE:                    for (i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i)                        DoorOpen(i);                    setTimer(BG_RV_FIRE_TO_PILAR_TIMER);                    setState(BG_RV_STATE_CLOSE_PILARS);                    break;                case BG_RV_STATE_CLOSE_PILARS:                    pillarsopened=false;                    uint32 i;                    for (i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i)                        DoorOpen(i);                    setTimer(BG_RV_PILAR_TO_FIRE_TIMER);                    setState(BG_RV_STATE_CLOSE_FIRE);                    break;            }    }    else        setTimer(getTimer() - diff);}
开发者ID:Demonid,项目名称:shadowhack3-public,代码行数:68,


示例23: GetStartTime

void CGameTeams::OnFinish(CPlayer* Player){	if (!Player || !Player->IsPlaying())		return;	//TODO:DDRace:btd: this ugly	float time = (float) (Server()->Tick() - GetStartTime(Player))			/ ((float) Server()->TickSpeed());	if (time < 0.000001f)		return;	CPlayerData *pData = GameServer()->Score()->PlayerData(Player->GetCID());	char aBuf[128];	SetCpActive(Player, -2);	str_format(aBuf, sizeof(aBuf),			"%s finished in: %d minute(s) %5.2f second(s)",			Server()->ClientName(Player->GetCID()), (int) time / 60,			time - ((int) time / 60 * 60));	if (g_Config.m_SvHideScore || !g_Config.m_SvSaveWorseScores)		GameServer()->SendChatTarget(Player->GetCID(), aBuf);	else		GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aBuf);	float diff = fabs(time - pData->m_BestTime);	if (time - pData->m_BestTime < 0)	{		// new record /o/		Server()->SaveDemo(Player->GetCID(), time);		if (diff >= 60)			str_format(aBuf, sizeof(aBuf), "New record: %d minute(s) %5.2f second(s) better.",					(int) diff / 60, diff - ((int) diff / 60 * 60));		else			str_format(aBuf, sizeof(aBuf), "New record: %5.2f second(s) better.",					diff);		if (g_Config.m_SvHideScore || !g_Config.m_SvSaveWorseScores)			GameServer()->SendChatTarget(Player->GetCID(), aBuf);		else			GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aBuf);	}	else if (pData->m_BestTime != 0) // tee has already finished?	{		Server()->StopRecord(Player->GetCID());		if (diff <= 0.005)		{			GameServer()->SendChatTarget(Player->GetCID(),					"You finished with your best time.");		}		else		{			if (diff >= 60)				str_format(aBuf, sizeof(aBuf), "%d minute(s) %5.2f second(s) worse, better luck next time.",						(int) diff / 60, diff - ((int) diff / 60 * 60));			else				str_format(aBuf, sizeof(aBuf),						"%5.2f second(s) worse, better luck next time.",						diff);			GameServer()->SendChatTarget(Player->GetCID(), aBuf); //this is private, sent only to the tee		}	}	else	{		Server()->SaveDemo(Player->GetCID(), time);	}	bool CallSaveScore = false;#if defined(CONF_SQL)	CallSaveScore = g_Config.m_SvUseSQL && g_Config.m_SvSaveWorseScores;#endif	if (!pData->m_BestTime || time < pData->m_BestTime)	{		// update the score		pData->Set(time, GetCpCurrent(Player));		CallSaveScore = true;	}	if (CallSaveScore)		if (g_Config.m_SvNamelessScore || str_comp_num(Server()->ClientName(Player->GetCID()), "nameless tee",				12) != 0)			GameServer()->Score()->SaveScore(Player->GetCID(), time,					GetCpCurrent(Player));	bool NeedToSendNewRecord = false;	// update server best time	if (GameServer()->m_pController->m_CurrentRecord == 0			|| time < GameServer()->m_pController->m_CurrentRecord)	{		// check for nameless		if (g_Config.m_SvNamelessScore || str_comp_num(Server()->ClientName(Player->GetCID()), "nameless tee",				12) != 0)		{			GameServer()->m_pController->m_CurrentRecord = time;			//dbg_msg("character", "Finish");			NeedToSendNewRecord = true;		}	}	SetDDRaceState(Player, DDRACE_FINISHED);	// set player score//.........这里部分代码省略.........
开发者ID:Enyltyn,项目名称:AllTheHaxx,代码行数:101,


示例24: PlaySoundToAll

void BattleGround::EndBattleGround(Team winner){    this->RemoveFromBGFreeSlotQueue();    uint32 loser_rating = 0;    uint32 winner_rating = 0;    WorldPacket data;    int32 winmsg_id = 0;    if (winner == ALLIANCE)    {        winmsg_id = LANG_BG_A_WINS;        PlaySoundToAll(SOUND_ALLIANCE_WINS);                // alliance wins sound    }    else if (winner == HORDE)    {        winmsg_id = LANG_BG_H_WINS;        PlaySoundToAll(SOUND_HORDE_WINS);                   // horde wins sound    }    SetWinner(winner);    SetStatus(STATUS_WAIT_LEAVE);    // we must set it this way, because end time is sent in packet!    m_EndTime = TIME_TO_AUTOREMOVE;    for (BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)    {        Team team = itr->second.PlayerTeam;        if (itr->second.OfflineRemoveTime)            continue;        Player* plr = sObjectMgr.GetPlayer(itr->first);        if (!plr)        {            sLog.outError("BattleGround:EndBattleGround %s not found!", itr->first.GetString().c_str());            continue;        }        // should remove spirit of redemption        if (plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))            plr->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);        if (!plr->isAlive())        {            plr->ResurrectPlayer(1.0f);            plr->SpawnCorpseBones();        }        else        {            // needed cause else in av some creatures will kill the players at the end            plr->CombatStop();            plr->getHostileRefManager().deleteReferences();        }        // this line is obsolete - team is set ALWAYS        // if(!team) team = plr->GetTeam();        if (team == winner)        {            RewardMark(plr, ITEM_WINNER_COUNT);            RewardQuestComplete(plr);        }        else            RewardMark(plr, ITEM_LOSER_COUNT);        plr->CombatStopWithPets(true);        BlockMovement(plr);        sBattleGroundMgr.BuildPvpLogDataPacket(&data, this);        plr->GetSession()->SendPacket(&data);        BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(GetTypeID());        sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime());        plr->GetSession()->SendPacket(&data);    }    if (winmsg_id)        SendMessageToAll(winmsg_id, CHAT_MSG_BG_SYSTEM_NEUTRAL);}
开发者ID:MonstermoshCOM,项目名称:server,代码行数:84,


示例25: EndBattleground

void BattlegroundWS::PostUpdateImpl(uint32 diff){    if (GetStatus() == STATUS_IN_PROGRESS)    {        if (GetStartTime() >= 27*MINUTE*IN_MILLISECONDS)        {            if (GetTeamScore(TEAM_ALLIANCE) == 0)            {                if (GetTeamScore(TEAM_HORDE) == 0)        // No one scored - result is tie                    EndBattleground(WINNER_NONE);                else                                 // Horde has more points and thus wins                    EndBattleground(HORDE);            }            else if (GetTeamScore(TEAM_HORDE) == 0)                EndBattleground(ALLIANCE);           // Alliance has > 0, Horde has 0, alliance wins            else if (GetTeamScore(TEAM_HORDE) == GetTeamScore(TEAM_ALLIANCE)) // Team score equal, winner is team that scored the last flag                EndBattleground(_lastFlagCaptureTeam);            else if (GetTeamScore(TEAM_HORDE) > GetTeamScore(TEAM_ALLIANCE))  // Last but not least, check who has the higher score                EndBattleground(HORDE);            else                EndBattleground(ALLIANCE);        }        // first update needed after 1 minute of game already in progress        else if (GetStartTime() > uint32(_minutesElapsed * MINUTE * IN_MILLISECONDS) +  3 * MINUTE * IN_MILLISECONDS)        {            ++_minutesElapsed;            UpdateWorldState(BG_WS_STATE_TIMER, 25 - _minutesElapsed);        }        if (_flagState[TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)        {            _flagsTimer[TEAM_ALLIANCE] -= diff;            if (_flagsTimer[TEAM_ALLIANCE] < 0)            {                _flagsTimer[TEAM_ALLIANCE] = 0;                RespawnFlag(ALLIANCE, true);            }        }        if (_flagState[TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_GROUND)        {            _flagsDropTimer[TEAM_ALLIANCE] -= diff;            if (_flagsDropTimer[TEAM_ALLIANCE] < 0)            {                _flagsDropTimer[TEAM_ALLIANCE] = 0;                RespawnFlagAfterDrop(ALLIANCE);                _bothFlagsKept = false;            }        }        if (_flagState[TEAM_HORDE] == BG_WS_FLAG_STATE_WAIT_RESPAWN)        {            _flagsTimer[TEAM_HORDE] -= diff;            if (_flagsTimer[TEAM_HORDE] < 0)            {                _flagsTimer[TEAM_HORDE] = 0;                RespawnFlag(HORDE, true);            }        }        if (_flagState[TEAM_HORDE] == BG_WS_FLAG_STATE_ON_GROUND)        {            _flagsDropTimer[TEAM_HORDE] -= diff;            if (_flagsDropTimer[TEAM_HORDE] < 0)            {                _flagsDropTimer[TEAM_HORDE] = 0;                RespawnFlagAfterDrop(HORDE);                _bothFlagsKept = false;            }        }        if (_bothFlagsKept)        {            _flagSpellForceTimer += diff;            if (_flagDebuffState == 0 && _flagSpellForceTimer >= 10*MINUTE*IN_MILLISECONDS)  //10 minutes            {                if (Player* player = ObjectAccessor::FindPlayer(m_FlagKeepers[0]))                    player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);                if (Player* player = ObjectAccessor::FindPlayer(m_FlagKeepers[1]))                    player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);                _flagDebuffState = 1;            }            else if (_flagDebuffState == 1 && _flagSpellForceTimer >= 900000) //15 minutes            {                if (Player* player = ObjectAccessor::FindPlayer(m_FlagKeepers[0]))                {                    player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);                    player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);                }                if (Player* player = ObjectAccessor::FindPlayer(m_FlagKeepers[1]))                {                    player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);                    player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);                }                _flagDebuffState = 2;            }//.........这里部分代码省略.........
开发者ID:SymbolixDEV,项目名称:123,代码行数:101,


示例26: BlockMovement

void BattleGround::PlayerAddedToBGCheckIfBGIsRunning(Player* plr){    if (GetStatus() != STATUS_WAIT_LEAVE)        return;    WorldPacket data;    BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(GetTypeID());    BlockMovement(plr);    sBattleGroundMgr.BuildPvpLogDataPacket(&data, this);    plr->GetSession()->SendPacket(&data);    sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, this, plr->GetBattleGroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, GetEndTime(), GetStartTime());    plr->GetSession()->SendPacket(&data);}
开发者ID:MonstermoshCOM,项目名称:server,代码行数:16,


示例27: GetStartTime

double WaveTrack::GetOffset(){   return GetStartTime();}
开发者ID:Kirushanr,项目名称:audacity,代码行数:4,


示例28: EndBattleground

void BattlegroundTP::Update(uint32 diff){    Battleground::Update(diff);    if (GetStatus() == STATUS_IN_PROGRESS)    {        if (GetStartTime() >= 25*MINUTE*IN_MILLISECONDS)        {            if (GetTeamScore(ALLIANCE) == 0)            {                if (GetTeamScore(HORDE) == 0)        // No one scored - result is tie                    EndBattleground(NULL);                else                                 // Horde has more points and thus wins                    EndBattleground(HORDE);            }            else if (GetTeamScore(HORDE) == 0)                EndBattleground(ALLIANCE);           // Alliance has > 0, Horde has 0, alliance wins            else if (GetTeamScore(HORDE) == GetTeamScore(ALLIANCE)) // Team score equal, winner is team that scored the last flag                EndBattleground(m_LastFlagCaptureTeam);            else if (GetTeamScore(HORDE) > GetTeamScore(ALLIANCE))  // Last but not least, check who has the higher score                EndBattleground(HORDE);            else                EndBattleground(ALLIANCE);        }        else if (GetStartTime() > uint32(m_minutesElapsed * MINUTE * IN_MILLISECONDS))        {            ++m_minutesElapsed;            UpdateWorldState(BG_TP_STATE_TIMER, 25 - m_minutesElapsed);        }        if (m_FlagState[BG_TEAM_ALLIANCE] == BG_TP_FLAG_STATE_WAIT_RESPAWN)        {            m_FlagsTimer[BG_TEAM_ALLIANCE] -= diff;            if (m_FlagsTimer[BG_TEAM_ALLIANCE] < 0)            {                m_FlagsTimer[BG_TEAM_ALLIANCE] = 0;                RespawnFlag(ALLIANCE, true);            }        }        if (m_FlagState[BG_TEAM_ALLIANCE] == BG_TP_FLAG_STATE_ON_GROUND)        {            m_FlagsDropTimer[BG_TEAM_ALLIANCE] -= diff;            if (m_FlagsDropTimer[BG_TEAM_ALLIANCE] < 0)            {                m_FlagsDropTimer[BG_TEAM_ALLIANCE] = 0;                RespawnFlagAfterDrop(ALLIANCE);                m_BothFlagsKept = false;            }        }        if (m_FlagState[BG_TEAM_HORDE] == BG_TP_FLAG_STATE_WAIT_RESPAWN)        {            m_FlagsTimer[BG_TEAM_HORDE] -= diff;            if (m_FlagsTimer[BG_TEAM_HORDE] < 0)            {                m_FlagsTimer[BG_TEAM_HORDE] = 0;                RespawnFlag(HORDE, true);            }        }        if (m_FlagState[BG_TEAM_HORDE] == BG_TP_FLAG_STATE_ON_GROUND)        {            m_FlagsDropTimer[BG_TEAM_HORDE] -= diff;            if (m_FlagsDropTimer[BG_TEAM_HORDE] < 0)            {                m_FlagsDropTimer[BG_TEAM_HORDE] = 0;                RespawnFlagAfterDrop(HORDE);                m_BothFlagsKept = false;            }        }        if (m_BothFlagsKept)        {          m_FlagSpellForceTimer += diff;          if (m_FlagDebuffState == 0 && m_FlagSpellForceTimer >= 600000)  //10 minutes          {            if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))              plr->CastSpell(plr, TP_SPELL_FOCUSED_ASSAULT, true);            if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))              plr->CastSpell(plr, TP_SPELL_FOCUSED_ASSAULT, true);            m_FlagDebuffState = 1;          }          else if (m_FlagDebuffState == 1 && m_FlagSpellForceTimer >= 900000) //15 minutes          {            if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0]))            {              plr->RemoveAurasDueToSpell(TP_SPELL_FOCUSED_ASSAULT);              plr->CastSpell(plr, TP_SPELL_BRUTAL_ASSAULT, true);            }            if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1]))            {              plr->RemoveAurasDueToSpell(TP_SPELL_FOCUSED_ASSAULT);              plr->CastSpell(plr, TP_SPELL_BRUTAL_ASSAULT, true);            }            m_FlagDebuffState = 2;          }//.........这里部分代码省略.........
开发者ID:Ekmek,项目名称:Antiker,代码行数:101,


示例29: Update

void BattlegroundRV::Update(uint32 diff){    Battleground::Update(diff);    if (GetStatus() == STATUS_IN_PROGRESS)    {        if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS)    // after 47 minutes without one team losing, the arena closes with no winner and no rating change        {            UpdateArenaWorldState();            CheckArenaAfterTimerConditions();        }        // teleport buggers        if(m_uiTeleport < diff)        {            for(BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)            {                Player * plr = sObjectMgr->GetPlayer(itr->first);                if (plr && plr->GetPositionZ() < 27)                    plr->TeleportTo(plr->GetMapId(), plr->GetPositionX(), plr->GetPositionY(), 29, plr->GetOrientation(), false);                if (plr && plr->GetPositionZ() < 27)                    plr->TeleportTo(plr->GetMapId(), plr->GetPositionX(), plr->GetPositionY(), 29, plr->GetOrientation(), false);            }            m_uiTeleport = 1000;        }        else            m_uiTeleport -= diff;    }    if (getTimer() < diff)    {        uint32 i;        switch(getState())        {        case BG_RV_STATE_OPEN_FENCES:        {            setTimer(BG_RV_PILAR_TO_FIRE_TIMER);            setState(BG_RV_STATE_CLOSE_FIRE);            break;        }        case BG_RV_STATE_CLOSE_FIRE:            //uint32 i;            for (i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i)                DoorOpen(i);            setTimer(BG_RV_FIRE_TO_PILAR_TIMER);            setState(BG_RV_STATE_OPEN_PILARS);            break;        case BG_RV_STATE_OPEN_PILARS:            for (i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i)                DoorOpen(i);            setTimer(BG_RV_PILAR_TO_FIRE_TIMER);            setState(BG_RV_STATE_OPEN_FIRE);            break;        case BG_RV_STATE_OPEN_FIRE:            for (i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i)                DoorOpen(i);            setTimer(BG_RV_FIRE_TO_PILAR_TIMER);            setState(BG_RV_STATE_CLOSE_PILARS);            break;        case BG_RV_STATE_CLOSE_PILARS:            //uint32 i;            for (i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i)                DoorOpen(i);            setTimer(BG_RV_PILAR_TO_FIRE_TIMER);            setState(BG_RV_STATE_CLOSE_FIRE);            break;        }    }    else        setTimer(getTimer() - diff);}
开发者ID:Nedj,项目名称:TrinityCore,代码行数:70,



注:本文中的GetStartTime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetStartupInfo函数代码示例
C++ GetStartPosition函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。