[General] Add orderChannel to packets

pull/176/merge
Koncord 8 years ago
parent 4ebc9f1314
commit 41005b1add

@ -73,5 +73,14 @@ enum GameMessages
ID_GAME_PREINIT ID_GAME_PREINIT
}; };
enum OrderingChannel
{
CHANNEL_SYSTEM = 0,
CHANNEL_ACTOR,
CHANNEL_PLAYER,
CHANNEL_WORLDEVENT,
CHANNEL_MASTER
};
#endif //OPENMW_NETWORKMESSAGES_HPP #endif //OPENMW_NETWORKMESSAGES_HPP

@ -10,6 +10,7 @@ BasePacket::BasePacket(RakNet::RakPeerInterface *peer)
packetID = 0; packetID = 0;
priority = HIGH_PRIORITY; priority = HIGH_PRIORITY;
reliability = RELIABLE_ORDERED; reliability = RELIABLE_ORDERED;
orderChannel = CHANNEL_SYSTEM;
this->peer = peer; this->peer = peer;
} }
@ -52,21 +53,21 @@ void BasePacket::RequestData(RakNet::RakNetGUID guid)
bsSend->ResetWritePointer(); bsSend->ResetWritePointer();
bsSend->Write(packetID); bsSend->Write(packetID);
bsSend->Write(guid); 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) void BasePacket::Send(RakNet::AddressOrGUID destination)
{ {
bsSend->ResetWritePointer(); bsSend->ResetWritePointer();
Packet(bsSend, true); Packet(bsSend, true);
peer->Send(bsSend, priority, reliability, 0, destination, false); peer->Send(bsSend, priority, reliability, orderChannel, destination, false);
} }
void BasePacket::Send(bool toOther) void BasePacket::Send(bool toOther)
{ {
bsSend->ResetWritePointer(); bsSend->ResetWritePointer();
Packet(bsSend, true); Packet(bsSend, true);
peer->Send(bsSend, priority, reliability, 0, guid, toOther); peer->Send(bsSend, priority, reliability, orderChannel, guid, toOther);
} }
void BasePacket::Read() void BasePacket::Read()

@ -92,6 +92,7 @@ namespace mwmp
unsigned char packetID; unsigned char packetID;
PacketReliability reliability; PacketReliability reliability;
PacketPriority priority; PacketPriority priority;
int orderChannel;
RakNet::BitStream *bsRead, *bsSend, *bs; RakNet::BitStream *bsRead, *bsSend, *bs;
RakNet::RakPeerInterface *peer; RakNet::RakPeerInterface *peer;
RakNet::RakNetGUID guid; RakNet::RakNetGUID guid;

Loading…
Cancel
Save