From 060ef63e53acedc2cab141061f3eb5b9e31cae86 Mon Sep 17 00:00:00 2001 From: AcidCaos Date: Sat, 18 Jun 2022 12:29:29 +0200 Subject: [PATCH] Fix build script. Prepare for 0.01 --- README.md | 65 +++++++++++++++++++++++++++++++------------------ build/build.bat | 3 ++- sessions.py | 12 ++++----- 3 files changed, 48 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 02861c3..c32df4d 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,44 @@ -# Social Emperors +![Social Empires](templates/img/logo.png "Social Empires logo") Social Empires preservation project. -## Installation -### Windows -You first need to install Python. -I have currently run this on 3.10.1, but you may be able to use any version from 3.7-3.10. -After you have installed Python, you will need to use your favorite package manager (usually `pip`) to install PyInstaller and Flask. -You can run `pip install -U flask pyinstaller` to do this. - -You will notice a `build` directory, containing a `build.bat` batch script. -To build the app, you will need to run this script. -Once it has finished, you will see a file called `social-emperors_0.01a.exe` in `build/dist`. -Move this out to the root directory `socialemperors`. -You will be able to run this application, but it is just a server for the Social Empires game. -There will be a line in the terminal that says something like `* Running on http://127.0.0.1:5050`. -Keep this address in mind. - -In order to actually play the game, you will need to use a browser that is still capable of running Flash. -[I use this browser](https://github.com/radubirsan/FlashBrowser/). -After you open the browser, enter the address from the `* Running` line and then you should be able to play the game. - -Have fun! :) - -### Other OSes -TODO \ No newline at end of file +:speech_balloon: Check our [Discord group](https://discord.gg/zW5gSbQJBw) + +--- + +## Releases + +| Version | Release date | Download | +| --- | --- | --- | +| pre-alpha 0.01a | June 18, 2022 | :ticket: [Launcher](../../releases/download/0.01a/social-emperors_0.01a.zip) | + +## How to Install on Windows + +- Download a flash-compatible browser (unless you already have one). **Recommended:** [Chromium 82.0](https://chromium.en.uptodown.com/windows/download/2181158) +- Downlaod Flash Player for that browser. For Chromium: [Pepper Flash](https://archive.org/download/flashplayerarchive/pub/flashplayer/installers/archive/fp_32.0.0.371_archive.zip/32_0_r0_371%2Fflashplayer32_0r0_371_winpep.exe). For Firefox or Basilisk: [Flash NPAPI](https://archive.org/download/flashplayerarchive/pub/flashplayer/installers/archive/fp_32.0.0.371_archive.zip/32_0_r0_371%2Fflashplayer32_0r0_371_win.exe) +- Download the latest released version from the Releases section. +- Unzip the file to a suitable location. + +## How to Play + +- Run the social-emperors executable. (It might take a couple of seconds to start) +- Open your flash browser and navigate to `http://127.0.0.1:5050/`. + +## On archives and accessibility to digital heritage + +- [Exemption to PCCPSACT](https://www.federalregister.gov/documents/2018/10/26/2018-23241/exemption-to-prohibition-on-circumvention-of-copyright-protection-systems-for-access-control), exemptions to the provision of the Digital Millennium Copyright Act (“DMCA”). +- [EFGAMP](https://efgamp.eu/), the European Federation of Video Game Archives, Museums and Preservation projects. +- [UNESCO PERSIST Programme](https://unescopersist.org/), helps ensure that digital information can continue to be accessed in the future. +- [The Internet Archive](https://archive.org/), a digital library of Internet sites and other cultural artifacts in digital form. +- [BlueMaxima's Flashpoint](https://bluemaxima.org/flashpoint/), the webgame preservation project. +- [Adobe Flash Player Archive](https://archive.org/download/flashplayerarchive/), the Adobe Inc. archive.org Flash Player Archive. + +--- + +## License [![GPL v3](https://img.shields.io/badge/GPL%20v3-blue)](http://www.gnu.org/licenses/gpl-3.0) + +``` +Social Empires preservation project. +Copyright (C) 2022 The Social Emperors team +See the GNU General Public License . +``` \ No newline at end of file diff --git a/build/build.bat b/build/build.bat index 2046970..488c313 100644 --- a/build/build.bat +++ b/build/build.bat @@ -1,4 +1,5 @@ @echo off set NAME=social-emperors_0.01a -pyinstaller --onefile --add-data "..\..\assets;assets" --add-data "..\..\config;config" --add-data "..\..\flash;flash" --add-data "..\..\stub;stub" --add-data "..\..\templates;templates" --add-data "..\..\villages;villages" --paths ..\..\. --workpath .\work --distpath .\dist --specpath .\bundle --noconfirm --name %NAME% ..\server.py +pyinstaller --onefile --add-data "..\..\assets;assets" --add-data "..\..\flash;flash" --add-data "..\..\stub;stub" --add-data "..\..\templates;templates" --paths ..\..\. --workpath .\work --distpath .\dist --specpath .\bundle --noconfirm --name %NAME% ..\server.py +echo Done. pause>NUL \ No newline at end of file diff --git a/sessions.py b/sessions.py index d21155c..95e7d55 100644 --- a/sessions.py +++ b/sessions.py @@ -75,11 +75,7 @@ def new_village() -> str: village["playerInfo"]["pid"] = USERID __saves[USERID] = village # Generate save_file - # save_session(USERID) - file = f"{USERID}.save.json" - print(f" * Saving village at {file}... ", end='') - with open(os.path.join(__saves_dir, file), 'w') as f: - json.dump(village, f, indent=4) + save_session(USERID) print("Done.") return USERID @@ -134,7 +130,9 @@ def backup_session(USERID: str): def save_session(USERID: str): # TODO - file = str(USERID) + ".save.json" + file = f"{USERID}.save.json" print(f" * Saving village at {file}... ", end='') - village = json.dump(session(USERID), open(os.path.join(__saves_dir, file), 'w'), indent=4) + village = session(USERID) + with open(os.path.join(__saves_dir, file), 'w') as f: + json.dump(village, f, indent=4) print("Done.") \ No newline at end of file