|
@@ -73,8 +73,21 @@ bool InPacket::readS32(int32& s) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-OutPacket::OutPacket(unsigned int size, int flags)
|
|
|
- : packet(enet_packet_create(nullptr, size, flags)), index(0) {
|
|
|
+OutPacket::OutPacket(unsigned int size, int flags, int channel)
|
|
|
+ : packet(enet_packet_create(nullptr, size, flags)), index(0),
|
|
|
+ channel(channel) {
|
|
|
+}
|
|
|
+
|
|
|
+OutPacket OutPacket::reliable(unsigned int size) {
|
|
|
+ return OutPacket(size, ENET_PACKET_FLAG_RELIABLE, 0);
|
|
|
+}
|
|
|
+
|
|
|
+OutPacket OutPacket::sequenced(unsigned int size) {
|
|
|
+ return OutPacket(size, 0, 1);
|
|
|
+}
|
|
|
+
|
|
|
+OutPacket OutPacket::unsequenced(unsigned int size) {
|
|
|
+ return OutPacket(size, ENET_PACKET_FLAG_UNSEQUENCED, 2);
|
|
|
}
|
|
|
|
|
|
OutPacket::~OutPacket() {
|