Commit Graph

90 Commits

Author SHA1 Message Date
jackpoz
d78e69cdc6 Core/Instances: Fix memory leak in InstanceSaveMgr
Fix memory leak in InstanceSaveMgr added in 1f170c99ef .
Make InstanceSave::SetToDelete() private since it's not supposed to be used by anything other than InstanceSave or its friend class InstanceSaveMgr .
2014-01-13 22:52:35 +01:00
jackpoz
1f170c99ef Core/Instances: Fix Instance binding
Fix players not being bound to instance if the group was disbanded before killing any boss.
Fixes #437
2014-01-03 18:56:11 +01:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
Spp
94e2b9332a Core/Logging: Remove LOG_FILTER_XXX defines with it's value (remember logger names are case-sensitive) 2013-11-08 10:50:51 +01:00
leguybrush
0a308144a8 Core/Code: Unify [more] codestyle for brackets: )\n{\n} to ) { }. 2013-10-28 14:36:07 -04:00
Ellie
1fae858645 Whitespace between string literals and user-defined literals is now mandatory for concatenation in C++11 2013-10-01 01:13:13 -07:00
jackpoz
a3bdf90b0a Core/Instances: Fix mutex released after being deleted
Modify how InstanceSave is deleted so the local mutex can be released before deleting the class itself.

Valgrind log:
 Invalid read of size 4
  at 0x662662B: __pthread_mutex_unlock_usercnt (pthread_mutex_unlock.c:52)
  by 0x55D3C55: ACE_OS::mutex_unlock(pthread_mutex_t*) (OS_NS_Thread.cpp:2335)
  by 0xB20057: Player::CleanupsBeforeDelete(bool) (OS_NS_Thread.inl:3519)
  by 0xD0E2FA: WorldSession::LogoutPlayer(bool) (WorldSession.cpp:527)
  by 0xC66D34: WorldSession::HandleLogoutRequestOpcode(WorldPacket&) (MiscHandler.cpp:403)
  by 0xD0EA82: WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:312)
  by 0xD9AD66: World::UpdateSessions(unsigned int) (World.cpp:2615)
  by 0xD9BEC4: World::Update(unsigned int) (World.cpp:1978)
  by 0xA035E5: WorldRunnable::run() (WorldRunnable.cpp:60)
  by 0xEC8D39: ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:183)
  by 0x55D7555: ACE_OS_Thread_Adapter::invoke() (OS_Thread_Adapter.cpp:103)
  by 0x6622B4F: start_thread (pthread_create.c:304)
Address 0x1884bb08 is 56 bytes inside a block of size 104 free'd
  at 0x4C279DC: operator delete(void*) (vg_replace_malloc.c:457)
  by 0xC9D533: InstanceSaveManager::RemoveInstanceSave(unsigned int) (InstanceSaveMgr.cpp:159)
  by 0xC9E826: InstanceSave::UnloadIfEmpty() (InstanceSaveMgr.cpp:238)
  by 0xB2003E: Player::CleanupsBeforeDelete(bool) (InstanceSaveMgr.h:84)
  by 0xD0E2FA: WorldSession::LogoutPlayer(bool) (WorldSession.cpp:527)
  by 0xC66D34: WorldSession::HandleLogoutRequestOpcode(WorldPacket&) (MiscHandler.cpp:403)
  by 0xD0EA82: WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:312)
  by 0xD9AD66: World::UpdateSessions(unsigned int) (World.cpp:2615)
  by 0xD9BEC4: World::Update(unsigned int) (World.cpp:1978)
  by 0xA035E5: WorldRunnable::run() (WorldRunnable.cpp:60)
  by 0xEC8D39: ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:183)
  by 0x55D7555: ACE_OS_Thread_Adapter::invoke() (OS_Thread_Adapter.cpp:103)
2013-08-25 19:08:22 +02:00
Spp
d1677b2db0 Core/Logging: Performance-related tweaks to logging system
All sLog->out* functions (except outCommand atm) are replaced with TC_LOG_* macros.
    Memleak fix
