Is there a case that client fails to send messages to server but still receives patches from server for a while?

15 Aug 2022, 08:41

We use the Colyseus (0.14) client for Unity and have run into an issue: Player A seems to fail to send messages to the server so that other players cannot see him move. But interestingly, he still can see other players move around. This persists for about 1 minute before onLeave() is triggered on him.

15 Aug 2022, 13:19

Any log or errors? If not, probably because of the network lagging.

15 Aug 2022, 14:56

@coco No error logs on both sides, unfortunately.

16 Aug 2022, 03:02

Do you all maybe know if a Colyseus client can ping the server?

16 Aug 2022, 10:48

@duong2179

Yes, there's a ping function inside Colyseus:

v0.15:

import { Server } from "colyseus";
import { WebSocketTransport } from "@colyseus/ws-transport";
const gameServer = new Server({
    transport: new WebSocketTransport({
        server: http.createServer(app),
        pingInterval: 5000,
        pingMaxRetries: 3,
    })
});

before v0.15:

import { Server } from "colyseus";
const gameServer = new Server({
    server: http.createServer(app),
    pingInterval: 5000,
    pingMaxRetries: 3,
})
16 Aug 2022, 10:51

@COCO Thank you. But I am asking about pinging from client to server...

16 Aug 2022, 15:52

@duong2179

Then you can send something by client, and timing yourself.