dplusic / gamelift-nodejs-serversdk Goto Github PK
View Code? Open in Web Editor NEWUnofficial GameLift Server SDK for Node.js
Home Page: https://www.npmjs.com/package/@dplusic/gamelift-nodejs-serversdk
License: Apache License 2.0
Unofficial GameLift Server SDK for Node.js
Home Page: https://www.npmjs.com/package/@dplusic/gamelift-nodejs-serversdk
License: Apache License 2.0
GameLift Anywhere allows you to provision any machine (like a local dev machine) to be a part of a fleet. More info here: https://aws.amazon.com/blogs/aws/introducing-amazon-gamelift-anywhere-run-your-game-servers-on-your-own-infrastructure/
The main change required for GameLift-Nodejs-ServerSDK to be compatible with GameLift Anywhere would be the addition of a ServerParameters argument in InitSdk. More info via the GameLift Docs:
To initialize a server process on a Amazon GameLift Anywhere compute resource, call InitSdk() with the following ServerParameters:
- The URL of the websocket used to connect to your game server.
- The ID of the process used to host your game server.
- The ID of the compute hosting your game server processes.
- The ID of the GameLift fleet containing your Amazon GameLift Anywhere compute.
- The authorization token generated by the Amazon GameLift operation GetComputeAuthToken.
I would be happy to implement this if a PR would be accepted.
Hi,
I'm trying to use your ported sdk with a realtime script so I can test in local.
I'm wondering where I can use AcceptPlayerSession? I can't find any function to listen to incoming clients.
Could you help me? You seem way more advanced than me :)
I know this repo is rather old, just saving this issue here for posterity. I hope I can submit a PR for it some day.
I'm seeing this error on live servers in GameLift:
2023-05-03T18:57:05.064Z engine.io-client:socket socket receive: type "message", data "2["TerminateProcess","{\n \"terminationTime\": \"1683140584\"\n}"]"
2023-05-03T18:57:05.065Z socket.io-parser decoded 2["TerminateProcess","{\n \"terminationTime\": \"1683140584\"\n}"] as {"type":2,"nsp":"/","data":["TerminateProcess","{\n \"terminationTime\": \"1683140584\"\n}"]}
2023-05-03T18:57:05.067Z socket.io-client:socket emitting event ["TerminateProcess","{\n \"terminationTime\": \"1683140584\"\n}"]
2023-05-03T18:57:05.068Z ServerState ServerState got the terminateProcess signal. rawTerminationTime : {
"terminationTime": "1683140584"
}
2023-05-03 11:57:05.070 INFO GameLift: Process is exiting with code 1. Calling GameLiftServerAPI.Destroy()
2023-05-03 11:57:05.071 INFO GameLift: Disposing of GameLift
2023-05-03 11:57:05.074 INFO /local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/src/Server/ServerState.ts:308
this.terminationTime = deserialized.terminationTime.mul(1000 * 10000)
^
2023-05-03 11:57:05.077 INFO TypeError: deserialized.terminationTime.mul is not a function
at ServerState.<anonymous> (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/src/Server/ServerState.ts:308:61)
at step (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/dist/lib/Server/ServerState.js:32:23)
at Object.next (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/dist/lib/Server/ServerState.js:13:53)
at /local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/dist/lib/Server/ServerState.js:7:71
at new Promise (<anonymous>)
at __awaiter (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/dist/lib/Server/ServerState.js:3:12)
at /local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/src/Server/ServerState.ts:293:7
at ServerState.OnTerminateProcess (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/src/Server/ServerState.ts:312:7)
at Socket.<anonymous> (/local/game/server/node_modules/@dplusic/gamelift-nodejs-serversdk/src/Server/Network.ts:61:20)
at Socket.Emitter.emit (/local/game/server/node_modules/component-emitter/index.js:145:20)
It appears that terminationTime is assumed to be a Long at this point. I'm not sure what the value actually is, but there could be some additional checks / conversions to avoid this error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.