Skip to content

Commit

Permalink
fix(net): linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianTerhorst committed Oct 22, 2024
1 parent 498bcf4 commit 7fefcc1
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion code/components/citizen-server-impl/include/GameServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ namespace fx
void ProcessPacket(NetPeerBase* peer, ENetPacketPtr& packet);

public:
using TPacketHandler = std::function<void(uint32_t packetId, const fx::ClientSharedPtr& client, net::ByteReader& packet, ENetPacketPtr packetPtr)>;
using TPacketHandler = std::function<void(uint32_t packetId, const fx::ClientSharedPtr& client, net::ByteReader& packet, ENetPacketPtr& packetPtr)>;

inline void SetPacketHandler(const TPacketHandler& handler)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7721,7 +7721,7 @@ static InitFunction initFunction([]()

auto gameServer = instance->GetComponent<fx::GameServer>();

gameServer->GetComponent<fx::HandlerMapComponent>()->Add(HashRageString("msgNetGameEvent"), { fx::ThreadIdx::Sync, [=](const fx::ClientSharedPtr& client, net::ByteReader& reader, fx::ENetPacketPtr& packet)
gameServer->GetComponent<fx::HandlerMapComponent>()->Add(HashRageString("msgNetGameEvent"), { fx::ThreadIdx::Sync, [=](const fx::ClientSharedPtr& client, net::ByteReader& reader, fx::ENetPacketPtr packet)
{
// this should match up with SendGameEventRaw on client builds
// 1024 bytes is from the rlBuffer
Expand Down
4 changes: 2 additions & 2 deletions code/components/net-base/include/Net.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ inline Type hton(Type net)
}
else
{
static_assert(false, "Unsupported type for hton");
static_assert(!std::is_same_v<Type,Type>, "Unsupported type for hton");
return Type{};
}
}
Expand Down Expand Up @@ -83,7 +83,7 @@ inline Type ntoh(Type net)
}
else
{
static_assert(false, "Unsupported type for ntoh");
static_assert(!std::is_same_v<Type,Type>, "Unsupported type for ntoh");
return Type{};
}
}
Expand Down
10 changes: 5 additions & 5 deletions code/components/net-base/include/SerializableProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ namespace net
if constexpr (SizeOption::kType != storage_type::SerializableSizeOption::Type::Value)
{
static_assert(
false,
!std::is_same_v<Type,Type>,
"serializable of a primitive type requires a SerializableSizeOptionValue when SizeOption is specified.")
;
}
Expand Down Expand Up @@ -193,7 +193,7 @@ namespace net
storage_type::SerializableSizeOption::Type::Area)
{
static_assert(
false,
!std::is_same_v<Type,Type>,
"serializable of a std::string or std::string_view requires a SerializableSizeOptionArea.");
}

Expand Down Expand Up @@ -222,7 +222,7 @@ namespace net
if constexpr (std::is_same<SizeOption, void>() || SizeOption::kType !=
storage_type::SerializableSizeOption::Type::Area)
{
static_assert(false, "serializable of a buffer requires a SerializableSizeOptionArea.");
static_assert(!std::is_same_v<Type,Type>, "serializable of a buffer requires a SerializableSizeOptionArea.");
}

bool validSize;
Expand All @@ -248,7 +248,7 @@ namespace net
if constexpr (std::is_same<SizeOption, void>() || SizeOption::kType !=
storage_type::SerializableSizeOption::Type::Area)
{
static_assert(false, "serializable of a buffer requires a SerializableSizeOptionArea.");
static_assert(!std::is_same_v<Type,Type>, "serializable of a buffer requires a SerializableSizeOptionArea.");
}

bool validSize;
Expand Down Expand Up @@ -286,7 +286,7 @@ namespace net
}
else
{
static_assert(false, "Unsupported property type");
static_assert(!std::is_same_v<Type,Type>, "Unsupported property type");
}

return Success;
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestArrayUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "ByteReader.h"
#include "ByteWriter.h"
#include "ConsoleContextInstance.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "GameServer.h"
#include "ServerGameStatePublicInstance.h"
#include "ServerInstance.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestGameStateAckPacketHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <catch_amalgamated.hpp>

#include "ConsoleContextInstance.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "GameServer.h"
#include "GameStateNAck.h"
#include "NetBuffer.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestGameStateNAckPacketHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <catch_amalgamated.hpp>

#include "ConsoleContextInstance.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "GameServer.h"
#include "GameStateNAck.h"
#include "NetBuffer.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestHeHostHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "ByteReader.h"
#include "ByteWriter.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "GameServer.h"
#include "GameServerInstance.h"
#include "HeHost.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestIHostHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "ByteReader.h"
#include "ByteWriter.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "GameServer.h"
#include "GameServerInstance.h"
#include "ServerInstance.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestIQuitHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "ByteReader.h"
#include "ByteWriter.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "GameServer.h"
#include "GameServerInstance.h"
#include "ServerInstance.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestNetGameEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "ByteReader.h"
#include "ByteWriter.h"
#include "ClientMetricData.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "GameServer.h"
#include "NetGameEventPacket.h"
#include "ServerInstance.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestRequestObjectIds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "ByteReader.h"
#include "ClientMetricData.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "ObjectIds.h"
#include "RoundToType.h"
#include "ServerGameStatePublicInstance.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestRoutingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <state/ServerGameStatePublic.h>

#include "ClientMetricData.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "ServerGameStatePublicInstance.h"
#include "ServerInstance.h"
#include "packethandlers/RoutingPacketHandler.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestServerCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "ByteWriter.h"
#include "ConsoleContextInstance.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "GameServer.h"
#include "ServerEventComponent.h"
#include "ServerEventComponentInstance.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestServerEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <catch_amalgamated.hpp>

#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "ServerInstance.h"
#include "TestUtils.h"
#include "packethandlers/ServerEventPacketHandler.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestStateBag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "ByteWriter.h"
#include "ClientRegistry.h"
#include "ConsoleContextInstance.h"
#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "ResourceManagerInstance.h"
#include "ServerInstance.h"
#include "TestUtils.h"
Expand Down
2 changes: 1 addition & 1 deletion code/tests/server/TestTimeSyncReq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <catch_amalgamated.hpp>

#include "EnetPacketInstance.h"
#include "ENetPacketInstance.h"
#include "GameServer.h"
#include "ServerInstance.h"
#include "packethandlers/TimeSyncReqPacketHandler.h"
Expand Down

0 comments on commit 7fefcc1

Please sign in to comment.