Skip to content

Latest commit

 

History

History
executable file
·
38 lines (26 loc) · 7.97 KB

TECHNICAL.md

File metadata and controls

executable file
·
38 lines (26 loc) · 7.97 KB

Technical Details of how Pokemon Tower Defense 1 (PTD1) works

Game

PTD1 was made in Flash and is distributed in the SWF file format by Samuel Otero on his blog site.

Flash uses ActionScript as it's programming language and PTD1 is coded in ActionScript 3.

When a flash project is compiled, the ActionScript is compiled into an intermediary "language" called P-Code.

PTD1 has an SWF Version of 15 (You can check the SWF header in JPEXS) which means it was made with or compiled in Flash Player 11.2 or Adobe AIR 3.2 (Released March 28, 2012).

Networking

PTD1 communicates (regrettably) using HTTP (I have made some attempts to use HTTPS with varying results, so I'm stuck using HTTP for the time being) and sends data through POSTs with the application/x-www-form-urlencoded content type and expects the same content type for data returned by the server (quite unconventional)

PTD1 also has hardcoded constants (const) for urls rather than a single domain variable and appending the route (I have attempted to change that but with P-Code, issues arise due to little documentation of how to do things in P-Code).

Note: PTD1 did have various routes going to different domains (3 domains total) but for simplicity, I will only go over the routes and not the individual domains as it is inconsequential

All Routes used by the SWF:

Route Method Notes Class(es) Referencing Route in SWF
/ GET This route is used for some elements, the feedback button and the blog button specifically. code.class_876
/p/mystery-gift.html GET This route contains the codes for the mystery gift that the SWF accepts and is triggered by clicking the mystery code button in the title screen. code.class_876,code.class_898
/php/ This subdirectory (as you could guess) contains all the PHP files the SWF calls.
All routes inside this subdirectory gets passed a Date URL Variable/Parameter which provides a unix timestamp in the request

(My best guess for why this is included is to prevent older requests from overriding newer data (by comparing the last Date to the Date in the request). I don't see this being an issue so personally the server code does not check or save the Date of previous requests.)
/php/newPoke8.php POST This is the main route for PTD1's operation. This route is responsible for handling creation of accounts, loading accounts and saving account data. code.class_890
/php/poke.php POST TODO (haven't investigated that functionality yet) code.class_898
/php/newAchieve.php POST This method is used to save and load achievements. code.class_894
/games/ptd/ This subdirectory is for the PokeCenter.
/games/ptd/trading.php GET This is the PokeCenter trading page where you can trade pokemon with other players or send your pokemon to other profiles. code.class_896,code.class_901
/games/ptd/trading.php POST TODO (haven't investigated that functionality yet) code.class_901

POST Route details:

TODO!!! More to come!

Server

TODO!!! More to come!