NAME

application_start - notifies the application about the initiation of server networking.

SYNOPSIS

#include <game-carrier/server.h>

GC_ADAPTER_EVENT
void application_start(
    GCT_INT app_id);

Parameters:

  • app_id GCT_INT Unique identifier of the application.

RETURN VALUE

None.

DESCRIPTION

The application_start function is invoked by the gcs for each application specified in the configuration.

The purpose of the application_start function is to notify the application about the initiation of server networking. This call occurs before any on_connect calls. It serves as an appropriate moment to commence application network activity, such as establishing necessary S2S connections.

Please note that creating new counters within this method is prohibited. The getCounterNames method will return the complete list of counters in the system, including those created by other applications.

The app_id parameter represents the unique application identifier, which was previously provided during the application_initialize call.

EXAMPLE

#include <game-carrier/server.h>

GC_ADAPTER_EVENT
GCT_INT application_initialize(
    GCT_INT id,
    GCT_CSTR name,
    GCT_CSTR type_name,
    GCT_CSTR file_name)
{
    /**
     * Here is a good place for:
     *   - initialization/allocation global application resources
     *   - creating application related counters
     **/
    return 0;
}

GC_ADAPTER_EVENT
void application_start(
    GCT_INT id)
{
    /**
     * Here is a good place for:
     *   - starting networking activity
     *   - obtaining counter names list
     **/
}

GC_ADAPTER_EVENT
void application_stop(
    GCT_INT id)
{
    /* Here is good place for last networking commucations */
}

GC_ADAPTER_EVENT
void application_shutdown(
    GCT_INT id)
{
    /* Here is good place for deinitialization/deallocation global application resources */
}

SEE ALSO

application_stop, on_connect, application_initialize