dist/server-module/lance-gg.js
/**
     * Add object to the game world.
     * On the client side, the object may not be created, if the server copy
     * of this object is already in the game world.  This could happen when the client
     * is using delayed-input, and the RTT is very low.
     *
     * @param {Object} object - the object.
     * @return {Object} the final object.
     */
Add object to the game world.
On the client side, the object may not be created, if the server copy
of this object is already in the game world.  This could happen when the client
is using delayed-input, and the RTT is very low.

@param {Object} object - the object.
@return {Object} the final object.
Add object to the game world . On the client side the object may not be created if the server copy of this object is already in the game world . This could happen when the client is using delayed - input and the RTT is very low . @param { Object } object - the object . @return { Object } the final object .
addObjectToWorld(object) {
        if (object.id >= this.options.clientIDSpace) {
            let serverCopyArrived = false;
            this.world.forEachObject((id, o) => {
                if (o.hasOwnProperty('inputId') && o.inputId === object.inputId) {
                    serverCopyArrived = true;
                    return false;
                }
            });
            if (serverCopyArrived) {
                this.trace.info(() => `========== shadow object NOT added ${object.toString()} ==========`);
                return null;
            }
        }
        this.world.addObject(object);
        if (typeof object.onAddToWorld === 'function')
            object.onAddToWorld(this);
        this.emit('objectAdded', object);
        this.trace.info(() => `========== object added ${object.toString()} ==========`);
        return object;
    }
addObjectToWorld ( object ) { if ( object . id >= this . options . clientIDSpace ) { let serverCopyArrived = false ; this . world . forEachObject ( ( id , o ) => { if ( o . hasOwnProperty ( 'inputId' ) && o . inputId === object . inputId ) { serverCopyArrived = true ; return false ; } } ) ; if ( serverCopyArrived ) { this . trace . info ( ( ) => ` ${ object . toString ( ) } ` ) ; return null ; } } this . world . addObject ( object ) ; if ( typeof object . onAddToWorld === 'function' ) object . onAddToWorld ( this ) ; this . emit ( 'objectAdded' , object ) ; this . trace . info ( ( ) => ` ${ object . toString ( ) } ` ) ; return object ; }
Add object to the game world.
Add object to the game world .
// if we are asked to create a local shadow object // the server copy may already have arrived. // tell the object to join the game, by creating // its corresponding physical entities and renderer entities.