@colyseus/monitor
Advanced tools
Comparing version 0.15.6 to 0.16.0-preview.0
@@ -18,3 +18,6 @@ "use strict"; | ||
// TODO: `Serializer<T>` should provide a method for this (e.g. `serializer.hasState()`) | ||
const hasState = (room._serializer.state || room._serializer.previousState); | ||
const hasState = (room._serializer.encoder || // schema v3 | ||
room._serializer.state || // schema v2 | ||
room._serializer.previousState // legacy-fossil-delta | ||
); | ||
const fullState = hasState && room._serializer.getFullState(); | ||
@@ -44,4 +47,8 @@ return fullState && (fullState.byteLength || fullState.length) || 0; | ||
const stateSize = getStateSize(this); | ||
const roomElapsedTime = this.clock.elapsedTime; | ||
const data = this.getAvailableData(); | ||
const clients = this.clients.map((client) => ({ sessionId: client.sessionId })); | ||
const clients = this.clients.map((client) => ({ | ||
sessionId: client.sessionId, | ||
elapsedTime: client._joinedAt - roomElapsedTime | ||
})); | ||
const locked = this.locked; | ||
@@ -48,0 +55,0 @@ return Object.assign(Object.assign({}, data), { locked, clients, state, stateSize }); |
import * as React from "react"; | ||
import 'react18-json-view/src/style.css'; | ||
export declare class RoomInspect extends React.Component { | ||
state: { | ||
roomId: any; | ||
state: {}; | ||
clients: any[]; | ||
maxClients: number; | ||
stateSize: number; | ||
locked: boolean; | ||
currentTab: string; | ||
sendDialogTitle: string; | ||
sendDialogOpen: boolean; | ||
sendToClient: any; | ||
sendType: string; | ||
sendData: any; | ||
}; | ||
interface Props { | ||
} | ||
interface State { | ||
roomId?: string; | ||
state: any; | ||
clients: Array<{ | ||
sessionId: string; | ||
elapsedTime: number; | ||
}>; | ||
maxClients: number; | ||
stateSize: number; | ||
locked: boolean; | ||
currentTab: string; | ||
sendDialogTitle: string; | ||
sendDialogOpen: boolean; | ||
sendToClient?: any; | ||
sendType: string; | ||
sendData: string; | ||
} | ||
export declare class RoomInspect extends React.Component<Props, State> { | ||
state: State; | ||
updateDataInterval: number; | ||
@@ -34,1 +40,2 @@ componentDidMount(): void; | ||
} | ||
export {}; |
{ | ||
"name": "@colyseus/monitor", | ||
"version": "0.15.6", | ||
"version": "0.16.0-preview.0", | ||
"description": "Web Monitoring Panel for Colyseus", | ||
@@ -33,4 +33,4 @@ "input": "./src/index.ts", | ||
"devDependencies": { | ||
"@colyseus/core": "^0.15.0", | ||
"@colyseus/playground": "^0.15.7", | ||
"@colyseus/core": "^0.16.0-preview.0", | ||
"@colyseus/playground": "^0.16.0-preview.0", | ||
"@emotion/react": "^11.11.1", | ||
@@ -47,3 +47,3 @@ "@emotion/styled": "^11.11.0", | ||
"@types/superagent": "^3.5.8", | ||
"colyseus": "^0.15.15", | ||
"colyseus": "^0.16.0-preview.0", | ||
"css-loader": "^0.28.11", | ||
@@ -50,0 +50,0 @@ "extract-text-webpack-plugin": "^4.0.0-beta.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26
2857607
6072