diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/CharacterHandler.cpp | 14 | ||||
-rw-r--r-- | src/game/World.cpp | 6 | ||||
-rw-r--r-- | src/game/World.h | 8 | ||||
-rw-r--r-- | src/trinitycore/trinitycore.conf.dist | 13 |
4 files changed, 41 insertions, 0 deletions
diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index aa884ddd2df..1190a45d050 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -40,6 +40,8 @@ #include "Util.h" #include "ArenaTeam.h" #include "Language.h" +#include "Chat.h" +#include "SystemConfig.h" class LoginQueryHolder : public SqlQueryHolder { @@ -487,6 +489,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) Player* pCurrChar = new Player(this); pCurrChar->GetMotionMaster()->Initialize(); + // for send server info and strings (config) + ChatHandler chH = ChatHandler(pCurrChar); // "GetAccountId()==db stored account id" checked in LoadFromDB (prevent login not own character using cheating tools) if(!pCurrChar->LoadFromDB(GUID_LOPART(playerGuid), holder)) @@ -550,6 +554,12 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) SendPacket( &data ); DEBUG_LOG( "WORLD: Sent motd (SMSG_MOTD)" ); + + // send server info + if(sWorld.getConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) + chH.PSendSysMessage(_FULLVERSION); + + DEBUG_LOG( "WORLD: Sent server info" ); } //QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow()); @@ -615,6 +625,10 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) data.Initialize( SMSG_TRIGGER_CINEMATIC,4 ); data << uint32(rEntry->startmovie); SendPacket( &data ); + + // send new char string if not empty + if (!sWorld.GetNewCharString().empty()) + chH.PSendSysMessage(sWorld.GetNewCharString().c_str()); } } diff --git a/src/game/World.cpp b/src/game/World.cpp index 0215426afbd..3a7469fa59d 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -407,6 +407,12 @@ void World::LoadConfigSettings(bool reload) SetPlayerLimit( sConfig.GetIntDefault("PlayerLimit", DEFAULT_PLAYER_LIMIT), true ); SetMotd( sConfig.GetStringDefault("Motd", "Welcome to the Massive Network Game Object Server." ) ); + ///- Get string for new logins (newly created characters) + SetNewCharString(sConfig.GetStringDefault("PlayerStart.String", "")); + + ///- Send server info on login? + m_configs[CONFIG_ENABLE_SINFO_LOGIN] = sConfig.GetIntDefault("Server.LoginInfo", 0); + ///- Read all rates from the config file rate_values[RATE_HEALTH] = sConfig.GetFloatDefault("Rate.Health", 1); if(rate_values[RATE_HEALTH] < 0) diff --git a/src/game/World.h b/src/game/World.h index 50a9ec6f836..9754e2b8ffb 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -198,6 +198,7 @@ enum WorldConfigs CONFIG_NO_RESET_TALENT_COST, CONFIG_SHOW_KICK_IN_WORLD, CONFIG_INTERVAL_LOG_UPDATE, + CONFIG_ENABLE_SINFO_LOGIN, CONFIG_VALUE_COUNT }; @@ -397,6 +398,11 @@ class World /// Get the current Message of the Day const char* GetMotd() const { return m_motd.c_str(); } + /// Set the string for new characters (first login) + void SetNewCharString(std::string str) { m_newCharString = str; } + /// Get the string for new characters (first login) + const std::string& GetNewCharString() const { return m_newCharString; } + uint32 GetDefaultDbcLocale() const { return m_defaultDbcLocale; } /// Get the path where data (dbc, maps) are stored on disk @@ -539,6 +545,8 @@ class World std::multimap<time_t, ScriptAction> m_scriptSchedule; + std::string m_newCharString; + float rate_values[MAX_RATES]; uint32 m_configs[CONFIG_VALUE_COUNT]; int32 m_playerLimit; diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist index 7855b616082..c4f9128ec56 100644 --- a/src/trinitycore/trinitycore.conf.dist +++ b/src/trinitycore/trinitycore.conf.dist @@ -572,6 +572,11 @@ LogColors = "" # Motd # Message of the Day. Displayed at worldlogin for every user ('@' for a newline). # +# Server.LoginInfo +# Enable/disable sending server info (core version) on login. +# Default: 0 - disable +# 1 - enable +# ################################################################################################################### GameType = 1 @@ -617,6 +622,7 @@ SkillChance.Prospecting = 0 Event.Announce = 0 BeepAtStart = 1 Motd = "Welcome to a Trinity Core server." +Server.LoginInfo = 0 ################################################################################################################### # PLAYER INTERACTION @@ -1265,6 +1271,12 @@ Ra.Secure = 1 # Default: 60000 (diff is written into log every 60000 ms or 1 minute. # >0 = Interval # 0 = Disable +# +# PlayerStart.String +# If set to anything else than "", this string will be displayed to players when they login +# to a newly created character. +# Default: "" - send no text +# ################################################################################################################### PlayerStart.AllReputation = 0 @@ -1280,3 +1292,4 @@ PvPToken.ItemCount = 1 NoResetTalentsCost = 0 ShowKickInWorld = 0 RecordUpdateTimeDiffInterval = 60000 +PlayerStart.String = ""
\ No newline at end of file |