News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Registration of Squirrel Standard Library

Started by THLeaderH, June 30, 2020, 03:04:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

THLeaderH

Squirrel provides Squirrel Standard Library that enables us to use basic I/O, string and math functions. However, these need a registration in the C++ code to use them in a squirrel code. For example, the I/O library needs the execution of sqstd_register_iolib. Current simutrans does not seem to do this routine and the Standard Library is unavailable.

It would be useful if I can use the Standard Library in squirrel code. Is there any reason not to support them in Simutrans?

Dwachs

Parts of this lib are used: math, string, and system. I did not see a reason to also register the other parts. Why do want to use this?
Parsley, sage, rosemary, and maggikraut.

makie

Quotethe I/O library
Open I/O, open a security problem. You can read and write files on the PC of the player. Maybe you want read some information from file in a script.
But this can be miss used too.

THLeaderH

Yes, I want to use the I/O library to extract some information of games as a file and use them with external programs, only with squirrel scripts. However, I have to admit that supporting I/O brings a security problem as makie put it.

prissi

One could force the files to be limtied to the simutrans directory by forbidding any path characters like /\:,; or so.