Navigation

    Colyseus
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. Michaelbest1
    M

    Michaelbest1

    @Michaelbest1

    Chat Follow Unfollow
    1
    Reputation
    6
    Posts
    1563
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Continue chat with Michaelbest1
      • Flag Profile
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    Michaelbest1 Follow

    Posts made by Michaelbest1

    RE: When working through https, access to the server is blocked by the browser, does it work through http?

    Succeded! Thanks very much!

    posted in General Discussion •
    How to config https server?

    Hi. I have to deploy my server to a platform that only allows https. I find the following doc: https://docs.colyseus.io/deployment/#nginx-recommended
    but I still don't know how to start the server because I'm starting just by executing comand npm start and the entry script is index.ts.
    Can anyone help me? Thanks!

    posted in Questions & Help •
    RE: When working through https, access to the server is blocked by the browser, does it work through http?

    Hi. Do you use nginx and pm2 for deployment? If so, how could you pack your web app and start it?

    posted in General Discussion •
    RE: [Bug] Uncaught TypeError: Colyseus.Client is not a constructor

    Hi @endel
    It WORKS! Thanks a lot!
    I learned just now that there're several ways of packing js. And maybe umd is suitable for CommonJS mentioned by @parkcd. So please use this way for future pack : )

    posted in Questions & Help •
    RE: [Bug] Uncaught TypeError: Colyseus.Client is not a constructor

    Hi @endel
    Thanks for your replay. Of course I've updated both server and client to latest version. The hash I shown is just the version that the dist file changed.
    I'm sorry that I'm not professional on JS. I've tried import, require and without any import but none of them works. If I use this:

    var Colyseus = require("colyseus");

    The error message is:

    ColyClient.js:16 Uncaught TypeError: Cannot read property 'Client' of undefined

    And if without any importing, the error message is:

    Colyseus is not defined

    The runtime of cocos creator is different from web browser. I think there is no global scope at all. If you want to use any module in js or ts, you have to import it or require it.
    So could you try cocos creator and find a solution? Thanks very much!

    posted in Questions & Help •
    [Bug] Uncaught TypeError: Colyseus.Client is not a constructor

    I have been using colyseus very well for a long time in Cocos Creator by importing dist/colyseus.js in my project. But recently when I updated it, both server and client, the client gave me error:

    Uncaught TypeError: Colyseus.Client is not a constructor

    And my code is the same with offical document:

    import * as Colyseus from "colyseus.js";
    var client = new Colyseus.Client('ws://localhost:2657');

    I checked file dist/colyseus.js and found it has changed a lot, which is seemed to be compiled and in just one line. The change ID is c4063f63ebfc4aadf39254d611ae8c81406ac203.

    I want to use consent argument in sever side for callback onLeave() so I have to update it.

    Can anyone help me? Thanks very much!

    posted in Questions & Help •