has anybody used RakNet before? i need some help!

Started by
5 comments, last by Cipher3D 20 years, 8 months ago
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
I eat heart attacks
Advertisement
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")
I eat heart attacks
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.
Member of the Unban nes8bit or the White Rhino in my Basement Gets Sold to the Highest Bidder Association (UNWRBGSHBA - Not accepting new members.)Member of the I'm Glad Mithrandir Finally Found an Association that Accepts People with his Past History Association (IGMFFAAPPHA)
::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.
RegardsThomas TomiczekTHONA Consulting Ltd.(Microsoft MVP C#/.NET)
:-( i don''t have any documentation, i can''t afford a subscription.
I eat heart attacks
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.
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...?

I eat heart attacks

This topic is closed to new replies.

Advertisement