preprocessordirectives.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <HTML>
  2. <HEAD>
  3. <TITLE>Preprocessor directives</TITLE>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></HEAD>
  5. <link href="RaknetManual.css" rel="stylesheet" type="text/css">
  6. <meta name="title" content="RakNet - Advanced multiplayer game networking API">
  7. </HEAD>
  8. <BODY BGCOLOR="#ffffff" LINK="#003399" vlink="#003399" alink="#003399" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"">
  9. <span style="background-color: rgb(255, 255, 255);"><img src="RakNet_Icon_Final-copy.jpg" alt="Oculus VR, Inc." width="150" height="150"></span><BR>
  10. <BR>
  11. <table width="100%" border="0"><tr><td bgcolor="#2c5d92" class="RakNetWhiteHeader">
  12. <img src="spacer.gif" width="8" height="1">Preprocessor directives</td>
  13. </tr></table>
  14. <TABLE BORDER="0" CELLPADDING="10" CELLSPACING="0" WIDTH="100%"><TR>
  15. <TD>
  16. <p>Define any of these values in RakNetDefinesOverrides.h to override. These are the defaults as set in RakNetDefines.h. Also see NativeFeatureIncludes.h to not compile in features you do not use.</p>
  17. <p class="RakNetCode">/// Define __GET_TIME_64BIT to have RakNet::TimeMS use a 64, rather than 32 bit value. A 32 bit value will overflow after about 5 weeks.<br>
  18. /// However, this doubles the bandwidth use for sending times, so don't do it unless you have a reason to.<br>
  19. /// Comment out if you are using the iPod Touch TG. See http://www.jenkinssoftware.com/forum/index.php?topic=2717.0<br>
  20. /// This must be the same on all systems, or they won't connect<br>
  21. #define __GET_TIME_64BIT 1</p>
  22. <p class="RakNetCode">// Define _FILE_AND_LINE_ to &quot;&quot;,0 if you want to strip out file and line info for memory tracking from the EXE<br>
  23. #define _FILE_AND_LINE_ __FILE__,__LINE__</p>
  24. <p class="RakNetCode">/// Define __BITSTREAM_NATIVE_END to NOT support endian swapping in the BitStream class. This is faster and is what you should use<br>
  25. /// unless you actually plan to have different endianness systems connect to each other<br>
  26. /// Enabled by default.<br>
  27. // #define __BITSTREAM_NATIVE_END</p>
  28. <p class="RakNetCode">/// Maximum (stack) size to use with _alloca before using new and delete instead.<br>
  29. #define MAX_ALLOCA_STACK_ALLOCATION 1048576</p>
  30. <p class="RakNetCode">// Use WaitForSingleObject instead of sleep.<br>
  31. // Defining it plays nicer with other systems, and uses less CPU, but gives worse RakNet performance<br>
  32. // Undefining it uses more CPU time, but is more responsive and faster.<br>
  33. #define USE_WAIT_FOR_MULTIPLE_EVENTS</p>
  34. <p class="RakNetCode">/// Uncomment to use RakMemoryOverride for custom memory tracking<br>
  35. /// See RakMemoryOverride.h. <br>
  36. #define _USE_RAK_MEMORY_OVERRIDE 0</p>
  37. <p class="RakNetCode">/// If defined, OpenSSL is enabled for the class TCPInterface<br>
  38. /// This is necessary to use the SendEmail class with Google POP servers<br>
  39. /// Note that OpenSSL carries its own license restrictions that you should be aware of. If you don't agree, don't enable this define<br>
  40. /// This also requires that you enable header search paths to DependentExtensions\openssl-0.9.8g<br>
  41. #define OPEN_SSL_CLIENT_SUPPORT 0</p>
  42. <p class="RakNetCode">/// Threshold at which to do a malloc / free rather than pushing data onto a fixed stack for the bitstream class<br>
  43. /// Arbitrary size, just picking something likely to be larger than most packets<br>
  44. #define BITSTREAM_STACK_ALLOCATION_SIZE 256</p>
  45. <p class="RakNetCode">// Redefine if you want to disable or change the target for debug RAKNET_DEBUG_PRINTF<br>
  46. #define RAKNET_DEBUG_PRINTF printf</p>
  47. <p class="RakNetCode">// Maximum number of local IP addresses supported<br>
  48. #define MAXIMUM_NUMBER_OF_INTERNAL_IDS 10</p>
  49. <p class="RakNetCode">/// This controls the amount of memory used per connection. If more than this many datagrams are sent without an ack, then the ack has no effect<br>
  50. #define DATAGRAM_MESSAGE_ID_ARRAY_LENGTH 512</p>
  51. <p class="RakNetCode">/// This is the maximum number of reliable user messages that can be on the wire at a time<br>
  52. #define RESEND_BUFFER_ARRAY_LENGTH 512<br>
  53. #define RESEND_BUFFER_ARRAY_MASK 511</p>
  54. <p class="RakNetCode">/// Uncomment if you want to link in the DLMalloc library to use with RakMemoryOverride<br>
  55. // #define _LINK_DL_MALLOC</p>
  56. <p class="RakNetCode">/// Workaround for http://support.microsoft.com/kb/274323<br>
  57. /// If two calls between RakNet::GetTime() happen farther apart than this time in microseconds, this delta will be returned instead<br>
  58. /// Note: This will cause ID_TIMESTAMP to be temporarily inaccurate if you set a breakpoint that pauses the UpdateNetworkLoop() thread in RakPeer<br>
  59. /// Define in RakNetDefinesOverrides.h to enable (non-zero) or disable (0)<br>
  60. #define GET_TIME_SPIKE_LIMIT 0</p>
  61. <p class="RakNetCode">// Use sliding window congestion control instead of ping based congestion control<br>
  62. #define USE_SLIDING_WINDOW_CONGESTION_CONTROL 1</p>
  63. <p><span class="RakNetCode">// When a large message is arriving, preallocate the memory for the entire block<br>
  64. // This results in large messages not taking up time to reassembly with memcpy, but is vulnerable to attackers causing the host to run out of memory<br>
  65. #define PREALLOCATE_LARGE_MESSAGES 0<br>
  66. </span> </p></TD></TR></TABLE>
  67. <table width="100%" border="0"><tr><td bgcolor="#2c5d92" class="RakNetWhiteHeader">
  68. <img src="spacer.gif" width="8" height="1">See Also</td>
  69. </tr></table>
  70. <TABLE BORDER="0" CELLPADDING="10" CELLSPACING="0" WIDTH="100%"><TR><TD>
  71. <A HREF="index.html">Index</A><BR>
  72. </TD></TR></TABLE>
  73. </BODY>
  74. </HTML>
粤ICP备19079148号