Interface administrators, moderator
2,770
edits
No edit summary |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 11: | Line 11: | ||
</resources>}} | </resources>}} | ||
You can also start, stop, restart and refresh resources without restarting the server. To do this, type one of the commands (start, stop, refresh, or restart) in the server console. Example: <code>start something</code>. | You can also start, stop, restart and refresh resources without restarting the server. To do this, type one of the commands (start, stop, refresh, or restart) in the server console. Example: <code>start something</code>. You can also use these commands in game, if your [[client.administrator|client.administrator]] is set to true (any running resource can set this). | ||
Line 36: | Line 36: | ||
== Meta File == | == Meta.xml File == | ||
This is used to provide some basic information and what scripts/files it provides.<br> | |||
'''All resources must have a meta.xml, or the resource won't load!''' | |||
Example | |||
{{XMLCode|1=<meta> | {{XMLCode|1=<meta> | ||
<info author="" type="" version="" description="" /> | <info author="" type="" version="" description="" /> | ||
Line 57: | Line 48: | ||
<file url="" src="" type="" /> | <file url="" src="" type="" /> | ||
</meta>}} | </meta>}} | ||
Some notes: | |||
* All "src" attributes are a relative path to the file, with the resource's folder as the root. | |||
* The <code>info</code> node contains attributes that indicates who made the resource, it's type (custom description), custom version number, and a description of the resource<br> | |||
* Every script file needs to have a <code><script></code> node, each with a "type" attribute that refers to what side the script will run on (server or client), a language attribute that tells the server/client which language the script file uses (see [[ScriptingLanguages|supported scripting languages]]), and a "src" attribute with the file name as a relative path (i.e. "example.js" or "foo/bar.js". | |||
* Every custom file needs to have a <code><file></code> node, each with a "src" attribute for the file's path, and a "type" attribute indicating whether it's for the client or server. | |||
* Any <code><dependency></code> node, with a "src" attribute with the other resource's name, will require the other resource to be loaded BEFORE this one. | |||
== Client-side Files == | |||
Resources that contain client-side files are cached. If the built-in HTTP server is enabled, this will be used to distribute these files to clients when they connect or when the resource is updated and restarted. The default folder is "htdocs" in the GTAC server's main directory. You can also use your own HTTP server (like apache2 or nginx) as long as you add a virtual directory pointing to that "htdocs" folder in your GTAC server. Please note that this only applies to client-side files (used in ''<file>'' tag of the resource's meta.xml), not script files! | |||
== Other Notes == | |||
* The server will ignore any folders named with open and close square brackets, meaning they will not be loaded or cached as resources. This is useful if you want to group resources into subfolders for organization. Example name: [foobar]<br> | |||
* Resources are completely sandboxed on both server and client, and any file paths are jailed in the resource's folder. All available file-related functions are carefully set up to only allow access to files within the resource. This also applies to client-side resource cache. | |||
* Client side ''scripts'' (provided by a <script> tags in meta.xml) are sent separately to clients using the server's game/sync networking and are NOT saved to the cache. This helps lower the chances of script theft. Only files provided with <file> tags are sent via the HTTP server. | |||
* Scripts and files that are only server-side are not accessible to clients. If your ''server-only'' scripts or files are stolen or leaked, it's not GTA Connected's fault. There is likely a security exploit somewhere on the machine or hosting service that you're running the server on. |