1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00
This commit is contained in:
Desour 2025-01-27 14:12:40 +01:00
parent 7935a63ed4
commit 0fb8e1b398
19 changed files with 284 additions and 17 deletions

View file

@ -8,6 +8,13 @@
#include "sscsm_stupid_channel.h"
SSCSMEnvironment::SSCSMEnvironment(std::shared_ptr<StupidChannel> channel) :
Thread("SSCSMEnvironment-thread"),
m_channel(std::move(channel)),
m_script(std::make_unique<SSCSMScripting>(this))
{
}
void *SSCSMEnvironment::run()
{
while (true) {
@ -28,6 +35,21 @@ SerializedSSCSMAnswer SSCSMEnvironment::exchange(SerializedSSCSMRequest req)
return m_channel->exchangeA(std::move(req));
}
void SSCSMEnvironment::updateVFSFiles(std::vector<std::pair<std::string, std::string>> &&files)
{
for (auto &&p : files) {
m_vfs.emplace(std::move(p.first), std::move(p.second));
}
}
void SSCSMEnvironment::setFatalError(const std::string &reason)
{
//TODO
// what to do on error?
// probably send a request
errorstream << "SSCSMEnvironment::setFatalError() reason: " << reason << std::endl;
}
std::unique_ptr<ISSCSMEvent> SSCSMEnvironment::requestPollNextEvent()
{
auto request = SSCSMRequestPollNextEvent{};