More work on client and server
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
|
||||
#include "invocation.hpp"
|
||||
#include <sstream>
|
||||
|
||||
const std::string &InvocationData::get(const std::string &key) const {
|
||||
static std::string blank_;
|
||||
@@ -51,3 +52,22 @@ void Invocation::deserialize(StreamBuffer *sb) {
|
||||
data_.deserialize(sb);
|
||||
}
|
||||
|
||||
std::string Invocation::debug_string() {
|
||||
std::ostringstream oss;
|
||||
oss << "inv[";
|
||||
switch (kind_) {
|
||||
case KIND_INVALID: oss << "invalid"; break;
|
||||
case KIND_PLAN: oss << "plan"; break;
|
||||
case KIND_LUA: oss << "lua"; break;
|
||||
case KIND_FLUSH_PRINTS: oss << "flush_prints"; break;
|
||||
default: oss << "UNKNOWN"; break;
|
||||
}
|
||||
oss << " a=" << actor_;
|
||||
oss << " p=" << place_;
|
||||
oss << " " << action_;
|
||||
for (const auto &pair : data_) {
|
||||
oss << " " << pair.first << "=" << pair.second;
|
||||
}
|
||||
oss << "]";
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user