GitHub Documentation Patreon donate button

Private Schema variable? inside Player instead of State Schema?



  • export class Player extends Schema {
    @type("number")
    x = Math.floor(Math.random() * 400);
    @type("number")
    y = Math.floor(Math.random() * 400);
    @type("number")
    cx = 0;
    @type("number")
    cy = 0;
    }

    export class State extends Schema {
    @type({
    map: Player
    })
    players = new MapSchema < Player > ();

    }

    i want some of my variables not sent over client inisde player schema



  • it seams remove @type("number") to some variable makes it private over the network


 

GitHub Documentation Patreon donate button

© 2019 Endel Dreyer