Get rid of invoke_engio

This commit is contained in:
2024-08-29 17:45:05 -04:00
parent 368581463e
commit d4f46eef45
7 changed files with 7 additions and 103 deletions

View File

@@ -221,7 +221,6 @@ enum DrvAction {
PLAY_NOTIFY_CLOSE,
PLAY_NOTIFY_ACCEPT,
PLAY_CALL_EVENT_UPDATE,
PLAY_INVOKE_ENGIO,
PLAY_INVOKE_LUA_CALL,
PLAY_INVOKE_LUA_SOURCE,
PLAY_RELEASE,
@@ -236,7 +235,6 @@ inline static const char *action_string(DrvAction act) {
case PLAY_NOTIFY_CLOSE: return "PLAY_NOTIFY_CLOSE";
case PLAY_NOTIFY_ACCEPT: return "PLAY_NOTIFY_ACCEPT";
case PLAY_CALL_EVENT_UPDATE: return "PLAY_CALL_EVENT_UPDATE";
case PLAY_INVOKE_ENGIO: return "PLAY_INVOKE_ENGIO";
case PLAY_INVOKE_LUA_CALL: return "PLAY_INVOKE_LUA_CALL";
case PLAY_INVOKE_LUA_SOURCE: return "PLAY_INVOKE_LUA_SOURCE";
case PLAY_RELEASE: return "PLAY_RELEASE";
@@ -485,11 +483,6 @@ void DrivenEngine::drv_call_event_update(double clock) {
event_update();
}
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);
}
void DrivenEngine::drv_invoke_lua_call(int64_t place, uint32_t datapklen, const char *datapk) {
Invocation *inv = new Invocation(Invocation::KIND_LUA_CALL, visible_actor_id_, place, std::string_view(datapk, datapklen));
queued_invocations_.emplace_back(inv);
@@ -825,32 +818,6 @@ static void replay_invoke_event_update(EngineWrapper *w) {
////////////////////////
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_ENGIO, eng::memhash());
w->wlog->write_int64(place);
w->wlog->write_string(std::string_view(datapk, datapklen));
w->wlog->flush();
}
w->engine->drv_invoke_engio(place, datapklen, datapk);
}
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_engio");
}
w->engine->drv_invoke_engio(place, srcpack.size(), srcpack.c_str());
}
////////////////////////
void play_invoke_lua_call(EngineWrapper *w, int64_t place, uint32_t datapklen, const char *datapk) {
assert(w->rlog == nullptr);
if (w->wlog != nullptr) {
@@ -964,7 +931,6 @@ static void replaycore_step(EngineWrapper *w) {
case PLAY_NOTIFY_CLOSE: replay_notify_close(w); return;
case PLAY_NOTIFY_ACCEPT: replay_notify_accept(w); return;
case PLAY_CALL_EVENT_UPDATE: replay_invoke_event_update(w); return;
case PLAY_INVOKE_ENGIO: replay_invoke_engio(w); return;
case PLAY_INVOKE_LUA_CALL: replay_invoke_lua_call(w); return;
case PLAY_INVOKE_LUA_SOURCE: replay_invoke_lua_source(w); return;
case PLAY_RELEASE: release(w); return;
@@ -1027,7 +993,6 @@ 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_engio = play_invoke_engio;
w->play_invoke_lua_call = play_invoke_lua_call;
w->play_invoke_lua_source = play_invoke_lua_source;