Skip to content

Commit

Permalink
Fix build script. Prepare for 0.01
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidCaos committed Jun 18, 2022
1 parent 4d0a640 commit 060ef63
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 32 deletions.
65 changes: 41 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
: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 <https://www.gnu.org/licenses/>.
```
3 changes: 2 additions & 1 deletion build/build.bat
Original file line number Diff line number Diff line change
@@ -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
12 changes: 5 additions & 7 deletions sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.")

0 comments on commit 060ef63

Please sign in to comment.