Raknet Problem [solved]

Started by
3 comments, last by Kavana 19 years, 2 months ago
I'm having a problem whenever I put an RPC function in a class, whenever I compile I get the following errors, Anyone know what's the problem, I would like to post in the rakkarsoft forums, but they are down unfortunately. e:\FYP Assignment\NetworkInterface.cpp(52): error C2664: 'RakClientInterface::RegisterAsRemoteProcedureCall' : cannot convert parameter 2 from 'void (char *,int,PlayerID)' to 'void (__cdecl *)(char *,int,PlayerID)' [Edited by - Kavana on February 9, 2005 10:21:12 AM]
Advertisement
Different Function calling conventions?
I'm rather new to raknet so I'm not really sure whether I'm doing right, doing this for a school project.

Anyway I have a class called NetworkInterface, there is one RPC function called registerPlayer. I have another function to register the RPC as well as do other stuff, I followed the same parameters, but I can't seem to get it running, is there any other way to make it function in a class, because I want to hook it up to my game component without mixing them all up. thanks.

registerPlayer
void NetworkInterface::registerPlayer(char *input, int numberOfBitsOfData, PlayerID sender)


and the clientRun function
//!	Function for client to run (simplified to make easy connectivity)void NetworkInterface::clientRun(){		//	Initialise the client	rakClient=RakNetworkFactory::GetRakClientInterface();	Multiplayer<RakClientInterface> rakClientMultiplayer;		//	Register RPC function	REGISTER_AS_REMOTE_PROCEDURE_CALL(rakClient, registerPlayer);        ..................................        ............................



Since it's a member function have you tried making it static?
it works now. thanks!

This topic is closed to new replies.

Advertisement