[General] Add orderChannel to packets

0.6.1
Koncord 8 years ago
parent 4ebc9f1314
commit 41005b1add

@ -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

@ -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()

@ -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;

Loading…
Cancel
Save