instance lists

This commit is contained in:
ntr
2019-04-25 15:31:57 +10:00
parent eb2089cc17
commit 2f4944db10
8 changed files with 67 additions and 41 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ class Home extends Phaser.Scene {
}
create() {
this.registry.get('ws').sendAccountPlayers();
this.registry.get('ws').sendAccountInstances();
this.registry.events.on('changedata', this.updateData, this);
this.registry.events.on('setdata', this.updateData, this);
+7 -7
View File
@@ -45,8 +45,8 @@ function createSocket(events) {
send({ method: 'account_cryps', params: {} });
}
function sendAccountPlayers() {
send({ method: 'account_players', params: {} });
function sendAccountInstances() {
send({ method: 'account_instances', params: {} });
}
function sendAccountZone() {
@@ -168,9 +168,9 @@ function createSocket(events) {
sendAccountCryps();
}
function accountPlayerList(res) {
const [struct, playerList] = res;
events.setPlayerList(playerList);
function accountInstanceList(res) {
const [struct, instanceList] = res;
events.setInstanceList(instanceList);
}
function accountCryps(response) {
@@ -221,7 +221,7 @@ function createSocket(events) {
account_login: accountLogin,
account_create: accountLogin,
account_cryps: accountCryps,
account_players: accountPlayerList,
account_instances: accountInstanceList,
instance_scores: instanceScores,
zone_create: res => console.log(res),
zone_state: zoneState,
@@ -302,7 +302,7 @@ function createSocket(events) {
sendAccountCreate,
sendAccountDemo,
sendAccountCryps,
sendAccountPlayers,
sendAccountInstances,
sendAccountZone,
sendGameState,
sendGamePve,