I added a new function to unitsync (not committed yet, will be done in weekend), which allows (lobby) clients to get better information about why a particular call to unitsync failed.
The prototype is as follows:
Code: Select all
DLL_EXPORT const char* __stdcall GetNextError();
This function should be called in a loop until it returns NULL to get all errors (in order they happened). Since many unitsync functions do not have any way to return an error code, it is advised to poll for errors after each unitsync call (if you want to handle them at least).
Nothing is guaranteed about the return message apart from that it's a C style zero terminated string. (Could be single word or detailed multiline error message etc.)
This is part of a change which actually makes unitsync not just crash/leak C++ exceptions if things go wrong, but return error code and store error message.