The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

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.


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?


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.


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.


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.


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