*Added Server into at login and new char string with conf settings - by XTZGZoReX

--HG--
branch : trunk
This commit is contained in:
Blaymoira
2008-12-31 11:06:52 +01:00
parent 1fa33c2bfd
commit 8e812a2ca6
4 changed files with 41 additions and 0 deletions
+14
View File
@@ -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());
}
}
+6
View File
@@ -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)
+8
View File
@@ -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;