*Update to HG 730.
--HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
|
||||
*
|
||||
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/** \file
|
||||
\ingroup Trinityd
|
||||
*/
|
||||
|
||||
#include "WorldSocketMgr.h"
|
||||
#include "Common.h"
|
||||
#include "World.h"
|
||||
#include "WorldRunnable.h"
|
||||
#include "Timer.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "MapManager.h"
|
||||
|
||||
#include "Database/DatabaseEnv.h"
|
||||
|
||||
#if (defined(SHORT_SLEEP) || defined(WIN32))
|
||||
#define WORLD_SLEEP_CONST 50
|
||||
#else
|
||||
#define WORLD_SLEEP_CONST 100 //Is this still needed?? [On linux some time ago not working 50ms]
|
||||
#endif
|
||||
|
||||
/// Heartbeat for the World
|
||||
void WorldRunnable::run()
|
||||
{
|
||||
///- Init new SQL thread for the world database
|
||||
WorldDatabase.ThreadStart(); // let thread do safe mySQL requests (one connection call enough)
|
||||
sWorld.InitResultQueue();
|
||||
|
||||
uint32 realCurrTime = 0;
|
||||
uint32 realPrevTime = getMSTime();
|
||||
|
||||
uint32 prevSleepTime = 0; // used for balanced full tick time length near WORLD_SLEEP_CONST
|
||||
|
||||
///- While we have not World::m_stopEvent, update the world
|
||||
while (!World::IsStopped())
|
||||
{
|
||||
++World::m_worldLoopCounter;
|
||||
realCurrTime = getMSTime();
|
||||
|
||||
uint32 diff = getMSTimeDiff(realPrevTime,realCurrTime);
|
||||
|
||||
sWorld.Update( diff );
|
||||
realPrevTime = realCurrTime;
|
||||
|
||||
// diff (D0) include time of previous sleep (d0) + tick time (t0)
|
||||
// we want that next d1 + t1 == WORLD_SLEEP_CONST
|
||||
// we can't know next t1 and then can use (t0 + d1) == WORLD_SLEEP_CONST requirement
|
||||
// d1 = WORLD_SLEEP_CONST - t0 = WORLD_SLEEP_CONST - (D0 - d0) = WORLD_SLEEP_CONST + d0 - D0
|
||||
if (diff <= WORLD_SLEEP_CONST+prevSleepTime)
|
||||
{
|
||||
prevSleepTime = WORLD_SLEEP_CONST+prevSleepTime-diff;
|
||||
ZThread::Thread::sleep(prevSleepTime);
|
||||
}
|
||||
else
|
||||
prevSleepTime = 0;
|
||||
}
|
||||
|
||||
sWorld.KickAll(); // save and kick all players
|
||||
sWorld.UpdateSessions( 1 ); // real players unload required UpdateSessions call
|
||||
|
||||
sWorldSocketMgr->StopNetwork();
|
||||
|
||||
MapManager::Instance().UnloadAll(); // unload all grids (including locked in memory)
|
||||
|
||||
///- End the database thread
|
||||
WorldDatabase.ThreadEnd(); // free mySQL thread resources
|
||||
}
|
||||
@@ -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
|
||||
@@ -672,7 +678,7 @@ TalentsInspecting = 1
|
||||
# ThreatRadius
|
||||
# Radius for creature to evade after being pulled away from combat start point
|
||||
# If ThreatRadius is less than creature aggro radius then aggro radius will be used
|
||||
# Default: 100 yards
|
||||
# Default: 60 yards
|
||||
#
|
||||
# Rate.Creature.Aggro
|
||||
# Aggro radius percent or off.
|
||||
@@ -703,7 +709,7 @@ TalentsInspecting = 1
|
||||
#
|
||||
# Rate.Corpse.Decay.Looted
|
||||
# Controls how long the creature corpse stays after it had been looted, as a multiplier of its Corpse.Decay.* config.
|
||||
# Default: 0.1
|
||||
# Default: 0.5
|
||||
#
|
||||
# Rate.Creature.Normal.Damage
|
||||
# Rate.Creature.Elite.Elite.Damage
|
||||
@@ -743,7 +749,7 @@ TalentsInspecting = 1
|
||||
#
|
||||
###################################################################################################################
|
||||
|
||||
ThreatRadius = 100
|
||||
ThreatRadius = 60
|
||||
Rate.Creature.Aggro = 1
|
||||
CreatureFamilyAssistanceRadius = 10
|
||||
CreatureFamilyAssistanceDelay = 1500
|
||||
@@ -753,7 +759,7 @@ Corpse.Decay.RARE = 300
|
||||
Corpse.Decay.ELITE = 300
|
||||
Corpse.Decay.RAREELITE = 300
|
||||
Corpse.Decay.WORLDBOSS = 3600
|
||||
Rate.Corpse.Decay.Looted = 0.1
|
||||
Rate.Corpse.Decay.Looted = 0.5
|
||||
Rate.Creature.Normal.Damage = 1
|
||||
Rate.Creature.Elite.Elite.Damage = 1
|
||||
Rate.Creature.Elite.RAREELITE.Damage = 1
|
||||
@@ -824,12 +830,6 @@ Channel.SilentlyGMJoin = 0
|
||||
# 0 (disable)
|
||||
# 1 (enable)
|
||||
#
|
||||
# GM.AcceptTickets
|
||||
# Is GM accepting tickets from player by default or not.
|
||||
# Default: 2 (last save state)
|
||||
# 0 (disable)
|
||||
# 1 (enable)
|
||||
#
|
||||
# GM.Chat
|
||||
# GM chat mode at login
|
||||
# Default: 2 (last save state)
|
||||
@@ -864,7 +864,6 @@ Channel.SilentlyGMJoin = 0
|
||||
###################################################################################################################
|
||||
|
||||
GM.LoginState = 2
|
||||
GM.AcceptTickets = 2
|
||||
GM.Chat = 2
|
||||
GM.WhisperingTo = 2
|
||||
GM.InGMList = 0
|
||||
@@ -1265,6 +1264,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 +1285,4 @@ PvPToken.ItemCount = 1
|
||||
NoResetTalentsCost = 0
|
||||
ShowKickInWorld = 0
|
||||
RecordUpdateTimeDiffInterval = 60000
|
||||
PlayerStart.String = ""
|
||||
Reference in New Issue
Block a user