MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Execute

Method Execute

Source/Online/Message/sp_string_message.cpp:65–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void SPStringMessage::Execute(const OnlineMessageRef& ref, void* object, PeerID from) {
66 SPStringMessage* t = static_cast<SPStringMessage*>(object);
67 ObjectID object_id = Online::Instance()->GetObjectID(t->param_id);
68
69 ScriptParam param;
70 param.SetString(t->value);
71 param.editor().SetType(t->editor_type);
72 param.editor().SetDetails(t->editor_details);
73
74 ScriptParams* params = Online::Instance()->GetScriptParamsFromID(object_id);
75 if (params != nullptr) {
76 params->InsertScriptParam(t->key_name, param);
77 Online::Instance()->UpdateMovementObjectFromID(object_id);
78 } else {
79 LOGW << "Unable to apply script param update for param_id: " << object_id << " (" << t->param_id << ")" << endl;
80 }
81}
82
83void* SPStringMessage::Construct(void* mem) {
84 return new (mem) SPStringMessage(0, "", "", ScriptParamEditorType::Type::UNDEFINED, "");

Callers

nothing calls this directly

Calls 7

SetDetailsMethod · 0.80
GetScriptParamsFromIDMethod · 0.80
InsertScriptParamMethod · 0.80
GetObjectIDMethod · 0.45
SetStringMethod · 0.45
SetTypeMethod · 0.45

Tested by

no test coverage detected