Giter Site home page Giter Site logo

colyseus-monitor's Introduction



Discussion forum

Multiplayer Framework for Node.js.
View documentation

Colyseus is an Authoritative Multiplayer Framework for Node.js, with SDKs available for the Web, Unity, Defold, Haxe, Cocos and Construct3. (See official SDKs)

The project focuses on providing synchronizable data structures for realtime and turn-based games, matchmaking, and ease of usage both on the server-side and client-side.

The mission of the framework is to be a standard netcode & matchmaking solution for any kind of project you can think of!

Key features:

  • WebSocket-based communication
  • Simple API in the server-side and client-side.
  • Automatic state synchronization from server-to-client (delta compressed)
  • Matchmaking clients into game rooms/sessions
  • Scale vertically or horizontally

See public roadmap for future plans.

๐Ÿš€ Quickstart

Create a bare-bones Colyseus server by using npm create colyseus-app@latest:

npm create colyseus-app@latest my-colyseus-server
cd my-colyseus-server
npm start

Sponsors

The sustainability of the project relies on Colyseus Cloud subscriptions and sponsorships. If you are not using Colyseus Cloud, please consider sponsoring the project ๐Ÿ’–

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Aymeric Chauvin

๐Ÿ’ฌ ๐Ÿ’ก

Brian Hay

๐Ÿ–‹

Damian A. Pastorini

๐Ÿ’ฌ ๐Ÿ“– ๐Ÿ›

Darek Greenly

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป

David Rydwanski

๐Ÿ’ฌ ๐Ÿ’ป

Dr. Burton

๐Ÿง‘โ€๐Ÿซ

Endel Dreyer

๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก

Enriqueto

๐Ÿ’ผ

Fazri Zubair

๐Ÿ’ผ

Federico

๐Ÿ› ๐Ÿ’ป

James Jacoby

๐Ÿ’ฌ ๐Ÿ’ก ๐Ÿ–‹

Jonas Voland

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป ๐Ÿค” ๐Ÿ’ก

Kyle J. Kemp

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป ๐Ÿค”

Luke Wood

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป

Milad Doorbash

๐Ÿ› ๐Ÿ’ป

Nikita Borisov

๐Ÿ› ๐Ÿ’ป ๐Ÿ’ผ ๐Ÿค”

Phil Harvey

๐Ÿ“–

Sergey

๐Ÿ› ๐Ÿ’ป

Tom

๐Ÿ’ฌ ๐Ÿ› ๐Ÿค”

Tommy Leung

๐Ÿง‘โ€๐Ÿซ

digimbyte

๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind are welcome!

Contributing

We encourage you to contribute to Colyseus! Please check out the Contributing guide for guidelines about how to proceed. Join us!

Everyone interacting in Colyseus and its sub-projects' codebases, issue trackers and chat rooms is expected to follow the code of conduct.

License

MIT

colyseus-monitor's People

Contributors

endel avatar jarvizx avatar jesgonzalezgc avatar seiyria avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colyseus-monitor's Issues

Feature Request: Sort Clients numerically

Currently, the sorting on the "Clients" column is alphabetic, so sorting in reverse order gives 9,99,8,800,...,100,10,1
Which is not very useful. I know the columns are semi dynamic, and won't have type information for the metadata columns, but I think the 'clients' column just needs to be tagged as a 'number' column in MUI

Could not find a declaration file for module '@colyseus/monitor'

I can see that the code of this library is typed but when I import this library with vscode I get this error:

Could not find a declaration file for module '@colyseus/monitor'. '/Users/miguel/src/later/node_modules/@colyseus/monitor/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/colyseus__monitor` if it exists or add a new declaration (.d.ts) file containing `declare module 'colyseus__monitor';`

I tried to run "npm install @types/colyseus__monitor" but it didn't worked

cannot see all rooms

Unfortunately, the latest colyseus monitor doesn't allow us to find all the rooms.
It is limited to maybe a few hundred rooms that are displayed. We have over 3000. Previously, we could find the long list.

All of the rooms are in the data. If we sort, we get different rooms displayed. But, since there is no search, we cannot find the rooms we need to find to kill or inspect.

run in "administrative mode"

