mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-12-16 08:09:07 +00:00
Changed unreliable sequential integer object id to BSON ObjectId #162
This commit is contained in:
24
Server/src/main/resources/static/js/mar.js
vendored
24
Server/src/main/resources/static/js/mar.js
vendored
@@ -291,7 +291,7 @@ var config = {
|
||||
};
|
||||
},
|
||||
kbBufferX: 350,
|
||||
kbBufferY: 20,
|
||||
kbBufferY: 35,
|
||||
arrowTextStyle: {
|
||||
fontSize: 32,
|
||||
fill: "#ffffff",
|
||||
@@ -735,24 +735,14 @@ var GameClient = (function () {
|
||||
self.listeners.push(new DebugResponseListener());
|
||||
self.socket.onmessage = function (received) {
|
||||
var message;
|
||||
try {
|
||||
message = JSON.parse(received.data);
|
||||
if (DEBUG) {
|
||||
console.log("[MAR] Received: " + received.data);
|
||||
}
|
||||
for (var i = 0; i < self.listeners.length; i++) {
|
||||
if (self.listeners[i].getListenedMessageType() === message.t) {
|
||||
self.listeners[i].handle(message);
|
||||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
console.log("[MAR] Received: " + received.data);
|
||||
}
|
||||
catch (e) {
|
||||
if (DEBUG) {
|
||||
console.log("[MAR] Received invalid message, assuming floppy data");
|
||||
message = JSON.parse(received.data);
|
||||
for (var i = 0; i < self.listeners.length; i++) {
|
||||
if (self.listeners[i].getListenedMessageType() === message.t) {
|
||||
self.listeners[i].handle(message);
|
||||
}
|
||||
document.getElementById("floppyDown").innerHTML = "<i class=\"fa fa-long-arrow-down\" aria-hidden=\"true\"></i> <i class=\"fa fa-floppy-o\" aria-hidden=\"true\"></i>";
|
||||
var blob = new Blob([received.data], { type: "application/octet-stream" });
|
||||
saveAs(blob, "floppy.bin");
|
||||
}
|
||||
};
|
||||
self.reloadCode();
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<button class="btn btn-shadow btn-info text-mono regular-screen"
|
||||
<button id="floppyDown" class="btn btn-shadow btn-info text-mono regular-screen"
|
||||
onclick="window.location.assign('floppy_download')"><i class="mi">file_download</i>
|
||||
Floppy
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user