*Added Server into at login and new char string with conf settings - by XTZGZoReX
--HG-- branch : trunk
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = ""
|
||||
Reference in New Issue
Block a user