scripting:restcallback
This is an old revision of the document!
Table of Contents
RestCallback
Class: RestCallback
Parent Class: (?none?)
Location: scripts/GameLib/online/RestApi.c
Description: RestCallback class.
Common usage
Typical usage : Do something with the data from the restAPI
class TestCallback : RestCallback { override void OnSuccess( string data, int dataSize ) { Print(" !!! OnSuccess() size=" + dataSize ); if( dataSize > 0 ) Print(data); // !!! NOTE: Print() will not output string longer than 1024b, check your dataSize !!! }; }
class TestCallback : RestCallback { /** \brief Called in case request failed (ERestResult) - Note! May be called multiple times in case of (RetryCount > 1) */ void OnError( int errorCode ) { // override this with your implementation //Print(" !!! OnError() "); }; /** \brief Called in case request timed out or handled improperly (no error, no success, no data) */ void OnTimeout() { // override this with your implementation //Print(" !!! OnTimeout() "); }; /** \brief Called when data arrived and/ or response processed successfully */ void OnSuccess( string data, int dataSize ) { // override this with your implementation //Print(" !!! OnSuccess() size=" + dataSize ); //if( dataSize > 0 ) // Print(data); // !!! NOTE: Print() will not output string longer than 1024b, check your dataSize !!! }; /** \brief Called when data arrived and/ or file created successfully */ void OnFileCreated( string fileName, int dataSize ) { // override this with your implementation //Print(" !!! OnFileCreated() file=" + fileName + " size=" + dataSize ); }; }
—
Functions
OnError();
OnError( int errorCode );
Called in case request failed (ERestResult) - Note! May be called multiple times in case of (RetryCount > 1)
Return type: void
OnTimeout();
OnTimeout( );
Called in case request timed out or handled improperly (no error, no success, no data)
Return type: void
OnSuccess();
OnSuccess( string data, int dataSize );
Return type: void
OnFileCreated();
OnFileCreated( string fileName, int dataSize );
Return type: void
scripting/restcallback.1661435642.txt.gz · Last modified: 2022/08/25 14:54 by jerryhopper