new unitsync API: GetNextError

new unitsync API: GetNextError

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

new unitsync API: GetNextError

Post by Tobi »

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.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: new unitsync API: GetNextError

Post by Tobi »

This is in SVN since earlier today, in case you didn't notice :-)
Post Reply

Return to “Engine”