Commit Graph

49 Commits

Author SHA1 Message Date
Gacko
678814836d Shared/OpenSSLCrypto: Add switch to fix build under Mac 2014-01-22 21:46:41 +01:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
jackpoz
04cc51a6cf Core/Misc: Fix some static analysis issues
Fix some static analysis issues, mostly false positive about fields not initialized in the constructor. It's good practice anyway to always initialize them.
2013-12-01 16:19:30 +01:00
Nay
1903d4ca7d Core/Server: Fix a spammy warning in WorldSession and move code to .cpp 2013-08-30 15:44:17 +01:00
raczman
ba22baebbd Core/Auth: Implement time-based token for user login as described in RFC 6238.
New column in account table is a base32 of token key bytes,
coincidentally it is the same format Google's Authenticator Android app uses.
If you want that to work, set system time on server correctly and use ntpd.

Closes #10527

Signed-off-by: Nay <dnpd.dd@gmail.com>
2013-08-25 14:02:40 +01:00
Vincent-Michael
7679145da5 Core: Fix warning 2013-08-19 15:04:45 +02:00
QAston
dedeb5f9eb Fix build with gcc. Thanks to McBitter for testing. 2013-08-19 14:52:17 +02:00
QAston
0513d9c8d0 Core: Fix warnings. Make callback symbols local. 2013-08-18 20:30:38 +02:00
QAston
19343ddd55 Fix crashed caused by using openssl from multiple threads simultanously.
Note that this doesn't make BigNumber class threadsafe - it never was that way.
2013-08-18 17:44:04 +02:00
QAston
2a3370929d Fix BigNumber::AsByteArray function by returning Auto_Ptr.
Remove mutex from BigNumber class - it didn't do what it was advertised to do - consider using the "locked" array outside of the function in which it was "locked".
2013-08-18 17:44:03 +02:00
QAston
8160633e12 Core: Fix a bug in BigNumber::SetBinary 2013-08-18 17:44:02 +02:00
QAston
10fb50ad66 Core: Fix a bug in BigNumber::SetQword 2013-08-18 17:44:02 +02:00
Shauren
8be181c7e6 Core/Misc: Fixed a bunch of issues found by static analysis 2013-05-17 20:39:53 +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
Spp
802657250c Core/Misc: Apply codestyle to multiple files 2013-01-14 09:50:59 +01: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
Spp
333b8e5159 Core/Build: Enable Clang PCH support and OS X specific features
Core: Fix warnings here and there
2012-11-09 13:13:45 +01:00
kaelima
7c971be3c5 Core/Misc: Fix some warnings and logic mistakes found by static code analysis 2012-09-05 17:18:05 +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
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
leak
176a2c1080 Core/Warden: Workaround for an OpenSSL bug in the ARC4 stream cipher initialization that causes crashes on some OS
-  Skip loading warden_action overrides when warden is disabled

fixes #6486
2012-07-13 09:11:05 +02:00
Shauren
c8d20004a5 Core: Minor code style corrections 2012-06-30 16:07:09 +02:00
click
593d003b7c Core. Fix non-PCH build 2012-03-09 21:53:47 +01:00
leak
700203ad1e Core/Shared: Add thread-safe access to BigNumber::AsByteArray()
fixes #5469
2012-03-06 17:22:58 +01:00
leak
33a04897de Core/Shared: Remove unused functions 2012-03-04 15:19:53 +01:00
leak
08268d2430 Core/Warden: Update copyright information / More cleanups 2012-02-20 14:31:26 +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
click
e6d5b21778 Core: Fix non-PCH build and remove a few warnings. 2012-01-24 00:24:39 +01: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
9e517c963b Cosmetic: Replace "* )" with "*)" and "* /*" with "* /*" 2011-09-29 09:32:55 +02:00
Spp
af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
Machiavelli
957c69de83 Update copyright note for 2011.
Happy new year.
2011-01-01 15:01:13 +01:00
Spp
408fce1de6 Core: Some optimizations
- Declare some functions const
- Fix some mem leak
- Fix some resource leak
- Remove unused variables and functions
- Remove duplicate functions
- Reduce the scope of some variables
- Remove unused file

--HG--
branch : trunk
2010-12-06 02:07:53 +01:00
click
613b81f36f REALLY fix the CRLF-crap...
--HG--
branch : trunk
2010-10-07 15:54:07 +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
a67d7c9afd Copyright header updates - part 3... (and some whitespace cleanups)
--HG--
branch : trunk
2010-10-07 14:00:52 +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
XTZGZoReX
18dce8897f * Rename: Sha1Hash -> SHA1Hash.
--HG--
branch : trunk
2010-08-08 04:49:04 +02:00
XTZGZoReX
66f1ac04d5 * Rename SARC4 to ARC4.
--HG--
branch : trunk
2010-08-08 03:55:24 +02:00
Tartalo
156f4c3057 Merge cmake files from shared/
--HG--
branch : trunk
2010-06-07 22:34:36 +02:00
Brian
36584926e6 * Auth lib builds again.
--HG--
branch : trunk
2010-06-07 07:43:20 -06:00
Tartalo
ce1b22ed0c More cmake fixes. Now cmake runs without errors with -DO_SCRIPTS=0
--HG--
branch : trunk
2010-06-07 12:41:57 +02:00
Tartalo
5358270186 Case sensitive renames on shared/ Fuck windows and insensitiveness
--HG--
branch : trunk
rename : src/server/shared/Cryptography/md5.c => src/server/shared/Cryptography/MD5.c
rename : src/server/shared/Cryptography/md5.h => src/server/shared/Cryptography/MD5.h
rename : src/server/shared/Cryptography/Sha1.cpp => src/server/shared/Cryptography/SHA1.cpp
rename : src/server/shared/Cryptography/Sha1.h => src/server/shared/Cryptography/SHA1.h
2010-06-06 23:29:55 +02:00
XTZGZoReX
309333ffff * Rename some cryptographic files.
--HG--
branch : trunk
2010-06-06 23:23:22 +02:00
XTZGZoReX
57f64f1f5a * Restructuring shared.
--HG--
branch : trunk
2010-06-06 23:18:57 +02:00