Skip to content

Commit

Permalink
3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RSamaium committed Oct 20, 2023
1 parent cf3ce93 commit ee1c9d5
Show file tree
Hide file tree
Showing 8 changed files with 376 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sync-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-room-client",
"version": "2.0.6",
"version": "3.0.0",
"description": "",
"main": "./dist/simple-room-client.umd.cjs",
"module": "./lib/index.js",
Expand Down
23 changes: 23 additions & 0 deletions sync-server/chat/room.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export class ChatRoom {
$schema = {
messages: [String]
}

$actions = {
message: true
}

messages: string[] = []

onJoin (client) {
this.messages.push(`${ client.id } joined.`)
}

onLeave (client) {
this.messages.push(`${ client.id } left.`)
}

message(client, message) {
this.messages.push(`${ client.id } ${message}`)
}
}
5 changes: 4 additions & 1 deletion sync-server/examples/node/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { createServer } from 'http';
import { Server } from 'socket.io';
import { World, Transmitter, Utils } from 'simple-room';
import { World } from 'simple-room';
import Room from './room.js';
import Player from './player.js'
import jwt from 'jsonwebtoken'
import AgonesSDK from '@google-cloud/agones-sdk'

const SECRET_KEY = 'shhhhh'

Expand Down Expand Up @@ -31,6 +32,8 @@ const io = new Server(httpServer, {
}
});

World.setAgones(new AgonesSDK() as any)

World.transport(io, {
maxKbpsIncoming: 0.2,
clientCanJoinRoom: true,
Expand Down
Loading

0 comments on commit ee1c9d5

Please sign in to comment.