From 04112377eabfb8b7b415012b275a4eb1d3c8a656 Mon Sep 17 00:00:00 2001 From: Kamil Date: Mon, 7 Dec 2020 19:24:56 +0100 Subject: [PATCH] Implement setting for disabling first use tips --- src/PlayerManager.cpp | 10 ++++++++-- src/settings.cpp | 4 +++- src/settings.hpp | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/PlayerManager.cpp b/src/PlayerManager.cpp index 136fb39..af79821 100644 --- a/src/PlayerManager.cpp +++ b/src/PlayerManager.cpp @@ -259,8 +259,14 @@ void PlayerManager::enterPlayer(CNSocket* sock, CNPacketData* data) { } // Computress tips - response.PCLoadData2CL.iFirstUseFlag1 = plr.iFirstUseFlag[0]; - response.PCLoadData2CL.iFirstUseFlag2 = plr.iFirstUseFlag[1]; + if (settings::DISABLEFIRSTUSEFLAG) { + response.PCLoadData2CL.iFirstUseFlag1 = UINT64_MAX; + response.PCLoadData2CL.iFirstUseFlag2 = UINT64_MAX; + } + else { + response.PCLoadData2CL.iFirstUseFlag1 = plr.iFirstUseFlag[0]; + response.PCLoadData2CL.iFirstUseFlag2 = plr.iFirstUseFlag[1]; + } plr.SerialKey = enter->iEnterSerialKey; plr.instanceID = INSTANCE_OVERWORLD; // the player should never be in an instance on enter diff --git a/src/settings.cpp b/src/settings.cpp index 1a2b138..4670b14 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -30,6 +30,7 @@ std::string settings::GRUNTWORKJSON = "tdata/gruntwork.json"; std::string settings::MOTDSTRING = "Welcome to OpenFusion!"; std::string settings::DBPATH = "database.db"; int settings::ACCLEVEL = 1; +bool settings::DISABLEFIRSTUSEFLAG = true; // monitor settings bool settings::MONITORENABLED = false; @@ -77,7 +78,8 @@ void settings::init() { ACCLEVEL = reader.GetInteger("shard", "accountlevel", ACCLEVEL); EVENTMODE = reader.GetInteger("shard", "eventmode", EVENTMODE); EVENTCRATECHANCE = reader.GetInteger("shard", "eventcratechance", EVENTCRATECHANCE); + DISABLEFIRSTUSEFLAG = reader.GetInteger("shard", "disablefirstuseflag", DISABLEFIRSTUSEFLAG); MONITORENABLED = reader.GetBoolean("monitor", "enabled", MONITORENABLED); MONITORPORT = reader.GetInteger("monitor", "port", MONITORPORT); - MONITORINTERVAL = reader.GetInteger("monitor", "interval", MONITORINTERVAL); + MONITORINTERVAL = reader.GetInteger("monitor", "interval", MONITORINTERVAL); } diff --git a/src/settings.hpp b/src/settings.hpp index 948e6ca..1150eb1 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -29,6 +29,7 @@ namespace settings { extern bool MONITORENABLED; extern int MONITORPORT; extern int MONITORINTERVAL; + extern bool DISABLEFIRSTUSEFLAG; void init(); }