Strdate / PythonConsole

Cities Skylines mod
25 stars 4 forks source link

Python 3 support #6

Closed HuangFuSL closed 2 years ago

HuangFuSL commented 2 years ago

I've re-implemented the Python engine of this mod. Changes are listed below:

  1. Requires a local Python environment (Python 3.5+) with Jupyter installed;
  2. If SkylinesPythonShared is statically linked to PythonConsole, the mod will support Linux and macOS;
  3. Change Serialization protocol from BinaryFormatter to XMLSerializer;
  4. Made change in PythonConsole to enable remote calls while not executing scripts (PythonConsole/PythonConsole.cs);
  5. Removed EngineAPI class and async_mode moved to GameAPI class;
  6. Removec help(), help_all(), list_globals() and print_list() method in GameAPI object
  7. Added external terminal support:
    from client import *
    initialize() # <-- Connect to Cities: Skylines
    game.get_node(6672) # Access objects
  8. input() disabled in internal engine;
  9. Result of the last expression executed is automatically printed out;
  10. Logging support in internal engine.
Strdate commented 2 years ago

Can you please create a separate pull request just for the XML serialization so I can merge it first?

HuangFuSL commented 2 years ago

Okay I've cherry-picked commits from master branch. I'll open a new request