From what I can see, this can be a pretty powerful debug tool, but it also has some handy diagnostic information. It would be helpful to be able to say "run in administrative mode on this route [aka: allow dispose, broadcast, send], but run in view-only mode on this route"

The benefit is that I can put this in prod and not have random people disposing my rooms.

Add processId to MonitorOptions columns

Is there any intention to permit showing the processId in the monitor? It's already working but I need to add a ts-ignore:

// @ts-ignore 
app.use("/colyseus", authMiddleware, monitor({ columns: ['roomId', "processId"] }));

Server crashes when room is disposed from inspection view

When disposing a room by clicking on the button "DISPOSE ROOM" in the inspection view, the colyseus server crashes with the following error:

TypeError: First argument must be a valid error code number
at Sender.close ([...]\node_modules@colyseus\ws-transport\node_modules\ws\lib\sender.js:116:13)
at WebSocket.close ([...]\node_modules@colyseus\ws-transport\node_modules\ws\lib\websocket.js:287:18)
at WebSocketClient.leave ([...]\node_modules@colyseus\ws-transport\build\WebSocketClient.js:82:14)
at [...]\node_modules@colyseus\core\build\Room.js:523:56

I tracked down the error to

this.roomCall('disconnect', this.state.roomId).
in combination with
return remoteRoomCall(roomId, method, ...args).
where the disconnect method is called with the room id as argument. This room id ends up as argument for closeCode in https://github.com/colyseus/colyseus/blob/0e69c0aade7445cdb1dca270d5f7143f478b867d/packages/core/src/Room.ts#L501 which ultimately results in the above error in the ws library.

In comparison, the dispose button in the list view works just fine, because it does not pass any arguments to the disconnect method:

await remoteRoomCall(roomId, "disconnect");

Removing the room id in the first mentioned code line should probably get rid of the error.

Monitor doesn't work with Colyseus v0.9.18

After upgrading my colyseus server to v0.9.18, the monitor no longer shows any rooms or clients. It was working fine on 0.9.15. All I get now is the monitor page that isn't populated with any data.

v11 negative clients - handler not visible

Hey just updated every colyseus module to v11.

Env:
"@colyseus/monitor": "^0.11.0",
"@colyseus/schema": "^0.4.54",
"@colyseus/social": "^0.11.0",
"colyseus": "^0.11.0-alpha.4",

  1. the handler field is blank.
  2. The amount of players is negative.
  3. Also the elapsedTime shows "less than a second" always.

monitor_err

Tried:

  • Reload the page multiple times

Note:

  • By opening the room by Inspect button shows a valid state of the players amount.

Update 1:

  • By updating the server "colyseus": "^0.11.0-alpha.4", -> "colyseus": "0.11.8" solves the clients amount and the time, however the handler still not visible

Room is undefined in inspect view

In list view, it shows 2 clients in the room.

image

Upon inspection, room is undefined and there are 0 clients.

image

State showing 0 items:

image

Console output showing 2 clients joined:

image

Client correctly gets room state:

image

React code:

import * as Colyseus from "colyseus.js";

function App() {
  var client = new Colyseus.Client("ws://localhost:2567");
  let room: Colyseus.Room;

  const joinRoom = async () => {
    room = await client.joinOrCreate("cg_chess");
    console.log(room.state);
  };

  return (
    <>
      <div>
        <button onClick={joinRoom}>
          Join Room
        </button>
     </div>
    </>
  );
}

Server code:

export class CGChess extends Room<CGChessState> {
  chess: Chess;
  constructor() {
    super();
    this.chess = new Chess();
  }

  maxClients = 2;

  onCreate (options: any) {
    this.setState(new CGChessState());
  }

  onJoin (client: Client, options: any) {
    this.state.players.set(client.sessionId, new Player());
    if (this.state.players.size === 2) {
      this.lock();
    }
  }
}

This might be related to #22 . I am using version 0.15.

"@colyseus/monitor": "^0.15.0",
"@colyseus/playground": "^0.15.3",
"@colyseus/tools": "^0.15.0",
"colyseus": "^0.15.0",

Other notes:

  • On Playground, creating/joining room, setting up state, and onMessage() works properly.
  • Same behavior occurs when only joining with 1 user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.