mirror of
https://github.com/genxium/DelayNoMore
synced 2024-12-26 03:39:00 +00:00
Minor fix.
This commit is contained in:
parent
a44535cad2
commit
16c27b0ce0
@ -271,13 +271,6 @@ window.initPersistentSessionClient = function(onopenCb, expectedRoomId) {
|
|||||||
clientSession.onclose = function(evt) {
|
clientSession.onclose = function(evt) {
|
||||||
// [WARNING] The callback "onclose" might be called AFTER the webpage is refreshed with "1001 == evt.code".
|
// [WARNING] The callback "onclose" might be called AFTER the webpage is refreshed with "1001 == evt.code".
|
||||||
console.warn(`The WS clientSession is closed: evt=${JSON.stringify(evt)}, evt.code=${evt.code}`);
|
console.warn(`The WS clientSession is closed: evt=${JSON.stringify(evt)}, evt.code=${evt.code}`);
|
||||||
if (cc.sys.isNative) {
|
|
||||||
if (mapIns.frameDataLoggingEnabled) {
|
|
||||||
console.warn(`${mapIns._stringifyRdfIdToActuallyUsedInput()}
|
|
||||||
`);
|
|
||||||
}
|
|
||||||
DelayNoMore.UdpSession.closeUdpSession();
|
|
||||||
}
|
|
||||||
switch (evt.code) {
|
switch (evt.code) {
|
||||||
case constants.RET_CODE.CLIENT_MISMATCHED_RENDER_FRAME:
|
case constants.RET_CODE.CLIENT_MISMATCHED_RENDER_FRAME:
|
||||||
break;
|
break;
|
||||||
@ -316,8 +309,18 @@ window.initPersistentSessionClient = function(onopenCb, expectedRoomId) {
|
|||||||
mapIns.popupSimplePressToGo("Disconnected unexpectedly, please retry", false, () => {
|
mapIns.popupSimplePressToGo("Disconnected unexpectedly, please retry", false, () => {
|
||||||
window.clearLocalStorageAndBackToLoginScene(true);
|
window.clearLocalStorageAndBackToLoginScene(true);
|
||||||
});
|
});
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
|
if (cc.sys.isNative) {
|
||||||
|
// [WARNING] This could be a BUG in CocosCreator JSB implementation of WebSocket client, the "evt.code" is always "undefined" in the "onclose" callback!
|
||||||
|
if (mapIns.frameDataLoggingEnabled) {
|
||||||
|
console.warn(`${mapIns._stringifyRdfIdToActuallyUsedInput()}
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
DelayNoMore.UdpSession.closeUdpSession();
|
||||||
|
mapIns.popupSimplePressToGo("Disconnected unexpectedly, please retry", false, () => {
|
||||||
|
window.clearLocalStorageAndBackToLoginScene(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user