Skip to content

Commit 3283247

Browse files
authored
Update rustg to 3.3.0 (#349)
* update rustg to 3.3.0 * update ci ubuntu to 22.04 * update run linters action * fix ci linter * awdfafasfa * hate * old linter action * ubuntu sucks
1 parent 182b290 commit 3283247

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

.github/workflows/ci_suite.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
pull_request:
77
branches:
88
- master
9+
910
jobs:
1011
run_linters:
1112
if: "!contains(github.event.head_commit.message, '[ci skip]')"
@@ -51,7 +52,7 @@ jobs:
5152
compile_all_maps:
5253
if: "!contains(github.event.head_commit.message, '[ci skip]')"
5354
name: Compile Maps
54-
runs-on: ubuntu-20.04
55+
runs-on: ubuntu-22.04
5556
steps:
5657
- uses: actions/checkout@v3
5758
- name: Restore BYOND cache
@@ -68,7 +69,7 @@ jobs:
6869
run_all_tests:
6970
if: "!contains(github.event.head_commit.message, '[ci skip]')"
7071
name: Integration Tests
71-
runs-on: ubuntu-20.04
72+
runs-on: ubuntu-22.04
7273
services:
7374
mysql:
7475
image: mysql:latest
@@ -105,9 +106,6 @@ jobs:
105106
mysql -u root -proot tg_ci_prefixed < SQL/tgstation_schema_prefixed.sql
106107
- name: Install rust-g
107108
run: |
108-
sudo dpkg --add-architecture i386
109-
sudo apt update || true
110-
sudo apt install -o APT::Immediate-Configure=false libssl1.1:i386
111109
bash tools/ci/install_rust_g.sh
112110
- name: Compile and run tests
113111
run: |

code/__DEFINES/rust_g.dm

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,23 @@
107107
#define rustg_cnoise_generate(percentage, smoothing_iterations, birth_limit, death_limit, width, height) \
108108
RUSTG_CALL(RUST_G, "cnoise_generate")(percentage, smoothing_iterations, birth_limit, death_limit, width, height)
109109

110+
/**
111+
* This proc generates a grid of perlin-like noise
112+
*
113+
* Returns a single string that goes row by row, with values of 1 representing an turned on cell, and a value of 0 representing a turned off cell.
114+
*
115+
* Arguments:
116+
* * seed: seed for the function
117+
* * accuracy: how close this is to the original perlin noise, as accuracy approaches infinity, the noise becomes more and more perlin-like
118+
* * stamp_size: Size of a singular stamp used by the algorithm, think of this as the same stuff as frequency in perlin noise
119+
* * world_size: size of the returned grid.
120+
* * lower_range: lower bound of values selected for. (inclusive)
121+
* * upper_range: upper bound of values selected for. (exclusive)
122+
*/
123+
#define rustg_dbp_generate(seed, accuracy, stamp_size, world_size, lower_range, upper_range) \
124+
RUSTG_CALL(RUST_G, "dbp_generate")(seed, accuracy, stamp_size, world_size, lower_range, upper_range)
125+
126+
110127
#define rustg_dmi_strip_metadata(fname) RUSTG_CALL(RUST_G, "dmi_strip_metadata")(fname)
111128
#define rustg_dmi_create_png(path, width, height, data) RUSTG_CALL(RUST_G, "dmi_create_png")(path, width, height, data)
112129
#define rustg_dmi_resize_png(path, width, height, resizetype) RUSTG_CALL(RUST_G, "dmi_resize_png")(path, width, height, resizetype)
@@ -159,6 +176,16 @@
159176

160177
#define rustg_noise_get_at_coordinates(seed, x, y) RUSTG_CALL(RUST_G, "noise_get_at_coordinates")(seed, x, y)
161178

179+
/*
180+
* Takes in a string and json_encode()"d lists to produce a sanitized string.
181+
* This function operates on whitelists, there is currently no way to blacklist.
182+
* Args:
183+
* * text: the string to sanitize.
184+
* * attribute_whitelist_json: a json_encode()'d list of HTML attributes to allow in the final string.
185+
* * tag_whitelist_json: a json_encode()'d list of HTML tags to allow in the final string.
186+
*/
187+
#define rustg_sanitize_html(text, attribute_whitelist_json, tag_whitelist_json) RUSTG_CALL(RUST_G, "sanitize_html")(text, attribute_whitelist_json, tag_whitelist_json)
188+
162189
#define rustg_sql_connect_pool(options) RUSTG_CALL(RUST_G, "sql_connect_pool")(options)
163190
#define rustg_sql_query_async(handle, query, params) RUSTG_CALL(RUST_G, "sql_query_async")(handle, query, params)
164191
#define rustg_sql_query_blocking(handle, query, params) RUSTG_CALL(RUST_G, "sql_query_blocking")(handle, query, params)

dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export BYOND_MAJOR=515
88
export BYOND_MINOR=1640
99

1010
#rust_g git tag
11-
export RUST_G_VERSION=0.5.0
11+
export RUST_G_VERSION=3.3.0
1212

1313
#node version
1414
export NODE_VERSION=20

rust_g.dll

926 KB
Binary file not shown.

0 commit comments

Comments
 (0)