2013-05-13 15:07:36 +02:00
Spp
1a6a23ec96 Core/Misc: Minor optimizations (+code changes to reduce differences with 4.3.4 branch)
Core/Logging: Create new logger type "Cheat". Will be used to log all cheat attempts
2013-03-25 13:26:48 +01:00
Nefarion
49fd11ab5a First step of comment style refactoring to doxygen-style. 2013-03-08 21:55:37 +01:00
Spp
d36c4a91ba Core/Misc: Use equal_range instead of lower_bound/upper_bound calls where possible. 2013-01-02 09:53:43 +01:00
Vincent_Michael
cc65aba789 Update copyright note for 2013.
Happy new year.
2013-01-01 00:41:01 +01:00
Spp
2251d1bfae Core/Misc: Set mode 0644 for files 2012-11-27 13:03:12 +01:00
Spp
8a1e7dd070 Core/Loading: Re-enable Server loading log 2012-08-16 00:23:44 +02:00
Spp
634776e0bc Fix compile under windows 2012-08-03 15:54:54 +02:00
Spp
55ce180f28 Core/Logging: Add Asyncronous logging with Loggers ("What to log") and Appenders ("Where to log") system. Will allow to select to full log some parts of core while others are not even logged.
- Logging System is asyncronous to improve performance.
- Each msg and Logger has a Log Type and Log Level assigned. Each msg is assigned the Logger of same Log Type or "root" Logger is selected if there is no Logger configured for the given Log Type
- Loggers have a list of Appenders to send the msg to. The Msg in the Logger is not sent to Appenders if the msg LogLevel is lower than Logger LogLevel.
- There are three (at the moment) types of Appenders: Console, File or DB (this is WIP, not working ATM). Msg is not written to the resource if msg LogLevel is lower than Appender LogLevel.
- Appender and Console Log levels can be changed while server is active with command '.set loglevel (a/l) name level'

Explanation of use with Sample config:

Appender.Console.Type=1       (1 = Console)
Appender.Console.Level=2      (2 = Debug)

Appender.Server.Type=2        (2 = File)
Appender.Server.Level=3       (3 = Info)
Appender.Server.File=Server.log

Appender.SQL.Type=2           (2 = File)
Appender.SQL.Level=1          (1 = Trace)
Appender.SQL.File=sql.log

