testing instance join
This commit is contained in:
Regular → Executable
+6
@@ -27,6 +27,12 @@ class MenuNavigation extends Phaser.Scene {
|
|||||||
.text(play.getCenter().x, play.getCenter().y, 'Play Cryps', TEXT.HEADER)
|
.text(play.getCenter().x, play.getCenter().y, 'Play Cryps', TEXT.HEADER)
|
||||||
.setOrigin(0.5, 0.5);
|
.setOrigin(0.5, 0.5);
|
||||||
play.on('pointerdown', () => {
|
play.on('pointerdown', () => {
|
||||||
|
const cryps = this.registry.get('cryps');
|
||||||
|
const crypJoinList = [0, 0, 0];
|
||||||
|
for (let i = 0; i <= 2; i += 1) {
|
||||||
|
crypJoinList[i] = cryps[i].id;
|
||||||
|
}
|
||||||
|
ws.sendInstanceJoin(crypJoinList);
|
||||||
this.selectMode(ws);
|
this.selectMode(ws);
|
||||||
play.destroy();
|
play.destroy();
|
||||||
playText.destroy();
|
playText.destroy();
|
||||||
|
|||||||
Regular → Executable
+10
@@ -81,6 +81,10 @@ function createSocket(events) {
|
|||||||
send({ method: 'cryp_unspec', params: { id, spec } });
|
send({ method: 'cryp_unspec', params: { id, spec } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sendPlayerCrypsSet(instanceId) {
|
||||||
|
send({ method: 'player_cryps_set', params: { instance_id: instanceId } });
|
||||||
|
}
|
||||||
|
|
||||||
function sendPlayerState(instanceId) {
|
function sendPlayerState(instanceId) {
|
||||||
send({ method: 'player_state', params: { instance_id: instanceId } });
|
send({ method: 'player_state', params: { instance_id: instanceId } });
|
||||||
}
|
}
|
||||||
@@ -132,6 +136,10 @@ function createSocket(events) {
|
|||||||
send({ method: 'zone_close', params: { zone_id: zoneId } });
|
send({ method: 'zone_close', params: { zone_id: zoneId } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sendInstanceJoin(cryps) {
|
||||||
|
send({ method: 'instance_join', params: { cryp_ids: cryps } });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------
|
// -------------
|
||||||
// Incoming
|
// Incoming
|
||||||
@@ -280,6 +288,8 @@ function createSocket(events) {
|
|||||||
sendZoneCreate,
|
sendZoneCreate,
|
||||||
sendZoneJoin,
|
sendZoneJoin,
|
||||||
sendZoneClose,
|
sendZoneClose,
|
||||||
|
sendInstanceJoin,
|
||||||
|
sendPlayerCrypsSet,
|
||||||
sendPlayerState,
|
sendPlayerState,
|
||||||
sendVboxAccept,
|
sendVboxAccept,
|
||||||
sendVboxApply,
|
sendVboxApply,
|
||||||
|
|||||||
Reference in New Issue
Block a user