mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-21 14:14:22 +00:00
feat: add the lightning orb script* (#2011)
* feat: add the lightning orb script* Doesn't do anything because MPC don't work... * Update LightningOrbServer.cpp
This commit is contained in:
@@ -369,8 +369,21 @@ public:
|
||||
|
||||
template<typename AmfType = AMFArrayValue>
|
||||
AmfType& PushDebug(const std::string_view name) {
|
||||
size_t i = 0;
|
||||
for (; i < m_Dense.size(); i++) {
|
||||
const auto& cast = dynamic_cast<AMFArrayValue*>(m_Dense[i].get());
|
||||
if (!cast) continue;
|
||||
|
||||
const auto& nameValue = cast->Get<std::string>("name");
|
||||
if (!nameValue || nameValue->GetValue() != name) continue;
|
||||
|
||||
// found a duplicate, return this instead
|
||||
auto valueCast = dynamic_cast<AmfType*>(cast->Get("value"));
|
||||
if (valueCast) return *valueCast;
|
||||
}
|
||||
|
||||
auto* value = PushArray();
|
||||
value->Insert("name", name.data());
|
||||
value->Insert<std::string>("name", name.data());
|
||||
return value->Insert<AmfType>("value", std::make_unique<AmfType>());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user