__PMA_GW

06/08/2019 13:21 Fatcode#1
I have added this system and, I did everything I can with my mid knowledge in c++ but I cannot get the thing to work how I want it..

Currently the TID_GAME_GUILDCOMBAT_START30 spams whenever the condition it is in is true. I have tried different ways to try and make it only get in that condition once but my knowledge is still incapable.. I want to ask some help from you guys thank you so much.. I will just write down the original piece as to how it was written when released as my edits doesn't work.

Code:
CTime ctime = CTime::GetCurrentTime();

#ifdef __PMA_GW
		for (DWORD i = 0; i < __AutoOpen.size(); i++)
		{
			if (__AutoOpen[i].nDay == ctime.GetDayOfWeek() - 1 && __AutoOpen[i].bUseing)
			{
				CTimeSpan ts(0, __AutoOpen[i].nHour - ctime.GetHour(), __AutoOpen[i].nMinute - ctime.GetMinute(), 0);

				if (ts.GetTotalSeconds() == GW_TIME_ANNOUNCE * 60) 
					g_DPCoreClient.SendSystem(prj.GetText(TID_GAME_GUILDCOMBAT_START30)); // This is being spammed in the game 30 minutes before GS will start.

				if (__AutoOpen[i].nHour == ctime.GetHour() &&
					__AutoOpen[i].nMinute == ctime.GetMinute() && m_bMutex == FALSE)
#else
		if (__AutoOpen[ctime.GetDayOfWeek() - 1].bUseing)
		{
			// ½ºÅµ µÉ ¼ö ÀÖÀ¸¹Ç·Î ¼öÁ¤À» ÇÊ¿ä·Î ÇÔ
			if (__AutoOpen[ctime.GetDayOfWeek() - 1].nHour == ctime.GetHour() &&
				__AutoOpen[ctime.GetDayOfWeek() - 1].nMinute == ctime.GetMinute() && m_bMutex == FALSE)
#endif
				{
#ifdef __S_BUG_GC
					if( (int)( m_vecGuildCombatMem.size() ) >= m_nMinGuild )
#else // __S_BUG_GC
				if( m_GuildCombatMem.size() > 1 )
#endif // __S_BUG_GC
					{				
						GuildCombatOpen();
					}
					else
					{
						m_ctrMutexOut.Set( SEC(60) );
						m_bMutexMsg = TRUE;
						g_DPCoreClient.SendSystem( prj.GetText( TID_GAME_GUILDCOMBAT_NEXT_COMBAT ) );	
						g_DPCoreClient.SendSystem( prj.GetText( TID_GAME_GUILDCOMBAT_ENJOY ) );	
					}

					m_bMutex = TRUE;				
				}

				if( m_bMutexMsg && m_ctrMutexOut.IsTimeOut() )
				{
					m_bMutexMsg = FALSE;
					m_bMutex    = FALSE;
				}
			}
		}
#ifdef __PMA_GW
	}
#endif
#endif //__WORLDSERVER
06/08/2019 20:06 Rhyder`#2
[Only registered and activated users can see links. Click Here To Register...]

never tried but i think this will work!
06/10/2019 12:33 Fatcode#3
Quote:
Originally Posted by Rhyder` View Post
[Only registered and activated users can see links. Click Here To Register...]

never tried but i think this will work!
Hey! Thank you so much for this. I will definitely try this out. Thank you so much!
06/12/2019 00:15 Fatcode#4
--
So here is an update.. the thing did not work with seconds as the loop was really fast and the seconds was not. What I did is made it milliseconds to make sure it is really not same when doing conditions. Thanks!