diff --git a/common/lib/src/extension/path.dart b/common/lib/src/extension/path.dart index 2f847c3..f5fc2fd 100644 --- a/common/lib/src/extension/path.dart +++ b/common/lib/src/extension/path.dart @@ -23,16 +23,31 @@ extension FortniteVersionExtension on FortniteVersion { return null; } - final lastModified = await result.lastModified(); + final lastModified = await _getLastModifiedTime(result); if(lastModified != _marker) { - print("Applying patch"); await Isolate.run(() => patchHeadless(result)); - await result.setLastModified(_marker); + await _setLastModifiedTime(result); } return result; } + Future _setLastModifiedTime(File result) async { + try { + await result.setLastModified(_marker); + }catch(_) { + // Ignored + } + } + + Future _getLastModifiedTime(File result) async { + try { + return await result.lastModified(); + }catch(_) { + return null; + } + } + File? get launcherExecutable => findExecutable(location, "FortniteLauncher.exe"); File? get eacExecutable => findExecutable(location, "FortniteClient-Win64-Shipping_EAC.exe"); diff --git a/documentation/en/PortForwarding,md b/documentation/en/PortForwarding,md new file mode 100644 index 0000000..8761dc2 --- /dev/null +++ b/documentation/en/PortForwarding,md @@ -0,0 +1,37 @@ +# How can I make my server accessible to other players? + +### 1. Set a static IP + +Set a static IP on the PC hosting the game server and copy it for later: + +- [Windows 11](https://pureinfotech.com/set-static-ip-address-windows-11/) +- [Windows 10](https://pureinfotech.com/set-static-ip-address-windows-10/) + + +### 2. Log into Your Router + +You'll need to access your router's web interface at 192.168.1.1. +You might need a username and a password to log in: refer to your router's manual for precise instructions. + +### 3. Find the Port Forwarding Section + +Once logged in, navigate to the port forwarding section of your router's settings. +This location may vary from router to router, but it's typically labelled as "Port Forwarding," "Port Mapping," or "Virtual Server." +Refer to your router's manual for precise instructions. + +### 4. Add a Port Forwarding Rule + +Now, you'll need to create a new port forwarding rule. Here's what you'll typically need to specify: + +- **Service Name:** Choose a name for your port forwarding rule (e.g., "Fortnite Game Server"). +- **Port Number:** Enter 7777 for both the external and internal ports. +- **Protocol:** Select the UDP protocol. +- **Internal IP Address:** Enter the static IP address you set earlier. +- **Enable:** Make sure the port forwarding rule is enabled. + +### 5. Save and Apply the Changes + +After configuring the port forwarding rule, save your changes and apply them. +This step may involve clicking a "Save" or "Apply" button on your router's web interface. + +### 6. Try hosting a game! \ No newline at end of file