From c17d8750e2409e36e9367a43b8cceafabd7185aa Mon Sep 17 00:00:00 2001 From: austin Date: Fri, 2 Aug 2024 16:17:53 -0400 Subject: [PATCH] docs work --- docs/src/architecture/architectureindex.md | 1 + .../src/architecture/networking/networking.md | 4 +++ .../networking/synchronization.md | 3 ++ .../architecture/scripting/scriptengine.md | 29 +++++++------------ .../java/electrosphere/engine/Globals.java | 2 +- 5 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 docs/src/architecture/networking/networking.md create mode 100644 docs/src/architecture/networking/synchronization.md diff --git a/docs/src/architecture/architectureindex.md b/docs/src/architecture/architectureindex.md index 9fd2a43b..5172447a 100644 --- a/docs/src/architecture/architectureindex.md +++ b/docs/src/architecture/architectureindex.md @@ -1,6 +1,7 @@ @page architectureindex Engine Architecture [TOC] +- @subpage networking - @subpage serverSceneManagement - @subpage fluidsimindex - @subpage worldstorageindex diff --git a/docs/src/architecture/networking/networking.md b/docs/src/architecture/networking/networking.md new file mode 100644 index 00000000..41587cb6 --- /dev/null +++ b/docs/src/architecture/networking/networking.md @@ -0,0 +1,4 @@ +@page networking Networking + +[TOC] +@subpage synchronization Synchronization \ No newline at end of file diff --git a/docs/src/architecture/networking/synchronization.md b/docs/src/architecture/networking/synchronization.md new file mode 100644 index 00000000..a562759a --- /dev/null +++ b/docs/src/architecture/networking/synchronization.md @@ -0,0 +1,3 @@ +@page synchronization Synchronzation + +TODO \ No newline at end of file diff --git a/docs/src/architecture/scripting/scriptengine.md b/docs/src/architecture/scripting/scriptengine.md index 124c4fb0..e0d5392a 100644 --- a/docs/src/architecture/scripting/scriptengine.md +++ b/docs/src/architecture/scripting/scriptengine.md @@ -8,24 +8,15 @@ A chief problem we want to avoid is allowing people to 'escape' the scripting en +# Startup +On startup, the script engine loads a number of files required to polyfill basic javascript ecosystem functionality. +Once these are integrated, the engine loads typescript and the compiler. +The compiler is used to translate scene files and mod files into javascript that the runtime environment can actually execute. -# On adding different instances of the scripting engine -There should be a single monolithic instance of the scripting engine -All context-dependent scripts running should have their context provided - -IE, lets say I'm the client and I want to fire an event when a client-side effect completes, -I'd provide a copy of the client's scene as a part of the function call on javascript side -That way for any unforseen reason the client could still get access to the server's objects - -IE, lets say I'm a script running on a specific scene on the server, -I'd provide the specific scene to the function call - -IE, lets say I'm some script firing every time a user logs in, -I'd provide the new user object and the global server user tracking service -That way you could still drill down to individual scenes on the server if you needed to - - - - - +# On loading a scene +When a scene is loaded, the scene and all dependent files are compiled from typescript to javascript. +Then, an instance of this scene is created which will store values set by the scene. +This instance is returned to the java side where it is associated with the java instance of the scene. +# On firing a hook +When a hook fires, java side calls a JS-side function that supplies the hook, values provided alongside the hook, and the scene which the hook was fired within. \ No newline at end of file diff --git a/src/main/java/electrosphere/engine/Globals.java b/src/main/java/electrosphere/engine/Globals.java index 4178f2d4..b6dd58de 100644 --- a/src/main/java/electrosphere/engine/Globals.java +++ b/src/main/java/electrosphere/engine/Globals.java @@ -135,7 +135,7 @@ public class Globals { public static boolean RUN_DEMO = false; public static boolean RUN_CLIENT = true; public static boolean RUN_HIDDEN = false; //glfw session will be created with hidden window - public static boolean RUN_AUDIO = false; + public static boolean RUN_AUDIO = true; public static int clientCharacterID; //