Commit Graph

43 Commits

Author SHA1 Message Date
jackpoz
b054275fb2 Shared/Logs: Fix crash in Console log output
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-31 22:11:49 +01:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
jackpoz
9578b5f87a Core/Thread: Fix race condition converting time values to local time
Replace thread-unsafe localtime() http://www.cplusplus.com/reference/ctime/localtime/ with thread-safe portable ACE_OS::localtime_r() .

Helgrind log:
 Possible data race during read of size 4 at 0x6F183C0 by thread #1
 Locks held: none
  at 0x14E72E3: World::InitDailyQuestResetTime() (World.cpp:2772)
  by 0x14E3A01: World::SetInitialWorldSettings() (World.cpp:1790)
  by 0x101122A: Master::Run() (Master.cpp:164)
  by 0x101740C: main (Main.cpp:142)

 This conflicts with a previous write of size 4 by thread #2
 Locks held: none
  at 0x6C2D3BA: __tzfile_compute (tzfile.c:797)
  by 0x6C2D036: __tz_convert (tzset.c:627)
  by 0x164146C: LogMessage::getTimeStr(long) (Appender.cpp:23)
  by 0x1641550: LogMessage::getTimeStr() (Appender.cpp:31)
  by 0x1641722: Appender::write(LogMessage&) (Appender.cpp:80)
  by 0x1633FCE: Logger::write(LogMessage&) (Logger.cpp:83)
  by 0x16433D8: LogOperation::call() (LogOperation.cpp:29)
  by 0x16428A4: LogWorker::svc() (LogWorker.cpp:45)
2013-09-07 14:37:54 +02:00
Shauren
6e80357f8e Core/Authserver: Added possibility to allow realm connections both from "world" and local networks. 2013-01-27 17:33:01 +01:00
Nay
e5945402ad Core/Misc: Use ASSERT (custom, better macro) instead of the C macro assert() 2013-01-04 20:59:24 +00:00
Vincent_Michael
cc65aba789 Update copyright note for 2013.
Happy new year.
2013-01-01 00:41:01 +01:00
Shauren
f1170ba0fb Core: Fixed some level 4 warnings (msvc) 2012-12-31 20:43:14 +01:00
Spp
2251d1bfae Core/Misc: Set mode 0644 for files 2012-11-27 13:03:12 +01:00
Warpten
c8c4291c6f Core/Commands: Allow .modify money to take another parameter structure:
Example uses:
* .modify money 325g 25s 12c is the same as .modify money 3252512
* .modify money -12g is the same as .modify money -120000
* .modify money -12g 45s is the same as .modify money -115500
* .modify money 25c 18g is the same as .modify money 18g 25c
2012-10-12 22:13:28 +02:00
Nay
99175e066c Core/Utils: Add asserts to irand, urand and frand
max should always be higher or equal than min
notice that SFMT was already covering these cases and it would return 0, -1 or min
2012-10-07 12:55:51 +01:00
Subv
74707a08d3 Core/Misc: Fix a format error in ByteArrayToHexStr
Was appending an extra space.
Closes #7959
2012-10-04 19:13:39 -05:00
Spp
02d68e4610 Core: Fix build without PCH 2012-10-03 15:40:01 +02:00
Spp
f8846cdeaf Core/Utilities: Do not expose internal store structure in Tokens and rename it to Tokenizer 2012-10-02 11:54:41 +02:00
Shauren
1e9fc84a12 Core: Warning fixes
C4100: 'x' : unreferenced formal parameter
C4310: cast truncates constant value
C4389: '==' : signed/unsigned mismatch
C4668: 'x' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
C4701: potentially uninitialized local variable 'x' used
C4826: Conversion from 'HMODULE' to 'DWORD64' is sign-extended. This may cause unexpected runtime behavior.
C6067: Parameter '3' in call to 'sprintf' must be the address of the string
C6387: 'argument 1' might be '0': this does not adhere to the specification for the function 'CloseHandle'
2012-09-04 14:40:41 +02:00
Nay
5f1977cb1d Core: Fix many "errors"/warnings and coding style (1)
Extractors, worldserver, authserver, shared and collision affected

Errors were found using Cppcheck, open-source static analysis tool
2012-08-30 19:07:59 +01:00
click
6afaed4a02 Core: Remove the MersenneTwiser-library (SFMT is now considered stable enough for full deployment) 2012-03-27 02:27:12 +02:00
click
e615fba7f8 Revert "Core: Fix the SFMT randgen-initbug" - alignment-fix is now properly handled within the respective code
This reverts commit 28310f0938.
2012-02-25 20:39:28 +01:00
Elron103
28310f0938 Core: Fix the SFMT randgen-initbug
Signed-off-by: click <click@gonnamakeyou.com>
2012-02-25 02:16:08 +01:00
leak
8e3a4b956e Core/Warden: Base implementation for Warden functionality
Note: The default config file action for clients failing the checks can be changed for each check via the characters.warden_action table

