2023-02-16 17:30:33 +00:00
|
|
|
#include "Action.h"
|
|
|
|
|
|
|
|
Action::Action() {
|
|
|
|
type = "";
|
|
|
|
valueParameterName = "";
|
|
|
|
valueParameterString = "";
|
|
|
|
valueParameterDouble = 0.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
Action::Action(AMFArrayValue* arguments) {
|
|
|
|
type = "";
|
|
|
|
valueParameterName = "";
|
|
|
|
valueParameterString = "";
|
|
|
|
valueParameterDouble = 0.0;
|
2023-05-13 22:22:00 +00:00
|
|
|
for (auto& typeValueMap : arguments->GetAssociative()) {
|
2023-02-16 17:30:33 +00:00
|
|
|
if (typeValueMap.first == "Type") {
|
2023-05-13 22:22:00 +00:00
|
|
|
if (typeValueMap.second->GetValueType() != eAmf::String) continue;
|
|
|
|
type = static_cast<AMFStringValue*>(typeValueMap.second)->GetValue();
|
2023-02-16 17:30:33 +00:00
|
|
|
} else {
|
|
|
|
valueParameterName = typeValueMap.first;
|
|
|
|
// Message is the only known string parameter
|
|
|
|
if (valueParameterName == "Message") {
|
2023-05-13 22:22:00 +00:00
|
|
|
if (typeValueMap.second->GetValueType() != eAmf::String) continue;
|
|
|
|
valueParameterString = static_cast<AMFStringValue*>(typeValueMap.second)->GetValue();
|
2023-02-16 17:30:33 +00:00
|
|
|
} else {
|
2023-05-13 22:22:00 +00:00
|
|
|
if (typeValueMap.second->GetValueType() != eAmf::Double) continue;
|
|
|
|
valueParameterDouble = static_cast<AMFDoubleValue*>(typeValueMap.second)->GetValue();
|
2023-02-16 17:30:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|