mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
Update names of states the client considers "online".
This commit is contained in:
@@ -271,6 +271,18 @@ var isTefFailure = function (engine_result_code) {
|
|||||||
return (engine_result_code >= -299 && engine_result_code < 199);
|
return (engine_result_code >= -299 && engine_result_code < 199);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Server states that we will treat as the server being online.
|
||||||
|
*
|
||||||
|
* Our requirements are that the server can process transactions and notify
|
||||||
|
* us of changes.
|
||||||
|
*/
|
||||||
|
Remote.online_states = [
|
||||||
|
'proposing',
|
||||||
|
'validating',
|
||||||
|
'full'
|
||||||
|
];
|
||||||
|
|
||||||
Remote.flags = {
|
Remote.flags = {
|
||||||
'OfferCreate' : {
|
'OfferCreate' : {
|
||||||
'Passive' : 0x00010000,
|
'Passive' : 0x00010000,
|
||||||
@@ -533,7 +545,7 @@ Remote.prototype._connect_message = function (ws, json) {
|
|||||||
case 'serverStatus':
|
case 'serverStatus':
|
||||||
// This message is only received when online. As we are connected, it is the definative final state.
|
// This message is only received when online. As we are connected, it is the definative final state.
|
||||||
this._set_state(
|
this._set_state(
|
||||||
message.server_status === 'tracking' || message.server_status === 'full'
|
Remote.online_states.indexOf(message.server_status) !== -1
|
||||||
? 'online'
|
? 'online'
|
||||||
: 'offline');
|
: 'offline');
|
||||||
break;
|
break;
|
||||||
@@ -916,7 +928,7 @@ Remote.prototype._server_subscribe = function () {
|
|||||||
self._reserve_inc = message.reserve_inc;
|
self._reserve_inc = message.reserve_inc;
|
||||||
self._server_status = message.server_status;
|
self._server_status = message.server_status;
|
||||||
|
|
||||||
if (message.server_status === 'tracking' || message.server_status === 'full') {
|
if (Remote.online_states.indexOf(message.server_status) !== -1) {
|
||||||
self._set_state('online');
|
self._set_state('online');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user