From 41005b1add693c7b98019528da5f533ff923e533 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sun, 23 Apr 2017 13:31:01 +0800 Subject: [PATCH] [General] Add orderChannel to packets --- components/openmw-mp/NetworkMessages.hpp | 9 +++++++++ components/openmw-mp/Packets/BasePacket.cpp | 7 ++++--- components/openmw-mp/Packets/BasePacket.hpp | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/components/openmw-mp/NetworkMessages.hpp b/components/openmw-mp/NetworkMessages.hpp index e1035f673..de07a6651 100644 --- a/components/openmw-mp/NetworkMessages.hpp +++ b/components/openmw-mp/NetworkMessages.hpp @@ -73,5 +73,14 @@ enum GameMessages ID_GAME_PREINIT }; +enum OrderingChannel +{ + CHANNEL_SYSTEM = 0, + CHANNEL_ACTOR, + CHANNEL_PLAYER, + CHANNEL_WORLDEVENT, + CHANNEL_MASTER +}; + #endif //OPENMW_NETWORKMESSAGES_HPP diff --git a/components/openmw-mp/Packets/BasePacket.cpp b/components/openmw-mp/Packets/BasePacket.cpp index 57fa5bfc5..2cffec9d0 100644 --- a/components/openmw-mp/Packets/BasePacket.cpp +++ b/components/openmw-mp/Packets/BasePacket.cpp @@ -10,6 +10,7 @@ BasePacket::BasePacket(RakNet::RakPeerInterface *peer) packetID = 0; priority = HIGH_PRIORITY; reliability = RELIABLE_ORDERED; + orderChannel = CHANNEL_SYSTEM; this->peer = peer; } @@ -52,21 +53,21 @@ void BasePacket::RequestData(RakNet::RakNetGUID guid) bsSend->ResetWritePointer(); bsSend->Write(packetID); bsSend->Write(guid); - peer->Send(bsSend, HIGH_PRIORITY, RELIABLE_ORDERED, 0, guid, false); + peer->Send(bsSend, HIGH_PRIORITY, RELIABLE_ORDERED, orderChannel, guid, false); } void BasePacket::Send(RakNet::AddressOrGUID destination) { bsSend->ResetWritePointer(); Packet(bsSend, true); - peer->Send(bsSend, priority, reliability, 0, destination, false); + peer->Send(bsSend, priority, reliability, orderChannel, destination, false); } void BasePacket::Send(bool toOther) { bsSend->ResetWritePointer(); Packet(bsSend, true); - peer->Send(bsSend, priority, reliability, 0, guid, toOther); + peer->Send(bsSend, priority, reliability, orderChannel, guid, toOther); } void BasePacket::Read() diff --git a/components/openmw-mp/Packets/BasePacket.hpp b/components/openmw-mp/Packets/BasePacket.hpp index 395d7094b..88d0fa2a3 100644 --- a/components/openmw-mp/Packets/BasePacket.hpp +++ b/components/openmw-mp/Packets/BasePacket.hpp @@ -92,6 +92,7 @@ namespace mwmp unsigned char packetID; PacketReliability reliability; PacketPriority priority; + int orderChannel; RakNet::BitStream *bsRead, *bsSend, *bs; RakNet::RakPeerInterface *peer; RakNet::RakNetGUID guid;