diff --git a/server/robotserver/android_agent.cc b/server/robotserver/android_agent.cc index 892ae2c6..86734425 100644 --- a/server/robotserver/android_agent.cc +++ b/server/robotserver/android_agent.cc @@ -113,6 +113,16 @@ behaviac::EBTStatus AndroidAgent::CoLogin() behaviac::EBTStatus AndroidAgent::CoConnectBattleServer() { + PRE_ENTER_COROUTINE(); + auto context = MAKE_BTCONTEXT + ( + std::function old_on_error; + std::function old_on_connect; + std::function old_on_disconnect; + ); + context->old_on_error = owner_->GetWebSocket()->on_error; + context->old_on_connect = owner_->GetWebSocket()->on_connect; + context->old_on_disconnect = owner_->GetWebSocket()->on_disconnect; owner_->GetWebSocket()->on_error = [this] (a8::WebSocketClient*,int err_code) {