Web file I/O
One of the main challenges of building desired functionality on top of SE is the difficulty of communicating with external services. A mod may write to and read from its respective folder in storage
, but getting that info requires running another program on the server, which is difficult to impossible logistically with a managed hosting provider.
It would be AMAZING if SESM provided an API endpoint we could remotely authenticate against and use to read/write from files in a given mod storage directory. This would enable exporting and importing information from SE with an appropriately written mod, which would enable us to do things like:
- integrate in game data with external sites, like official sites for our servers and users (subscriptions, stats tracking, etc)
- send players alerts when things happen ingame (your "Alarm block" goes off when enemies are close and we send you an email)
- send admins alerts when things go wrong (mod stalled / went down, items spawned into game, etc)
All the while being pretty simple to implement for SESM.
Preferably the file I/O would be XML and the web I/O would be JSON.
It would be particularly helpful if we could register a callback with SESM that it would post to when a file is updated. This would allow us to use an event model instead of constantly polling the SESM server (and the file itself) for updates.
Comments (2)
-
reporter -
reporter I can't find any windows-based FTP servers that support file change notifications.
So I think the best way to do this is using filesystemwatcher: https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx https://social.msdn.microsoft.com/Forums/vstudio/en-US/c6d07bda-67ff-4613-975e-50ecf5b5a8f6/ftp-file-monitor-for-new-file-and-download?forum=csharpgeneral
- Log in to comment
The easiest way to do this I suppose would be to provide ftp to the mod folders that only allows writing text files, but without the hooks we would still have to poll the server frequently.