From: <sv...@ww...> - 2004-12-18 11:38:07
|
Author: mkrose Date: 2004-12-18 03:38:01 -0800 (Sat, 18 Dec 2004) New Revision: 1409 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/CSPSim.cpp Log: Simplify the network parameters in the ini file. If unset, LocalIp should default to the correct value. ExternalIp is no longer needed or used. LocalPort now defaults to 3161, and ServerPort defaults to 3160. You still need to specify ServerIp to connect to remote index servers. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1409 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-18 11:32:30 UTC (rev 1408) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-18 11:38:01 UTC (rev 1409) @@ -5,6 +5,12 @@ * Add hooks in GameScreen to catch player join/quit events and display a message on the screen. + * Simplify the network parameters in the ini file. If unset, LocalIp + should default to the correct value. ExternalIp is no longer needed + or used. LocalPort now defaults to 3161, and ServerPort defaults to + 3160. You still need to specify ServerIp to connect to remote index + servers. + 2004-12-18: delta * Until we make a more accurate FCS, we'll use the animation binding to provide a better visual approximation of the animations of the "ailerons" Modified: trunk/CSP/CSPSim/Source/CSPSim.cpp =================================================================== --- trunk/CSP/CSPSim/Source/CSPSim.cpp 2004-12-18 11:32:30 UTC (rev 1408) +++ trunk/CSP/CSPSim/Source/CSPSim.cpp 2004-12-18 11:38:01 UTC (rev 1409) @@ -367,24 +367,18 @@ // create the networking layer if (g_Config.getBool("Networking", "UseNetworking", false, true)) { simnet::netlog().setLogPriority(simdata::LOG_INFO); - std::string local_address = g_Config.getString("Networking", "LocalIp", "127.0.0.1", true); - int local_port = g_Config.getInt("Networking", "LocalPort", 14111, true); - + std::string default_ip = simnet::NetworkNode().getIpString(); + std::string local_address = g_Config.getString("Networking", "LocalIp", default_ip, true); + int local_port = g_Config.getInt("Networking", "LocalPort", 3161, true); + simnet::NetworkNode local_node(local_address, local_port); CSP_LOG(NETWORK, INFO, "Initializing network interface " << local_address << ":" << local_port); + int incoming_bw = g_Config.getInt("Networking", "IncomingBandwidth", 36000, true); int outgoing_bw = g_Config.getInt("Networking", "OutgoingBandwidth", 36000, true); - simnet::NetworkNode local_node(local_address, local_port); m_NetworkClient = new simnet::Client(local_node, incoming_bw, outgoing_bw); - if (g_Config.hasKey("Networking", "ExternalIp")) { - std::string external_address = g_Config.getString("Networking", "ExternalIp"); - simnet::NetworkNode external_node(external_address, local_port); - CSP_LOG(NETWORK, INFO, "External interface is " << external_address << ":" << local_port); - m_NetworkClient->setExternalNode(external_node); - } - - std::string server_address = g_Config.getString("Networking", "ServerIp", "127.0.0.1", true); - int server_port = g_Config.getInt("Networking", "ServerPort", 14110, true); + std::string server_address = g_Config.getString("Networking", "ServerIp", default_ip, true); + int server_port = g_Config.getInt("Networking", "ServerPort", 3160, true); CSP_LOG(NETWORK, INFO, "Connecting to server: " << server_address << ":" << server_port); simnet::NetworkNode server_node(server_address, server_port); if (!m_NetworkClient->connectToServer(server_node, 5.0 /*seconds*/)) { |