mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Saving to database working
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "Action.h"
|
||||
#include "Amf3.h"
|
||||
|
||||
#include "tinyxml2.h"
|
||||
|
||||
Action::Action(const AMFArrayValue& arguments) {
|
||||
for (const auto& [paramName, paramValue] : arguments.GetAssociative()) {
|
||||
if (paramName == "Type") {
|
||||
@@ -32,3 +34,15 @@ void Action::SendBehaviorBlocksToClient(AMFArrayValue& args) const {
|
||||
actionArgs->Insert(m_ValueParameterName, m_ValueParameterDouble);
|
||||
}
|
||||
}
|
||||
|
||||
void Action::Serialize(tinyxml2::XMLElement& action) const {
|
||||
action.SetAttribute("Type", m_Type.c_str());
|
||||
|
||||
if (m_ValueParameterName.empty()) return;
|
||||
|
||||
if (m_ValueParameterName == "Message") {
|
||||
action.SetAttribute(m_ValueParameterName.c_str(), m_ValueParameterString.c_str());
|
||||
} else {
|
||||
action.SetAttribute(m_ValueParameterName.c_str(), m_ValueParameterDouble);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user