most-box 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -4
- package/electron/main.js +31 -10
- package/out/404/index.html +2 -2
- package/out/404.html +2 -2
- package/out/__next.__PAGE__.txt +6 -6
- package/out/__next._full.txt +15 -15
- package/out/__next._head.txt +3 -3
- package/out/__next._index.txt +7 -7
- package/out/__next._tree.txt +4 -4
- package/out/_next/static/chunks/{0hpev4am9jpmu.css → 0.4ov9319fecg.css} +1 -1
- package/out/_next/static/chunks/0._8s6pbfw.xk.js +1 -0
- package/out/_next/static/chunks/02jvyg27pp0mz.js +1 -0
- package/out/_next/static/chunks/{0pt.5cg1t09qs.js → 08qqf0rsi3oot.js} +1 -1
- package/out/_next/static/chunks/{0adx~d-j05c9d.css → 09h7l4i38xc7q.css} +1 -1
- package/out/_next/static/chunks/09hqx79-jkvm_.css +1 -0
- package/out/_next/static/chunks/09vcm1ku9k7o8.js +1 -0
- package/out/_next/static/chunks/0c6e_d2jq179x.js +1 -0
- package/out/_next/static/chunks/0ccalho416.d7.js +1 -0
- package/out/_next/static/chunks/0exj_tg.ew-t3.js +1 -0
- package/out/_next/static/chunks/0f-wz5d~tv-r4.js +1 -0
- package/out/_next/static/chunks/0f0jhsujtf-61.js +1 -0
- package/out/_next/static/chunks/0ig8a4sazk3~2.css +1 -0
- package/out/_next/static/chunks/0iq1h7g4dudg8.js +1 -0
- package/out/_next/static/chunks/0knnzo9aih48r.js +1 -0
- package/out/_next/static/chunks/0nzyk~sg_tn._.js +1 -0
- package/out/_next/static/chunks/0w~2fjq86t7c7.css +1 -0
- package/out/_next/static/chunks/0xrqerhosrp9~.js +1 -0
- package/out/_next/static/chunks/14-fm9r_mom81.js +1 -0
- package/out/_next/static/chunks/14jhy~xia8lh8.js +1 -0
- package/out/_next/static/chunks/{turbopack-0xta0kqwzkf28.js → turbopack-05qngmxam3ar~.js} +1 -1
- package/out/_not-found/__next._full.txt +12 -12
- package/out/_not-found/__next._head.txt +3 -3
- package/out/_not-found/__next._index.txt +7 -7
- package/out/_not-found/__next._not-found.__PAGE__.txt +4 -4
- package/out/_not-found/__next._not-found.txt +3 -3
- package/out/_not-found/__next._tree.txt +2 -2
- package/out/_not-found/index.html +2 -2
- package/out/_not-found/index.txt +12 -12
- package/out/admin/__next._full.txt +14 -14
- package/out/admin/__next._head.txt +3 -3
- package/out/admin/__next._index.txt +7 -7
- package/out/admin/__next._tree.txt +3 -3
- package/out/admin/__next.admin.__PAGE__.txt +4 -4
- package/out/admin/__next.admin.txt +4 -4
- package/out/admin/index.html +2 -2
- package/out/admin/index.txt +14 -14
- package/out/app/__next._full.txt +13 -13
- package/out/app/__next._head.txt +3 -3
- package/out/app/__next._index.txt +7 -7
- package/out/app/__next._tree.txt +2 -2
- package/out/app/__next.app.__PAGE__.txt +4 -4
- package/out/app/__next.app.txt +3 -3
- package/out/app/index.html +2 -2
- package/out/app/index.txt +13 -13
- package/out/chat/__next._full.txt +14 -14
- package/out/chat/__next._head.txt +3 -3
- package/out/chat/__next._index.txt +7 -7
- package/out/chat/__next._tree.txt +3 -3
- package/out/chat/__next.chat.__PAGE__.txt +4 -4
- package/out/chat/__next.chat.txt +4 -4
- package/out/chat/index.html +2 -2
- package/out/chat/index.txt +14 -14
- package/out/chat/join/__next._full.txt +14 -14
- package/out/chat/join/__next._head.txt +3 -3
- package/out/chat/join/__next._index.txt +7 -7
- package/out/chat/join/__next._tree.txt +3 -3
- package/out/chat/join/__next.chat.join.__PAGE__.txt +4 -4
- package/out/chat/join/__next.chat.join.txt +3 -3
- package/out/chat/join/__next.chat.txt +4 -4
- package/out/chat/join/index.html +2 -2
- package/out/chat/join/index.txt +14 -14
- package/out/download/__next._full.txt +33 -35
- package/out/download/__next._head.txt +3 -3
- package/out/download/__next._index.txt +7 -7
- package/out/download/__next._tree.txt +3 -3
- package/out/download/__next.download.__PAGE__.txt +6 -6
- package/out/download/__next.download.txt +3 -3
- package/out/download/index.html +2 -2
- package/out/download/index.txt +33 -35
- package/out/favicon.ico +0 -0
- package/out/game/__next._full.txt +11 -11
- package/out/game/__next._head.txt +3 -3
- package/out/game/__next._index.txt +7 -7
- package/out/game/__next._tree.txt +2 -2
- package/out/game/__next.game.__PAGE__.txt +2 -2
- package/out/game/__next.game.txt +3 -3
- package/out/game/gandengyan/__next._full.txt +13 -13
- package/out/game/gandengyan/__next._head.txt +3 -3
- package/out/game/gandengyan/__next._index.txt +7 -7
- package/out/game/gandengyan/__next._tree.txt +2 -2
- package/out/game/gandengyan/__next.game.gandengyan.__PAGE__.txt +4 -4
- package/out/game/gandengyan/__next.game.gandengyan.txt +3 -3
- package/out/game/gandengyan/__next.game.txt +3 -3
- package/out/game/gandengyan/index.html +2 -2
- package/out/game/gandengyan/index.txt +13 -13
- package/out/game/index.html +1 -1
- package/out/game/index.txt +11 -11
- package/out/game/zhajinhua/__next._full.txt +13 -13
- package/out/game/zhajinhua/__next._head.txt +3 -3
- package/out/game/zhajinhua/__next._index.txt +7 -7
- package/out/game/zhajinhua/__next._tree.txt +2 -2
- package/out/game/zhajinhua/__next.game.txt +3 -3
- package/out/game/zhajinhua/__next.game.zhajinhua.__PAGE__.txt +4 -4
- package/out/game/zhajinhua/__next.game.zhajinhua.txt +3 -3
- package/out/game/zhajinhua/index.html +2 -2
- package/out/game/zhajinhua/index.txt +13 -13
- package/out/index.html +2 -2
- package/out/index.txt +15 -15
- package/out/logo-512.png +0 -0
- package/out/logo.ico +0 -0
- package/out/logo.svg +12 -0
- package/out/note/__next._full.txt +13 -13
- package/out/note/__next._head.txt +3 -3
- package/out/note/__next._index.txt +7 -7
- package/out/note/__next._tree.txt +2 -2
- package/out/note/__next.note.__PAGE__.txt +4 -4
- package/out/note/__next.note.txt +3 -3
- package/out/note/index.html +2 -2
- package/out/note/index.txt +13 -13
- package/out/ping/__next._full.txt +14 -14
- package/out/ping/__next._head.txt +3 -3
- package/out/ping/__next._index.txt +7 -7
- package/out/ping/__next._tree.txt +3 -3
- package/out/ping/__next.ping.__PAGE__.txt +5 -5
- package/out/ping/__next.ping.txt +3 -3
- package/out/ping/index.html +2 -2
- package/out/ping/index.txt +14 -14
- package/out/web3/__next._full.txt +13 -13
- package/out/web3/__next._head.txt +3 -3
- package/out/web3/__next._index.txt +7 -7
- package/out/web3/__next._tree.txt +2 -2
- package/out/web3/__next.web3.__PAGE__.txt +4 -4
- package/out/web3/__next.web3.txt +3 -3
- package/out/web3/ed25519/__next._full.txt +11 -11
- package/out/web3/ed25519/__next._head.txt +3 -3
- package/out/web3/ed25519/__next._index.txt +7 -7
- package/out/web3/ed25519/__next._tree.txt +2 -2
- package/out/web3/ed25519/__next.web3.ed25519.__PAGE__.txt +2 -2
- package/out/web3/ed25519/__next.web3.ed25519.txt +3 -3
- package/out/web3/ed25519/__next.web3.txt +3 -3
- package/out/web3/ed25519/index.html +1 -1
- package/out/web3/ed25519/index.txt +11 -11
- package/out/web3/index.html +2 -2
- package/out/web3/index.txt +13 -13
- package/out/web3/tools/__next._full.txt +11 -11
- package/out/web3/tools/__next._head.txt +3 -3
- package/out/web3/tools/__next._index.txt +7 -7
- package/out/web3/tools/__next._tree.txt +2 -2
- package/out/web3/tools/__next.web3.tools.__PAGE__.txt +2 -2
- package/out/web3/tools/__next.web3.tools.txt +3 -3
- package/out/web3/tools/__next.web3.txt +3 -3
- package/out/web3/tools/index.html +1 -1
- package/out/web3/tools/index.txt +11 -11
- package/package.json +5 -5
- package/public/favicon.ico +0 -0
- package/public/logo-512.png +0 -0
- package/public/logo.ico +0 -0
- package/public/logo.svg +12 -0
- package/server/src/games/gandengyan.js +9 -5
- package/server/src/http/app.js +15 -13
- package/server/src/http/uploads.js +1 -0
- package/server/src/index.js +266 -89
- package/server/src/utils/avatar.js +3 -2
- package/out/_next/static/chunks/03gsbg0fr00ey.js +0 -1
- package/out/_next/static/chunks/0ao1lbi4b.sfa.js +0 -1
- package/out/_next/static/chunks/0fo9-h4knidcz.js +0 -1
- package/out/_next/static/chunks/0g_a~e050bgzg.css +0 -1
- package/out/_next/static/chunks/0i9sfdypwuw8~.js +0 -1
- package/out/_next/static/chunks/0olqjomda37-e.js +0 -1
- package/out/_next/static/chunks/0puk.7e.tr2zy.js +0 -1
- package/out/_next/static/chunks/0qgx9t4jx16ua.css +0 -1
- package/out/_next/static/chunks/0s1k6rlwy02c2.js +0 -1
- package/out/_next/static/chunks/0sgltmtk_9s8p.css +0 -1
- package/out/_next/static/chunks/0snehvtvu1n4q.js +0 -1
- package/out/_next/static/chunks/0s~g.l~x049o2.js +0 -1
- package/out/_next/static/chunks/0u38kke9vhobe.js +0 -1
- package/out/_next/static/chunks/0vd4_a5x-wpdh.js +0 -1
- package/out/_next/static/chunks/10f-t2n4y1zx8.js +0 -1
- package/out/_next/static/chunks/13jdyag9a-~kk.js +0 -1
- package/out/_next/static/chunks/153-sz7s.qml2.js +0 -1
- package/out/_next/static/chunks/17cwkb2yn_akx.js +0 -1
- /package/out/_next/static/{sSvbBrwXZY-4lBmcHshga → 2smv1H9Y4Z2Ri-SL-UFgR}/_buildManifest.js +0 -0
- /package/out/_next/static/{sSvbBrwXZY-4lBmcHshga → 2smv1H9Y4Z2Ri-SL-UFgR}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{sSvbBrwXZY-4lBmcHshga → 2smv1H9Y4Z2Ri-SL-UFgR}/_ssgManifest.js +0 -0
- /package/out/{pwa-512x512.png → avatar.png} +0 -0
- /package/public/{pwa-512x512.png → avatar.png} +0 -0
package/out/web3/tools/index.txt
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
2:I[14232,["/_next/static/chunks/
|
|
3
|
-
3:I[52925,["/_next/static/chunks/
|
|
4
|
-
4:I[39756,["/_next/static/chunks/
|
|
5
|
-
5:I[37457,["/_next/static/chunks/
|
|
6
|
-
6:I[36768,["/_next/static/chunks/
|
|
7
|
-
8:I[97367,["/_next/static/chunks/
|
|
2
|
+
2:I[14232,["/_next/static/chunks/0ccalho416.d7.js","/_next/static/chunks/14jhy~xia8lh8.js","/_next/static/chunks/0t2xr05rlu96l.js"],"ErrorBoundary"]
|
|
3
|
+
3:I[52925,["/_next/static/chunks/0ccalho416.d7.js","/_next/static/chunks/14jhy~xia8lh8.js","/_next/static/chunks/0t2xr05rlu96l.js"],"default"]
|
|
4
|
+
4:I[39756,["/_next/static/chunks/0ccalho416.d7.js","/_next/static/chunks/14jhy~xia8lh8.js","/_next/static/chunks/0t2xr05rlu96l.js"],"default"]
|
|
5
|
+
5:I[37457,["/_next/static/chunks/0ccalho416.d7.js","/_next/static/chunks/14jhy~xia8lh8.js","/_next/static/chunks/0t2xr05rlu96l.js"],"default"]
|
|
6
|
+
6:I[36768,["/_next/static/chunks/0ccalho416.d7.js","/_next/static/chunks/14jhy~xia8lh8.js","/_next/static/chunks/0t2xr05rlu96l.js","/_next/static/chunks/02jvyg27pp0mz.js"],"default"]
|
|
7
|
+
8:I[97367,["/_next/static/chunks/0ccalho416.d7.js","/_next/static/chunks/14jhy~xia8lh8.js","/_next/static/chunks/0t2xr05rlu96l.js"],"OutletBoundary"]
|
|
8
8
|
9:"$Sreact.suspense"
|
|
9
|
-
c:I[97367,["/_next/static/chunks/
|
|
10
|
-
e:I[97367,["/_next/static/chunks/
|
|
11
|
-
10:I[68027,["/_next/static/chunks/
|
|
12
|
-
:HL["/_next/static/chunks/
|
|
9
|
+
c:I[97367,["/_next/static/chunks/0ccalho416.d7.js","/_next/static/chunks/14jhy~xia8lh8.js","/_next/static/chunks/0t2xr05rlu96l.js"],"ViewportBoundary"]
|
|
10
|
+
e:I[97367,["/_next/static/chunks/0ccalho416.d7.js","/_next/static/chunks/14jhy~xia8lh8.js","/_next/static/chunks/0t2xr05rlu96l.js"],"MetadataBoundary"]
|
|
11
|
+
10:I[68027,["/_next/static/chunks/0ccalho416.d7.js","/_next/static/chunks/14jhy~xia8lh8.js","/_next/static/chunks/0t2xr05rlu96l.js"],"default",1]
|
|
12
|
+
:HL["/_next/static/chunks/09h7l4i38xc7q.css","style"]
|
|
13
13
|
:HL["/_next/static/chunks/0xdwau5k2augv.css","style"]
|
|
14
14
|
:HL["/_next/static/chunks/0ukyg~tkm~h2m.css","style"]
|
|
15
15
|
:HC["/",""]
|
|
16
|
-
0:{"P":null,"c":["","web3","tools",""],"q":"","i":false,"f":[[["",{"children":["web3",{"children":["tools",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/
|
|
16
|
+
0:{"P":null,"c":["","web3","tools",""],"q":"","i":false,"f":[[["",{"children":["web3",{"children":["tools",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/09h7l4i38xc7q.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/chunks/0xdwau5k2augv.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/0ccalho416.d7.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/14jhy~xia8lh8.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/_next/static/chunks/0t2xr05rlu96l.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"zh-CN","suppressHydrationWarning":true,"data-scroll-behavior":"smooth","children":[["$","head",null,{"children":[["$","meta",null,{"charSet":"UTF-8"}],["$","meta",null,{"name":"viewport","content":"width=device-width, initial-scale=1.0"}],["$","link",null,{"rel":"icon","href":"/logo.svg","type":"image/svg+xml"}],["$","meta",null,{"name":"theme-color","content":"#5e6ad2"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n (function() {\n var theme = localStorage.getItem('theme');\n if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {\n document.documentElement.setAttribute('data-theme', 'dark');\n }\n })();\n "}}]]}],["$","body",null,{"children":["$","$L2",null,{"children":[["$","$L3",null,{}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n window.onerror = function(message, source, lineno, colno, error) {\n console.error('[Global Error]', { message, source, lineno, colno, error });\n };\n window.onunhandledrejection = function(event) {\n console.error('[Unhandled Promise Rejection]', event.reason);\n };\n "}}],["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","$L6",null,{}],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]]}]}]]}]]}],{"children":[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/0ukyg~tkm~h2m.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":["$L7",null,["$","$L8",null,{"children":["$","$9",null,{"name":"Next.MetadataOutlet","children":"$@a"}]}]]}],{},null,false,null]},null,false,"$@b"]},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$9",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/09h7l4i38xc7q.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/chunks/0xdwau5k2augv.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"2smv1H9Y4Z2Ri-SL-UFgR"}
|
|
17
17
|
7:E{"digest":"NEXT_REDIRECT;replace;/web3;307;"}
|
|
18
18
|
11:[]
|
|
19
19
|
b:"$W11"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "most-box",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "MostBox - P2P file sharing application",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "electron/main.js",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"start": "next dev",
|
|
20
|
+
"server": "node --watch server/index.js",
|
|
20
21
|
"dev": "next dev",
|
|
21
22
|
"build": "next build",
|
|
22
|
-
"server": "node --watch server/index.js",
|
|
23
23
|
"serve": "next build && node server/index.js",
|
|
24
24
|
"test": "node --test server/tests/**/*.test.js",
|
|
25
25
|
"test:unit": "node --test server/tests/unit/*.test.js",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"nsis"
|
|
129
129
|
],
|
|
130
130
|
"artifactName": "${productName}-${version}-win-${arch}-setup.${ext}",
|
|
131
|
-
"icon": "public/
|
|
131
|
+
"icon": "public/logo.ico"
|
|
132
132
|
},
|
|
133
133
|
"nsis": {
|
|
134
134
|
"oneClick": false,
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
]
|
|
149
149
|
}
|
|
150
150
|
],
|
|
151
|
-
"icon": "public/
|
|
151
|
+
"icon": "public/logo-512.png",
|
|
152
152
|
"category": "public.app-category.utilities"
|
|
153
153
|
},
|
|
154
154
|
"dmg": {
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
]
|
|
177
177
|
}
|
|
178
178
|
],
|
|
179
|
-
"icon": "public/
|
|
179
|
+
"icon": "public/logo-512.png",
|
|
180
180
|
"category": "Utility"
|
|
181
181
|
}
|
|
182
182
|
}
|
package/public/favicon.ico
CHANGED
|
Binary file
|
|
Binary file
|
package/public/logo.ico
ADDED
|
Binary file
|
package/public/logo.svg
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
width="512"
|
|
3
|
+
height="512"
|
|
4
|
+
viewBox="0 0 24 24"
|
|
5
|
+
fill="none"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<rect x="2" y="2" width="8" height="8" rx="2" fill="#5e6ad2" opacity="0.4" />
|
|
9
|
+
<rect x="14" y="2" width="8" height="8" rx="2" fill="#5e6ad2" opacity="0.7" />
|
|
10
|
+
<rect x="2" y="14" width="8" height="8" rx="2" fill="#5e6ad2" opacity="0.7" />
|
|
11
|
+
<rect x="14" y="14" width="8" height="8" rx="2" fill="#5e6ad2" />
|
|
12
|
+
</svg>
|
|
@@ -4,6 +4,7 @@ const STRAIGHT_RANKS = RANKS.filter(rank => rank !== '2')
|
|
|
4
4
|
const RANK_VALUE = new Map(RANKS.map((rank, index) => [rank, index + 3]))
|
|
5
5
|
const INITIAL_HAND_SIZE = 5
|
|
6
6
|
const SEALED_PENALTY = 15
|
|
7
|
+
const INITIAL_SCORE = 1000
|
|
7
8
|
|
|
8
9
|
export function createGanDengYanRoom({
|
|
9
10
|
roomCode,
|
|
@@ -31,7 +32,7 @@ export function createGanDengYanRoom({
|
|
|
31
32
|
seat,
|
|
32
33
|
hand: [],
|
|
33
34
|
handCount: 0,
|
|
34
|
-
score:
|
|
35
|
+
score: INITIAL_SCORE,
|
|
35
36
|
playedCards: 0,
|
|
36
37
|
})),
|
|
37
38
|
deck: [],
|
|
@@ -64,7 +65,7 @@ export function syncGanDengYanLobby(room, players = []) {
|
|
|
64
65
|
seat,
|
|
65
66
|
hand: [],
|
|
66
67
|
handCount: 0,
|
|
67
|
-
score: currentScores.get(player.address)
|
|
68
|
+
score: currentScores.get(player.address) ?? INITIAL_SCORE,
|
|
68
69
|
playedCards: 0,
|
|
69
70
|
}))
|
|
70
71
|
state.seq += 1
|
|
@@ -216,7 +217,7 @@ export function publicGanDengYanRoom(room) {
|
|
|
216
217
|
name: player.name,
|
|
217
218
|
seat: player.seat,
|
|
218
219
|
handCount: player.hand?.length ?? player.handCount ?? 0,
|
|
219
|
-
score: Number(player.score
|
|
220
|
+
score: Number(player.score ?? INITIAL_SCORE),
|
|
220
221
|
playedCards: Number(player.playedCards || 0),
|
|
221
222
|
hand: Array.isArray(player.hand) ? player.hand.map(publicCard) : [],
|
|
222
223
|
})),
|
|
@@ -359,7 +360,10 @@ function canBeat(combo, tableCombo) {
|
|
|
359
360
|
}
|
|
360
361
|
if (combo.length !== tableCombo.length) return false
|
|
361
362
|
if (combo.type === 'single' || combo.type === 'pair') {
|
|
362
|
-
return
|
|
363
|
+
return (
|
|
364
|
+
combo.value === nextValue(tableCombo.value) ||
|
|
365
|
+
(combo.value === RANK_VALUE.get('2') && tableCombo.value !== RANK_VALUE.get('2'))
|
|
366
|
+
)
|
|
363
367
|
}
|
|
364
368
|
return combo.value === nextValue(tableCombo.value)
|
|
365
369
|
}
|
|
@@ -388,7 +392,7 @@ function normalizeRoundPlayer(input) {
|
|
|
388
392
|
seat: Number(input.seat || 0),
|
|
389
393
|
hand: Array.isArray(input.hand) ? input.hand.map(normalizeCard).filter(Boolean) : [],
|
|
390
394
|
handCount: Number(input.handCount || 0),
|
|
391
|
-
score: Number(input.score
|
|
395
|
+
score: Number(input.score ?? INITIAL_SCORE),
|
|
392
396
|
playedCards: Number(input.playedCards || 0),
|
|
393
397
|
}
|
|
394
398
|
}
|
package/server/src/http/app.js
CHANGED
|
@@ -672,16 +672,16 @@ export function createApp(engine, options = {}) {
|
|
|
672
672
|
return c.json({ error: parsed.error }, 400)
|
|
673
673
|
}
|
|
674
674
|
|
|
675
|
-
const
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
if (
|
|
675
|
+
const localAvailability = await engine.getLocalCidAvailability(body.link, {
|
|
676
|
+
ownerAddress: c.get('userAddress'),
|
|
677
|
+
})
|
|
678
|
+
if (localAvailability) {
|
|
679
679
|
return c.json({
|
|
680
680
|
success: true,
|
|
681
681
|
available: true,
|
|
682
682
|
cid: parsed.cid,
|
|
683
|
-
fileName:
|
|
684
|
-
size: Number(
|
|
683
|
+
fileName: localAvailability.fileName,
|
|
684
|
+
size: Number(localAvailability.size) || null,
|
|
685
685
|
alreadyExists: true,
|
|
686
686
|
})
|
|
687
687
|
}
|
|
@@ -719,11 +719,13 @@ export function createApp(engine, options = {}) {
|
|
|
719
719
|
return c.json({ error: parsed.error }, 400)
|
|
720
720
|
}
|
|
721
721
|
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
if (
|
|
726
|
-
console.log(
|
|
722
|
+
const localAvailability = await engine.getLocalCidAvailability(body.link, {
|
|
723
|
+
ownerAddress: c.get('userAddress'),
|
|
724
|
+
})
|
|
725
|
+
if (localAvailability) {
|
|
726
|
+
console.log(
|
|
727
|
+
`[MostBox] CID content already exists locally: ${parsed.cid}`
|
|
728
|
+
)
|
|
727
729
|
try {
|
|
728
730
|
const result = await engine.downloadFile(body.link, taskId, {
|
|
729
731
|
ownerAddress: c.get('userAddress'),
|
|
@@ -801,7 +803,7 @@ export function createApp(engine, options = {}) {
|
|
|
801
803
|
})
|
|
802
804
|
return c.json({ success: true, ...result })
|
|
803
805
|
} catch (err) {
|
|
804
|
-
return c
|
|
806
|
+
return badRequestOrAppError(c, err)
|
|
805
807
|
}
|
|
806
808
|
})
|
|
807
809
|
|
|
@@ -1071,7 +1073,7 @@ export function createApp(engine, options = {}) {
|
|
|
1071
1073
|
})
|
|
1072
1074
|
return c.json({ success: true, ...result })
|
|
1073
1075
|
} catch (err) {
|
|
1074
|
-
return c
|
|
1076
|
+
return badRequestOrAppError(c, err)
|
|
1075
1077
|
}
|
|
1076
1078
|
})
|
|
1077
1079
|
|