Beispiel #1
0
void jsapi_init(int filter){
  if(filter){
	ENetCallbacks callbacks = { NULL, NULL, NULL, packet_filter };
        enet_initialize_with_callbacks(ENET_VERSION, &callbacks);
 	return;
  }
  enet_initialize();
}
Beispiel #2
0
void NetClient::LibraryLoad()
{
	ENetCallbacks enc;
	enc.free = tinker_enet_free;
	enc.malloc = tinker_enet_malloc;
	enc.no_memory = tinker_enet_no_memory;

	enet_initialize_with_callbacks(ENET_VERSION, &enc);
}
Beispiel #3
0
bool NetworkInitialize()
{
    gs_NetworkAllocator = AllocatorCreateHeap(AllocatorGetHeap());
    AllocatorSetGroup(gs_NetworkAllocator, "Network");

    ENetCallbacks callbacks;
    callbacks.malloc = enet_custom_malloc;
    callbacks.free = enet_custom_free;

    int ret = enet_initialize_with_callbacks(ENET_VERSION, &callbacks);

    if(ret != 0)
    {
        LogError("Error initializing ENet");
        return false;
    }

    LogInfo("Initialized ENet %d.%d.%d networking layer",
            ENET_VERSION_MAJOR, ENET_VERSION_MINOR, ENET_VERSION_PATCH);

    return true;
}
Beispiel #4
0
 void initialise() {
     ENetCallbacks callbacks = {henet_malloc, henet_free, henet_nomem};
     enet_initialize_with_callbacks(ENET_VERSION, &callbacks);
 }