You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4225416
Browse filesBrowse the repository at this point in the historyBrowse files
Alpha SDK and example for Node.js (Player tracking) (agones-dev#1658)
* update dependencies in sdk and example
* update build and generate pb
* add alpha sdk
* export sdk and alpha sdk
* cleanup nodejs-simple
* add nodejs-alpha example
Co-authored-by: Mark Mandel <markmandel@google.com>
Copy file name to clipboardExpand all lines: examples/nodejs-simple/README.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@ It will:
12
12
- After the shutdown duration (default 60 seconds), shut the server down
13
13
- Parse options to get help or set the shutdown timeout duration
14
14
15
+
If alpha features are enabled it will additionally:
16
+
- Set and get the player capacity (this is not enforced)
17
+
- Add, get and remove players, and test if they are present
18
+
15
19
To learn how to deploy this example service to GKE, please see the tutorial [Build and Run a Simple Gameserver (node.js)](https://agones.dev/site/docs/tutorials/simple-gameserver-nodejs/).
16
20
17
21
## Building
@@ -56,7 +60,7 @@ Connecting to the SDK server...
56
60
...connected to SDK server
57
61
```
58
62
59
-
To see help, pass `--help` as the argument (all are equivalent):
63
+
To see help, pass `--help` as the argument (use the preferred command below, all are equivalent):
60
64
```
61
65
$ make args="--help" run
62
66
$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.5 --help
@@ -76,4 +80,16 @@ To make run indefinitely use the special timeout value of 0:
76
80
$ make args="--timeout=0" run
77
81
$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.5 --timeout=0
78
82
$ npm start -- --timeout=0
79
-
```
83
+
```
84
+
85
+
To enable alpha features ensure the feature gate is enabled:
86
+
```bash
87
+
$ cd ../../build; make run-sdk-conformance-local TIMEOUT=120 FEATURE_GATES="PlayerTracking=true" TESTS=ready,watch,health,gameserver
88
+
```
89
+
90
+
Then enable the alpha suite:
91
+
```
92
+
$ make args="--alpha" run
93
+
$ docker run --network=host gcr.io/agones-images/nodejs-simple-server:0.5 --alpha
console.log(`Example to call each SDK feature in turn. Once complete will call shutdown and close after a default timeout of ${DEFAULT_TIMEOUT} seconds.\n\nOptions:\n\t--timeout=...\t\tshutdown timeout in seconds. Use 0 to never shut down`);
169
+
console.log(`Example to call each SDK feature in turn. Once complete will call shutdown and close after a default timeout of ${DEFAULT_TIMEOUT} seconds.
170
+
171
+
Options:
172
+
--timeout=...\t\tshutdown timeout in seconds. Use 0 to never shut down
173
+
--alpha\t\t\tenable alpha features`);
104
174
return;
105
175
}
106
176
if(argName==='--timeout'){
@@ -116,6 +186,11 @@ for (let arg of args) {
116
186
console.log(`Using shutdown timeout of ${timeout} seconds`);
0 commit comments