You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server.js
+5-6Lines changed: 5 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,7 @@ const userEvents = {
124
124
broadcast({x: 'clear'});
125
125
}),
126
126
modmotd: roleck('Mod',function(data,user){
127
-
constmatch=data.m.match(/^(\d+)?(.*)$/);
127
+
constmatch=data.m.match(/^(\d+)*(.*)$/);
128
128
if(match){
129
129
constnum=match[1],
130
130
text=match[2];
@@ -215,7 +215,6 @@ const userEvents = {
215
215
if(!user.ocard||!data.d){
216
216
return;
217
217
}
218
-
constau=`${data.lv ? 'B:' : 'A:'}${data.u}`;
219
218
if(data.mod){
220
219
returnpg.pool.query({
221
220
text: `update arena set deck = $3, hp = $4, draw = $5, mark = $6 where user_id = $1 and arena_id = $2`,
@@ -331,7 +330,7 @@ from arena where user_id = $1`,
331
330
idx=RngMock.upto(len);
332
331
}
333
332
constares=awaitpg.pool.query({
334
-
text: `select u.name, a.score, a.deck, a.hp, a.mark, a.draw, a.day, a.won, a.loss, a.code from arena a join users u on u.id = a.user_id where a.arena_id = $1 order by a."rank" limit 1 offset $2`,
333
+
text: `select u.name, a.deck, a.hp, a.mark, a.draw, a.day, a.won, a.loss, a.code from arena a join users u on u.id = a.user_id where a.arena_id = $1 order by a."rank" limit 1 offset $2`,
335
334
values: [arenaId,idx],
336
335
});
337
336
if(ares.rows.length==0){
@@ -607,7 +606,7 @@ where mr1.user_id = $1 and mr2.user_id = $2 and not mr1.accepted and mr2.accepte
607
606
typeofdata.forcards==='string'&&
608
607
typeofdata.forg==='number'
609
608
){
610
-
constacceptResult=awaitpg.pool.query({
609
+
constacceptResult=awaitsql.query({
611
610
text: `select 1 from trade_request where user_id = $2 and for_user_id = $1 and cards = $5 and g = $6 and forcards = $3 and forg = $4`,
612
611
values: [
613
612
userId,
@@ -650,14 +649,14 @@ where mr1.user_id = $1 and mr2.user_id = $2 and not mr1.accepted and mr2.accepte
650
649
data.cards,
651
650
);
652
651
foe.gold+=p2gdelta;
653
-
returnpg.pool.query({
652
+
returnsql.query({
654
653
text:
655
654
'delete from trade_request where (user_id = $1 and for_user_id = $2) or (user_id = $2 and for_user_id = $1)',
0 commit comments