Initial implementation of 'engio' finished

This commit is contained in:
2023-10-24 15:49:43 -04:00
parent 7f5744da2d
commit c0c360a3a7
8 changed files with 49 additions and 25 deletions

View File

@@ -486,8 +486,8 @@ void DrivenEngine::drv_call_event_update(double clock) {
event_update();
}
void DrivenEngine::drv_invoke_player(int64_t place, uint32_t datapklen, const char *datapk) {
Invocation *inv = new Invocation(Invocation::KIND_PLAYER, visible_actor_id_, place, std::string_view(datapk, datapklen));
void DrivenEngine::drv_invoke_engio(int64_t place, uint32_t datapklen, const char *datapk) {
Invocation *inv = new Invocation(Invocation::KIND_ENGIO, visible_actor_id_, place, std::string_view(datapk, datapklen));
queued_invocations_.emplace_back(inv);
}
@@ -826,7 +826,7 @@ static void replay_invoke_event_update(EngineWrapper *w) {
////////////////////////
void play_invoke_player(EngineWrapper *w, int64_t place, uint32_t datapklen, const char *datapk) {
void play_invoke_engio(EngineWrapper *w, int64_t place, uint32_t datapklen, const char *datapk) {
assert(w->rlog == nullptr);
if (w->wlog != nullptr) {
w->wlog->write_cmd_hash(PLAY_INVOKE_PLAYER, eng::memhash());
@@ -835,17 +835,17 @@ void play_invoke_player(EngineWrapper *w, int64_t place, uint32_t datapklen, con
w->wlog->flush();
}
w->engine->drv_invoke_player(place, datapklen, datapk);
w->engine->drv_invoke_engio(place, datapklen, datapk);
}
void replay_invoke_player(EngineWrapper *w) {
void replay_invoke_engio(EngineWrapper *w) {
int64_t place = w->rlog->read_int64();
std::string srcpack = w->rlog->read_string();
if (!w->rlog->good()) {
return reset_wrapper(w, "replay log corrupt in replay_invoke_player");
return reset_wrapper(w, "replay log corrupt in replay_invoke_engio");
}
w->engine->drv_invoke_player(place, srcpack.size(), srcpack.c_str());
w->engine->drv_invoke_engio(place, srcpack.size(), srcpack.c_str());
}
@@ -1029,7 +1029,7 @@ static void init_engine_wrapper_helper(EngineWrapper *w) {
w->play_notify_close = play_notify_close;
w->play_notify_accept = play_notify_accept;
w->play_invoke_event_update = play_invoke_event_update;
w->play_invoke_player = play_invoke_player;
w->play_invoke_engio = play_invoke_engio;
w->play_invoke_choose = play_invoke_choose;
w->play_invoke_lua_source = play_invoke_lua_source;