aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared
AgeCommit message (Collapse)Author
2014-06-24Core/Misc: Fixed warningsShauren
2014-06-23Merge pull request #11976 from Ascathor/masterAokromes
Core/Misc: New ability to log account IP access history
2014-06-15Core: Kill again whitespace :/Vincent-Michael
2014-06-15Shared/Misc: Improve Windows crash reportjackpoz
Improve WheatyExceptionReport Windows crash report to write a cleaner and more readable crash report, in particular: - Fix missing variable Type in some cases - Fix missing variable Name in some cases - Properly format each member to avoid confusion when reading the log - Add support for double pointers, e.g. Type** - Add initial support for arrays, logging the number of elements and the first 10 elements for now. UDT members of array elements are not supported yet - Skip static members, SymTagVTable and other not needed types - Skip SymTagUDT with no children - Fix possible stack overflows when logging strings/char*/char[] values. - Fix "punting on symbol" error happening when trying to dereference bad pointers. - Fix <user defined> type being logged instead of the correct type when reaching WER_MAX_NESTING_LEVEL or with pointer types with invalid addresses.
2014-06-13Core/Misc:Ascathor
* Fix some codestyle, fix some typos * Change CMakeLists for: Custom (can be uncommented), Events, World ** Custom is theoretically unchanged. You can, however, uncomment the glob_recurse that initializes every file within. This might be easier for beginners. * Introducing the IP Based Action Log System: ** On several different actions, e.g. Login, Character Login, etc., a new entry is added ** Can be logged on and off in worldserver config *** Disabled by default to prevent increased log db size for unknowing users. * Add a new row to account table called 'last_attempt_ip' ** Lists the last ip trying to connect to the account * Add a new type of HookScripts: AccountScript ** Includes: OnAccountLogin, OnFailedAccountLogin, OnEmailChange, OnFailedChange, OnPasswordChange, OnFailedPasswordChange * Added new Hook to PlayerScripts: OnFailedPlayerDelete * Added new variables to PlayerScripts: OnPlayerDelete
2014-06-11Fixed windows nopch buildShauren
2014-06-07Core/Misc: Kill Whitespace ...Vincent-Michael
2014-06-07Core/Database: Update log for incorrect db structureAokromes
2014-06-07Core: Fix non pch buildVincent-Michael
2014-06-06Core/Utils: Move EventMap to Util.hTrisjdc
2014-06-01Core/Misc: Added utility method for checking is two sorted containers have a ↵Shauren
common element
2014-06-01Core/NetworkIO: Fix performance loss when handling bad packetsjackpoz
Revert f9cb4280bd8f1c29e4acbae5339bce40c3b52bcb which retrieved the callstack each time a ByteBufferPositionException or a ByteBufferSourceException occurred, for example with bad packet structure.
2014-05-25Core/Misc: Fix no-pch buildjackpoz
2014-05-25Core/Misc: Throw an exception if client sends invalid float/double datajackpoz
Throw a ByteBufferException if client sends 1.#INF0000, 1.#QNAN000, 1.#IND0000 or other invalid float/double values. Handle this invalid values in StaticMapTree::isInLineOfSight() to avoid triggering an assert. Fixes #12126
2014-05-18Revert "Core/Logging: Use logger cache for speed up logger filter search"jackpoz
This reverts commit 39331ea7b9e906b67378a1be6c0c694d264eda3a. This is required to fix a race condition introduced with the logger cache. Adding a locking mechanism might make worthless the speed gain added by the cache itself, push a proper thread-safe implementation if it's worth it. Helgrind log: Possible data race during write of size 8 at 0x736F428 by thread #1 Locks held: none at 0x11872DF: std::_Hashtable<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert_bucket_begin(unsigned long, std::__detail::_Hash_node<std::pair<std::string const, Logger const*>, true>*) (hashtable.h:1196) by 0x11865A1: std::_Hashtable<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert_unique_node(unsigned long, unsigned long, std::__detail::_Hash_node<std::pair<std::string const, Logger const*>, true>*) (hashtable.h:1342) by 0x1185A48: std::__detail::_Map_base<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::string const&) (hashtable_policy.h:496) by 0x1184F3A: std::unordered_map<std::string, Logger const*, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, Logger const*> > >::operator[](std::string const&) (unordered_map.h:596) by 0x1184495: Log::GetLoggerByType(std::string const&) (Log.h:106) by 0x1184527: Log::ShouldLog(std::string const&, LogLevel) (Log.h:112) by 0x16E7121: World::LoadConfigSettings(bool) (World.cpp:909) by 0x16EB623: World::SetInitialWorldSettings() (World.cpp:1276) by 0x118F0EC: Master::Run() (Master.cpp:169) by 0x1196AFF: main (Main.cpp:142) This conflicts with a previous read of size 8 by thread #3 Locks held: none at 0x1186EA6: std::_Hashtable<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_find_before_node(unsigned long, std::string const&, unsigned long) const (hashtable.h:1162) by 0x1186263: std::_Hashtable<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_find_node(unsigned long, std::string const&, unsigned long) const (hashtable.h:604) by 0x11857B9: std::_Hashtable<std::string, std::pair<std::string const, Logger const*>, std::allocator<std::pair<std::string const, Logger const*> >, std::__detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::find(std::string const&) (hashtable.h:1025) by 0x1184DE2: std::unordered_map<std::string, Logger const*, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, Logger const*> > >::find(std::string const&) (unordered_map.h:543) by 0x11842EF: Log::GetLoggerByType(std::string const&) (Log.h:84) by 0x1184527: Log::ShouldLog(std::string const&, LogLevel) (Log.h:112) by 0x189AACA: MySQLConnection::Execute(char const*) (MySQLConnection.cpp:175) by 0x18A3225: BasicStatementTask::Execute() (AdhocStatement.cpp:56) Address 0x736F428 is 120 bytes inside a block of size 184 alloc'd at 0x4C2AE3A: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:350) by 0x1185046: ACE_Singleton<Log, ACE_Thread_Mutex>::instance() (Singleton.cpp:91) by 0x11968E2: main (Main.cpp:135)
2014-05-18Revert "Core/Logging: store loggers in cache correctly"jackpoz
This reverts commit c6a4d5a1de1c8e9c7722a5a13695d1273b8cbfbc.
2014-05-18Shared/Packets: Handle crash by throwing an exception insteadjackpoz
Throw a ByteBufferException when trying to access the first element of an empty ByteBuffer class
2014-05-17Shared/Database: Increase Database Worker Pool queue sizejackpoz
Increase DatabaseWorkerPool queue size from the default 16KB to 8MB to avoid blocking the caller thread when queuing an async statement/transaction.
2014-05-01Core/Misc: Remove remaining COMPILER_HAS_CPP11_SUPPORT related macrosDehravor
2014-04-29Core/Misc: Remove obsolete C++11 backward compatibility macrosDehravor
OVERRIDE, FINAL, DELETE_MEMBER
2014-04-27Core: Droped `faction_H` field -- only one faction table is necessaryKinzcool
2014-04-22Core/Texts: Implemented loading BroadcastTextsjoschiwald
2014-04-20Core/Misc: Fixed some -Weffc++ warningsShauren
2014-04-08Core/CrashHandler: Log GetLastError() id if no description is foundjackpoz
Log the System Error id returned by GetLastError() in case FormatMessage() doesn't find a proper description for that message.
2014-04-08Core/Logging: store loggers in cache correctlyjoschiwald
2014-04-05Core/CrashHandler: Add more informations about localsjackpoz
Handle BasicType btChar and custom type std::basic_string<char,std::char_traits<char>,std::allocator<char> > (std::string). This allows WheatyExceptionReport to log the text stored in char*, char[] and std::string.
2014-03-29Merge pull request #11719 from Dehravor/master-lootShauren
Core/Loot: Fix master loot
2014-03-24Core/Logging: Fixed filenames of backup logsShauren
Closes #11765
2014-03-23Core/Misc: Removed unused defines, added missing include and removed a few ↵Shauren
warnings
2014-03-23Fixed build without PCHShauren
2014-03-22Core/Misc: Fix some static analysis issuesjackpoz
Fix some static analysis issues about: - uninitialized values, most of which are false positives, always initialized before being accessed - unchecked return values - dead code never executed - bad formatting leading to wrong behavior Please ensure EventMap is never used with event id set to 0 or those events will never execute.
2014-03-16Core/Loot: Implement round robin for under threshold items in case of master ↵Dehravor
loot Thanks @Shauren for pointing out
2014-03-02Core/Player: delete queststatus (weekly/monthly/seasonal) on deleting ↵joschiwald
character thx @Expecto - also rename some prepared statements Closes #11658
2014-02-08Shared/Logs: Code cleanupjackpoz
Remove unneeded check added in 89af6097f37587e178ac412252326351ca655075
2014-02-07Shared/Logs: Make AppenderFile more thread-safejackpoz
In case of dynamic file names don't store the FILE* handle in a shared class variable but keep it only at function scope. Valgrind log: at _IO_un_link (genops.c:69) by fclose@@GLIBC_2.2.5 (iofclose.c:55) by AppenderFile::CloseFile() (AppenderFile.cpp:94) by AppenderFile::_write(LogMessage const&) (AppenderFile.cpp:66) by Appender::write(LogMessage&) (Appender.cpp:102) by Logger::write(LogMessage&) const (Logger.cpp:63) by Log::write(LogMessage*) (Log.cpp:279) by Log::vlog(std::string const&, LogLevel, char const*, __va_list_tag*) (Log.cpp:267) by Log::outMessage(std::string const&, LogLevel, char const*, ...) (Log.h:129) Address 0x2a1bd2d0 is 0 bytes inside a block of size 568 free'd at free (vg_replace_malloc.c:468) by fclose@@GLIBC_2.2.5 (iofclose.c:85) by AppenderFile::CloseFile() (AppenderFile.cpp:94) by AppenderFile::_write(LogMessage const&) (AppenderFile.cpp:66) by Appender::write(LogMessage&) (Appender.cpp:102) by Logger::write(LogMessage&) const (Logger.cpp:63) by Log::write(LogMessage*) (Log.cpp:279) by Log::vlog(std::string const&, LogLevel, char const*, __va_list_tag*) (Log.cpp:267) by Log::outMessage(std::string const&, LogLevel, char const*, ...) (Log.h:129)
2014-02-07Shared/Logs: Add workaround for "w" flag used with dynamic name filesjackpoz
Ignore "w" flag and always use "a" for log files with dynamic name since the file handle is created at every log line and "w" would delete any other logged line from previous _write() calls. The best solution would be to overwrite only at first call and append at any other call.
2014-02-06Core/CrashHandler: Add more informations about localsjackpoz
Handle SymTagData with inner type of SymTagPointerType. Increase buffer sizes to avoid buffer overflows. Avoid infinite loops by logging the children of each type only once. Avoid too deep nesting by adding a max nesting level. Print the address for arrays instead of just the name.
2014-01-31Build: Use override/final keywords for VS 2012 and newer. (VS 2013 still ↵Shauren
defines __cplusplus as 199711L)
2014-01-31Shared/Logs: Fix crash in Console log outputjackpoz
Correctly handle the return value of vsnprintf() which returns -1 if the buffer is too small http://msdn.microsoft.com/en-us/library/1kt27hek.aspx . In this case just truncate the output. This caused a crash on character delete if Logger.entities.player.dump was enabled and set to 3. Fixes #11539
2014-01-30Fix warnings introduced on littleendian in ↵QAston
2134cb610d45727a0623741f7416a360882133fa This fix prevents possible issues on bigendian machines. Don't use c style casts ppl, it's evul.
2014-01-23Core/CrashHandler: Add more informations about localsjackpoz
Log "NULL" for NULL pointers. Log the correct type instead of <user defined> for pointers and log its fields recursively. Log locals of all threads. Log the address if retrieving the value threw an exception. Increase buffer sizes to avoid buffer overflows.
2014-01-22Shared/OpenSSLCrypto: Add switch to fix build under MacGacko
2014-01-19CoreCore/CrashHandler: Handle CRT asserts in Windows buildjackpoz
Handle CRT asserts in Windows crash handler instead of popping up a Abort/Retry/Ignore window
2014-01-19Core/CrashHandler: Fix issues on Windows crash handlerjackpoz
Fix few issues on WheatyExceptionReport: - fix NULL dereference exception in GetLogicalAddress() when TC assert in triggered ( *((volatile int*)NULL) = 0; ) - fix infinite loop in DumpTypeIndex() when dumping std types like std::string - fix FormatSymbolValue() pointing to wrong address when accessing local variable values - use portable types instead of x86 specific types, this fixes some wrong address issues on x86 platform - use bigger buffers to format symbols to avoid buffer overflows
2014-01-12Core/Movement: Add LOS check for fleeingmovement target point.zengwf
Prevents fleeing or feared units from going to upper floor ignoring walls/ceilings with mmaps on(and usually get stucked). Current implementation just randomly selects a distance and angle against the frighting unit, when in narrow circumstance such as underground caves, such targeting point would be at another floor. Closes #11300 Ref #9475 (needs fixed confirmation)
2014-01-01Update copyright note for 2014.Vincent_Michael
Happy new year.
2013-12-25Core/Scripting: Replace casted with cast as casted is not a word.Malcrom
2013-12-22Core/Auth: Fix expiring account bansjackpoz
Fix a database race condition in authserver that would delay the account ban expiry by 1 login because the query that would have removed the ban was executed asynchronously.
2013-12-19Core/Logging: Use logger cache for speed up logger filter searchSpp
2013-12-14Core/Misc: Fix some static analysis issuesjackpoz
Fix some static analysis issues about uninitialized values. Most of them are false positives, always initialized before being accessed, while some of them are real issues spotted by valgrind too.