Skip to content

Commit

Permalink
Merge pull request #6412 from Goober5000/connection_speed
Browse files Browse the repository at this point in the history
handle connection speed in a user-friendly way
  • Loading branch information
Goober5000 authored Nov 4, 2024
2 parents 1493774 + 37a24b2 commit 6cbde28
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 22 deletions.
9 changes: 2 additions & 7 deletions code/network/multi_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,8 @@ void multi_options_set_local_defaults(multi_local_options *options)
// accept pix by default and broadcast on the local subnet
options->flags = (MLO_FLAG_ACCEPT_PIX | MLO_FLAG_LOCAL_BROADCAST);

// set the object update level based on the type of network connection specified by the user
// at install (or launcher) time.
if ( Psnet_connection == NETWORK_CONNECTION_DIALUP ) {
options->obj_update_level = OBJ_UPDATE_LOW;
} else {
options->obj_update_level = Default_multi_object_update_level;
}
// set the object update level based on the type of network connection specified by the mod
options->obj_update_level = Default_multi_object_update_level;
}

// fill in the passed netgame options struct with the data from my player file data (only host/server should do this)
Expand Down
4 changes: 0 additions & 4 deletions code/network/multiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2936,11 +2936,7 @@ int multi_get_connection_speed()
int cspeed;
const char *connection_speed;

#ifdef _WIN32
connection_speed = os_config_read_string(nullptr, "ConnectionSpeed", "");
#else
connection_speed = os_config_read_string(nullptr, "ConnectionSpeed", "Fast");
#endif

if ( !stricmp(connection_speed, NOX("Slow")) ) {
cspeed = CONNECTION_SPEED_288;
Expand Down
8 changes: 0 additions & 8 deletions code/network/psnet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ static bool Psnet_active = false;

static int Network_status;
int Psnet_failure_code = 0;
int Psnet_connection;

uint16_t Psnet_default_port;

Expand Down Expand Up @@ -423,8 +422,6 @@ void psnet_init(uint16_t port_num)
return;
}

Psnet_connection = NETWORK_CONNECTION_LAN;

Network_status = NETWORK_STATUS_NO_PROTOCOL;

#ifdef _WIN32
Expand Down Expand Up @@ -660,11 +657,6 @@ bool psnet_init_my_addr()
*/
int psnet_get_network_status()
{
// first case is when "none" is selected
if (Psnet_connection == NETWORK_CONNECTION_NONE) {
return NETWORK_ERROR_NO_TYPE;
}

// first, check the connection status of the network
if (Network_status == NETWORK_STATUS_NO_WINSOCK) {
return NETWORK_ERROR_NO_WINSOCK;
Expand Down
4 changes: 1 addition & 3 deletions code/network/psnet2.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ typedef uint PSNET_SOCKET_RELIABLE;

// define values for network errors when trying to enter the ready room
#define NETWORK_ERROR_NONE 0
#define NETWORK_ERROR_NO_TYPE -1
#define NETWORK_ERROR_NO_TYPE -1 // this is no longer used because we no longer require the user to set the connection type via the launcher
#define NETWORK_ERROR_NO_WINSOCK -2
#define NETWORK_ERROR_NO_PROTOCOL -3
#define NETWORK_ERROR_RELIABLE -4
Expand All @@ -88,8 +88,6 @@ extern int Psnet_failure_code;
#define NETWORK_CONNECTION_DIALUP 2
#define NETWORK_CONNECTION_LAN 3

extern int Psnet_connection;

extern ushort Psnet_default_port;

// Reliable socket states
Expand Down

0 comments on commit 6cbde28

Please sign in to comment.