resonance 1.0.1
Loading...
Searching...
No Matches
packet.h
Go to the documentation of this file.
1#pragma once
2
3#include "msg/message.h"
4
35class Packet : public Message {
36public:
46 virtual void saveGuts(OBStream &stream) const;
47
58 virtual void restoreGuts(IBStream &stream);
59
60protected:
77 Packet(int nDestination, int nDestinationSystem)
78 : mDestination(nDestination), mDestinationSystem(nDestinationSystem), mClientId(-1),
79 mTargetClientId(-1) {
80 }
81
84
92
100};
Input half of the byte stream interface.
Definition ibstream.h:36
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
Output half of the byte stream interface.
Definition obstream.h:25
Packet(int nDestination, int nDestinationSystem)
Set the two routing words and mark the remaining two as unset.
Definition packet.h:77
int mClientId
The client the packet concerns, or -1 until set.
Definition packet.h:91
virtual void saveGuts(OBStream &stream) const
Write the four words to a stream.
int mDestinationSystem
Definition packet.h:83
int mTargetClientId
A second client identifier, -1 until set.
Definition packet.h:99
int mDestination
Definition packet.h:82
virtual void restoreGuts(IBStream &stream)
Read the four words back from a stream.