Commit Graph

80 Commits

Author SHA1 Message Date
jackpoz
b0ffbb2179 Core/Auth: Fix expiring account bans
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-22 14:00:14 +01:00
jackpoz
096cb6bf00 Core/Auth: Fix Auth failing sometimes
Fix a database race condition between authserver saving session key to database asynchronously and worldserver reading it; session key is now saved synchronously.
2013-11-16 23:25:21 +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
Ascathor
2607738990 Core/Code: Unify codestyle for brackets: {} to { }.
Also added missing copyright to some files.
2013-10-27 23:46:02 +01:00
jackpoz
03657525ad Core/Auth: Mitigate DoS attacks to authserver
Mitigate DoS attacks to authserver like "Wow Auth Flooder.exe" by allowing a finite number of AUTH_LOGON_CHALLEGE packets in a row from same socket, 3 sounds like a reasonable limit.
2013-10-05 13:10:06 +02:00
Chaplain
aa8bfeec4f Auth/Misc: Code cleanup.
*Random performance optimizations
2013-09-02 19:40:31 +03: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
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
Shauren
779a59e7e2 Core/Config: Refactored ConfigMgr
* Loading initial configuration files is now separate from loading any additional custom configs
2013-07-15 17:31:44 +02:00
Spp
9664c0ab5c Core/Misc: Another batch of fixes for issues found by static analysis 2013-05-30 13:18:29 +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
Bezo
7542049eba [Ip2nationLock] Implement the ip2nation lock country. 2013-04-22 15:53:48 +02:00
Nay
db0b81e8e7 Core/RealmSocket: Remove a not required #ifndef MSG_NOSIGNAL / #define MSG_NOSIGNAL 0
Somewhere in ACE overloads of send(), flags are default'ed  to 0 if not provided
2013-02-11 03:33:02 +00:00
Nay
42e660e2a2 Core/Sockets: Always try to send MSG_NOSIGNAL in peer().send()
Fixes RASocket::authenticate crash

"MSG_NOSIGNAL:
If you send() to a remote host which is no longer recv()ing, you'll typically get the signal SIGPIPE. Adding this flag prevents that signal from being raised."

Closes #5040
Thanks to @derex for the hint
2013-02-11 02:59:37 +00:00
Shauren
b6e56e42ea Core/Auth: Reverted part of fb43a92cc2 - session key is still needed after logging in to be able to switch realms 2013-02-08 01:03:56 +01: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
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
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
Spp
358c6a26d6 Core: Warning fixes (Also some -pedantic under game folder) 2012-09-10 13:04:31 +02:00
Nay
d0e1a6d742 Core/Authsocket: Correct field types for an account_banned related query
Thanks @Tuxity

Closes #6373
Closes #7511
2012-09-08 00:42:00 +01:00
Nay
abbb896cfb Core: Fix many "errors"/warnings and coding style (2)
Scripts; also reverted a change to AuthSocket

Errors were found using Cppcheck, open-source static analysis tool
2012-08-30 22:44:03 +01: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
Shauren
ad8010730c Core/Authserver: Improved realmlist for multiple realms with different versions, idea from MaNGOS and allow 4.0.6a, 4.2.2 and 4.3.4 clients to use the authserver (no world connections) 2012-08-28 01:11:03 +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
kaelima
19f821d00a Auth/Realmlist: Make use of RealmFlags and rename color to flag (core- and dbwise)
Also fix connecting with realmflag & 4
2012-03-26 05:14:10 +02: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
Spp
03c34ee507 Fix a lot of warnings 2012-02-16 13:56:28 +01:00
Subv2112
93d199f043 Core/Collision: Ported dynamic line of sight patch by Silverice from MaNGOS and
added lots of improvements
Please re-extract vmaps
2012-02-09 13:58:22 -05:00
leak
e28dbe9f88 Core/AuthServer: Streamlined authserver log messages (added client port for easier identification and matching for multiple connections from same IP) 2012-01-24 20:56:16 +01:00
kiper
8299627ed9 Update headers for 2012. HAPPY NEW YEAR!!! 2012-01-01 00:32:13 +01:00
leak
73cf793e56 Core/DBLayer: Refactor prepared statement defines Note:
The new format for the middle section is a 3-letter upper case abbreviation of the sql command being executed (select -> SEL, update -> UPD, etc.)
{DB}_{SEL/INS/UPD/DEL/REP}_{Summary of data changed}
2011-12-31 20:14:38 +01:00
kaelima
a919265623 Core/DB: Fix character creation in Player::SaveToDB.
And some misc comments/whitespaces
2011-11-26 01:53:44 +01:00
Spp
bb64e64463 Compile Fix 2011-10-18 17:55:21 +02:00
Spp
9e517c963b Cosmetic: Replace "* )" with "*)" and "* /*" with "* /*" 2011-09-29 09:32:55 +02:00
Spp
be12603150 Configuration/ConfigMgr: converted from singleton to namespace with free functions. 2011-09-28 13:00:43 +02:00
Spp
af05915b9e [Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions) 2011-09-15 14:12:57 +02:00
Derex
d65e1d9a3f Core/Network: Handle running out of file descriptors on linux-based systems (windows-based systems requires additional fixes)
Signed-off-by: click <click@gonnamakeyou.com>
2011-06-23 11:14:01 +02:00
leak
1003f30448 Add spaces after commas 2011-04-29 20:47:02 +02:00
Shauren
2f79b0f266 Core: Removed all double (and more) empty lines 2011-03-21 10:52:14 +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
leak
137b079eea Core: Generic cleanup (tab2spaces/trailing whitespace removal) 2011-01-26 01:03:35 +01:00
Derex
45459bed23 Core/Netcode: Fix file descriptor leak under linux platforms with ACE dev poll reactor.
close #15

Signed-off-by: Machiavelli <machiavelli.trinity@gmail.com>
2011-01-09 13:53:25 +01:00
Machiavelli
957c69de83 Update copyright note for 2011.
Happy new year.
2011-01-01 15:01:13 +01:00
silinoron
8b99f28e29 Core/Authserver: Revert a small mistake. Thanks aurimas.
--HG--
branch : trunk
2010-12-27 09:19:44 -08:00
silinoron
60c6d462e4 Core/Authserver: Significant cleanup in preparation for a rewrite.
Dropped support for running as a service on windows; it may be back in some form later.
Otherwise there should be no functional changes.

--HG--
branch : trunk
2010-12-27 09:02:02 -08:00
Shauren
928443d899 Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG--
branch : trunk
2010-12-23 23:25:44 +01:00
click
5180ed0383 Core/AuthServer: Fix the previous commit (it might help to actually fetch what we want to work on as well)
--HG--
branch : trunk
2010-12-21 05:57:53 +01:00