Giter Site home page Giter Site logo

glennnm / flashprivateserver Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 1.0 2.82 MB

Fully rebuilt and playable servers for Ninja Kiwi's flash games

License: GNU Affero General Public License v3.0

Java 97.32% PowerShell 1.15% Python 1.19% Shell 0.18% Batchfile 0.17%
adobe-flash java multiplayer ninja-kiwi private-server bloons bloons-td-5 bloons-td-battles ninja-kiwi-archive sas4

flashprivateserver's Introduction

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

  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.


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.
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

flashprivateserver's People

Contributors

glennnm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gungungun

flashprivateserver's Issues

BTD Battles bot doesn't work

I changed the connection info from the NK server to localhost, but trying to run Bloon Terminator resulted in a crash saying the server actively refused the connection. The repo to the bot is archived so I can't ask there, so sorry if this is unrelated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.