# Raknet Problem [solved]

## Recommended Posts

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]

##### Share on other sites
Different Function calling conventions?

##### Share on other sites
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);        ..................................        ............................

##### Share on other sites
Since it's a member function have you tried making it static?

##### Share on other sites
it works now. thanks!

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627719
• Total Posts
2978790

• 9
• 21
• 14
• 12
• 42