Navigation

    Colyseus
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. halome
    H

    halome

    @halome

    Chat Follow Unfollow
    0
    Reputation
    14
    Posts
    2033
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

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

    Posts made by halome

    RE: Webpack bundle colyseus typescript

    @endel
    Ok, so i ended up with p2.js on the server side and this is working and looking really great.
    Synchro between clients is perfectly matched and its really lightweigt :)
    When i will make something trully playable then i can provide that to you so you could put that as example if you want to :)

    Please take a look at this gif: https://imgur.com/7t17Qfw

    Cheers

    posted in Questions & Help •
    RE: Webpack bundle colyseus typescript

    @endel

    I want to create client with Phaser so i thought it would be good idea to have Phaser on server side too, so the physics and whole logic would be on server etc.
    So how to make that properly? Maybe i should create some kind of HEADLESS Phaser client that will be treat as another server that the Colysues one will ask for every states? What do you thing about that or please let me know what is the best proper way. I dont want to give client physics to simulate etc.

    posted in Questions & Help •
    RE: Webpack bundle colyseus typescript

    @endel
    What i am trying is to combine Colyseus server with Phaser.
    I wish to make that in TypeScript so that's why i am doing that with webpack because otherwise Phaser-ce wouldnt work because there is some troubles with PIXI there.
    So i am trying to pack everything with Webpack but then i got those errors i sent earlier.
    Try to build app with Colyseus server + Phaser-CE :)

    posted in Questions & Help •
    RE: Webpack bundle colyseus typescript

    Nah, dont working

    posted in Questions & Help •
    RE: Webpack bundle colyseus typescript

    Ok, i am trying to build phaser as local module right now and import that via npm, seems like it hase sense

    posted in Questions & Help •
    RE: Webpack bundle colyseus typescript

    Hi @endel
    but i want to use server-side :)

    posted in Questions & Help •
    RE: Webpack bundle colyseus typescript

    i forgot to show you errors and my configuration

    errors:

    WARNING in ./node_modules/cluster/lib/master.js
    133:18-52 Critical dependency: the request of a dependency is an expression
     @ ./node_modules/cluster/lib/master.js
     @ ./node_modules/cluster/lib/cluster.js
     @ ./node_modules/cluster/index.js
     @ ./node_modules/colyseus/lib/ClusterServer.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/express/lib/view.js
    81:13-25 Critical dependency: the request of a dependency is an expression
     @ ./node_modules/express/lib/view.js
     @ ./node_modules/express/lib/application.js
     @ ./node_modules/express/lib/express.js
     @ ./node_modules/express/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_linux_46.node
    Module parse failed: Unexpected character '' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_linux_47.node
    Module parse failed: Unexpected character '' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_linux_57.node
    Module parse failed: Unexpected character '' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_linux_48.node
    Module parse failed: Unexpected character '' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_linux_51.node
    Module parse failed: Unexpected character '' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_darwin_46.node
    Module parse failed: Unexpected character '�' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_darwin_48.node
    Module parse failed: Unexpected character '�' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_darwin_57.node
    Module parse failed: Unexpected character '�' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_darwin_47.node
    Module parse failed: Unexpected character '�' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_darwin_51.node
    Module parse failed: Unexpected character '�' (1:0)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_win32_48.node
    Module parse failed: Unexpected character '�' (1:2)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_win32_51.node
    Module parse failed: Unexpected character '�' (1:2)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    WARNING in ./node_modules/uws/uws_win32_57.node
    Module parse failed: Unexpected character '�' (1:2)
    You may need an appropriate loader to handle this file type.
    (Source code omitted for this binary file)
     @ ./node_modules/uws ^\.\/uws_.*$
     @ ./node_modules/uws/uws.js
     @ ./node_modules/colyseus/lib/Server.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    ERROR in ./node_modules/cluster/lib/master.js
    Module not found: Error: Can't resolve 'child_process' in 'D:\projekty\unity\UnitySocketIO\server_colyseus_typescript_phaser\node_modules\cluster\lib'
     @ ./node_modules/cluster/lib/master.js 15:12-36
     @ ./node_modules/cluster/lib/cluster.js
     @ ./node_modules/cluster/index.js
     @ ./node_modules/colyseus/lib/ClusterServer.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    ERROR in ./node_modules/cluster/lib/worker.js
    Module not found: Error: Can't resolve 'child_process' in 'D:\projekty\unity\UnitySocketIO\server_colyseus_typescript_phaser\node_modules\cluster\lib'
     @ ./node_modules/cluster/lib/worker.js 13:12-36
     @ ./node_modules/cluster/lib/master.js
     @ ./node_modules/cluster/lib/cluster.js
     @ ./node_modules/cluster/index.js
     @ ./node_modules/colyseus/lib/ClusterServer.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    ERROR in ./node_modules/colyseus/lib/cluster/Master.js
    Module not found: Error: Can't resolve 'child_process' in 'D:\projekty\unity\UnitySocketIO\server_colyseus_typescript_phaser\node_modules\colyseus\lib\cluster'
     @ ./node_modules/colyseus/lib/cluster/Master.js 5:20-44
     @ ./node_modules/colyseus/lib/ClusterServer.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    ERROR in ./node_modules/cluster/lib/master.js
    Module not found: Error: Can't resolve 'dgram' in 'D:\projekty\unity\UnitySocketIO\server_colyseus_typescript_phaser\node_modules\cluster\lib'
     @ ./node_modules/cluster/lib/master.js 25:12-28
     @ ./node_modules/cluster/lib/cluster.js
     @ ./node_modules/cluster/index.js
     @ ./node_modules/colyseus/lib/ClusterServer.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    ERROR in ./node_modules/cluster/lib/master.js
    Module not found: Error: Can't resolve 'dns' in 'D:\projekty\unity\UnitySocketIO\server_colyseus_typescript_phaser\node_modules\cluster\lib'
     @ ./node_modules/cluster/lib/master.js 440:6-20
     @ ./node_modules/cluster/lib/cluster.js
     @ ./node_modules/cluster/index.js
     @ ./node_modules/colyseus/lib/ClusterServer.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    
    ERROR in ./node_modules/cluster/lib/plugins/repl.js
    Module not found: Error: Can't resolve 'repl' in 'D:\projekty\unity\UnitySocketIO\server_colyseus_typescript_phaser\node_modules\cluster\lib\plugins'
     @ ./node_modules/cluster/lib/plugins/repl.js 13:11-26
     @ ./node_modules/cluster/lib/plugins ^\.\/.*$
     @ ./node_modules/cluster/lib/cluster.js
     @ ./node_modules/cluster/index.js
     @ ./node_modules/colyseus/lib/ClusterServer.js
     @ ./node_modules/colyseus/lib/index.js
     @ ./index.ts
    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! colyseus-examples@1.0.0 webpack:dev: `webpack --config webpack.config.dev.js --progress --colors`
    npm ERR! Exit status 2
    npm ERR!
    npm ERR! Failed at the colyseus-examples@1.0.0 webpack:dev script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\Rafal\AppData\Roaming\npm-cache\_logs\2018-01-21T20_32_39_923Z-debug.log
    

    webpack.config

    const webpack = require('webpack');
    const path = require('path');
    
    const phaserModule = path.join(__dirname, '/node_modules/phaser-ce/build/custom/');
    const assets = path.join(__dirname, 'assets/');
    const phaser = path.join(phaserModule, 'phaser-split.js'); 
    const pixi = path.join(phaserModule, 'pixi.js');
    const p2 = path.join(phaserModule, 'p2.js');
    
    module.exports = {
        entry: path.join(__dirname, 'index.ts'),
        output: {
            path: path.join(__dirname, 'dist'),
            filename: 'server.js'
        },
    
        module: {
            rules: [
                { test: /\.ts$/, enforce: 'pre', loader: 'tslint-loader' },
                { test: /assets(\/|\\)/, loader: 'file-loader?name=assets/[hash].[ext]' },
                { test: /pixi\.js$/, loader: 'expose-loader?PIXI' },
                { test: /phaser-split\.js$/, loader: 'expose-loader?Phaser' },
                { test: /p2\.js$/, loader: 'expose-loader?p2' },
                { test: /\.ts$/, loader: 'ts-loader', exclude: '/node_modules/' }
            ]
        },
    
        node: {
            fs: 'empty',
            net: 'empty',
            tls: 'empty',
        },
    
        resolve: {
            extensions: ['.ts', '.js'],
            alias: {
                pixi: path.join(__dirname, 'node_modules/phaser-ce/build/custom/pixi.js'),
                phaser: path.join(__dirname, 'node_modules/phaser-ce/build/custom/phaser-split.js'),
                p2: path.join(__dirname, 'node_modules/phaser-ce/build/custom/p2.js'),
                assets: path.join(__dirname, 'assets/')
            }
        },
    
        devtool: 'source-map',
    };
    
    posted in Questions & Help •
    Webpack bundle colyseus typescript

    Hey,

    have anyone of you ever used Webpack with colyseus? I am trying to pack it to the bundle.js file but i have got a lot of errors.
    If you know how to do that (have proper configs/package.json/webpack.config.js) then please let me know

    Cheers!

    posted in Questions & Help •
    Sending actions

    Hello again,

    i realised now that Colyseus is not like Socket.io, you dont send actions, you send patches with newest values of server state.
    But what if i want to send some action to the client?

    For example, imagine any 3D game with gathering. One player is grabing something from the ground, i want to make other players know about this, for example to play the bend down animation of this player. How to make this?

    How to notify other players that this one is grabbing some stuff from the floor RIGHT NOW to play proper animation and then notify that it ends grabbing this stuff to show another animation with standing of the player.

    Cheers!

    posted in Questions & Help •
    RE: Unity3d request position at time

    But i am using NevMashNavigator in Unity3D Client.

    To do in the way you told me i should move that logic to the server and server should push the player forward in some direction, i am right?

    posted in Questions & Help •