|
|
@ -31,7 +31,10 @@ websockets::TestProtocol<User> default_protocol{ |
|
|
|
[](User& user, basic_websocket_info) -> std::string{ |
|
|
|
js::Object ret; |
|
|
|
ret["balls"] = vector_to_json(app->sim.balls); |
|
|
|
ret["lines"] = vector_to_json(app->sim.lines); |
|
|
|
if(user.update_lines){ |
|
|
|
ret["lines"] = vector_to_json(app->sim.lines); |
|
|
|
user.update_lines = false; |
|
|
|
} |
|
|
|
return write_json(ret); |
|
|
|
}, |
|
|
|
// receive
|
|
|
|