Acknowledge receiving requests from the server

There will be a more detailed explanation of this in the
corresponding server commit.
This commit is contained in:
Cathy J. Fitzpatrick
2013-01-25 01:04:33 -07:00
parent 04e3f491e8
commit ccf0a97733
2 changed files with 5 additions and 1 deletions

View File

@@ -188,7 +188,7 @@ $serverlibrary = $serverlibs[$serverprotocol];
<script src="<?php echo $serverlibrary; ?>"></script>
<script src="/js/teambuilder.js?v0.7.12"></script>
<script src="/js/ladder.js?v0.8.2"></script>
<script src="/js/sim.js?v0.8.2"></script>
<script src="/js/sim.js?v0.8.3"></script>
<script>
document.getElementById('loading-message').innerHTML += ' DONE<br />Connecting to login server...';

View File

@@ -220,6 +220,7 @@ function BattleRoom(id, elem) {
}
};
this.init = function (data) {
this.version = (data.version !== undefined) ? data.version : 0;
if (selfR.battle.activityQueue) {
// re-initialize
selfR.battleEnded = false;
@@ -323,6 +324,9 @@ function BattleRoom(id, elem) {
}
if (update.request) {
selfR.me.request = update.request;
if (selfR.version > 0) {
selfR.send('/ackrequest ' + selfR.me.request.rqid);
}
selfR.me.request.requestType = 'move';
if (selfR.me.request.forceSwitch) {
selfR.me.request.requestType = 'switch';