summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d2a6680)
raw | patch | inline | side by side (parent: d2a6680)
author | Stas'M <x86corez@gmail.com> | |
Sat, 14 Mar 2020 19:14:27 +0000 (22:14 +0300) | ||
committer | Stas'M <x86corez@gmail.com> | |
Sat, 14 Mar 2020 19:18:34 +0000 (22:18 +0300) |
Also fix the same problem for UPnP port forwarding.
src/game/g_net.pas | patch | blob | history |
diff --git a/src/game/g_net.pas b/src/game/g_net.pas
index fbc85eec75c06e797d0a006a452f9c33f9e16cbe..07d9713477ed7da1251d54bfffac53b3cfd5d9b7 100644 (file)
--- a/src/game/g_net.pas
+++ b/src/game/g_net.pas
NetOut.Clear();
NetOut.Write(Byte(Ord('D')));
NetOut.Write(Byte(Ord('F')));
- NetOut.Write(NetPort);
+ NetOut.Write(NetHost.address.port);
NetOut.Write(ClTime);
TMasterHost.writeInfo(NetOut);
NPl := 0;
begin
Result := False;
- if NetPortForwarded = NetPort then
+ if NetPortForwarded = NetHost.address.port then
begin
Result := True;
exit;
exit;
end;
- StrPort := IntToStr(NetPort);
+ StrPort := IntToStr(NetHost.address.port);
I := UPNP_AddPortMapping(
Urls.controlURL, Addr(data.first.servicetype[1]),
PChar(StrPort), PChar(StrPort), Addr(LanAddr[0]), PChar('D2DF'),
if I <> 0 then
begin
- conwritefln('forwarding port %d failed: error %d', [NetPort, I]);
+ conwritefln('forwarding port %d failed: error %d', [NetHost.address.port, I]);
FreeUPNPDevList(DevList);
FreeUPNPUrls(@Urls);
exit;
end;
end;
- conwritefln('forwarded port %d successfully', [NetPort]);
+ conwritefln('forwarded port %d successfully', [NetHost.address.port]);
NetIGDControl := AnsiString(Urls.controlURL);
NetIGDService := data.first.servicetype;
- NetPortForwarded := NetPort;
+ NetPortForwarded := NetHost.address.port;
FreeUPNPDevList(DevList);
FreeUPNPUrls(@Urls);