Skip to content

AlirezaBME/LanPartyToolKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

LAN Party Toolkit v4.0

Plug‑and‑play wireless LAN party setup for classic C&C Generals Zero Hour and Counter‑Strike v34.

No internet needed.
Start a Wi‑Fi hotspot, configure the network, find the host, sync game data, and jump into the game – all from one simple window.


⚠️ Important Notes

  • Only the Router / phone hotspot network mode is currently reliable.
    The “Laptop hotspot (legacy netsh)” and “Windows Mobile Hotspot” modes may fail due to driver or Windows restrictions.
    We strongly recommend you host your LAN using a dedicated router or a phone’s Wi‑Fi hotspot and select the third option in the toolkit.

  • For C&C Generals Zero Hour, GameData.ini must be manually prepared.
    The toolkit cannot automatically share or synchronise GameData.ini because it depends on a special modded file. You need to:

    1. Download a working GameData.ini from the internet (find a LAN‑compatible version).
    2. Place it in your Zero Hour installation folder under Data\INI (e.g. C:\Program Files (x86)\EA Games\Command and Conquer Generals Zero Hour\Data\INI\GameData.ini).
    3. Manually copy this file to the same location on every player’s PC.
      The toolkit will not do this for you – you must handle it once before the LAN party.
    4. The Options.ini file (which contains each player’s IP settings) is created automatically by the toolkit in Documents\Command and Conquer Generals Zero Hour Data – you do not need to share that file; it stays local to each machine.

Features

  • Graphical User Interface – No PowerShell commands required; everything is point‑and‑click.
  • Offline‑ready – Works without any internet connection. All modules run locally.
  • Two classic games – Optimised for:
    • Command & Conquer: Generals – Zero Hour (LAN multiplayer, Options.ini update, manual GameData.ini sync)
    • Counter‑Strike v34 / Source build (autoexec.cfg, connect.cfg, desktop launchers)
  • Host or Client – Choose your role and the toolkit handles the rest.
  • Automatic network setup – Identifies the correct Wi‑Fi adapter, assigns IP settings (static where needed), sets the network profile to Private, and opens all required firewall ports (inbound and outbound, plus network discovery and file sharing).
  • Smart hotspot detection – Supports three Wi‑Fi styles, though only the router / phone hotspot mode is fully stable.
  • Host discovery – Automatically scan the subnet to find the game host, or pick from a list.
  • Full cleanup – Restores original IP settings, removes firewall rules, stops hotspot, and deletes the temporary share.
  • Session persistence – Your last used settings are saved for the next LAN party.
  • Automatic admin elevation – The script checks for administrator rights and re‑launches itself elevated if necessary.

Requirements

  • Windows 10 or Windows 11 (64‑bit recommended) with PowerShell 5.1 or higher.
  • Administrator rights – the script will request elevation automatically.
  • A Wi‑Fi adapter that supports the router / phone hotspot mode (other modes are unreliable).
  • Both host and clients must be on the same local network.
  • The games must be installed on the same PC (the toolkit will find them automatically or you can browse).

Installation

  1. Download the latest release package (LANPartyToolkit.zip).
  2. Extract all files to a folder of your choice (e.g. D:\LANParty).
    ⚠️ Do not run the script from a temporary or network location – always from a local folder.
  3. Right‑click Main.ps1 and select Run with PowerShell.

If you get security warnings, you may need to unblock the files first:

Unblock-File -Path .\Main.ps1

or set the execution policy temporarily:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Pre‑LAN Checklist (Zero Hour)

Before running the toolkit for Zero Hour:

  1. Get the modded GameData.ini – search for a “Zero Hour LAN GameData.ini” or use one from a trusted source.
  2. Place it in each player’s Command and Conquer Generals Zero Hour\Data\INI folder (create the INI subfolder if missing).
  3. Make sure every PC has the same file – the toolkit will not automate this step.

Once that is done, the toolkit will handle updating each PC’s Options.ini with the correct IP address.


How to Use (Step‑by‑Step)

1. Launch the toolkit

Run Main.ps1 as Administrator (or just double‑click – it will elevate itself). The GUI will open. image

2. Choose your role

In the left panel, set:

  • This PC is the: Host or Client
  • Network style: Always select “Router / phone hotspot” (the other two modes are unstable).

The toolkit will use your existing Wi‑Fi connection (the SSID you are already connected to).

3. Party details

  • Wi‑Fi name (SSID): The toolkit usually detects this automatically. Verify it matches your router or phone hotspot name.
  • Players including host: Total number of players (2‑5).
  • Client slot – ignored for this mode; leave as default.

4. Set game paths

In the right panel, under Game setup:

  • Click Auto Find to let the toolkit search for installed games on all drives.
  • Or Browse to pick the folder manually.

The toolkit validates that the folder contains the expected launcher files (e.g. run_css.exe, generals.exe).

5. Check your PC

Click Check This PC to run a pre‑flight check. The banner will show:

  • Ready to continue – all good.
  • ⚠️ Usable with warnings – minor issues (e.g. no game path set yet).
  • 🚫 Blocked – critical problems that must be fixed first (adapter missing, etc.).

The Network summary and Diagnostics panels will fill with live information about your adapter, IP, gateway, and any reachable devices.

6. Fix the network automatically

