Skip to content

Core

Provides methods to configure the client-side plugin.

init

Initialize the client.

core.init( config_tbl )

Config Table Keys

Name Description Type Required
version The Coronium Plugin revision. Set to 2 to support server features in v2.6.0 or better. Set to 1 for older versions. Number Y
server The Coronium Core server address. String Y
key The Coronium Core server key. String Y
scope A unique application name for your Corona project. See Application Scope in the client guide. String Y
api The server-side API Project name to run api methods against (see Server-side API). String N

Example

Coronium Core 2.6.0 or better

core.init({
  version = 2,
  server = "https://<coronium-host-address>",
  key = "<coronium-server-key>",
  scope = "Space Race"
})

Coronium Core 2.5.0 or earlier

core.init({
  version = 1,
  server = "https://<coronium-host-address>",
  key = "<coronium-server-key>",
  scope = "Space Race"
})

Initialization

For detailed initialization instructions, see the Initialization section of the Client Guide.

useProject

Change the server-side project to run api methods against.

core.useProject( project )

Parameters

Name Description Type Required
project The project name to run api methods against. String Y

Example

core.useProject("default")

debug

Pretty print the response event to the console. Useful for debugging.

core.debug(response_event)

Example

local function apiResponse( evt )
  core.debug( evt )

  ...
end