Ok that sounds good and thanks
One more question I need to ask of you is what exactly are the difference between UDPMODE_PER_CLIENT_PER_OPERATION & UDPMODE_PER_CLIENT I read the help document but it did not completely answer the question for me, I dont really understand the purpose of whole operation thing and why it would be useful.. So if your not too busy can you just give a quick explanation of the usage and what it would be most effective for? Thanks
EDIT:
I am having problems with using UDP
I have used the TCP packet system just fine and everything worked but when I tried to do the same with UDP ive gotten multiple problems..
USING: UDPMODE_PER_CLIENT
Problem 1
If I do not put mnAddInt() at the start of a packet when sending UDP i get this error "An error occurred whilst dealing with new udp packet. Client Number must be less than or equal to maximum number of clients at line 1238. Error code: '997', Version: 'Release v 1.0.2 CPP (28/8/08)'. Would you like to exit?"
It appears that in that problem I have to first put the interger value of a client that iam sending to even though iam using mnSendUDP(client,false,false) which that does not make sense
Problem 2
EDIT 2:
I have to change the value in mnRecvUDP from mnRecvUDP(0,0)
to mnRecv(1,0) for it to recognize any data is being sent, if I
leave it 0 it does not see that any UDP packets were recieved
According to help document, this can be set client side to anything
When I receive the UDP message it appears to be empty and not clearing cache, I have found it is not any other code as this project is very small and the TCP worked out just fine
Due to this problems I cannot properly send UDP packets
If the problem is due to using UDPMODE_PER_CLIENT please show me how to properly use them, becuase using the other method i do not understand the whole "operation client setup" and I do not want to send unneccessary UDP packets to every client on the server just the one that it needs to go to hence why I used mnSendUDP, sorry for the inconvience and here is the code I am using below to send and receive TCP / UDP packets
SENDING (SERVER)
if(iNew_Client > 0)
{
cout << "--New Client " << iNew_Client << " has joined" << endl;
if(mnClientConnected(iNew_Client) == 1)
{
/*
mnAddUnsignedByte(NETWORK_PROTOCOL_MESSAGE);
mnAddString("Hello World (TCP)");
iSend_Status = mnSendTCP(iNew_Client,false,false);
cout << "--Send status of TCP message is " << int(iSend_Status) << endl;
*/
///*
mnAddInt(8908);
mnAddUnsignedByte(NETWORK_PROTOCOL_MESSAGE);
mnAddString("Hello World (UDP)");
cout << "--Sending UDP Packet to client number " << iNew_Client << endl;
iSend_Status = mnSendUDP(iNew_Client,false,false);
cout << "--Send status of UDP message is " << int(iSend_Status) << endl;
//mnSendUDPAll(false,false,NULL);
//*/
}
}
RECIEVING (CLIENT)
iConnection = mnClientConnected(0);
if(iConnection == 1) // Means we are connected to server
{
iTCPData = mnRecvTCP(0);
if(iTCPData == 1)
{
iCommand = mnGetUnsignedByte();
switch(iCommand)
{
case NETWORK_PROTOCOL_MESSAGE:
cout << "[TCP] " << mnGetString() << endl;
break;
}
}
iUDPData = mnRecvUDP(1,0);
if(iUDPData == 1)
{
cout << "--UDP data is waiting to be recieved" << endl;
iClient = mnGetInt();
iCommand = mnGetUnsignedByte();
switch(iCommand)
{
case NETWORK_PROTOCOL_MESSAGE:
cout << "[UDP] " << mnGetString() << endl;
break;
}
}
}
Thank you for your time and your plugin, if this is an error on the plugin iam happy to find it
if not its my fault lol
Making dreams possible, one line at a time...