-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
681 additions
and
445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,45 @@ | ||
{ | ||
"private": true, | ||
"name": "my-app", | ||
"version": "1.0.0", | ||
"description": "Usage Examples of Colyseus Game Server", | ||
"main": "index.js", | ||
"description": "npm init template for bootstrapping an empty Colyseus project", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"start": "ts-node index.ts", | ||
"schema-codegen": "schema-codegen rooms/TestRoom.ts --haxe --output ../heaps/src/" | ||
}, | ||
"engines": { | ||
"node": ">=14.0.0" | ||
"start": "ts-node-dev --respawn --transpile-only src/index.ts", | ||
"tsx": "tsx watch src/index.ts", | ||
"loadtest": "ts-node loadtest/example.ts --room my_room --numClients 99", | ||
"build": "npm run clean && tsc && node node_modules/copyfiles/copyfiles package.json ./lib && node node_modules/copyfiles/copyfiles arena.env ./lib", | ||
"clean": "node node_modules/rimraf/bin lib", | ||
"test": "mocha --require ts-node/register test/**_test.ts --exit --timeout 15000" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@colyseus/monitor": "^0.14.3", | ||
"colyseus": "^0.14.0", | ||
"cors": "^2.8.5", | ||
"express": "^4.14.0", | ||
"serve-index": "^1.8.0", | ||
"superagent": "^3.8.1" | ||
"license": "UNLICENSED", | ||
"bugs": { | ||
"url": "https://github.com/colyseus/create-colyseus/issues" | ||
}, | ||
"homepage": "https://github.com/colyseus/create-colyseus#readme", | ||
"devDependencies": { | ||
"ts-node": "^8.10.2", | ||
"typescript": "^3.5.3" | ||
"@colyseus/loadtest": "^0.15.0-preview.10", | ||
"@colyseus/testing": "^0.15.0-preview.1", | ||
"@types/cors": "^2.8.6", | ||
"@types/express": "^4.17.1", | ||
"@types/mocha": "^8.2.3", | ||
"copyfiles": "^2.4.1", | ||
"mocha": "^9.0.2", | ||
"rimraf": "^2.7.1", | ||
"ts-node": "^10.9.1", | ||
"ts-node-dev": "^2.0.0", | ||
"tsx": "^3.12.7", | ||
"typescript": "^5.0.4" | ||
}, | ||
"dependencies": { | ||
"@colyseus/core": "^0.15.0-preview.8", | ||
"@colyseus/monitor": "^0.15.0-preview.3", | ||
"@colyseus/redis-driver": "^0.15.0-preview.0", | ||
"@colyseus/redis-presence": "^0.15.0-preview.2", | ||
"@colyseus/tools": "^0.15.0-preview.10", | ||
"colyseus": "^0.15.0-preview.4", | ||
"cors": "^2.8.5", | ||
"express": "^4.16.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import config from "@colyseus/tools"; | ||
|
||
import { WebSocketTransport } from "@colyseus/ws-transport"; | ||
import { monitor } from "@colyseus/monitor"; | ||
|
||
import { RedisDriver } from "@colyseus/redis-driver"; | ||
import { RedisPresence } from "@colyseus/redis-presence"; | ||
|
||
/** | ||
* Import your Room files | ||
*/ | ||
import { MyRoom } from "./rooms/MyRoom"; | ||
|
||
export default config({ | ||
getId: () => "Your Colyseus App", | ||
|
||
options: { | ||
devMode: true, | ||
driver: new RedisDriver(), | ||
presence: new RedisPresence(), | ||
}, | ||
|
||
initializeTransport: (options) => new WebSocketTransport(options), | ||
|
||
initializeGameServer: (gameServer) => { | ||
/** | ||
* Define your room handlers: | ||
*/ | ||
gameServer.define('my_room', MyRoom); | ||
|
||
}, | ||
|
||
initializeExpress: (app) => { | ||
/** | ||
* Bind your custom express routes here: | ||
*/ | ||
app.get("/", (req, res) => { | ||
res.send(`Instance ID => ${process.env.NODE_APP_INSTANCE ?? "NONE"}`); | ||
}); | ||
|
||
/** | ||
* Bind @colyseus/monitor | ||
* It is recommended to protect this route with a password. | ||
* Read more: https://docs.colyseus.io/tools/monitor/ | ||
*/ | ||
app.use("/colyseus", monitor()); | ||
}, | ||
|
||
|
||
beforeListen: () => { | ||
/** | ||
* Before before gameServer.listen() is called. | ||
*/ | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* IMPORTANT: | ||
* --------- | ||
* Do not manually edit this file if you'd like to use Colyseus Arena | ||
* | ||
* If you're self-hosting (without Arena), you can manually instantiate a | ||
* Colyseus Server as documented here: 👉 https://docs.colyseus.io/server/api/#constructor-options | ||
*/ | ||
import { listen } from "@colyseus/tools"; | ||
|
||
// Import arena config | ||
import app from "./app.config"; | ||
|
||
// Create and listen on 2567 (or PORT environment variable.) | ||
listen(app); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "lib", | ||
"module": "commonjs", | ||
"lib": ["es6"], | ||
"target": "es2016", | ||
"declaration": true, | ||
"noImplicitAny": false, | ||
"experimentalDecorators": true, | ||
"sourceMap": false, | ||
"esModuleInterop": true | ||
}, | ||
"include": [ | ||
"**/*.ts" | ||
] | ||
"compilerOptions": { | ||
"outDir": "lib", | ||
"target": "es6", | ||
"module": "commonjs", | ||
"strict": true, | ||
"allowJs": true, | ||
"strictNullChecks": false, | ||
"esModuleInterop": true, | ||
"experimentalDecorators": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"useDefineForClassFields": false | ||
}, | ||
// other settings... | ||
"ts-node": { | ||
"esm": true, | ||
"experimentalSpecifierResolution": "node" | ||
}, | ||
|
||
"include": [ | ||
"src" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
{ | ||
"name": "colyseus", | ||
"url" : "https://github.com/colyseus/colyseus-hx/", | ||
"url" : "https://github.com/colyseus/colyseus-haxe/", | ||
"license": "MIT", | ||
"tags": ["multiplayer", "networking", "websockets", "netcode"], | ||
"description": "Multiplayer Game Client for Haxe", | ||
"version": "0.14.10", | ||
"version": "0.15.0", | ||
"classPath": "src/", | ||
"releasenote": "Aidan's fixes for Haxe 4.2", | ||
"releasenote": "Compatible with new version 0.15 of Colyseus server", | ||
"contributors": ["endel"], | ||
"dependencies": { | ||
"colyseus-websocket": "1.0.7" | ||
"colyseus-websocket": "1.0.12", | ||
"tink_url": "0.5.0", | ||
"tink_await": "0.6.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
-cp src | ||
-cp tests | ||
-lib colyseus-websocket | ||
-lib tink_url | ||
# use deprecated haxe.unit.TestCase | ||
-lib hx3compat |
Oops, something went wrong.