Panda3D
|
00001 // Filename: config_distributed.cxx 00002 // Created by: drose (19May04) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "config_distributed.h" 00016 #include "dconfig.h" 00017 00018 Configure(config_distributed); 00019 NotifyCategoryDef(distributed, ""); 00020 00021 ConfigureFn(config_distributed) { 00022 init_libdistributed(); 00023 } 00024 00025 ConfigVariableInt game_server_timeout_ms 00026 ("game-server-timeout-ms", 20000, 00027 PRC_DESC("This represents the amount of time to block waiting for the TCP " 00028 "connection to the game server. It is only used when the connection " 00029 "method is NSPR.")); 00030 00031 ConfigVariableDouble min_lag 00032 ("min-lag", 0.0, 00033 PRC_DESC("This represents the time in seconds by which to artificially lag " 00034 "inbound messages. It is useful to test a game's tolerance of " 00035 "network latency.")); 00036 00037 ConfigVariableDouble max_lag 00038 ("max-lag", 0.0, 00039 PRC_DESC("This represents the time in seconds by which to artificially lag " 00040 "inbound messages. It is useful to test a game's tolerance of " 00041 "network latency.")); 00042 00043 ConfigVariableBool handle_datagrams_internally 00044 ("handle-datagrams-internally", true, 00045 PRC_DESC("When this is true, certain datagram types can be handled " 00046 "directly by the C++ cConnectionRepository implementation, " 00047 "for performance reasons. When it is false, all datagrams " 00048 "are handled by the Python implementation.")); 00049 00050 //////////////////////////////////////////////////////////////////// 00051 // Function: init_libdistributed 00052 // Description: Initializes the library. This must be called at 00053 // least once before any of the functions or classes in 00054 // this library can be used. Normally it will be 00055 // called by the static initializers and need not be 00056 // called explicitly, but special cases exist. 00057 //////////////////////////////////////////////////////////////////// 00058 void 00059 init_libdistributed() { 00060 static bool initialized = false; 00061 if (initialized) { 00062 return; 00063 } 00064 initialized = true; 00065 00066 } 00067