MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Send

Method Send

src/script/api/script_admin.cpp:119–137  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

117}
118
119/* static */ SQInteger ScriptAdmin::Send(HSQUIRRELVM vm)
120{
121 if (sq_gettop(vm) - 1 != 1) return sq_throwerror(vm, "wrong number of parameters");
122
123 if (sq_gettype(vm, 2) != OT_TABLE) {
124 return sq_throwerror(vm, "ScriptAdmin::Send requires a table as first parameter. No data sent.");
125 }
126
127 nlohmann::json json;
128 if (!ScriptAdminMakeJSON(json, vm, -1)) {
129 sq_pushinteger(vm, 0);
130 return 1;
131 }
132
133 NetworkAdminGameScript(json.dump());
134
135 sq_pushinteger(vm, 1);
136 return 1;
137}

Callers

nothing calls this directly

Calls 7

sq_gettopFunction · 0.85
sq_throwerrorFunction · 0.85
sq_gettypeFunction · 0.85
ScriptAdminMakeJSONFunction · 0.85
sq_pushintegerFunction · 0.85
NetworkAdminGameScriptFunction · 0.85
dumpMethod · 0.80

Tested by

no test coverage detected