22 Commits

Author SHA1 Message Date
Shauren
7c4c5ba549 Core/Misc: Clean up WorldSession includes a bit 2022-12-30 14:00:20 +01:00
jackpoz
b6f28a7ebc Core/Packets: Reduce memory footprint of cached queries (#22297)
Ensure only the minimum required memory is used by caching query packets by calling shrink_to_fit()

(cherry picked from commit deabd4ab45)
2021-10-22 23:15:27 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
beb3316089 Core/Shared: Include cleanup 2017-05-13 11:49:09 +02:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Naios
bf33159a70 Core/Game: Converted the game library to a shared library.
* There is still the possibility to static link against game.
2016-03-24 01:31:51 +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
66d8ccde7f Core/PacketIO: Fixed chat packet building in CreatureTextMgr
Closes #14871
2015-06-15 00:25:18 +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
joschiwald
a4afd80479 Core/Packets: updated some channel moderation packets
- synch opcodes with wpp
2015-01-02 02:20:40 +01:00
Vincent-Michael
ab90f74486 Update copyright note for 2015
Happy new year
2015-01-01 00:28:09 +01:00
joschiwald
6c6e4d4328 Core/Packets: moved chat packet building function to packet builder class 2014-12-23 00:06:36 +01:00
Rat
0b80eb0048 Core/Packets: Add GetOpcode() methods to ClientPacket and ServerPacket 2014-11-15 02:51:40 +00:00
DDuarte
6586cae13c Core/Packets: Add a constructor to ClientPacket with expected opcode (asserted)
Also move all trivial packet constructors from .cpp to .h
2014-11-10 04:39:20 +00: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
Intel
9267c78a77 Core: Fixed Non-PCH build 2014-11-05 02:26:34 +02:00
Shauren
b8d1d9a733 Core/PacketIO: Minor refactor to writing server packets 2014-11-03 20:23:21 +01:00
joschiwald
310c33d96f Core/NetworkIO: update SMSG_CHAR_ENUM and CMSG_PLAYER_LOGIN 2014-10-31 14:47:56 +01:00
Shauren
7de1356085 Core/NetworkIO: Moved SMSG_AUTH_CHALLENGE and CMSG_AUTH_SESSION to packet claases, added SMSG_COMPRESSED_PACKET 2014-10-31 01:20:53 +01:00
DDuarte
7b2274a744 Core/Networking: PoC changes to the way packets are handled
This is a rewrite of the way we send SMSG opcodes, the reasoning behind this is to make fixing packets sent in multiple places easier, and allow for clearer documentation of the packet fields.

Included SMSG_AUTH_RESPONSE and SMSG_AUCTION_COMMAND_RESULT as two examples.
2014-10-30 02:04:54 +00:00