Pārlūkot izejas kodu

LEaderboards wasn't saving when names had single quotes

tags/v0.1.4^2
Big Bad Waffle pirms 7 gadiem
vecāks
revīzija
124e99a273
2 mainītis faili ar 29 papildinājumiem un 9 dzēšanām
  1. +21
    -1
      src/server/config/maps/cave/map.json
  2. +8
    -8
      src/server/leaderboard/leaderboard.js

+ 21
- 1
src/server/config/maps/cave/map.json Parādīt failu

@@ -2170,6 +2170,26 @@
"width":24,
"x":1504,
"y":64
},
{
"gid":377,
"height":8,
"id":897,
"name":"",
"properties":
{
"cpnPortal":"{\"zone\":\"tutorial\",\"pos\":{\"x\":82,\"y\":66}}"
},
"propertytypes":
{
"cpnPortal":"string"
},
"rotation":0,
"type":"",
"visible":true,
"width":8,
"x":168,
"y":1128
}],
"opacity":1,
"type":"objectgroup",
@@ -2177,7 +2197,7 @@
"x":0,
"y":0
}],
"nextobjectid":897,
"nextobjectid":898,
"orientation":"orthogonal",
"properties":
{


+ 8
- 8
src/server/leaderboard/leaderboard.js Parādīt failu

@@ -60,8 +60,7 @@ define([
field: 'leaderboard',
value: JSON.stringify(list)
});
}
else
} else
this.parseList(result);

this.loaded = true;
@@ -111,11 +110,10 @@ define([
if (exists) {
if (exists.level != level) {
exists.level = level;
this.save();
}
}
else {
} else {
this.list.push({
name: name,
level: level,
@@ -152,12 +150,14 @@ define([
if (!this.loaded)
return;

var value = JSON.stringify({
list: this.list
}).split(`'`).join(`''`);

io.set({
ent: 'list',
field: 'leaderboard',
value: JSON.stringify({
list: this.list
})
value: value
});
}
};

Notiek ielāde…
Atcelt
Saglabāt