@@ -119,7 +119,6 @@ passing in a `stable::agones::dev::sdk::GameServer*` to push the results of the
119119This function will return a grpc::Status object, from which we can call ` status.ok() ` to determine
120120if the function completed successfully.
121121
122- {{% feature expiryVersion="0.12.0" %}}
123122``` cpp
124123stable::agones::dev::sdk::GameServer gameserver;
125124grpc::Status status = sdk->GameServer (&gameserver);
@@ -140,31 +139,32 @@ sdk->WatchGameServer([](stable::agones::dev::sdk::GameServer gameserver){
140139});
141140```
142141{{% /feature %}}
143- {{% feature publishversion ="0.12.0" %}}
142+ {{% feature publishVersion ="0.12.0" %}}
144143To get the details on the [ backing ` GameServer ` ] ({{< relref "_ index.md#gameserver" >}}) call ` sdk->GameServer(&gameserver) ` ,
145144passing in a ` agones::dev::sdk::GameServer* ` to push the results of the ` GameServer ` configuration into.
146145
147146This function will return a grpc::Status object, from which we can call ` status.ok() ` to determine
148147if the function completed successfully.
149148
150- {{% feature expiryVersion="0.12.0" %}}
151149``` cpp
152150agones::dev::sdk::GameServer gameserver;
153151grpc::Status status = sdk->GameServer (&gameserver);
154152if (!status.ok()) {...}
155153```
156154
157155To get [updates on the backing `GameServer`]({{< relref "_index.md#watchgameserver-function-gameserver" >}}) as they happen,
158- call `sdk->WatchGameServer([](agones::dev::sdk::GameServer gameserver){...})`.
156+ call `sdk->WatchGameServer([](const agones::dev::sdk::GameServer& gameserver){...})`.
159157
160158This will call the passed in `std::function`
161159synchronously (this is a blocking function, so you may want to run it in its own thread) whenever the backing `GameServer`
162160is updated.
163161
164162```cpp
165- sdk->WatchGameServer([](agones::dev::sdk::GameServer gameserver){
166- std::cout << "GameServer Update, name: " << gameserver.object_meta().name() << std::endl;
167- std::cout << "GameServer Update, state: " << gameserver.status().state() << std::endl;
163+ sdk->WatchGameServer([](const agones::dev::sdk::GameServer& gameserver){
164+ std::cout << "GameServer Update:\n" //
165+ << "\tname: " << gameserver.object_meta().name() << "\n" //
166+ << "\tstate: " << gameserver.status().state() << "\n"
167+ << std::flush;
168168});
169169```
170170{{% /feature %}}
0 commit comments