Commit Graph

91 Commits

Author SHA1 Message Date
Shauren
d9f1d6466d Core/Battle.net: Implemented authserver 2014-05-06 23:43:29 +02:00
Shauren
f0d6f87138 Core/Battle.net: Fixed encryption 2014-05-04 11:49:32 +02:00
Shauren
769fadd104 Core/Battle.net
* Extended AuthResult enum
* Implemented WriteString in BitStream
* Fixed HexStrToByteArray in reverse mode
2014-05-04 00:59:24 +02:00
Shauren
2654fd67f3 Core/Battle.net: Refactored FCC writing 2014-05-02 13:30:41 +02:00
Shauren
6955d7c9ad Core/Battle.net
* Fixed AuthResult codes
* Fixed BitStream::WriteBytes size check
* Fixed comparison operator for packet header
* Fixed channel for client packets without channel
* Implemented loading modules from database
2014-05-02 02:55:10 +02:00
Shauren
fea9d275fa Verify received components 2014-04-30 23:02:01 +02:00
Shauren
a142eb9f7a Core/Auth: Battle.net stuff 2014-04-30 20:50:15 +02:00
QAston
9495194bf2 Fix warnings introduced on littleendian in 2134cb610d
This fix prevents possible issues on bigendian machines. Don't use c style casts ppl, it's evul.
2014-01-30 23:43:37 +01:00
QAston
139ee0c8b7 Fix incorrect debug log in authserver 2014-01-26 22:04:45 +01:00
QAston
2134cb610d Remove unneeded bigendian checks (they're already part of EndianConvert). 2014-01-26 21:32:07 +01:00
Vincent_Michael
20004050bc Update copyright note for 2014.
Happy new year.
2014-01-01 00:07:53 +01:00
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