Skip to content

Commit

Permalink
Merge pull request #3 from davawen/main
Browse files Browse the repository at this point in the history
Add typescript server
  • Loading branch information
evolutionleo authored Feb 18, 2021
2 parents 4b32d03 + a8a94c4 commit 4dbb148
Show file tree
Hide file tree
Showing 8 changed files with 470 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@ if you write a wrapper
- Client runs as a usual GMS2 project
- To start the server - navigate to the folder and execute `node server.js`

## Typescript Server
### Installing
- Follow the original steps, but clone TypescriptServer/
- Install the [Typescript compiler](https://www.typescriptlang.org/) with `npm i -g typescript`

### Networking

| | |
--------|------------
| Send command | Use the `Client.write` function or add a wrapper in the `Client`class |
| Recieve command | Add a case in the `handlePacket` function |

### Running
- Compile the project by running `tsc` or run `tsc -w` to avoid recompiling after every change
- Run `node .` or `node dist/server.js`


## Credits
- [Messagepack](https://msgpack.org/) serialization format
- [@jujuadams](https://github.com/jujuadams)'s [SNAP](https://github.com/jujuadams/snap) library, which enables Messagepack's encoding/decoding inside GameMaker
Expand Down
Binary file added Release/TypescriptServer.zip
Binary file not shown.
2 changes: 2 additions & 0 deletions TypescriptServer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
276 changes: 276 additions & 0 deletions TypescriptServer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions TypescriptServer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "ponk",
"version": "0.0.1",
"private": true,
"description": "kappa",
"main": "dist/server.js",
"author": {
"name": "Evoleo"
},
"dependencies": {
"@msgpack/msgpack": "^2.3.0",
"@types/node": "^14.14.28",
"binary-parser": "^1.6.2",
"extend": "^3.0.2",
"minimist": "^1.2.5",
"mongoose": "^5.9.27",
"performance-now": "^2.1.0",
"underscore": "^1.10.2"
}
}
Loading

0 comments on commit 4dbb148

Please sign in to comment.