That code as it stands is guaranteed to crash, through no fault of RakNet - the pointer 'p' hasn't been populated. You need to either populate the pointer 'p' with an instance of a RakPeer object, or replace it with an actual RakPeer object.
So, either populate the pointer:
RakPeer* p;
MYCOMMAND void Initialise()
{
p = new RakPeer; // May need some parameters
}
MYCOMMAND void rakpeerstartup( int x, int y, int s1, int z)
{
p->Startup(x, y, &SocketDescriptor(s1, NULL), z);
}
MYCOMMAND void maximuminputconnections(int no)
{
p->SetMaximumIncomingConnections ( no );
}
or use an object:
RakPeer p; // May need some parameters
MYCOMMAND void rakpeerstartup( int x, int y, int s1, int z)
{
p.Startup(x, y, &SocketDescriptor(s1, NULL), z);
}
MYCOMMAND void maximuminputconnections(int no)
{
p.SetMaximumIncomingConnections ( no );
}
That's untested of course - just examples to give you the right idea.