139 Type(type), ResponseID(responseid)
141 LEVIATHAN_ASSERT(responseid != static_cast<uint32_t>(-1),
142 "Response should use 0 if in response to anything");
149 packet << static_cast<uint16_t>(Type) << ResponseID;
151 _SerializeCustom(packet);
163 DLLEXPORT static std::shared_ptr<NetworkResponse> LoadFromPacket(sf::Packet &packet);
167 DLLEXPORT static void LimitResponseSize(ResponseIdentification &response,
173 DLLEXPORT virtual void _SerializeCustom(sf::Packet &packet)
const = 0;
185 std::shared_ptr<GameSpecificPacketData> actualresponse) :
187 ActualResponse(actualresponse)
192 LEVIATHAN_ASSERT(0,
"_SerializeCustom called on ResponseCustom");
197 packet << ResponseID << static_cast<uint16_t>(Type);
203 uint32_t responseid, sf::Packet &packet) :
209 throw InvalidArgument(
"invalid packet format for user defined response");
238 #include "../Generated/ResponseImpl.h" 242 #ifdef LEAK_INTO_GLOBAL Used for BaseGameSpecificResponsePacket storing.
Only one side of the connection can send this request, usually the client.
All values above this are application specific types.
virtual ~NetworkResponse()
ResponseCustom(GameSpecificPacketHandler &handler, uint32_t responseid, sf::Packet &packet)
void AddDataToPacket(sf::Packet &packet) const
NetworkResponse(NETWORK_RESPONSE_TYPE type, uint32_t responseid)
DLLEXPORT std::shared_ptr< GameSpecificPacketData > ReadGameSpecificPacketFromPacket(bool responsepacket, sf::Packet &packet)
ResponseNone(NETWORK_RESPONSE_TYPE actualtype, uint32_t responseid, sf::Packet &packet)
Contains an updated cache variable.
Sent by a server when a request is allowed.
NETWORK_RESPONSE_TYPE
Defines the type of response that the packet contains.
auto GetResponseID() const
Sends a update/new SyncedValue.
NETWORK_RESPONSE_TYPE GetType() const
Client sents this when they want input to be destroyed.
Sent when the server changes physics frozen state.
Empty response, used for keeping alive/nothing.
Contains (list) an ID for entity to be deleted.
const NETWORK_RESPONSE_TYPE Type
Type of response. Specifies which subclass this object is.
void _SerializeCustom(sf::Packet &packet) const override
Base classes serialize their data.
ResponseCustom(uint32_t responseid, std::shared_ptr< GameSpecificPacketData > actualresponse)
Contains the name of a removed cache variable.
Contains SyncedResource update notification.
DLLEXPORT void PassGameSpecificDataToPacket(GameSpecificPacketData *datatosend, sf::Packet &packet)
A server heartbeat packet.
Handles construction of all game specific packets.
std::shared_ptr< GameSpecificPacketData > ActualResponse
void _SerializeCustom(sf::Packet &packet) const override
Base classes serialize their data.
Contains control state updates regarding a NetworkedInput.
Contains a new NetworkedInput.
Empty keep alive response.
The access mask controls which registered functions and classes a script sees.
Marks that the client is required to send heartbeats.
ResponseNone(NETWORK_RESPONSE_TYPE actualtype, uint32_t responseid=0)
void AddDataToPacket(GameSpecificPacketHandler &handler, sf::Packet &packet)
Sent by a server when it disallows a made request.
A new entity was created on the server.
Sent in response to a NETWORK_REQUEST_TYPE::Connect.