Author Topic: New the RakNet. A simple program getting an error  (Read 2446 times)

Chad

  • Guest
New the RakNet. A simple program getting an error
« on: September 27, 2006, 09:56:58 PM »
Hey, first of all I am new to RakNet like I said in the title.  I am going though the hello world tutorial, and I am on the code part 3.  Well, I am having trouble with this define:

REGISTER_STATIC_RPC

This is how I use it, and where I use it

Code: [Select]
if(rakServerInterface)
{
//run on the server at port 60000
rakServerInterface->Start(32, 0, 0, 60000);
REGISTER_STATIC_RPC(rakServerInterface, PrintMessage);
}

Well...this is the error I get when I use this:

Code: [Select]
c:\documents and settings\chad\my documents\visual studio 2005\projects\chat server\chat server\chatserver.cpp(41) : error C2664: 'RakServerInterface::RegisterAsRemoteProcedureCall' : cannot convert parameter 2 from 'void (__cdecl *)(char *,int,PlayerID)' to 'void (__cdecl *)(RPCParameters *)'

This is my PrintMessage prototype:

Code: [Select]
void PrintMessage(char *input, int numberOfBitsOfData, PlayerID sender);


I am sorry if this is a noob question but this is bothering me.  I have even copied and pasted there new code to my code, and still no luck.  Any suggestions?

Thanks to all who help

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: New the RakNet. A simple program getting an error
« Reply #1 on: September 27, 2006, 10:00:47 PM »
What tutorial are you looking at?  In tutorialsample3.html under /Help in the download it is
void PrintMessage(RPCParameters *rpcParams)
{
   printf("Hello World\n");
}

Chad

  • Guest
Re: New the RakNet. A simple program getting an error
« Reply #2 on: September 28, 2006, 08:18:21 PM »
Ahhh, that makes since.  I was going through the one online here at the site.


http://www.rakkarsoft.com/raknet/manual/tutorial.html

This one.

That makes totally 100% since.  I guess I will go through the one on the download now.  Hehe.  I feel really stupid now.

Thanks a lot!

Chad

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: New the RakNet. A simple program getting an error
« Reply #3 on: September 29, 2006, 12:02:07 AM »
OK sorry about that.  I'll update the online ones.