Fixed frontend ws session onclose handling.

This commit is contained in:
yflu 2022-10-25 23:02:39 +08:00
parent 486c46f608
commit 4e0f7b52d4
3 changed files with 6 additions and 5 deletions

View File

@ -440,7 +440,7 @@
"array": [ "array": [
0, 0,
0, 0,
216.05530045313827, 344.75930058781137,
0, 0,
0, 0,
0, 0,

View File

@ -253,8 +253,8 @@ cc.Class({
if (null != window.handleBattleColliderInfo) { if (null != window.handleBattleColliderInfo) {
window.handleBattleColliderInfo = null; window.handleBattleColliderInfo = null;
} }
if (null != window.handleClientSessionCloseOrError) { if (null != window.handleClientSessionError) {
window.handleClientSessionCloseOrError = null; window.handleClientSessionError = null;
} }
}, },
@ -349,8 +349,8 @@ cc.Class({
window.forceBigEndianFloatingNumDecoding = self.forceBigEndianFloatingNumDecoding; window.forceBigEndianFloatingNumDecoding = self.forceBigEndianFloatingNumDecoding;
console.warn("+++++++ Map onLoad()"); console.warn("+++++++ Map onLoad()");
window.handleClientSessionCloseOrError = function() { window.handleClientSessionError = function() {
console.warn('+++++++ Common handleClientSessionCloseOrError()'); console.warn('+++++++ Common handleClientSessionError()');
if (ALL_BATTLE_STATES.IN_SETTLEMENT == self.battleState) { if (ALL_BATTLE_STATES.IN_SETTLEMENT == self.battleState) {
console.log("Battled ended by settlement"); console.log("Battled ended by settlement");

View File

@ -224,6 +224,7 @@ window.initPersistentSessionClient = function(onopenCb, expectedRoomId) {
case constants.RET_CODE.MYSQL_ERROR: case constants.RET_CODE.MYSQL_ERROR:
case constants.RET_CODE.PLAYER_NOT_FOUND: case constants.RET_CODE.PLAYER_NOT_FOUND:
case constants.RET_CODE.PLAYER_CHEATING: case constants.RET_CODE.PLAYER_CHEATING:
case 1006: // Peer(i.e. the backend) gone unexpectedly
if (window.handleClientSessionError) { if (window.handleClientSessionError) {
window.handleClientSessionError(); window.handleClientSessionError();
} }