Click Fix Network Automatically. This will:

  • Ensure you are connected to the correct Wi‑Fi network.
  • Identify the correct network adapter.
  • Back up the current network configuration.
  • Set the network profile to Private (enables file sharing).
  • Open inbound and outbound firewall rules for CS:GO, Zero Hour, and SMB, as well as enable Network Discovery and File and Printer Sharing rules.
  • Remember the host IP for the current SSID.

Now your network is ready. The Host IP box will be filled in, and the diagnostics will show other PCs.

7. Find the host (client only)

If you are a client and the host IP wasn’t auto‑detected, click Find Host Automatically.
The toolkit scans the subnet and lists all live hosts. Pick the correct one, and it will be saved for future sessions on the same SSID.

8. Prepare the games

  • Prepare Zero Hour

    • Ensure the manual GameData.ini copy has been done (see Pre‑LAN Checklist above).
    • The toolkit updates your local Options.ini with your IP address.
    • It also clears _tmpChunk.dat and MapCache to avoid glitches.
    • No automatic sharing – remember, you already copied the GameData.ini manually to all PCs.
  • Prepare Counter‑Strike

    • Creates an autoexec.cfg that forces LAN mode and sets hostport 27015.
    • Creates a connect.cfg with connect <host IP>.
    • Places two .bat files on your desktop: CSGO_LAN_Join.bat and CSGO_LAN_Host.bat.

9. Launch and play!

Use the desktop batch files to start the games, or start them normally – your network settings are already in place.


Network Modes Explained

Mode Status Notes
Router / phone hotspot Stable Join an existing Wi‑Fi network created by your router or phone. All PCs connect to the same SSID. DHCP is used for IP assignment.
Laptop hotspot (legacy netsh) ❌ Unreliable May fail on modern drivers or Windows updates. Use only as a fallback if you know your hardware supports it.
Windows Mobile Hotspot ❌ Unreliable Often fails due to Windows security restrictions. The toolkit may prompt you to manually enable the hotspot, but connectivity issues are common.

Recommendation: Always set up a hotspot on your phone or use a dedicated Wi‑Fi router and select “Router / phone hotspot” in the toolkit.


How It Works (Under the Hood)

The toolkit is built from separate PowerShell modules, each handling one aspect of the LAN party:

Module Purpose
Main.ps1 Orchestrator, loads modules, starts GUI, handles cleanup on exit.
Ui.ps1 The entire GUI, including all controls, diagnostics grid, and safe threading.
AdminCheck.ps1 Ensures the script runs with administrator privileges (auto‑elevation).
StateStore.ps1 Saves/restores session state in %ProgramData%\LANPartyToolkit, backs up adapter settings.
AdapterDiscovery.ps1 Finds Wi‑Fi adapters, gets IP info, pings, probes, and hosts discovery.
Preflight.ps1 Pre‑flight checks for wireless driver support, adapter availability, and potential conflicts.
Hotspot.ps1 Starts/connects the legacy hosted network and manual hotspot helpers.
IPConfig.ps1 Assigns static IP addresses safely, removes conflicting addresses.
NetworkProfile.ps1 Sets the network to Private for LAN sharing.
FirewallRules.ps1 Adds inbound and outbound allow rules for game ports, and enables Network Discovery / File and Printer Sharing.
NetworkScanner.ps1 Console‑based network scan (used by older modules, superseded by GUI diagnostics).
GameDiscovery.ps1 Searches all fixed drives for Steam, Epic, EA, GOG, and manual installations of both games.
CSGO.ps1 Modifies CS:GO configs, creates desktop launchers.
CnCZH.ps1 Updates Options.ini, but does not automatically share GameData.ini (see manual setup).
Cleanup.ps1 Reverses all changes: stops hotspot, removes firewall rules, reverts IP settings, deletes temporary share.

All state and logs are stored in %ProgramData%\LANPartyToolkit\. Transcript logs of each session are saved automatically for troubleshooting.


Troubleshooting

The “Detect SSID” button doesn’t find any networks

  • Make sure your Wi‑Fi adapter is enabled and not in airplane mode.
  • On Windows 11, a background scan may be required – click the Wi‑Fi icon in the taskbar once, then try again.

“Fix Network Automatically” fails with a hosted network error

  • You likely selected an unstable mode. Switch to Router / phone hotspot mode and try again.

The client cannot find the host

  • Verify both PCs are connected to the same SSID.
  • On the host, make sure the network is set to Private. The toolkit does this automatically.
  • Try pinging the host IP manually from the client (ping 192.168.1.x).

Zero Hour doesn’t connect / can’t see LAN games

  • Double‑check that the same GameData.ini is in Data\INI on every PC (see Pre‑LAN Checklist).
  • Ensure both PCs are on the same subnet and can ping each other.
  • Check that Windows Firewall or third‑party firewall is not blocking the game (ports 8088 TCP, 16000 UDP, 1234 UDP).

The game still uses old settings / doesn’t connect (CS:GO)

  • Launch the game via the .bat file, or use -console +exec autoexec.cfg +exec connect.cfg.
  • Make sure the host has started a listen server (map <mapname> in console) before clients connect.

Cleanup

When you close the toolkit, a popup will ask if you want to restore your original network settings.
You can also press Force Cleanup at any time to roll back all changes (IP settings, firewall rules, temporary share, and hotspot).


License

This toolkit is provided as‑is, without any warranty. Use it at your own risk.
Feel free to share it with your LAN party friends.


Happy LAN gaming! 🎮

About

LAN Party Toolkit v4.0 - Automated wireless LAN setup for C&C Generals Zero Hour and Counter-Strike gaming on Windows

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors