From: fgsfds Date: Mon, 5 Feb 2018 17:19:29 +0000 (+0300) Subject: added ForwardPorts config option X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=43eeba3379f1ef7e7f64724eafcbaeb33d70962b;p=d2df-sdl.git added ForwardPorts config option --- diff --git a/src/game/g_net.pas b/src/game/g_net.pas index 4e2ed9a..6d6be99 100644 --- a/src/game/g_net.pas +++ b/src/game/g_net.pas @@ -1136,7 +1136,7 @@ begin NetPongForwarded := False; NetPortForwarded := 0; - DevList := upnpDiscover(2000, nil, nil, 0, 0, Addr(Err)); + DevList := upnpDiscover(1000, nil, nil, 0, 0, Addr(Err)); if DevList = nil then begin conwritefln(' upnpDiscover() failed: %d', [Err]); diff --git a/src/game/g_options.pas b/src/game/g_options.pas index 90effe0..c43da69 100644 --- a/src/game/g_options.pas +++ b/src/game/g_options.pas @@ -252,6 +252,7 @@ begin end; NetUseMaster := True; + NetForwardPorts := False; g_Net_Slist_Set('mpms.doom2d.org', 25665); end; @@ -510,6 +511,7 @@ begin NetUpdateRate := Max(0, config.ReadInt('Server', 'UpdateInterval', 0)); NetRelupdRate := Max(0, config.ReadInt('Server', 'ReliableUpdateInterval', 18)); NetMasterRate := Max(1, config.ReadInt('Server', 'MasterSyncInterval', 60000)); + NetForwardPorts := config.ReadBool('Server', 'ForwardPorts', False); // Êëèåíò NetInterpLevel := Max(0, config.ReadInt('Client', 'InterpolationSteps', 2)); @@ -711,6 +713,7 @@ begin config.WriteBool('Server', 'RCON', NetAllowRCON); config.WriteStr ('Server', 'RCONPassword', NetRCONPassword); config.WriteBool('Server', 'SyncWithMaster', NetUseMaster); + config.WriteBool('Server', 'ForwardPorts', NetForwardPorts); config.WriteInt ('Server', 'UpdateInterval', NetUpdateRate); config.WriteInt ('Server', 'ReliableUpdateInterval', NetRelupdRate); config.WriteInt ('Server', 'MasterSyncInterval', NetMasterRate); @@ -829,6 +832,7 @@ begin config.WriteInt ('Server', 'Port', NetPort); config.WriteInt ('Server', 'MaxClients', NetMaxClients); config.WriteBool('Server', 'SyncWithMaster', NetUseMaster); + config.WriteBool('Server', 'ForwardPorts', NetForwardPorts); config.SaveFile(FileName); config.Free();