More work on client and server
This commit is contained in:
@@ -97,6 +97,22 @@ void PrintBuffer::patch(StreamBuffer *sb) {
|
||||
}
|
||||
}
|
||||
|
||||
bool PrintChanneler::channel(const PrintBuffer *printbuffer, std::ostream &ostream) {
|
||||
if (printbuffer == nullptr) return false;
|
||||
if (printbuffer->first_line() > line_) {
|
||||
line_ = printbuffer->first_line();
|
||||
}
|
||||
while (line_ < printbuffer->first_unchecked()) {
|
||||
ostream << printbuffer->nth(line_) << std::endl;
|
||||
line_ += 1;
|
||||
}
|
||||
return line_ > printbuffer->first_line();
|
||||
}
|
||||
|
||||
Invocation PrintChanneler::invocation(int64_t actor_id) {
|
||||
return Invocation(Invocation::KIND_FLUSH_PRINTS, actor_id, actor_id, std::to_string(line_), InvocationData());
|
||||
}
|
||||
|
||||
LuaDefine(unittests_printbuffer, "c") {
|
||||
PrintBuffer pbm(util::WORLD_TYPE_MASTER);
|
||||
PrintBuffer pbs(util::WORLD_TYPE_S_SYNC);
|
||||
|
||||
Reference in New Issue
Block a user