static void onGlobalChanged(const std::string& name, void*) { // This Callback is removed in replay mode. As // well, the /set and /reset commands are blocked. std::string value = BZDB.get(name); void *bufStart = getDirectMessageBuffer(); void *buf = nboPackUShort(bufStart, 1); buf = nboPackUByte(buf, name.length()); buf = nboPackString(buf, name.c_str(), name.length()); buf = nboPackUByte(buf, value.length()); buf = nboPackString(buf, value.c_str(), value.length()); broadcastMessage(MsgSetVar, (char*)buf - (char*)bufStart, bufStart); }