Commit Graph

275 Commits

Author SHA1 Message Date
Shauren
87bcf6c3c1 Warning fix 2019-07-15 18:03:48 +02:00
Shauren
74a801182a Core/PacketIO: Updated packet encryption to 8.2 2019-07-14 19:20:45 +02:00
Shauren
455959c606 Core/PacketIO: Rewrite updatefield handling 2019-06-08 17:06:57 +02:00
Shauren
50cfeb9aa4 Core/Misc: Improved ip2location code and set it to disabled by default
(cherry picked from commit 0ead73516a)
2019-01-09 17:35:18 +01:00
Gooyeth
163c487be7 Common: Replace ip2nation by ip2location. (#21957)
Replace ip2nation by ip2location.

Download: https://lite.ip2location.com/database/ip-country
(cherry picked from commit 2fe4ab94c5)
2019-01-09 17:35:13 +01:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren
0a779bd791 Core/PacketIO: Updated packet structures to 8.0.1 2018-11-05 00:00:34 +01:00
Shauren
c2d61e05cf Core: Updated allowed build to 7.3.5.26972 2018-06-29 22:38:38 +02:00
Shauren
6ef9c4dbfc Core: Updated allowed build to 7.3.5.26899 2018-06-22 18:00:24 +02:00
Shauren
170d10b8a9 Core: Updated allowed build to 7.3.5.26822 2018-06-14 23:08:55 +02:00
Shauren
f313e9f5e1 Core: Updated allowed build to 7.3.5.26654 2018-05-24 22:34:18 +02:00
Roc13x
11c3c456b7 Core/Bnet: Improve client ban messages (#21837)
* Don't hide banned game accounts from list.
* Display proper ban messages with suspension time remaining.
* More appropriate error codes for bans and locks
2018-04-18 20:27:45 +03:00
Shauren
72a9a8a29c Core: Updated allowed build to 7.3.5.26365 2018-04-06 18:03:08 +02:00
Shauren
31f6ba5a92 Core: Updated allowed build to 7.3.5.26124 2018-02-28 23:18:41 +01:00
Shauren
4af15915bc Core/PacketIO: Updated opcodes and packet structures to 7.3.5 2018-02-18 16:33:49 +01:00
Shauren
dfd2660a85 Core/Misc: Added compatibility layer for boost 1.66 and future std:: networking stuff
* Based on work done by @dimiandre in PR #21173

Closes #21171
Closes #21173
2018-01-06 01:21:59 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
20a3c9eed2 Core/PacketIO: Update opcodes to 7.3.2 2017-12-30 00:23:43 +01:00
Shauren
ca9b0b029f Core/Misc: Fixed uninitialized values
CID 1254611 1377296 1377728 1377727
2017-07-17 19:10:32 +02:00
Shauren
c5d3dd90be Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers
* Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files
* Moved SAI function definitions to source files (massive or requiring many different dependencies)
2017-05-18 23:53:25 +02:00
Shauren
6c92a481a3 Core/Misc: Cleanup worldserver/bnetserver main() functions to run destructors in predictable order
* world/bnet servers will now fail to startup if listen ports are in use
* Restored "Network.OutUBuff" config option lost during boost transition
2017-05-04 20:41:22 +02:00
Shauren
8e2634b2b4 Core/DBLayer: Convert async queries to new query callbacks and remove old callback handling 2017-01-13 21:38:03 +01:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Shauren
0d9136f764 Merge branch '6.x' of https://github.com/TrinityCore/TrinityCore into legion 2016-07-10 00:37:33 +02:00
Shauren
ebff8cb342 Core/PacketIO: Fixed crash happening when someone sends too small packet that is processed directly in WorldSocket
Closes #17536
2016-07-07 18:12:50 +02:00
Shauren
3903482eb8 Core: Updated to 7.0.3.21916 2016-06-13 19:54:06 +02:00
Shauren
d62b52befb Core/Addons: Removed AddonMgr 2016-05-30 23:42:09 +02:00
Shauren
174a6142f4 Core/Networking: Fixed a crash caused by attempting to connect directly to worldserver by setting portal=worldserver address
Closes #16927
2016-04-10 00:08:11 +02:00
Shauren
619669c620 Core/PacketIO: Updated remaining packet structures and enums appearing in packets 2016-03-28 15:23:41 +02:00
Shauren
9ad79934d3 Core/PacketIO: Updated packet structures to 6.2.4.21355 2016-03-25 21:33:55 +01:00
Shauren
45c857a6bf Core/Networking: Updated packet headers for 6.2.4 2016-03-24 21:15:02 +01:00
Shauren
6de7a0b879 Core/PacketIO: Updated opcode values to 6.2.4.21348 and disabled packets that had their structures changed 2016-03-24 19:28:16 +01:00
Shauren
f123c39659 Core/Networking: Added new AsyncRead method to Socket class allowing to pass a custom completion handler and refactor world socket initialization string handling 2016-03-10 23:33:56 +01:00
Shauren
97a79af470 Core/Networking: Rewrite networking threading model
Each network thread has its own io_service - this means that all operations on a given socket except queueing packets run from a single thread, removing the need for locking
Sending packets now writes to a lockfree intermediate queue directly, encryption is applied in network thread if it was required at the time of sending the packet
2016-02-19 19:23:04 +01:00
Shauren
a6dd6d7841 Core/Logging: Include more info in bad realm log 2016-01-20 17:19:42 +01:00
Vincent-Michael
478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
Shauren
6ace6aabbf Core/Networking: Added safety checks against linking instance socket with incorrect/old session
Ref #15892
2015-12-29 21:22:31 +01:00
Shauren
c463c84325 Core/Auth: Added missing lock country check to AuthSession handler 2015-11-02 20:23:39 +01:00
Shauren
783e8299cc Core/Misc: Fix for builds linked with libc++ instead of libstdc++ 2015-10-24 15:39:32 +02:00
Shauren
63def8aa32 Core/Battle.net:
* Changed packet structures to mirror client names
* Simplified ToString Building
* Removed deprecated structures

World: Cleaned up duplicate realm info 'realm' and 'realmHandle' variables (realmHandle was removed, that data is fully contained in realm)
2015-10-06 00:30:47 +02:00
Shauren
590c6e399d Core/Networking: Fixed possible crashes happening if async query retrieving account data takes too long
Closes #14944
2015-08-09 15:30:06 +02:00
Vincent-Michael
2e586bc520 Core: Header cleanup in game/*/*.cpp 2015-07-25 20:18:42 +02:00
Naios
6bf10c2b83 Core/Utilities: Remove global using of std::chrono namespace.
* never use "using namespace" in header files!
2015-07-21 20:42:07 +02:00
Shauren
f6bc87fe5d Core/Threading: Fixed possible data races after making auth queries async by moving their processing to boost::asio::io_service::run threads 2015-06-21 02:13:08 +02:00
Shauren
0e49eefe85 Core/DBLayer: Sprinkle some async magic on worldserver auth/session load process
* Implemented base for loading account wide data
2015-06-20 00:59:31 +02:00
Shauren
07260316ba Core/NetworkIO: Fixed packet compression
Closes #14401
2015-06-13 00:16:06 +02:00
Naios
800d5d8939 Core/Misc: Replace tc's optional with boost::optional.
* benefits from empty optimization (objects are only constructed if needed).
* supports r-value references (move semantics) (boost >= 1.56.0).
* preparation for c++14/17's std::optional and std::none_t.
* add move constructor to CompactArray.
2015-04-26 23:45:52 +02:00
Shauren
59e9bcf0bf Core/Socket: Removed unused synchronous read method 2015-04-24 00:10:04 +02:00
Shauren
bfca8246d8 Core/Socket: Fixed race conditions with instance socket
Helgrind logs:
==41785== Possible data race during write of size 8 at 0x6D80D590 by thread #4
==41785== Locks held: none
==41785==    at 0x19603A2: void std::swap<std::__future_base::_State_baseV2*>(std::__future_base::_State_baseV2*&, std::__future_base::_State_baseV2*&) (move.h:177)
==41785==    by 0x195FD7C: std::__shared_ptr<std::__future_base::_State_baseV2, (__gnu_cxx::_Lock_policy)2>::swap(std::__shared_ptr<std::__future_base::_State_baseV2, (__gnu_cxx::_Lock_policy)2>&) (shared_ptr_base.h:1069)
==41785==    by 0x1FC5B84: std::__basic_future<SQLQueryHolder*>::_M_swap(std::__basic_future<SQLQueryHolder*>&) (future:629)
==41785==    by 0x1FC5155: std::future<SQLQueryHolder*>::operator=(std::future<SQLQueryHolder*>&&) (future:691)
==41785==    by 0x1FB94C6: WorldSession::HandleContinuePlayerLogin() (CharacterHandler.cpp:832)
==41785==    by 0x1ABD31A: WorldSocket::HandleAuthContinuedSession(WorldPackets::Auth::AuthContinuedSession&) (WorldSocket.cpp:742)
==41785==    by 0x1AB8322: WorldSocket::ReadDataHandler() (WorldSocket.cpp:261)
==41785==    by 0x1AB77D1: WorldSocket::ReadHandler() (WorldSocket.cpp:157)
==41785==    by 0x1AC068A: Socket<WorldSocket>::ReadHandlerInternal(boost::system::error_code, unsigned long) (Socket.h:201)
==41785==    by 0x1AC39ED: void std::_Mem_fn<void (Socket<WorldSocket>::*)(boost::system::error_code, unsigned long)>::_M_call<std::shared_ptr<WorldSocket>&, boost::system::error_code const&, unsigned long const&>(std::shared_ptr<WorldSocket>&, void const volatile*, boost::system::error_code const&, unsigned long const&) const (in /usr/local/bin/worldserver)
==41785==    by 0x1AC393F: void std::_Mem_fn<void (Socket<WorldSocket>::*)(boost::system::error_code, unsigned long)>::operator()<std::shared_ptr<WorldSocket>&, boost::system::error_code const&, unsigned long const&, void>(std::shared_ptr<WorldSocket>&, boost::system::error_code const&, unsigned long const&) const (functional:578)
==41785==    by 0x1AC370F: void std::_Bind<std::_Mem_fn<void (Socket<WorldSocket>::*)(boost::system::error_code, unsigned long)> (std::shared_ptr<WorldSocket>, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, boost::system::error_code const&, unsigned long const&, 0ul, 1ul, 2ul>(std::tuple<boost::system::error_code const&, unsigned long const&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (functional:1264)
==41785==
==41785== This conflicts with a previous read of size 8 by thread #1
==41785== Locks held: none
==41785==    at 0x144BF6A: std::__shared_ptr<std::__future_base::_State_baseV2, (__gnu_cxx::_Lock_policy)2>::operator bool() const (shared_ptr_base.h:1056)
==41785==    by 0x1AAF7BD: std::__basic_future<SQLQueryHolder*>::valid() const (future:590)
==41785==    by 0x1AAA04C: WorldSession::ProcessQueryCallbacks() (WorldSession.cpp:1006)
==41785==    by 0x1AA5167: WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:452)
==41785==    by 0x1D2D667: World::UpdateSessions(unsigned int) (World.cpp:2793)
==41785==    by 0x1D2A8C6: World::Update(unsigned int) (World.cpp:2159)
==41785==    by 0x145B823: WorldUpdateLoop() (Main.cpp:397)
==41785==    by 0x145957F: main (Main.cpp:255)

==41785== Possible data race during read of size 8 at 0x6D80D638 by thread #1
==41785== Locks held: none
==41785==    at 0x1A5E914: std::__shared_ptr<WorldSocket, (__gnu_cxx::_Lock_policy)2>::operator bool() const (shared_ptr_base.h:1056)
==41785==    by 0x1AA52A9: WorldSession::Update(unsigned int, PacketFilter&) (WorldSession.cpp:468)
==41785==    by 0x1D2D667: World::UpdateSessions(unsigned int) (World.cpp:2793)
==41785==    by 0x1D2A8C6: World::Update(unsigned int) (World.cpp:2159)
==41785==    by 0x145B823: WorldUpdateLoop() (Main.cpp:397)
==41785==    by 0x145957F: main (Main.cpp:255)
==41785==
==41785== This conflicts with a previous write of size 8 by thread #4
==41785== Locks held: none
==41785==    at 0x1AAD12D: std::__shared_ptr<WorldSocket, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<WorldSocket, (__gnu_cxx::_Lock_policy)2> const&) (shared_ptr_base.h:860)
==41785==    by 0x1AAD174: std::shared_ptr<WorldSocket>::operator=(std::shared_ptr<WorldSocket> const&) (shared_ptr.h:93)
==41785==    by 0x1ABF0B5: WorldSession::AddInstanceConnection(std::shared_ptr<WorldSocket>) (WorldSession.h:684)
==41785==    by 0x1ABD2F8: WorldSocket::HandleAuthContinuedSession(WorldPackets::Auth::AuthContinuedSession&) (WorldSocket.cpp:741)
==41785==    by 0x1AB8322: WorldSocket::ReadDataHandler() (WorldSocket.cpp:261)
==41785==    by 0x1AB77D1: WorldSocket::ReadHandler() (WorldSocket.cpp:157)
==41785==    by 0x1AC068A: Socket<WorldSocket>::ReadHandlerInternal(boost::system::error_code, unsigned long) (Socket.h:201)
==41785==    by 0x1AC39ED: void std::_Mem_fn<void (Socket<WorldSocket>::*)(boost::system::error_code, unsigned long)>::_M_call<std::shared_ptr<WorldSocket>&, boost::system::error_code const&, unsigned long const&>(std::shared_ptr<WorldSocket>&, void const volatile*, boost::system::error_code const&, unsigned long const&) const (in /usr/local/bin/worldserver)
2015-04-19 15:30:24 +02:00
Shauren
18343a7309 Core/Networking: Cleanup CloseSocket calls from read failures in WorldSocket 2015-04-03 15:38:03 +02:00