RakNet Wrapper 0.5 Released

Blitz3D Forums/Blitz3D Userlibs/RakNet Wrapper 0.5 Released

Well, wrapping Raknet is an easy job, but you need to make some little tricks, as i commented before, for example to use the UNASSIGNED_PLAYER_ID struct as C.

Two samples of the wrapper:

/******************************************/
/* INITIALIZE THE RAKNET SERVER INTERFACE */
/******************************************/
RN_API RakServerInterface* _stdcall RN_GetRakServerInterface()
{
	RakServerInterface *rakServerInterface;
	rakServerInterface=RakNetworkFactory::GetRakServerInterface();

	return rakServerInterface;
}

/* INITIALIZE THE RAKNET CLIENT INTERFACE */
RN_API RakClientInterface* _stdcall RN_GetRakClientInterface()
{
	RakClientInterface *rakClientInterface;
	rakClientInterface=RakNetworkFactory::GetRakClientInterface();

	return rakClientInterface;
}

/******************/
/* SERVER FUNCTIONS */
/******************/
RN_API bool _stdcall RN_ServerStart(RakServerInterface *rakServerInterface,int maxplayers,int connectionvalidationinteger,int highprioritythreads,int port)
{
	if (rakServerInterface)
		return rakServerInterface->Start(maxplayers, connectionvalidationinteger, highprioritythreads, port);
	else
		return 0;
}


and of course don't forget to include all the header files and the raknetstaticlib!