@google-cloud/agones-sdk 1.29.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -26,5 +26,5 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
- "version": "1.29.0"
29
+ "version": "1.30.0"
30
30
  }
@@ -0,0 +1,86 @@
1
+ // Copyright 2023 Google LLC All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import Alpha from './alpha';
16
+
17
+ type Seconds = number;
18
+
19
+ type GameServer = {
20
+ objectMeta: {
21
+ name: string;
22
+ namespace: string;
23
+ uid: string;
24
+ resourceVersion: string;
25
+ generation: number;
26
+ creationTimestamp: number;
27
+ deletionTimestamp: number;
28
+ annotationsMap: [string, string][];
29
+ labelsMap: [string, string][];
30
+ };
31
+ spec: {
32
+ health: {
33
+ disabled: boolean;
34
+ periodSeconds: number;
35
+ failureThreshold: number;
36
+ initialDelaySeconds: number;
37
+ };
38
+ };
39
+ status: {
40
+ state:
41
+ | 'Scheduled'
42
+ | 'Reserved'
43
+ | 'RequestReady'
44
+ | 'Ready'
45
+ | 'Shutdown'
46
+ | 'Allocated'
47
+ | 'Unhealthy';
48
+ address: string;
49
+ portsList: {
50
+ name: string;
51
+ port: number;
52
+ }[];
53
+ };
54
+ };
55
+
56
+ export declare class AgonesSDK {
57
+ constructor();
58
+
59
+ alpha: Alpha
60
+
61
+ get port(): string
62
+
63
+ connect(): Promise<void>
64
+
65
+ close(): void
66
+
67
+ ready(): Promise<Record<string, any>>
68
+
69
+ allocate(): Promise<Record<string, any>>
70
+
71
+ shutdown(): Promise<Record<string, any>>
72
+
73
+ health(errorCallback: (error: any) => any): void
74
+
75
+ getGameServer(): Promise<GameServer>
76
+
77
+ watchGameServer(callback: (gameServer: GameServer) => any, errorCallback: (error: any) => any): void
78
+
79
+ setLabel(key: string, value: string): Promise<Record<string, any>>
80
+
81
+ setAnnotation(key: string, value: string): Promise<Record<string, any>>
82
+
83
+ reserve(duration: Seconds): Promise<Record<string, any>>
84
+ }
85
+
86
+ export default AgonesSDK
package/src/alpha.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ // Copyright 2023 Google LLC All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ type PlayerId = string;
16
+
17
+ declare class Alpha {
18
+ playerConnect(playerID: PlayerId): Promise<boolean>
19
+
20
+ playerDisconnect(playerID: PlayerId): Promise<boolean>
21
+
22
+ setPlayerCapacity(capacity: number): Promise<Record<string, any>>
23
+
24
+ getPlayerCapacity(): Promise<number>
25
+
26
+ getPlayerCount(): Promise<number>
27
+
28
+ isPlayerConnected(playerID: PlayerId): Promise<boolean>
29
+
30
+ getConnectedPlayers(): Promise<PlayerId[]>
31
+ }
32
+
33
+ export default Alpha;
package/src/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ // Copyright 2023 Google LLC All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ export { default } from './agonesSDK';