I'm using RakNet to create a program which involves networking. I however don't know how to define a typedef for a Packet. The function I am trying to get it working for is:
void UDP_ClientDisconnected(Packet *pPacket);
Packet needs to be a typedef for this function obviously, however I don't know how to do this? Thanks to anyone who offers a solution.
Edit:
void Connections::UpdateRakNetwork()
{
for(Packet = Peer ->Receive(); Packet; Peer ->DeallocatePacket(Packet), Packet = Peer ->Recieve())
{
PacketID = GetPacketIdentifier(Pacekt);
switch(PacketID)
{
case ID_DISCONNECTION_NOTIFICATION:
UDP_ClientDisconnected(Packet);
break;
}
Peer ->DeallocatePacket(Packet);
}
}
Information is passed from this Packet sorting also in Connections.cpp, to the .h file in order to allow me to access these features from other elements of the game. Therefore allowing me to call UDP_ClientDisconnected(..);
from another file.
As of yet there is no errors with this part of the file but the .h declaration, with the "Packet is not a Type name" error. As the guy below suggested it might be the fact that I named something else packet therefore I renamed it RakPacket and gain the same error.