Archived

This topic is now archived and is closed to further replies.

has anybody used RakNet before? i need some help!

This topic is 5246 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just downloaded the evaluation version of RakNet (www.rakkarsoft.com) and I''m trying to integrate it into my game. My question is - how do i get the server to send a message to itself? I''m using the RakServerInterface::Send() function - but i don''t know what PlayerId to use to send to the server. Is it even possible for the server to send a message to itself? Thanks in advance! I am Ciph, and that is what I am

Share this post


Link to post
Share on other sites
oh yeah - one more question:

what does
#pragma pack(1) do?

or even what does
#pragma do?

the only pragma i use (but don''t understand) is
to include library files

#pragma comment(lib,"d3dx8.h")

Share this post


Link to post
Share on other sites
I don''t know about RakNet, but #pragma pack(n) will align variables on n byte boundaries. If you want to align stuff on 32-bit boundaries, use #pragma pack(4).

Look up #pragma on MSDN.

Share this post


Link to post
Share on other sites
::what does
::#pragma pack(1) do?
::
::or even what does
::#pragma do?

Now, did it ever occur to you that you could just look into the documentation? You DO know how to use the documentation, or?

Nothing against coming here when you dont understand what the documentation says, but not reading the documentation shows a very poor atttitude.

Share this post


Link to post
Share on other sites
quote:
Original post by Cipher3D
:-( i don''t have any documentation, i can''t afford a subscription.


A subscription to what?? Doesn''t MSVC come with docs?? Even if it doesn''t, MSDN is free...

Back to the original question now. Why do you want the server to send a message to itself? That doesn''t sound terribly useful unless you want it to handle an event created locally in the same way as if it was created remotely and sent over the network...

In the latter case, I recommend creating an event-queue type of thing to which you can add events received as packets, or events created locally, and handle them in your game loop somewhere.

P.S. #pragmas are generally compiler-specific commands that are contained in the code. With MSVC, #pragma comment(lib,"foobar.lib") includes a library. Including librarys that war is generally not considered a good idea.

Share this post


Link to post
Share on other sites
MSDN IS FREE?!!?!??!?!?@ OMG I HAVE BEEN MISSING OUT ON SO MUCH! LOL.

anyway...i need somethingl ike...

m_pServerInterface->Send(...) where it sends it back to itself..because I want the server to act as a client (i want the server to be a player too...not just a dedicated server that doesn''t actively participate in the game)...just for design purposes..i want to abstract my game engine so that everybody (clietns and server) run through the client side code...and only the server runs through the server side code....kinda hard to explain...?

Share this post


Link to post
Share on other sites