Skip to content

Commit 54302e7

Browse files
committed
Excluded some checks & logging when using the editor or local server. Added check for JSON precision modification.
1 parent c50ccb0 commit 54302e7

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

Diff for: Server/mods/deathmatch/logic/CGame.cpp

+28-7
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,15 @@ bool CGame::Start ( int iArgumentCount, char* szArguments [] )
554554
return false;
555555
}
556556

557+
// Check json has precision mod - #8853 (toJSON passes wrong floats)
558+
json_object* pJsonObject = json_object_new_double(5.12345678901234);
559+
SString strJsonResult = json_object_to_json_string_ext(pJsonObject, JSON_C_TO_STRING_PLAIN);
560+
json_object_put(pJsonObject);
561+
if (strJsonResult != "5.12345678901234")
562+
{
563+
CLogger::ErrorPrintf("JSON built without precision modification\n");
564+
}
565+
557566
// Grab the path to the main config
558567
SString strBuffer;
559568
const char* szMainConfig;
@@ -564,6 +573,7 @@ bool CGame::Start ( int iArgumentCount, char* szArguments [] )
564573
else
565574
{
566575
strBuffer = g_pServerInterface->GetModManager ()->GetAbsolutePath ( "mtaserver.conf" );
576+
m_bUsingMtaServerConf = true;
567577
}
568578
m_pMainConfig->SetFileName ( strBuffer );
569579

@@ -907,14 +917,25 @@ bool CGame::Start ( int iArgumentCount, char* szArguments [] )
907917
// Flush any pending master server announce messages
908918
g_pNetServer->GetHTTPDownloadManager ( EDownloadMode::ASE )->ProcessQueuedFiles ();
909919

910-
if ( m_pMainConfig->GetAuthSerialEnabled() )
920+
// Warnings only if not editor or local server
921+
if (IsUsingMtaServerConf())
911922
{
912-
CLogger::LogPrintf( "Authorized serial account protection is enabled for the ACL group(s): `%s` See http:""//mtasa.com/authserial\n",
913-
*SString::Join( ",", m_pMainConfig->GetAuthSerialGroupList() ) );
914-
}
915-
else
916-
{
917-
CLogger::LogPrint( "Authorized serial account protection is DISABLED. See http:""//mtasa.com/authserial\n" );
923+
// Authorized serial account protection
924+
if ( m_pMainConfig->GetAuthSerialEnabled() )
925+
{
926+
CLogger::LogPrintf( "Authorized serial account protection is enabled for the ACL group(s): `%s` See http:""//mtasa.com/authserial\n",
927+
*SString::Join( ",", m_pMainConfig->GetAuthSerialGroupList() ) );
928+
}
929+
else
930+
{
931+
CLogger::LogPrint( "Authorized serial account protection is DISABLED. See http:""//mtasa.com/authserial\n" );
932+
}
933+
934+
// Owner email address
935+
if (m_pMainConfig->GetOwnerEmailAddressList().empty())
936+
{
937+
CLogger::LogPrintf("WARNING: <owner_email_address> not set\n");
938+
}
918939
}
919940

920941
// Done

Diff for: Server/mods/deathmatch/logic/CGame.h

+2
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ class CGame
404404
bool IsBelowMinimumClient ( const SString& strVersion );
405405
bool IsBelowRecommendedClient ( const SString& strVersion );
406406
void ApplyAseSetting ( void );
407+
bool IsUsingMtaServerConf ( void ) { return m_bUsingMtaServerConf; }
407408

408409
private:
409410
void AddBuiltInEvents ( void );
@@ -517,6 +518,7 @@ class CGame
517518
float m_fAircraftMaxVelocity;
518519
float m_fAircraftMaxVelocity_Sq;
519520
bool m_bOcclusionsEnabled;
521+
bool m_bUsingMtaServerConf;
520522

521523
unsigned char m_ucTrafficLightState;
522524
bool m_bTrafficLightsLocked;

Diff for: Server/mods/deathmatch/logic/CMainConfig.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,10 @@ bool CMainConfig::Save ( void )
863863
//
864864
bool CMainConfig::AddMissingSettings(void)
865865
{
866+
// Only mtaserver.conf is currently supported
867+
if (!g_pGame->IsUsingMtaServerConf())
868+
return false;
869+
866870
// Load template
867871
const char *szTemplateText =
868872
#include MTA_SERVER_CONF_TEMPLATE

0 commit comments

Comments
 (0)