Credits to TOM_RUS
2012-02-19 13:51:16 +01:00
Chaplain
29c2dfb1da [Core/Utilities] Implement random generator for float values.
*for mt and sfmt
 *some codestyle
2012-01-02 12:38:55 +03:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
Spp
e3f8588a22 Minor changes here and there:
- Cosmetic changes
- 'Engrish fix'
- Initialization of some vars
- Remove some not needed includes
2011-10-18 14:59:23 +02:00
Spp
b16d2245bb Cosmetic: Multiple cosmetic changes
- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '('
- Added missing space after a comma and remove space before comma (with some exceptions)
- Remove trailing spaces
- Convert tab to spaces

Note: Only affects files with extension "cpp" and "h" under /src/server
2011-09-29 12:43:05 +02:00
Spp
af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
leak
91a3bfe42a Core/Commands: .pinfo improvements
- Allow .pinfo <guid>
- Add map/zone/subzone/phase to output
2011-08-13 13:00:38 +02:00
Spp-
e47b96af3e Core: Append single character to stream as character, not as a string 2011-07-29 14:18:28 +02:00
click
158966dc79 Core: Codestyle cleanup 2011-06-11 22:35:29 +02:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
Machiavelli
957c69de83 Update copyright note for 2011.
Happy new year.
2011-01-01 15:01:13 +01:00
click
7e0dee8cb1 Fix build
--HG--
branch : trunk
2010-12-10 01:44:34 +01:00
linencloth
d9d1ec3670 Core: optimize string splitting
- Mainly affects item loading performance
  - Reduces guild loading time a lot

--HG--
branch : trunk
2010-10-21 16:56:51 +02:00
Xanadu
1e101ed785 Core/Utils: Fixed some unsafe calls to utf8 translation functions.
--HG--
branch : trunk
2010-10-17 20:35:11 +02:00
click
f0c4241ea4 Remove the accidental additions of CRLF-crap from the header updates
--HG--
branch : trunk
2010-10-07 15:35:36 +02:00
click
8ea4b32fab Update copyright headers (following the same standard in all files = good)
--HG--
branch : trunk
2010-10-07 12:41:56 +02:00
Machiavelli
49dc1e55de Core/Utils: Fix a crash in vutf8printf. Author: Vladimir
--HG--
branch : trunk
2010-09-18 11:29:09 +02:00
silinoron
5179d3149a Core/Game: Fix remaining warnings on windows (and most likely almost all of the ones on *nix)
--HG--
branch : trunk
2010-09-03 21:55:57 -07:00
silinoron
43b1c2dba4 * Remove support for map-based random number generation (which seems unused).
* Re-add in support for the old mersenne twister for those whose processors don't support SSE2.
* Toggling whether or not you are using SFMT is as easy as checking a CMake flag, USE_SFMT, which defaults to 0.

--HG--
branch : trunk
2010-08-20 12:42:14 -07:00
click
6501948dc8 Buildsystem/Core: Adjust filenames to their correct case
--HG--
branch : trunk
2010-08-20 02:10:08 +02:00
silinoron
ac59ff802b Switch to using SIMD-oriented Fast Mersenne Twister for random number generation.
In testing, reduced random number generation time by a factor of 8-10.
Drops support for processors older than Pentium 4.
Drop Mersenne Twister library; use a C++ SFMT library.

--HG--
branch : trunk
2010-08-19 16:13:10 -07:00
Xanadu
ffaffe3fd7 * Renamed several VS projects and the executables they produce to reflect the new naming convention.
* Cleaned up some useless and redundant preprocessor definitions.
* Fixed the win build so that it correctly uses the mysql lib it built from the sources.
* Note that you still need to use 8615_mysql_openssl_libs.zip for the OpenSSL binaries.
* Also note that Win x64 build from the existing VS files is still fubar (mysql lib...).

--HG--
branch : trunk
2010-06-23 01:47:41 +02:00
Brian
d9127cdee7 * Reverted to the old Mersenne Twister till the new one can be properly added
--HG--
branch : trunk
2010-06-07 14:13:56 -06:00
Brian
1a3f840a17 * broken
--HG--
branch : trunk
2010-06-07 13:20:46 -06:00
XTZGZoReX
57f64f1f5a * Restructuring shared.
--HG--
branch : trunk
2010-06-06 23:18:57 +02:00