Beispiel #1
0
bool MBMatchServer::AddClanServerSwitchDownSchedule()
{
	int a = 0;

	MCommand* pCmd = CreateCommand( MC_MATCH_SCHEDULE_CLAN_SERVER_SWITCH_DOWN, MUID(0, 0) );
	if( 0 == pCmd )
		return false;

	tm t;
	MMatchGetLocalTime(&t);

	MMatchScheduleData* pScheduleData = m_pScheduler->MakeOnceScheduleData( t.tm_year - 100, t.tm_mon + 1, GetMaxDay(), 23, 50, pCmd );
	if( 0 == pScheduleData ){
		delete pCmd;
		return false;
	}

	if( !m_pScheduler->AddDynamicSchedule(pScheduleData) ){
		delete pCmd;
		delete pScheduleData;
		return false;
	}

	mlog( "MBMatchServer::AddClanServerSwitchDownSchedule - 클랜서버다운 커맨드 생성 성공. 다음실행시간:%d년%d월%d일 %d시%d분\n",
		pScheduleData->GetYear(), pScheduleData->GetMonth(), pScheduleData->GetDay(),
		pScheduleData->GetHour(), pScheduleData->GetMin() );

	return true;
}
Beispiel #2
0
// first	: 추교성. 2004. 11. 08
// last		: 추교성. 2004. 11. 08
// 시간을 비교하여 같을경우만 true를 반환함.
bool MMatchScheduleMgr::CompareTime( MMatchScheduleData* pScheduleData ) const
{
	tm* pCurTime = MMatchGetLocalTime();

	if( (pCurTime->tm_mon + 1) != pScheduleData->GetMonth() )	return false;
	if( pCurTime->tm_mday != pScheduleData->GetDay() )			return false;
	if( pCurTime->tm_hour != pScheduleData->GetHour() )			return false;
	if( pCurTime->tm_min != pScheduleData->GetMin() )			return false;

	return true;
}
Beispiel #3
0
bool MBMatchServer::AddClanServerSwitchUpSchedule()
{
	MCommand* pCmd = CreateCommand( MC_MATCH_SCHEDULE_CLAN_SERVER_SWITCH_ON, MUID(0, 0) );
	if( 0 == pCmd )
	{
		mlog( "MBMatchServer::AddClanServerSwitchUpSchedule - 클랜섭 활성화 커맨드 생성 실패.\n" );
		return false;
	}

	tm t;
	MMatchGetLocalTime(&t);

	unsigned char cYear;
	unsigned char cMon;

	if( 12 >= (t.tm_mon + 2) )
	{
		cYear = t.tm_year - 100;
		cMon  = t.tm_mon + 2;
	}
	else
	{
		cYear = t.tm_year - 99;
		cMon  = 1;
	}

	MMatchScheduleData* pScheduleData = m_pScheduler->MakeOnceScheduleData( cYear, cMon, 1, 9, 0, pCmd );
	if( 0 == pScheduleData )
	{
		delete pCmd;
		return false;
	}

	if( !m_pScheduler->AddDynamicSchedule(pScheduleData) )
	{
		delete pCmd;
		delete pScheduleData;
		return false;
	}

	mlog( "MBMatchServer::AddClanServerSwitchUpSchedule - 클랜서버업 커맨드 생성 성공. 다음실행시간:%d년%d월%d일 %d시%d분\n",
		pScheduleData->GetYear(), pScheduleData->GetMonth(), pScheduleData->GetDay(),
		pScheduleData->GetHour(), pScheduleData->GetMin() );

	return true;
}
Beispiel #4
0
bool MBMatchServer::AddClanServerAnnounceSchedule()
{
	char szTest[] = "클랜전 게임을 11시 50분에 닫도록 하겠습니다.";

	MCommand* pCmd = CreateCommand( MC_MATCH_SCHEDULE_ANNOUNCE_MAKE, MUID(0, 0) );
	if( 0 == pCmd )
		return false;

	MCommandParameterString* pCmdPrmStr = new MCommandParameterString( szTest );
	if( 0 == pCmdPrmStr ){
		delete pCmd;
		return false;
	}
	
	if( !pCmd->AddParameter(pCmdPrmStr) ){
		delete pCmd;
		return false;
	}

	tm t;
	MMatchGetLocalTime(&t);

	MMatchScheduleData* pScheduleData = m_pScheduler->MakeOnceScheduleData( t.tm_year - 100, t.tm_mon + 1, GetMaxDay(), 23, 40, pCmd );
	if( 0 == pScheduleData ){
		delete pCmd;
		return false;
	}

	if( !m_pScheduler->AddDynamicSchedule(pScheduleData) ){
		pScheduleData->Release();
		delete pScheduleData;
		return false;
	}
	
	return true;
}