Commit Graph
255 Commits
Author SHA1 Message Date
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
Shauren 3da0f7e409 Core/Networking: Fixed deadlock in HandlePing if the client is about to be kicked for overspeed pings 2015-04-01 01:47:40 +02:00
Shauren 942f9f079c Build fix 2015-03-28 21:50:58 +01:00
Shauren bed88e0dd4 Core/Networking: Fixed unsafe access to _worldSession member in WorldSocket 2015-03-28 21:45:27 +01:00
Shauren 5ac0b7844c Core/PacketIO: Implemented CMSG_ENABLE_NAGLE 2015-03-28 20:51:01 +01:00
click aec6353297 Core: More INFO -> DEBUG changes (WorldSession/WorldSocket)
(cherry picked from commit 132d4ede37f849ef3803dda85ae3c7087a51cc83)

Conflicts:
	src/server/game/Server/WorldSession.cpp
	src/server/game/Server/WorldSocket.cpp
2015-03-18 00:18:20 +00:00
jackpoz a20905598d Core/PacketLog: Avoid unneeded calls with disabled packet logs
Avoid calling GetOpcodeNameForLogging() when packet logs are disabled.

(cherry picked from commit 5e7d4a44e0d6b92da8ba68a00be00c530a72c873)

Conflicts:
	src/server/game/Server/WorldSocket.cpp
2015-03-18 00:13:05 +00:00
Vincent-Michael f2cb963565 Core/Packets: Update some opcodes and enable this 2015-03-15 03:09:34 +01:00
Vincent-Michael 369b08b68d Core/Misc: Update base stuff for V6.1.0 build 19702 2015-03-01 02:24:59 +01:00
Shauren bbb2000fea Build fix 2015-02-24 00:32:01 +01:00
Shauren 3fcea2e9d4 Core/PacketIO: Handle ConnectToFailed and allow the client to reconnect up to 5 times before aborting login to world
Closes #14214
2015-02-23 22:35:26 +01:00
Shauren 880be1bc63 Core/Cosmetic: Use DEFINE_HANDLER to mark implemented packets processed directly in WorldSocket 2015-02-23 19:35:52 +01:00
Vincent-Michael ab90f74486 Update copyright note for 2015
Happy new year
2015-01-01 00:28:09 +01:00
joschiwald b68b6417f6 Core: fixed few coverity issues and warnings 2014-12-07 01:24:00 +01:00
joschiwald d55c0cbf3a Core/Packets: updated AccountData packets 2014-11-16 06:08:46 +01:00
Shauren e52357eb45 Warning fixes 2014-11-10 09:26:01 +01:00
Shauren f59a701e29 Core/PacketIO: Updated and enabled logout opcodes 2014-11-09 21:36:06 +01:00
Shauren 31730d52b6 Core/Logging: Added connection index to packetlog 2014-11-09 20:48:13 +01:00
Shauren bacc90b6ba Core/NetworkIO: Added second connection to WorldSession, handle AuthContinuedSession and enabled ConnectTo and ResumeComms 2014-11-09 00:37:33 +01:00
Shauren b8d1d9a733 Core/PacketIO: Minor refactor to writing server packets 2014-11-03 20:23:21 +01:00
Shauren dd040c5992 Core/NetworkIO: Fixed packet compression 2014-10-31 22:36:43 +01:00