Skip to content

Latest commit

 

History

History
123 lines (114 loc) · 8.18 KB

README.md

File metadata and controls

123 lines (114 loc) · 8.18 KB

FlashPrivateServer

On April 29, 2022, Ninja Kiwi shut down their multiplayer servers for the following games:

SAS4 Flash
Countersnipe Flash
SAS3 Flash
BTD5 Flash
as well as BTD Battles Flash, despite it not being mentioned in the original blog post.

This project fully recreates these servers, built from scratch with Java TCP sockets.
Currently I am hosting all of these - BTD Battles, BTD5 challenges, BTD5 co-op, SAS3, Countersnipe, and SAS4. The guide to play on these servers is also available as a video:
https://www.youtube.com/watch?v=J3q-Vb5A4jI
When playing on these servers, some quality of life/easter egg features are added, but mostly they will play exactly as you would expect the game to play on Ninja Kiwi's servers, and any data or achievements from these games will register in your actual NK profile.

HOW TO PLAY

1. Ensure you have Ninja Kiwi Archive installed(from ninja kiwi website or Steam)
2. Download FlashClient.ps1 from this page(click)
3. Open the folder you downloaded it to, close all NK Archive windows(INCLUDING THE LAUNCHER), then run the script.
There are different methods of running the PowerShell script. The methods are as follows:

First Method

  1. open PowerShell (or PowerShell ISE)
  2. Enable PowerShell execution Set-ExecutionPolicy Unrestricted -Force
  3. On the prompt, change to the directory where you downloaded the files: cd c:\Users\NAME_HERE\Downloads
  4. Next, to run the script, enter in the following: .\FlashClient.ps1

Second Method(does not work on Windows 11)

  1. Right-click the PowerShell file that you'd like to run and click on "Run With PowerShell"
  2. This will allow the script to run without having to do the above steps but Powershell will ask if you're sure you want to run this script.

Third Method

  1. Instead of the powershell file, download 'FlashClient.bat'(windows) or 'FlashClient.sh'(Mac) and run it. You might receive a warning since the application isn't signed.


That's it! Next time you start BTD Battles, BTD5, SAS3, Countersnipe, or SAS4 on the archive they will be modded to link to the private server, allowing you to play online with other players.
Enjoy!!

Since the games are fairly inactive, you can play "solo" multiplayer with the following methods:
join code 400 in SAS4 to play a boosted game with bots(works in any mode)
bots for battles flash(will require some code changes to work)

If you would like to run multiple instances of the same game, opening multiple archive launchers will not work with these mods.
However, you can run them from the same launcher using the following mod:
NKMultiArchive

Manual install(if powershell doesn't work/isn't available on your system)

All the script does is copy some files, so you can do it manually if you want.
Windows:
0. Close all Ninja Kiwi Archive windows
1. Navigate to %appdata%/Ninja Kiwi Archive/Cache
2. Delete everything that was there previously.
3. Download cache_windows.zip from the releases page and extract it there.
Max OS X:
0. Close all Ninja Kiwi Archive windows
1. Naviagte to ~/Library/Application Support/Ninja Kiwi Archive/Cache
2. Delete everything that was there previously.
3. Download cache_osx.zip from the releases page and extract it there.
Linux(proton):
0. Close all Ninja Kiwi Archive windows
1. Search for folders named "Ninja Kiwi Archive" and find the one that contains "Cache"
2. Delete everything that was there previously.
3. Download cache_windows.zip from the releases page and extract it there.
Stuck installing flash player?

If the links provided to you during archive installation don't work for you(make sure to read 'How to Play' first!) try one of the following methods:

    

Archive.org installer - requires admin

https://archive.org/download/flashplayerarchivedversions2/333/fp_29.0.0.171_archive.zip
    1. extract the zip file from the link above
    2. run the correct installer(most likely winpep something)
    3. Restart the archive and it should load!
    

Manual 'install' - no admin required


    1. download "pepflashplayer.dll" for your system(just search for it on google)
    How to verify a .dll from the internet is legit
    1. right click on pepflashplayer.dll(the one extracted from the zip, not the zip itself) and click 'Properties'
    2. click the 'Digital Signatures' tab(if it isn't there don't trust the file)
    3. ensure there is a valid signature from 'Adobe Systens Incorporated'.
    2. navigate to %appdata%/Ninja Kiwi Archive/ in file explorer
    3. open the folder there named "flash"(create it if it didn't exist)
    4. delete anything there previously
    5. create a folder called "system"
    6. paste the pepflashplayer.dll there
    7. restart the archive and it should load!

Building

With JDK 17+:


This is required for the newest version(the tree starting from src/java). If virtual threads are available they will be used by default(checked via reflection).
Note that this won't affect the async NIO implementation which can be enabled in flash.properties for each server. This mostly exists because byte buffers made sense for SAS4's binary protocol.

0. Add the JDK to your system PATH, or edit the script to an absolute one in the next step.
1. Download the source and run "compile.bat" or "compile.sh" depending on your system.

This will compile the source to ./classes and launch the server.
To configure the server, edit "flash.properties".
You can also create a jar file with mvn package or extra/package.bat, or download one from build artifacts.

With JDK 8+:


There is an older version of each server which can be compiled here and is a few updates behind, but each server is only a single source file and they have been tested to run consistently for months. However some deadlocks might emerge after thousands of games.

0. Add the JDK to your system PATH, or edit the script to an absolute one in the next step.
1. Navigate to extra/old/[game name] and run "runme.bat" or "runme.sh" depending on your system.


There are no dependencies for either version.

Daily Challenges

These are hosted on a JSP servlet, which can be built from src/webapp.

Client

In order to play on a server you are hosting, you will have to create SWFs that link game clients to your server,
since the ones generated by the powershell scripts only link to my server.
This can be done through decompilation+Fiddler MITM and other methods, but eventually an archive mod with server selection might be available.
Some useful tools for analyzing client and server behavior are FFDec and Wireshark.

Contact

If you have questions or concerns feel free to message me on discord: glenn_m
or join: https://discord.gg/VVGuvq7kAv