Could you just add a null character to it in the receive code inside OINC? Leaving the size passed to the callback the same. Then people could treat it as binary or a null-terminated string as they wanted.
Printable View
Could you just add a null character to it in the receive code inside OINC? Leaving the size passed to the callback the same. Then people could treat it as binary or a null-terminated string as they wanted.
Thank you all so much! Everything is working great now! :grin:
...Except whenever I call Client.StringIP() inside of a printf or sprintf I get an "unresolved external symbol" compiler error and I can't dobecause StringIP() returns a const char*.Code:char* ip = CLient.StringIP();
What's wrong with doing:
const char* ip = Client.StringIP();
?
Well I'm making a master server for a "server lobby" in my game and there is an array of server structures and they need to have an IP variable that can be changed if that server were to stop hosting and another one took its place.
char* ip = (const char*)Client.StringIP(); should work...
If StringIP generates an unresolved external symbol error, it sounds like the function isn't implemented in that build of the DLL. You could use sprintf and the byte IP array, or you could wait until the next build. Sorry about that.
Alright I'll try the byte IP array.
Thanks again for the help.
Hmmm
seems to crash the app. I guess I'll just wait for the next build.Code:sprintf(ip, "%i.%i.%i.%i", Client.IP[0], Client.IP[1], Client.IP[2], Client.IP[3]);
Is "ip" a char* or a char array?
sprintf has to be given the memory it's going to use, you can't just pass it an uninitialized pointer.