Appenders=Console Server      (NOTE: SQL has not been included here... that will make core ignore the config for "SQL" as it's not in this list)

Logger.root.Type=0            (0 = Default - if it's not created by config, server will create it with LogLevel = DISABLED)
Logger.root.Level=5           (5 = Error)
Logger.root.Appenders=Console

Logger.SQL.Type=26            (26 = SQL)
Logger.SQL.Level=3            (2 = Debug)
Logger.SQL.Appenders=Console Server SQL

Logger.SomeRandomName.Type=24 (24 = Guild)
Logger.SomeRandomName.Level=5 (5 = Error)
Loggers=root SQL SomeRandomName

* At loading Appender SQL will be ignored, as it's not present on "Appenders"

* sLog->outDebug(LOG_FILTER_GUILD, "Some log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomName is found but it's LogLevel = 5 and Msg LogLevel=2... Msg is not logged

* sLog->outError(LOG_FILTER_GUILD, "Some error log msg related to Guilds")
  - Msg is sent to Logger of Type LOG_FILTER_GUILD (24). Logger with name SomeRandomeName is found with proper LogLevel but Logger does not have any Appenders assigned to that logger... Msg is not logged

* sLog->outDebug(LOG_FILTER_SQL, "Some msg related to SQLs")
  - Msg is sent to Logger SQL (matches type), as it matches LogLevel the msg is sent to Appenders Console, Server and SQL
    - Appender Console has lower Log Level: Msg is logged to Console
    - Appender Server has higher Log Level: Msg is not logged to file
    - Appender SQL has lower Log Level: Msg is logged to file sql.log

* sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Some msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). As Logger has higher LogLevel msg is not sent to any appender

* sLog->outError(LOG_FILTER_BATTLEGROUND, "Some error msg related to Battelgrounds")
  - Msg is sent to Logger root (Type 0) as no Logger was found with Type LOG_FILTER_BATTLEGROUND (13). Msg has lower LogLevel and is sent to Appender Console
    - Appender Console has lower LogLevel: Msg is logged to Console
2012-08-03 14:20:18 +02:00
Shauren
32aa983fe2 Core/Maps: Fixed possible crash when resetting instances 2012-06-08 14:52:52 +02:00
Shauren
c7775c8d72 Core/Maps: Moved object respawn time storage from global to map level. This removes unneccessary locking since all objects run within its map's thread. 2012-06-07 23:20:57 +02:00
Nay
5ebace6c7f Core/DBLayer: Fix issues in instance saving; spotted by Saring, thank you 2012-04-03 23:11:08 +01:00
Nay
f44e6834df Core/DBLayer: Fix remaining errors in loading world tables and a couple of them in characters database
Also removed World::LoadIp2nation(), it was not doing anything.
Closes #5897
2012-03-28 00:38:24 +01:00
leak
c6cbe4c77c Core/DBLayer: Convert PAppend() queries to prepared statements No.1 2012-03-25 16:25:06 +02:00
Elron103
7daf69f20c Core: Fix warnings 2012-03-24 18:25:24 +01:00
leak
178c658363 Core/DBLayer: Convert DirectExecute() queries that are not runtime relevant back to regular queries 2012-03-19 18:09:13 +01:00
Spp
f1949b20a6 Some random cleanup here and there 2012-03-09 13:42:52 +01:00
leak
0fbb86f221 Core/DBLayer: Restore removal and cleanup of respawn times of expired instances 2012-01-30 00:31:06 +01:00
leak
ced346076b Merge pull request #4567 from Kiperr/master
Happy new year!
2011-12-31 16:13:28 -08:00
leak
cdbeb42e0f Core/DBLayer: Refactor prepared statement defines to new format (char db) 2012-01-01 01:09:38 +01:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
leak
e646dbb3cd Core/DBLayer: Convert PExecute() queries to prepared statements No. 2 2011-12-27 00:29:48 +01:00
Shauren
358b33239a Core: Fixed remaining C6246: Local declaration of 'x' hides declaration of the same name in outer scope. from previous commit 2011-11-23 19:17:33 +01:00
megamage
5a0ffefecc Remove unnecessary const_cast<Map*>. 2011-11-23 12:51:20 -05:00
megamage
298c162c86 Do not allow an instance map to be created twice if it already exists. Fix #4018. 2011-11-23 09:34:08 -05:00
Machiavelli
82dbe7bc17 Core: Fix some build errors after code style cleanup 2011-10-08 13:20:04 +02:00
Bootz
5b4c7783c2 REPO: Code-style clean-ups
* Fixed pMap->map
* Fixed pInstance->instance
* Fixed pInsta->instance
* Fixed pQuest->quest
* Fixed pWho->who
* Fixed pTarget->target
* Fixed pGo->go

~DEVNOTES: Handlers/QuestHandler.cpp still needs to be cleaned...
2011-10-07 19:45:43 -05:00
Spp
af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
click
f16df538ee Core: More codestyle cleanups 2011-06-12 01:47:45 +02:00
leak
d64c6ad55a Core/Instances: Kill weird SQL generator function and fix cleaning of expired instances 2011-05-02 22:04:35 +02:00
leak
f70d5196ac And another one 2011-05-02 14:45:53 +02:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
leak
6d1924cee8 Removing SQLStorage class leftovers 2011-04-28 23:03:02 +02:00
leak
5aeb4fe794 Core/ObjectMgr: Refactor sInstanceTemplate 2011-04-28 22:16:13 +02:00
Azazel
3993b73925 Core/CharDB cleanup: change creature_respawn and gameobject_respawn column names to lowerCamel, rename instance column to instanceId and move all queries to these tables to prepared statements.
Fix import error in character_database.sql.
2011-04-13 17:02:06 +06:00
Azazel
5357b1ba77 Core/CharDB Cleanup: alter corpse table making column names lowerCamel and move all queries to prepared statements.
NOTICE: column can be named `guid` only if it represents character guid. All other guids will be renamed to reflect their purpose (like corpseGuid in this specific case)
2011-04-11 14:39:00 +06:00
leak
190ef1c2ef Core/Instances: Fix crash and allocation issue in instance id generation 2011-03-11 13:24:58 +01:00
leak
4569e4852a Core/Instances: Recycle instance IDs. Should fix instance ID shifting and related issues with instance binding.
fixes #736
2011-03-10 22:22:27 +01:00
Machiavelli
e07e20ffca Core/Log: Implement log masks for debug log level, to allow selective debug output. Update your worldserver.conf. 2011-02-20 20:16:34 +01:00
Shauren
c2b0bcbd6c Core/Instances: Implemented DungeonEncounter.dbc for creating completed encounters mask to use in packets
Core/Dungeon Finder: Implemented new way of giving random dungeon rewards, linked to DungeonEncounter.dbc
2011-02-03 22:20:40 +01:00
Shauren
3f0d888b0e Core/Instances: Fixed cleaning and packing query for account_instance_times table (instance can no longer exist but player limit is still there) 2011-01-28 15:05:46 +01:00
leak
137b079eea Core: Generic cleanup (tab2spaces/trailing whitespace removal) 2011-01-26 01:03:35 +01:00
Shauren
867bc197ef Core/Instances: Made the max amount of instances player can enter within hour configurable and fixed typo in instance packing/cleaning query 2011-01-24 16:12:02 +01:00