diff --git a/sdks/cpp/include/agones/sdk.h b/sdks/cpp/include/agones/sdk.h index 96b9513fdc..506d1523da 100644 --- a/sdks/cpp/include/agones/sdk.h +++ b/sdks/cpp/include/agones/sdk.h @@ -46,17 +46,17 @@ class SDK { // Retrieve the current GameServer data AGONES_EXPORT grpc::Status GameServer( - stable::agones::dev::sdk::GameServer* response); + agones::dev::sdk::GameServer* response); // Marks the Game Server as ready to shutdown AGONES_EXPORT grpc::Status Shutdown(); // SetLabel sets a metadata label on the `GameServer` with the prefix - // stable.agones.dev/sdk- + // agones.dev/sdk- AGONES_EXPORT grpc::Status SetLabel(std::string key, std::string value); // SetAnnotation sets a metadata annotation on the `GameServer` with the - // prefix stable.agones.dev/sdk- + // prefix agones.dev/sdk- AGONES_EXPORT grpc::Status SetAnnotation(std::string key, std::string value); // Watch the GameServer configuration, and fire the callback @@ -64,7 +64,7 @@ class SDK { // This is a blocking function, and as such you will likely want to run it // inside a thread. AGONES_EXPORT grpc::Status WatchGameServer( - const std::function& + const std::function& callback); private: diff --git a/sdks/cpp/src/agones/sdk.cc b/sdks/cpp/src/agones/sdk.cc index bf074ce5d4..c22097cf17 100644 --- a/sdks/cpp/src/agones/sdk.cc +++ b/sdks/cpp/src/agones/sdk.cc @@ -25,8 +25,8 @@ namespace agones { class SDKImpl final { public: std::shared_ptr channel_; - std::unique_ptr stub_; - std::unique_ptr> health_; + std::unique_ptr stub_; + std::unique_ptr> health_; }; SDK::SDK() : pimpl_{std::make_unique()} { @@ -43,10 +43,10 @@ bool SDK::Connect() { return false; } - pimpl_->stub_ = stable::agones::dev::sdk::SDK::NewStub(pimpl_->channel_); + pimpl_->stub_ = agones::dev::sdk::SDK::NewStub(pimpl_->channel_); // make the health connection - stable::agones::dev::sdk::Empty response; + agones::dev::sdk::Empty response; pimpl_->health_ = pimpl_->stub_->Health(new grpc::ClientContext(), &response); return true; @@ -56,33 +56,33 @@ grpc::Status SDK::Ready() { grpc::ClientContext *context = new grpc::ClientContext(); context->set_deadline(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(30, GPR_TIMESPAN))); - stable::agones::dev::sdk::Empty request; - stable::agones::dev::sdk::Empty response; + agones::dev::sdk::Empty request; + agones::dev::sdk::Empty response; return pimpl_->stub_->Ready(context, request, &response); } bool SDK::Health() { - stable::agones::dev::sdk::Empty request; + agones::dev::sdk::Empty request; return pimpl_->health_->Write(request); } -grpc::Status SDK::GameServer(stable::agones::dev::sdk::GameServer *response) { +grpc::Status SDK::GameServer(agones::dev::sdk::GameServer *response) { grpc::ClientContext *context = new grpc::ClientContext(); context->set_deadline(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(30, GPR_TIMESPAN))); - stable::agones::dev::sdk::Empty request; + agones::dev::sdk::Empty request; return pimpl_->stub_->GetGameServer(context, request, response); } grpc::Status SDK::WatchGameServer( - const std::function &callback) { + const std::function &callback) { grpc::ClientContext *context = new grpc::ClientContext(); - stable::agones::dev::sdk::Empty request; - stable::agones::dev::sdk::GameServer gameServer; + agones::dev::sdk::Empty request; + agones::dev::sdk::GameServer gameServer; - std::unique_ptr> + std::unique_ptr> reader = pimpl_->stub_->WatchGameServer(context, request); while (reader->Read(&gameServer)) { callback(gameServer); @@ -94,8 +94,8 @@ grpc::Status SDK::Shutdown() { grpc::ClientContext *context = new grpc::ClientContext(); context->set_deadline(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(30, GPR_TIMESPAN))); - stable::agones::dev::sdk::Empty request; - stable::agones::dev::sdk::Empty response; + agones::dev::sdk::Empty request; + agones::dev::sdk::Empty response; return pimpl_->stub_->Shutdown(context, request, &response); } @@ -105,11 +105,11 @@ grpc::Status SDK::SetLabel(std::string key, std::string value) { context->set_deadline(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(30, GPR_TIMESPAN))); - stable::agones::dev::sdk::KeyValue request; + agones::dev::sdk::KeyValue request; request.set_key(key); request.set_value(value); - stable::agones::dev::sdk::Empty response; + agones::dev::sdk::Empty response; return pimpl_->stub_->SetLabel(context, request, &response); } @@ -119,11 +119,11 @@ grpc::Status SDK::SetAnnotation(std::string key, std::string value) { context->set_deadline(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(30, GPR_TIMESPAN))); - stable::agones::dev::sdk::KeyValue request; + agones::dev::sdk::KeyValue request; request.set_key(key); request.set_value(value); - stable::agones::dev::sdk::Empty response; + agones::dev::sdk::Empty response; return pimpl_->stub_->SetAnnotation(context, request, &response); }