This is the Pley native SDK reference documentation, the libraries and headers are available for download in the game manager.
What's available in the package:
include/
pley.h # Header file with the definition of all our functions and structs
lib/
pleysdk.bundle # Lib for developing on OSX
libpleysdk.bc # Emscripten lib compiled with emcc 2.0.16
libpleysdk.so # Linux shared object
pleysdk.dll # Windows dll
Example
#include <pley.h>
const char* cloud_storage_path;
const char* username = "anon";
void sync_cloud_storage_cb(
PleyResult res,
void *data) {}
fprintf(stderr, "Error while initializing Pley SDK: %d\n", res);
exit(EXIT_FAILURE);
}
pley_sdk = sdk;
pley_destroy = destroy;
char* file_path;
asprintf(&file_path, "%s/%s", cloud_storage_path, "my_save");
FILE *save = fopen(file_path, "w+");
fprintf(save,"level:%d", 7);
fclose(save);
}
int main() {
char dev_host[] = "127.0.0.1:23000";
strncpy((char*)params.dev_host, dev_host, sizeof(dev_host));
while (true) {
}
pley_destroy(pley);
return 0;
}
PleyResult(* get_username)(const char **username)
Definition pley.h:309
PleyResult(* get_cloud_storage_path)(const char **ptr)
Definition pley.h:186
void(* sync_cloud_storage)(PleyBasicCB callback, void *callback_data)
Definition pley.h:187
PleyAuthKit * auth_kit
Definition pley.h:503
PleyFileKit * file_kit
Definition pley.h:506
PLEY_SDK_API PleyResult pley_init(PleyInitParams *params, PleyInitCB callback, void *callback_data)
Initialize the Pley SDK, the call is blocking on non EMSCRIPTEN build.
void(* PleyDestroy)(Pley *pley)
Definition pley.h:515
int32_t PleyResult
Definition pley.h:41
@ PLEY_RESULT_OK
Definition pley.h:44