Ethereal-Software / virtual-world

Virtual world interaction
0 stars 0 forks source link

Websocket protocol #28

Open RoddoWasHere opened 4 years ago

RoddoWasHere commented 4 years ago

Register:

var clientRequest = {
    action: "register",
    id: null, //prevent re-reqister
}

var serverResponse = {
    action: "register",
    id: client.id,
    sourceId: client.playerAudio.audioSource3D.id,
    listenerId: client.playerAudio.audioListener3D.id,
    // send sources...etc
    sources: {
        "id": {...}
    },
    clients: {
        "id": {...}
    },
};
var clientUpdate = {
    position: camera.position.toArray(),
    direction: client3D.getFacingDirection(),
    sources: serialSources,
};