SC_HandleBPSEvent()

Continue processing of Scoreloop code when using SC_RUN_LOOP_TYPE_BPS.

Synopsis:

#include <scoreloop/sc_init.h>
 
int SC_HandleBPSEvent(SC_InitData_t *initData, bps_event_t *event)

Arguments:

initData

A pointer to the init data

event

The BPS event to handle

Library:

libscoreloopcore

Description:

You have to call this method at the beginning of your BPS event loop, so that Scoreloop can continue its processing of asynchronous message receives from the servers. Your event loop should look like this:

for (;;) {
     // Get next event
     bps_event_t *event;
     bps_get_event(&event, -1);

     if (bps_event_get_domain(event) == SC_GetBPSEventDomain(&initData)) {
         SC_HandleBPSEvent(&initData, event);
     }
     ...
}

Returns:

BPS_SUCCESS if it was a Scoreloop event, BPS_FAILURE otherwise

Last modified: 2013-12-23

comments powered by Disqus