KRPC#

Provides functionality to interact with the server: its status and services, the connected clients, the game scene and pause state, and holding the game on a physics tick. The expressions build server side functions.

Example#

The following example prints the version of the server:

#include <krpc_cnano.h>
#include <krpc_cnano/services/krpc.h>
#include <stdio.h>

int main() {
  krpc_connection_t conn;
  if (krpc_open_serial(&conn, "COM0") != KRPC_OK) return 1;
  if (krpc_connect(conn, "KRPC Example") != KRPC_OK) return 1;

  krpc_KRPC_ServerStatus_t status = {0};
  krpc_KRPC_GetStatus(conn, &status);
  printf("%s\n", status.version);
  krpc_free(status.version);
  krpc_disconnect(conn);
}