You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Docs/src/content/docs/guides/coresetup.mdoc
+45-4Lines changed: 45 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -19,24 +19,65 @@ The Join script loads the Starter script (default ID 37801172), and the Starter
19
19
Libraries were removed from the Client in 2020 after years of deprecation. Depending on the Client version, they may be used heavily, rarely, or not at all.
20
20
- **Plugins**: These are scripts distributed alongside Studio to provide extra functionality.
21
21
- **Client scripts**: The combination of Builtin scripts, Loadscripts, Corescripts, and Libraries.
22
-
- **Privileged assets**: The combination of all Builtins, Hardcoded assets, Corescripts, Libraries, and Dependencies.
22
+
- **Privileged assets**: The combination of all Hardcoded assets, Corescripts, Libraries, and Dependencies.
23
23
24
24
Under the usual vague definitions, "corescripts" could refer to *any* of the above.
25
25
26
26
Loadscripts are loaded from the Site, each from their own specific URL paths.
27
-
Hardcoded assets, Corescripts, Libraries, and Dependencies are all loaded as if they were normal assets from the Site. However, they are instead loaded from a separate directory from the other assets to improve ease of setup, updating, and management. It would theoretically be possible to set up Mercury Core normally, and upload all these assets to the Site like normal assets, but this would be an inconvenient and tedious process, especially in development where Database resets may be common.
27
+
Privileged assets are all loaded as if they were normal assets from the Site. However, they are instead loaded from a separate directory from the other assets to improve ease of setup, updating, and management. It would theoretically be possible to set up Mercury Core normally, and upload all these assets to the Site like normal assets, but this would be an inconvenient and tedious process, especially in development where Database resets may be common.
28
28
29
-
## Example Corescripts
29
+
## Example scripts
30
30
31
-
An example repository, holding most Hardcoded assets, Loadscripts, Corescripts, Dependencies, Libraries, and Plugins for the 11 December 2013 client (release 132) used in Mercury 2 can be found at [tp-link-extender/2013](https://github.com/tp-link-extender/2013).
31
+
An example repository, holding most Loadscripts, Plugins, and Privileged assets for the 11 December 2013 client (release 132) used in Mercury 2 can be found at [tp-link-extender/2013](https://github.com/tp-link-extender/2013).
32
32
33
33
{% aside type="caution" title="Omissions" %}
34
34
Some of the less useful or untestable Corescripts, such as those for handling badges and gamepass/product purchases, have been deliberately removed from the example repository. This is because the functionality for these features is not implemented in Mercury Core, mainly due to the trust required between the Site and gameservers to handle communications securely. As such, they can't be implemented in a revival platform that allows users to host their own gameservers.
35
35
Once we are able to test with dedicated servers, we may re-add these scripts to the example repository.
36
36
{% /aside %}
37
37
38
+
### Instructions
39
+
40
+
The set of scripts includes a compiler to move and bundle scripts into the format and directory structure expected by Mercury Core. These instructions also include how to run the compiler and set up the output to be used by Mercury Core.
41
+
42
+
{% steps %}
43
+
44
+
1. Clone the [tp-link-extender/2013](https://github.com/tp-link-extender/2013) repository to a directory of your choice on your local machine.
2. Navigate to the root directory of the cloned repository.
51
+
52
+
3. Install the necessary tools. This can be done in a few ways:
53
+
54
+
- Install [Aftman](https://github.com/lpghatguy/aftman), and run `aftman install` to install the necessary tools.
55
+
- Install [Rokit](https://github.com/rojo-rbx/rokit), and run `rokit install` to install the necessary tools.
56
+
- Manually install [Darklua](https://darklua.com/docs/installation/) and add it to your PATH so it is accessible from the command line as `darklua`. This is the main dependency for the compiler, though we're planning to remove its requirement in the future.
57
+
58
+
4. Copy your **PrivateKey.pem** file (the private key corresponding to the public key patched into the client) into the **compile** directory.
59
+
60
+
5. Run `go run .` in the **compile** directory to compile all scripts.
61
+
62
+
6. Navigate to the **out** directory in the root of the repository.
63
+
64
+
7. There should be two directories: **server** and **plugins**. Move the entire **server** directory into the **data** directory of your Mercury Core repository.
65
+
66
+
{% /steps %}
67
+
68
+
The output structure of the compiler is as follows:
69
+
70
+
- **out**
71
+
- **server**: Assets and scripts to be served from the Site. This entire directory must be moved into the **data** directory of the Mercury Core repository.
72
+
- **assets**: All Privileged assets. Each has an ID matching that expected by the Client, and are served normally as assets from the Site. When serving any asset, this directory is checked first. Privileged assets are pre-signed with the private key if required (if they are Corescripts or Libraries).
73
+
- **loadscripts**: Loadscripts. These are not pre-signed as they need to be modified by the Site before they are served.
74
+
- **render**: Render scripts, used to send to RCCService to render thumbnails and icons for assets.
75
+
- **plugins**: Studio plugins. These are bundled alongside the Client itself, so this directory is not needed by Mercury Core.
76
+
38
77
## Modification
39
78
79
+
This section details how to modify Client scripts.
80
+
40
81
The first thing to set straight is that **Client scripts don't *need* to be modified**. If a repository of scripts equal to that distributed at the time of the client being used is available, it can sometimes be used as-is if using URL-rewriting methods in, for example, a DLL or other dynamic library hook.
41
82
42
83
Usually, minor modifications are required. This sometimes includes changing asset IDs to match those uploaded to the Site, or changing URLs in Loadscripts and Corescripts to match the Site's URL structure. Client script modification can result in incredible benefits, though most of these can be attained with little more than these minor changes.
0 commit comments