×

To be able to write in the forum you need to authenticate. Meanwhile it's read-only.

Change History

New api methods will be announced here. Changes in our data that is relevant to checkers scripts/tags will also be announced here.

Message: New LUA Sandbox

Changed By: magma1447
Change Date: March 02, 2018 09:54PM

New LUA Sandbox
If you have read the topic [url=https://project-gc.com/forum/read?6,17264]Big boring changes incoming (PHP7)[/url] you know that we are up for some changes. I'll try to make it short to not repeat myself too much. Read the linked topic for more details.

We are upgrading to PHP 7 (from 5.6). The old LUA Sandbox implementation doesn't work anymore, we have added a new one. It affects quite a few scripts. It also affects the syntax that will be used in the future. Also, we are adding all of the LUA scripts to GitLab.

Due to current incompatibility issues between our Development environment and the Live servers we have [b]disabled[/b] all editing of LUA source code and creating of LUA scripts on the Live servers. Until further notice, they have to be edited via a development server that will be used as a staging server. More information later in this post.

All scripts in [b][url=https://project-gc.com/forum/read?6,17264,17329#msg-17329]THIS THREAD[/url][/b] are broken with the new LUA sandbox. For most of them, there are notes about why. I will try to fix a few of them myself as well, as soon as I get the time. Most of them are very easy to fix.

As mentioned, to edit LUA scripts you now need to access a development server. Every user who has access to create LUA scripts [s]now has[/s] will get a new menu item at Project-GC. Admin. In this menu you will find one item only, use it to grant yourself access to the development server. While on that, you can edit your own scripts, just as usual.

We [s]have also pushed [/s] are also pushing all LUA scripts to GitLab.com, including all historical versions (with the wrong time-stamps though). When a script is edited at Project-GC.com it will automatically be stored both in our database and at GitLab.com. If edited at GitLab.com, it will be pushed to Project-GC.com as well. This push normally takes 1-2 seconds.

With these changes there are now three ways to edit LUA scripts.
[list=1]
[*] At Project-GC.com, just as before.
[*] Online at GitLab.com, via there ir online editors.
[*] Cloning the repository, editing, pushing back to origin.
[/list]

The repositories at GitLab.com are private. They are not open for the public (though we could very well make them readable in the future). If you want access there, register an account and reply to this post with your GitLab username, we will then grant you access to the repository, [b]if you have access to writing LUA scripts at Project-GC.com[/b]. When editing scripts at GitLab.com you can edit [b]ANY[/b] script, not just your own. This will hopefully help us emptying the list of broken scripts.

While fixing scripts it's important that we keep them compatible with the Live servers as well, which is using the old Sandbox. We therefore added a new parameter with a sandbox version that the scripts can access.
[i]args[1].environmentSettings.sandboxVersion[/i] will equal 2 when in the new sandbox. In the old sandbox [i]args[1].environmentSettings.sandboxVersion[/i] does not exist.
With this you could potentially have different code paths if needed.

All LUA functions have been renamed with the new Sandbox. For example, TableSort will become table.sort. Until later on you should not care about that. To keep it compatible with the Live servers we need to stick to the old syntax until the Live servers has been updated. We will then update the documentation as well.


There are 66000 versions of the scripts to push to GitLab.com. We are currently pushing one version per second (due to rate limits). Therefore it will take almost a day until they are all pushed. Once they are all pushed, we will add the menu item to access the development environment, and we will also start granting access to GitLab.com. Feel free to register there and give us your usernames beforehand.


PS! It's not impossible that we will use different branches on GitLab.com for keeping development versions of scripts in the future. This is step one towards endless of possibilities.
Changed By: magma1447
Change Date: March 02, 2018 09:52PM

New LUA Sandbox
If you have read the topic [url=https://project-gc.com/forum/read?6,17264]Big boring changes incoming (PHP7)[/url] you know that we are up for some changes. I'll try to make it short to not repeat myself too much. Read the linked topic for more details.

We are upgrading to PHP 7 (from 5.6). The old LUA Sandbox implementation doesn't work anymore, we have added a new one. It affects quite a few scripts. It also affects the syntax that will be used in the future. Also, we are adding all of the LUA scripts to GitLab.

Due to current incompatibility issues between our Development environment and the Live servers we have [b]disabled[/b] all editing of LUA source code and creating of LUA scripts on the Live servers. Until further notice, they have to be edited via a development server that will be used as a staging server. More information later in this post.

All scripts in [b][url=https://project-gc.com/forum/read?6,17264,17329#msg-17329]this threadTHIS THREAD[/url] [/b] are broken with the new LUA sandbox. For most of them, there are notes about why. I will try to fix a few of them myself as well, as soon as I get the time. Most of them are very easy to fix.

As mentioned, to edit LUA scripts you now need to access a development server. Every user who has access to create LUA scripts [s]now has[/s] will get a new menu item at Project-GC. Admin. In this menu you will find one item only, use it to grant yourself access to the development server. While on that, you can edit your own scripts, just as usual.

We have also pushed all LUA scripts to GitLab.com, including all historical versions (with the wrong time-stamps though). When a script is edited at Project-GC.com it will automatically be stored both in our database and at GitLab.com. If edited at GitLab.com, it will be pushed to Project-GC.com as well. This push normally takes 1-2 seconds.

With these changes there are now three ways to edit LUA scripts.
[list=1]
[*] At Project-GC.com, just as before.
[*] Online at GitLab.com, via there online editors.
[*] Cloning the repository, editing, pushing back to origin.
[/list]

The repositories at GitLab.com are private. They are not open for the public (though we could very well make them readable in the future). If you want access there, register an account and reply to this post with your GitLab username, we will then grant you access to the repository, [b]if you have access to writing LUA scripts at Project-GC.com[/b]. When editing scripts at GitLab.com you can edit [b]ANY[/b] script, not just your own. This will hopefully help us emptying the list of broken scripts.

While fixing scripts it's important that we keep them compatible with the Live servers as well, which is using the old Sandbox. We therefore added a new parameter with a sandbox version that the scripts can access.
[i]args[1].environmentSettings.sandboxVersion[/i] will equal 2 when in the new sandbox. In the old sandbox [i]args[1].environmentSettings.sandboxVersion[/i] does not exist.
With this you could potentially have different code paths if needed.

All LUA functions have been renamed with the new Sandbox. For example, TableSort will become table.sort. Until later on you should not care about that. To keep it compatible with the Live servers we need to stick to the old syntax until the Live servers has been updated. We will then update the documentation as well.


There are 66000 versions of the scripts to push to GitLab.com. We are currently pushing one version per second (due to rate limits). Therefore it will take almost a day until they are all pushed. Once they are all pushed, we will add the menu item to access the development environment, and we will also start granting access to GitLab.com. Feel free to register there and give us your usernames beforehand.


PS! It's not impossible that we will use different branches on GitLab.com for keeping development versions of scripts in the future. This is step one towards endless of possibilities.

Original Message

Author: magma1447
Date: March 02, 2018 09:46PM

New LUA Sandbox
If you have read the topic [url=https://project-gc.com/forum/read?6,17264]Big boring changes incoming (PHP7)[/url] you know that we are up for some changes. I'll try to make it short to not repeat myself too much. Read the linked topic for more details.

We are upgrading to PHP 7 (from 5.6). The old LUA Sandbox implementation doesn't work anymore, we have added a new one. It affects quite a few scripts. It also affects the syntax that will be used in the future. Also, we are adding all of the LUA scripts to GitLab.

Due to current incompatibility issues between our Development environment and the Live servers we have [b]disabled[/b] all editing of LUA source code and creating of LUA scripts on the Live servers. Until further notice, they have to be edited via a development server that will be used as a staging server. More information later in this post.

All scripts in [url=https://project-gc.com/forum/read?6,17264,17329#msg-17329]this thread[/url] are broken with the new LUA sandbox. For most of them, there are notes about why. I will try to fix a few of them myself as well, as soon as I get the time. Most of them are very easy to fix.

As mentioned, to edit LUA scripts you now need to access a development server. Every user who has access to create LUA scripts [s]now has[/s] will get a new menu item at Project-GC. Admin. In this menu you will find one item only, use it to grant yourself access to the development server. While on that, you can edit your own scripts, just as usual.

We have also pushed all LUA scripts to GitLab.com, including all historical versions (with the wrong time-stamps though). When a script is edited at Project-GC.com it will automatically be stored both in our database and at GitLab.com. If edited at GitLab.com, it will be pushed to Project-GC.com as well. This push normally takes 1-2 seconds.

With these changes there are now three ways to edit LUA scripts.
[list=1]
[*] At Project-GC.com, just as before.
[*] Online at GitLab.com, via there online editors.
[*] Cloning the repository, editing, pushing back to origin.
[/list]

The repositories at GitLab.com are private. They are not open for the public (though we could very well make them readable in the future). If you want access there, register an account and reply to this post with your GitLab username, we will then grant you access to the repository, [b]if you have access to writing LUA scripts at Project-GC.com[/b]. When editing scripts at GitLab.com you can edit [b]ANY[/b] script, not just your own. This will hopefully help us emptying the list of broken scripts.

While fixing scripts it's important that we keep them compatible with the Live servers as well, which is using the old Sandbox. We therefore added a new parameter with a sandbox version that the scripts can access.
[i]args[1].environmentSettings.sandboxVersion[/i] will equal 2 when in the new sandbox. In the old sandbox [i]args[1].environmentSettings.sandboxVersion[/i] does not exist.
With this you could potentially have different code paths if needed.

All LUA functions have been renamed with the new Sandbox. For example, TableSort will become table.sort. Until later on you should not care about that. To keep it compatible with the Live servers we need to stick to the old syntax until the Live servers has been updated. We will then update the documentation as well.


There are 66000 versions of the scripts to push to GitLab.com. We are currently pushing one version per second (due to rate limits). Therefore it will take almost a day until they are all pushed. Once they are all pushed, we will add the menu item to access the development environment, and we will also start granting access to GitLab.com. Feel free to register there and give us your usernames beforehand.


PS! It's not impossible that we will use different branches on GitLab.com for keeping development versions of scripts in the future. This is step one towards endless of possibilities.