most-box 0.1.6 → 0.1.7
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 +18 -13
- 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/0-c8h4u1i2f78.js +1 -0
- package/out/_next/static/chunks/02j6ojja7vzp8.js +1 -0
- package/out/_next/static/chunks/06im3as4nwfil.js +1 -0
- package/out/_next/static/chunks/0sq_0pwxnhby2.js +1 -0
- package/out/_next/static/chunks/1h-f81ddyfcmx.css +1 -0
- package/out/_next/static/chunks/22h69_zwmttt4.js +1 -0
- package/out/_next/static/chunks/23zlmarf-go2x.js +1 -0
- package/out/_next/static/chunks/24k_4-y4ym0df.js +1 -0
- package/out/_next/static/chunks/{0vmjat-s4a3yj.css → 258tyt1xt34p4.css} +1 -1
- package/out/_next/static/chunks/2693fczty5yr8.js +1 -0
- package/out/_next/static/chunks/26hcvxjw9do9d.js +1 -0
- package/out/_next/static/chunks/2_i1b78h0yiu_.js +1 -0
- package/out/_next/static/chunks/3e9ia0hs-pqvs.css +1 -0
- package/out/_next/static/chunks/3ejz1mdljwwqf.css +1 -0
- package/out/_next/static/chunks/3mccxoa60ley8.js +1 -0
- package/out/_next/static/chunks/{23kls47vn_rpg.css → 418_591yp64lx.css} +1 -1
- package/out/_next/static/chunks/43l72x-2z3zxb.js +1 -0
- 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 +13 -13
- package/out/admin/__next._head.txt +3 -3
- package/out/admin/__next._index.txt +7 -7
- package/out/admin/__next._tree.txt +2 -2
- package/out/admin/__next.admin.__PAGE__.txt +4 -4
- package/out/admin/__next.admin.txt +3 -3
- package/out/admin/index.html +2 -2
- package/out/admin/index.txt +13 -13
- 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 +13 -13
- package/out/chat/__next._head.txt +3 -3
- package/out/chat/__next._index.txt +7 -7
- package/out/chat/__next._tree.txt +2 -2
- package/out/chat/__next.chat.__PAGE__.txt +4 -4
- package/out/chat/__next.chat.txt +3 -3
- package/out/chat/index.html +2 -2
- package/out/chat/index.txt +13 -13
- package/out/chat/join/__next._full.txt +13 -13
- 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 +2 -2
- 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 +3 -3
- package/out/chat/join/index.html +2 -2
- package/out/chat/join/index.txt +13 -13
- package/out/demo/__next._full.txt +15 -15
- package/out/demo/__next._head.txt +3 -3
- package/out/demo/__next._index.txt +7 -7
- package/out/demo/__next._tree.txt +4 -4
- package/out/demo/__next.demo.__PAGE__.txt +6 -6
- package/out/demo/__next.demo.txt +3 -3
- package/out/demo/index.html +3 -3
- package/out/demo/index.txt +15 -15
- package/out/download/__next._full.txt +35 -33
- 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 +35 -33
- 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 +14 -14
- 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 +3 -3
- package/out/game/gandengyan/__next.game.gandengyan.__PAGE__.txt +5 -5
- 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 +14 -14
- package/out/game/index.html +1 -1
- package/out/game/index.txt +11 -11
- package/out/game/zhajinhua/__next._full.txt +14 -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 +3 -2
- package/out/game/zhajinhua/__next.game.txt +3 -3
- package/out/game/zhajinhua/__next.game.zhajinhua.__PAGE__.txt +5 -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 +14 -13
- package/out/index.html +2 -2
- package/out/index.txt +15 -15
- 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 +1 -1
- package/server/src/core/gameRoom.js +12 -0
- package/server/src/core/zhajinhua.js +82 -14
- package/server/src/games/gandengyan.js +39 -0
- package/server/src/index.js +8 -1
- package/out/_next/static/chunks/0-ryc9icn6dql.css +0 -1
- package/out/_next/static/chunks/088-v8tzobg5g.js +0 -1
- package/out/_next/static/chunks/0g9303i8psy6z.js +0 -1
- package/out/_next/static/chunks/10p6-qnuk3p9x.js +0 -1
- package/out/_next/static/chunks/2524ggtr3e4fp.js +0 -1
- package/out/_next/static/chunks/2mcmt4yla_xle.js +0 -1
- package/out/_next/static/chunks/2v7_4ps1l4a8o.css +0 -1
- package/out/_next/static/chunks/2vk2ln79gpvm4.js +0 -1
- package/out/_next/static/chunks/37msy2-4ucgts.js +0 -1
- package/out/_next/static/chunks/384w3w4qvhw61.js +0 -1
- package/out/_next/static/chunks/3aa-weedhv4e0.js +0 -1
- package/out/_next/static/chunks/3erbaukgkw8f2.js +0 -1
- package/out/_next/static/chunks/3qj5xz_d4cbk6.js +0 -1
- /package/out/_next/static/{NPIlpdzQWkiVZpgfhlypH → eXddCOt9eyz0j78b1m4Ex}/_buildManifest.js +0 -0
- /package/out/_next/static/{NPIlpdzQWkiVZpgfhlypH → eXddCOt9eyz0j78b1m4Ex}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{NPIlpdzQWkiVZpgfhlypH → eXddCOt9eyz0j78b1m4Ex}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
3:I[97367,["/_next/static/chunks/
|
|
2
|
+
3:I[97367,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"OutletBoundary"]
|
|
3
3
|
4:"$Sreact.suspense"
|
|
4
|
-
0:{"rsc":["$","$1","c",{"children":["$L2",null,["$","$L3",null,{"children":["$","$4",null,{"name":"Next.MetadataOutlet","children":"$@5"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"
|
|
4
|
+
0:{"rsc":["$","$1","c",{"children":["$L2",null,["$","$L3",null,{"children":["$","$4",null,{"name":"Next.MetadataOutlet","children":"$@5"}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"eXddCOt9eyz0j78b1m4Ex"}
|
|
5
5
|
5:null
|
|
6
6
|
2:E{"digest":"NEXT_REDIRECT;replace;/web3;307;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
2:I[39756,["/_next/static/chunks/
|
|
3
|
-
3:I[37457,["/_next/static/chunks/
|
|
2
|
+
2:I[39756,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"default"]
|
|
3
|
+
3:I[37457,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"default"]
|
|
4
4
|
4:[]
|
|
5
|
-
0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"
|
|
5
|
+
0:{"rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":"$W4","buildId":"eXddCOt9eyz0j78b1m4Ex"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
1:"$Sreact.fragment"
|
|
2
|
-
2:I[39756,["/_next/static/chunks/
|
|
3
|
-
3:I[37457,["/_next/static/chunks/
|
|
2
|
+
2:I[39756,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"default"]
|
|
3
|
+
3:I[37457,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"default"]
|
|
4
4
|
:HL["/_next/static/chunks/2nbju8t9-ux58.css","style"]
|
|
5
|
-
0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/2nbju8t9-ux58.css","precedence":"next"}]],["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"
|
|
5
|
+
0:{"rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/2nbju8t9-ux58.css","precedence":"next"}]],["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"eXddCOt9eyz0j78b1m4Ex"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0az8vxg2gfuhm.js"/><script src="/_next/static/chunks/0s7i7nfr9j3b1.js" async=""></script><script src="/_next/static/chunks/3oe03qxgd_rid.js" async=""></script><script src="/_next/static/chunks/3w4o9hklow6fg.js" async=""></script><script src="/_next/static/chunks/27jktro2p5rq9.js" async=""></script><script src="/_next/static/chunks/turbopack-026p0g9v9_pva.js" async=""></script><script src="/_next/static/chunks/
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0az8vxg2gfuhm.js"/><script src="/_next/static/chunks/0s7i7nfr9j3b1.js" async=""></script><script src="/_next/static/chunks/3oe03qxgd_rid.js" async=""></script><script src="/_next/static/chunks/3w4o9hklow6fg.js" async=""></script><script src="/_next/static/chunks/27jktro2p5rq9.js" async=""></script><script src="/_next/static/chunks/turbopack-026p0g9v9_pva.js" async=""></script><script src="/_next/static/chunks/23zlmarf-go2x.js" async=""></script><script src="/_next/static/chunks/3g0c367tk4esf.js" async=""></script><script src="/_next/static/chunks/2im7c515bo69p.js" async=""></script><link rel="preload" href="/_next/static/chunks/418_591yp64lx.css" as="style"/><link rel="preload" href="/_next/static/chunks/2vm9uslik2wfi.css" as="style"/><title>MostBox</title><meta name="description" content="P2P 文件分享,无需注册"/><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><script src="/_next/static/chunks/0az8vxg2gfuhm.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[14232,[\"/_next/static/chunks/23zlmarf-go2x.js\",\"/_next/static/chunks/3g0c367tk4esf.js\",\"/_next/static/chunks/2im7c515bo69p.js\"],\"ErrorBoundary\"]\n3:I[52925,[\"/_next/static/chunks/23zlmarf-go2x.js\",\"/_next/static/chunks/3g0c367tk4esf.js\",\"/_next/static/chunks/2im7c515bo69p.js\"],\"default\"]\n4:I[39756,[\"/_next/static/chunks/23zlmarf-go2x.js\",\"/_next/static/chunks/3g0c367tk4esf.js\",\"/_next/static/chunks/2im7c515bo69p.js\"],\"default\"]\n5:I[37457,[\"/_next/static/chunks/23zlmarf-go2x.js\",\"/_next/static/chunks/3g0c367tk4esf.js\",\"/_next/static/chunks/2im7c515bo69p.js\"],\"default\"]\n6:I[36768,[\"/_next/static/chunks/23zlmarf-go2x.js\",\"/_next/static/chunks/3g0c367tk4esf.js\",\"/_next/static/chunks/2im7c515bo69p.js\",\"/_next/static/chunks/1v-molv0hbcjl.js\"],\"default\"]\n8:I[97367,[\"/_next/static/chunks/23zlmarf-go2x.js\",\"/_next/static/chunks/3g0c367tk4esf.js\",\"/_next/static/chunks/2im7c515bo69p.js\"],\"OutletBoundary\"]\n9:\"$Sreact.suspense\"\nc:I[97367,[\"/_next/static/chunks/23zlmarf-go2x.js\",\"/_next/static/chunks/3g0c367tk4esf.js\",\"/_next/static/chunks/2im7c515bo69p.js\"],\"ViewportBoundary\"]\ne:I[97367,[\"/_next/static/chunks/23zlmarf-go2x.js\",\"/_next/static/chunks/3g0c367tk4esf.js\",\"/_next/static/chunks/2im7c515bo69p.js\"],\"MetadataBoundary\"]\n10:I[68027,[\"/_next/static/chunks/23zlmarf-go2x.js\",\"/_next/static/chunks/3g0c367tk4esf.js\",\"/_next/static/chunks/2im7c515bo69p.js\"],\"default\",1]\n:HL[\"/_next/static/chunks/418_591yp64lx.css\",\"style\"]\n:HL[\"/_next/static/chunks/2vm9uslik2wfi.css\",\"style\"]\n:HL[\"/_next/static/chunks/2nbju8t9-ux58.css\",\"style\"]\n:HC[\"/\",\"\"]\n"])</script><script>self.__next_f.push([1,"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/418_591yp64lx.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/2vm9uslik2wfi.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/23zlmarf-go2x.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/3g0c367tk4esf.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-2\",{\"src\":\"/_next/static/chunks/2im7c515bo69p.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 \u0026\u0026 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/2nbju8t9-ux58.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/418_591yp64lx.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/chunks/2vm9uslik2wfi.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"eXddCOt9eyz0j78b1m4Ex\"}\n"])</script><script>self.__next_f.push([1,"7:E{\"digest\":\"NEXT_REDIRECT;replace;/web3;307;\"}\n"])</script><script>self.__next_f.push([1,"11:[]\nb:\"$W11\"\n"])</script><script>self.__next_f.push([1,"d:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"a:null\nf:[[\"$\",\"title\",\"0\",{\"children\":\"MostBox\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"P2P 文件分享,无需注册\"}]]\n"])</script></body></html>
|
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/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"ErrorBoundary"]
|
|
3
|
+
3:I[52925,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"default"]
|
|
4
|
+
4:I[39756,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"default"]
|
|
5
|
+
5:I[37457,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"default"]
|
|
6
|
+
6:I[36768,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js","/_next/static/chunks/1v-molv0hbcjl.js"],"default"]
|
|
7
|
+
8:I[97367,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.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/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"ViewportBoundary"]
|
|
10
|
+
e:I[97367,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"MetadataBoundary"]
|
|
11
|
+
10:I[68027,["/_next/static/chunks/23zlmarf-go2x.js","/_next/static/chunks/3g0c367tk4esf.js","/_next/static/chunks/2im7c515bo69p.js"],"default",1]
|
|
12
|
+
:HL["/_next/static/chunks/418_591yp64lx.css","style"]
|
|
13
13
|
:HL["/_next/static/chunks/2vm9uslik2wfi.css","style"]
|
|
14
14
|
:HL["/_next/static/chunks/2nbju8t9-ux58.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/418_591yp64lx.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/chunks/2vm9uslik2wfi.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/23zlmarf-go2x.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/3g0c367tk4esf.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/_next/static/chunks/2im7c515bo69p.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/2nbju8t9-ux58.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/418_591yp64lx.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/chunks/2vm9uslik2wfi.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"eXddCOt9eyz0j78b1m4Ex"}
|
|
17
17
|
7:E{"digest":"NEXT_REDIRECT;replace;/web3;307;"}
|
|
18
18
|
11:[]
|
|
19
19
|
b:"$W11"
|
package/package.json
CHANGED
|
@@ -120,6 +120,18 @@ export function deriveGameRoomLobby(messages = [], options = {}) {
|
|
|
120
120
|
if (event.event === 'player:join') {
|
|
121
121
|
const player = createPlayerFromPayload(event.payload?.player, message.author)
|
|
122
122
|
if (player) upsertPlayer(players, playerMap, player)
|
|
123
|
+
continue
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (event.event === 'player:leave') {
|
|
127
|
+
const address = normalizeAddress(event.payload?.player?.address || message.author)
|
|
128
|
+
if (address) {
|
|
129
|
+
const index = players.findIndex(p => p.address === address)
|
|
130
|
+
if (index !== -1) {
|
|
131
|
+
players.splice(index, 1)
|
|
132
|
+
playerMap.delete(address)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
123
135
|
}
|
|
124
136
|
}
|
|
125
137
|
|
|
@@ -179,7 +179,7 @@ export function canStartRound(players = []) {
|
|
|
179
179
|
return eligible.length >= ZHJ_MIN_PLAYERS && eligible.length <= ZHJ_MAX_PLAYERS
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
export function startRound({ roomCode, players, hostAddress, roundId = createRoundId(), random = Math.random }) {
|
|
182
|
+
export function startRound({ roomCode, players, hostAddress, previousSeq = 0, previousWinner = '', roundId = createRoundId(), random = Math.random }) {
|
|
183
183
|
const participants = players
|
|
184
184
|
.filter(player => Number(player.chips) >= ZHJ_ANTE)
|
|
185
185
|
.slice(0, ZHJ_MAX_PLAYERS)
|
|
@@ -204,17 +204,24 @@ export function startRound({ roomCode, players, hostAddress, roundId = createRou
|
|
|
204
204
|
}
|
|
205
205
|
})
|
|
206
206
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
let turnAddress
|
|
208
|
+
const winnerNorm = normalizeAddress(previousWinner)
|
|
209
|
+
const winnerIndex = winnerNorm
|
|
210
|
+
? publicPlayers.findIndex(p => normalizeAddress(p.address) === winnerNorm)
|
|
211
|
+
: -1
|
|
212
|
+
if (winnerIndex >= 0) {
|
|
213
|
+
turnAddress = publicPlayers[winnerIndex].address
|
|
214
|
+
} else {
|
|
215
|
+
const randomIndex = Math.floor(random() * publicPlayers.length)
|
|
216
|
+
turnAddress = publicPlayers[randomIndex].address
|
|
217
|
+
}
|
|
218
|
+
|
|
212
219
|
const round = {
|
|
213
220
|
roomCode: normalizeRoomCode(roomCode),
|
|
214
221
|
roundId,
|
|
215
222
|
status: 'playing',
|
|
216
223
|
host: normalizeAddress(hostAddress),
|
|
217
|
-
seq: 1,
|
|
224
|
+
seq: previousSeq + 1,
|
|
218
225
|
startedAt: Date.now(),
|
|
219
226
|
ante: ZHJ_ANTE,
|
|
220
227
|
pot: ZHJ_ANTE * publicPlayers.length,
|
|
@@ -226,6 +233,8 @@ export function startRound({ roomCode, players, hostAddress, roundId = createRou
|
|
|
226
233
|
showdown: null,
|
|
227
234
|
appliedEventIds: [],
|
|
228
235
|
hands,
|
|
236
|
+
actionCounts: {},
|
|
237
|
+
compareReveal: {},
|
|
229
238
|
}
|
|
230
239
|
|
|
231
240
|
return round
|
|
@@ -268,6 +277,10 @@ export function normalizePublicRoundState(input) {
|
|
|
268
277
|
appliedEventIds: Array.isArray(input.appliedEventIds)
|
|
269
278
|
? input.appliedEventIds.map(String)
|
|
270
279
|
: [],
|
|
280
|
+
actionCounts: input.actionCounts && typeof input.actionCounts === 'object' ? clone(input.actionCounts) : {},
|
|
281
|
+
compareReveal: input.compareReveal && typeof input.compareReveal === 'object' ? clone(input.compareReveal) : {},
|
|
282
|
+
lastCompare: input.lastCompare && typeof input.lastCompare === 'object' ? clone(input.lastCompare) : null,
|
|
283
|
+
finishedAt: input.finishedAt ? Number(input.finishedAt) : null,
|
|
271
284
|
}
|
|
272
285
|
}
|
|
273
286
|
|
|
@@ -290,8 +303,7 @@ export function validatePlayerAction(round, actionEvent, authorAddress) {
|
|
|
290
303
|
}
|
|
291
304
|
|
|
292
305
|
if (action === 'call') {
|
|
293
|
-
|
|
294
|
-
return player.chips >= need ? { ok: true } : { ok: false, error: '筹码不足,不能跟注' }
|
|
306
|
+
return player.chips >= ZHJ_ANTE ? { ok: true } : { ok: false, error: '筹码不足,不能跟注' }
|
|
295
307
|
}
|
|
296
308
|
|
|
297
309
|
if (action === 'raise') {
|
|
@@ -309,6 +321,11 @@ export function validatePlayerAction(round, actionEvent, authorAddress) {
|
|
|
309
321
|
if (!target || target === author || !targetPlayer || targetPlayer.status !== 'active') {
|
|
310
322
|
return { ok: false, error: '请选择有效的比牌对象' }
|
|
311
323
|
}
|
|
324
|
+
const activePlayers = state.players.filter(p => p.status === 'active')
|
|
325
|
+
const allActed = activePlayers.every(p => (state.actionCounts?.[p.address] || 0) >= 1)
|
|
326
|
+
if (!allActed) {
|
|
327
|
+
return { ok: false, error: '第一轮不能比牌,请先跟注或加注' }
|
|
328
|
+
}
|
|
312
329
|
const need = Math.max(0, state.currentBet - player.bet)
|
|
313
330
|
return player.chips >= need ? { ok: true } : { ok: false, error: '筹码不足,不能比牌' }
|
|
314
331
|
}
|
|
@@ -341,12 +358,16 @@ export function applyPlayerAction(round, actionEvent, authorAddress) {
|
|
|
341
358
|
if (actionEvent.action === 'fold') {
|
|
342
359
|
player.status = 'folded'
|
|
343
360
|
state.lastAction = `${player.name} 弃牌`
|
|
361
|
+
incrementActionCount(state, author)
|
|
344
362
|
return maybeFinishOrAdvance(state, author)
|
|
345
363
|
}
|
|
346
364
|
|
|
347
365
|
if (actionEvent.action === 'call') {
|
|
348
|
-
|
|
366
|
+
player.chips -= ZHJ_ANTE
|
|
367
|
+
player.bet += ZHJ_ANTE
|
|
368
|
+
state.pot += ZHJ_ANTE
|
|
349
369
|
state.lastAction = `${player.name} 跟注`
|
|
370
|
+
incrementActionCount(state, author)
|
|
350
371
|
return maybeFinishOrAdvance(state, author)
|
|
351
372
|
}
|
|
352
373
|
|
|
@@ -355,6 +376,7 @@ export function applyPlayerAction(round, actionEvent, authorAddress) {
|
|
|
355
376
|
state.currentBet += amount
|
|
356
377
|
payToCurrentBet(state, player)
|
|
357
378
|
state.lastAction = `${player.name} 加注 ${amount}`
|
|
379
|
+
incrementActionCount(state, author)
|
|
358
380
|
return maybeFinishOrAdvance(state, author)
|
|
359
381
|
}
|
|
360
382
|
|
|
@@ -362,10 +384,38 @@ export function applyPlayerAction(round, actionEvent, authorAddress) {
|
|
|
362
384
|
payToCurrentBet(state, player)
|
|
363
385
|
const targetAddress = normalizeAddress(actionEvent.target)
|
|
364
386
|
const targetPlayer = state.players.find(item => item.address === targetAddress)
|
|
387
|
+
const initiatorLooked = player.looked
|
|
388
|
+
const targetLookedBefore = targetPlayer.looked
|
|
365
389
|
const diff = compareHands(state.hands?.[author] || [], state.hands?.[targetAddress] || [])
|
|
390
|
+
const winner = diff >= 0 ? player : targetPlayer
|
|
366
391
|
const loser = diff >= 0 ? targetPlayer : player
|
|
367
392
|
loser.status = 'folded'
|
|
393
|
+
loser.looked = true
|
|
394
|
+
if (!state.compareReveal) state.compareReveal = {}
|
|
395
|
+
const bothLooked = initiatorLooked && targetLookedBefore
|
|
396
|
+
const neitherLooked = !initiatorLooked && !targetLookedBefore
|
|
397
|
+
if (bothLooked) {
|
|
398
|
+
state.compareReveal[author] = state.hands?.[targetAddress] || []
|
|
399
|
+
state.compareReveal[targetAddress] = state.hands?.[author] || []
|
|
400
|
+
} else if (neitherLooked) {
|
|
401
|
+
state.compareReveal[loser.address] = state.hands?.[winner.address] || []
|
|
402
|
+
} else {
|
|
403
|
+
const lookedPlayer = initiatorLooked ? player : targetPlayer
|
|
404
|
+
const unlookedPlayer = initiatorLooked ? targetPlayer : player
|
|
405
|
+
state.compareReveal[lookedPlayer.address] = state.hands?.[unlookedPlayer.address] || []
|
|
406
|
+
state.compareReveal[loser.address] = state.hands?.[winner.address] || []
|
|
407
|
+
}
|
|
408
|
+
state.lastCompare = {
|
|
409
|
+
initiator: author,
|
|
410
|
+
target: targetAddress,
|
|
411
|
+
winner: winner.address,
|
|
412
|
+
loser: loser.address,
|
|
413
|
+
initiatorLooked,
|
|
414
|
+
targetLooked: targetLookedBefore,
|
|
415
|
+
timestamp: Date.now(),
|
|
416
|
+
}
|
|
368
417
|
state.lastAction = `${player.name} 与 ${targetPlayer.name} 比牌,${loser.name} 出局`
|
|
418
|
+
incrementActionCount(state, author)
|
|
369
419
|
return maybeFinishOrAdvance(state, author)
|
|
370
420
|
}
|
|
371
421
|
|
|
@@ -387,7 +437,11 @@ export function getAllowedActions(round, address) {
|
|
|
387
437
|
if (ZHJ_RAISE_STEPS.some(amount => validatePlayerAction(round, { action: 'raise', amount }, player.address).ok)) {
|
|
388
438
|
actions.push('raise')
|
|
389
439
|
}
|
|
390
|
-
if (getActiveRoundPlayers(round).length > 1)
|
|
440
|
+
if (getActiveRoundPlayers(round).length > 1) {
|
|
441
|
+
const activePlayers = round.players.filter(p => p.status === 'active')
|
|
442
|
+
const allActed = activePlayers.every(p => (round.actionCounts?.[p.address] || 0) >= 1)
|
|
443
|
+
if (allActed) actions.push('compare')
|
|
444
|
+
}
|
|
391
445
|
actions.push('fold')
|
|
392
446
|
return actions
|
|
393
447
|
}
|
|
@@ -403,6 +457,12 @@ export function chooseBotAction(round, address, random = Math.random) {
|
|
|
403
457
|
item => item.address !== botAddress
|
|
404
458
|
)
|
|
405
459
|
|
|
460
|
+
function canCompare() {
|
|
461
|
+
if (!allowedActions.includes('compare') || activeOpponents.length === 0) return false
|
|
462
|
+
const target = activeOpponents[0].address
|
|
463
|
+
return validatePlayerAction(round, { action: 'compare', target }, botAddress).ok
|
|
464
|
+
}
|
|
465
|
+
|
|
406
466
|
if (
|
|
407
467
|
allowedActions.includes('look') &&
|
|
408
468
|
!player?.looked &&
|
|
@@ -412,7 +472,7 @@ export function chooseBotAction(round, address, random = Math.random) {
|
|
|
412
472
|
}
|
|
413
473
|
|
|
414
474
|
if (
|
|
415
|
-
|
|
475
|
+
canCompare() &&
|
|
416
476
|
activeOpponents.length === 1 &&
|
|
417
477
|
handStrength >= 0.54 &&
|
|
418
478
|
random() < 0.58
|
|
@@ -426,7 +486,7 @@ export function chooseBotAction(round, address, random = Math.random) {
|
|
|
426
486
|
}
|
|
427
487
|
|
|
428
488
|
if (
|
|
429
|
-
|
|
489
|
+
canCompare() &&
|
|
430
490
|
activeOpponents.length > 0 &&
|
|
431
491
|
handStrength >= 0.82 &&
|
|
432
492
|
random() < 0.36
|
|
@@ -455,6 +515,11 @@ function payToCurrentBet(state, player) {
|
|
|
455
515
|
state.pot += need
|
|
456
516
|
}
|
|
457
517
|
|
|
518
|
+
function incrementActionCount(state, address) {
|
|
519
|
+
if (!state.actionCounts) state.actionCounts = {}
|
|
520
|
+
state.actionCounts[address] = (state.actionCounts[address] || 0) + 1
|
|
521
|
+
}
|
|
522
|
+
|
|
458
523
|
function maybeFinishOrAdvance(state, fromAddress) {
|
|
459
524
|
const active = getActiveRoundPlayers(state)
|
|
460
525
|
if (active.length === 1) {
|
|
@@ -466,15 +531,18 @@ function maybeFinishOrAdvance(state, fromAddress) {
|
|
|
466
531
|
|
|
467
532
|
function finishRound(state, winnerAddress) {
|
|
468
533
|
const winner = state.players.find(player => player.address === winnerAddress)
|
|
534
|
+
const winAmount = state.pot
|
|
469
535
|
if (winner) {
|
|
470
536
|
winner.chips += state.pot
|
|
471
537
|
}
|
|
472
538
|
state.status = 'finished'
|
|
473
539
|
state.winner = winnerAddress
|
|
540
|
+
state.winAmount = winAmount
|
|
474
541
|
state.turnAddress = ''
|
|
475
542
|
state.showdown = state.hands ? clone(state.hands) : null
|
|
476
|
-
state.lastAction = winner ? `${winner.name} 赢得 ${
|
|
543
|
+
state.lastAction = winner ? `${winner.name} 赢得 ${winAmount} 筹码` : '本局结束'
|
|
477
544
|
state.pot = 0
|
|
545
|
+
state.finishedAt = Date.now()
|
|
478
546
|
return advanceSeq(state)
|
|
479
547
|
}
|
|
480
548
|
|
|
@@ -182,6 +182,45 @@ export function passGanDengYanTurn(room, address) {
|
|
|
182
182
|
return { ok: true, state: publicGanDengYanRoom(state) }
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
+
export function removeGanDengYanPlayer(room, address) {
|
|
186
|
+
const state = hydrateGanDengYanRoom(room)
|
|
187
|
+
if (!state) return null
|
|
188
|
+
const normalizedAddress = normalizeAddress(address)
|
|
189
|
+
const index = state.players.findIndex(p => p.address === normalizedAddress)
|
|
190
|
+
if (index === -1) return publicGanDengYanRoom(state)
|
|
191
|
+
const leaving = state.players[index]
|
|
192
|
+
const wasCurrentTurn = state.currentSeat === leaving.seat
|
|
193
|
+
const wasLastWinner = state.lastWinnerSeat === leaving.seat
|
|
194
|
+
state.players.splice(index, 1)
|
|
195
|
+
state.passSeats = state.passSeats.filter(seat => seat !== leaving.seat)
|
|
196
|
+
state.log.unshift(`${leaving.name} 已退出房间`)
|
|
197
|
+
const remaining = orderedPlayers(state)
|
|
198
|
+
if (state.status === 'playing') {
|
|
199
|
+
if (remaining.length <= 1) {
|
|
200
|
+
if (remaining.length === 1) {
|
|
201
|
+
finishGame(state, remaining[0])
|
|
202
|
+
} else {
|
|
203
|
+
state.status = 'finished'
|
|
204
|
+
state.log.unshift('玩家不足,本局结束')
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
if (wasCurrentTurn) {
|
|
208
|
+
const active = activePlayers(state)
|
|
209
|
+
if (active.length > 0) {
|
|
210
|
+
const nextIndex = active.findIndex(p => p.seat > leaving.seat)
|
|
211
|
+
state.currentSeat = active[nextIndex >= 0 ? nextIndex : 0].seat
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (wasLastWinner && state.table) {
|
|
215
|
+
state.table = null
|
|
216
|
+
state.passSeats = []
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
state.seq += 1
|
|
221
|
+
return publicGanDengYanRoom(state)
|
|
222
|
+
}
|
|
223
|
+
|
|
185
224
|
export function publicGanDengYanRoom(room) {
|
|
186
225
|
if (!room) return null
|
|
187
226
|
return {
|
package/server/src/index.js
CHANGED
|
@@ -67,6 +67,7 @@ import {
|
|
|
67
67
|
|
|
68
68
|
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
|
69
69
|
const CHAT_FILE_ROOT = 'chat-file'
|
|
70
|
+
const TRANSIENT_CHANNEL_TYPES = new Set(['game'])
|
|
70
71
|
|
|
71
72
|
function normalizeOwnerAddress(address) {
|
|
72
73
|
const value = String(address || '').trim()
|
|
@@ -3181,7 +3182,13 @@ export class MostBoxEngine extends EventEmitter {
|
|
|
3181
3182
|
#saveChannelsMetadata() {
|
|
3182
3183
|
try {
|
|
3183
3184
|
const metadataPath = this.#getChannelsMetadataPath()
|
|
3184
|
-
this.#
|
|
3185
|
+
const persistentChannels = this.#channels.filter(
|
|
3186
|
+
channel => !TRANSIENT_CHANNEL_TYPES.has(channel?.type)
|
|
3187
|
+
)
|
|
3188
|
+
this.#atomicWrite(
|
|
3189
|
+
metadataPath,
|
|
3190
|
+
JSON.stringify(persistentChannels, null, 2)
|
|
3191
|
+
)
|
|
3185
3192
|
} catch (err) {
|
|
3186
3193
|
console.error('Failed to save channels metadata:', err.message)
|
|
3187
3194
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.page-module__bH9uOG__page{background:var(--bg-primary);min-height:calc(100vh - 64px);padding:18px}.page-module__bH9uOG__headerActions{align-items:center;gap:8px;display:flex}.page-module__bH9uOG__entry{grid-template-columns:minmax(0,1fr) 360px;align-items:center;gap:48px;max-width:1040px;min-height:calc(100vh - 116px);margin:0 auto;display:grid}.page-module__bH9uOG__entryBrand{align-items:center;gap:22px;display:flex}.page-module__bH9uOG__cardMark{width:112px;height:152px;box-shadow:var(--shadow-lg);color:#fff;background:#c93d32;border:8px solid #fff;border-radius:8px;flex:0 0 112px;place-items:center;font-size:70px;font-weight:900;display:grid}.page-module__bH9uOG__entryBrand h1{color:var(--text-primary);margin:0;font-size:64px;line-height:.95}.page-module__bH9uOG__entryBrand p{max-width:520px;color:var(--text-secondary);margin:18px 0 0;font-size:18px;line-height:1.7}.page-module__bH9uOG__entryPanel,.page-module__bH9uOG__panel,.page-module__bH9uOG__handPanel{border:1px solid var(--glass-border);background:var(--glass-bg);box-shadow:var(--glass-shadow);border-radius:8px}.page-module__bH9uOG__entryPanel{gap:16px;padding:22px;display:grid}.page-module__bH9uOG__accountLine,.page-module__bH9uOG__scoreMeta,.page-module__bH9uOG__roomBar,.page-module__bH9uOG__badges,.page-module__bH9uOG__actions{align-items:center;gap:10px;display:flex}.page-module__bH9uOG__accountLine{color:var(--text-secondary);justify-content:space-between;font-size:14px}.page-module__bH9uOG__accountLine strong{max-width:190px;color:var(--text-primary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.page-module__bH9uOG__joinForm,.page-module__bH9uOG__joinForm label{gap:8px;display:grid}.page-module__bH9uOG__joinForm label{color:var(--text-secondary);font-size:14px}.page-module__bH9uOG__joinForm input{border:1px solid var(--glass-border);background:var(--bg-primary);width:100%;min-height:40px;color:var(--text-primary);border-radius:8px;padding:0 12px}.page-module__bH9uOG__status{color:var(--text-secondary);margin:0;font-size:14px}.page-module__bH9uOG__gameGrid{grid-template:"table side"minmax(360px,1fr)"hand side"/minmax(0,1fr) 320px;gap:14px;min-height:calc(100vh - 104px);display:grid}.page-module__bH9uOG__tablePanel{color:#fff;background:radial-gradient(circle,#ffffff2e,#0000 46%),#247658;border-radius:8px;grid-area:table;grid-template-rows:auto auto 1fr auto;gap:14px;min-height:360px;padding:16px;display:grid}.page-module__bH9uOG__roomBar{justify-content:space-between}.page-module__bH9uOG__roomBar div:first-child{gap:2px;display:grid}.page-module__bH9uOG__roomBar span,.page-module__bH9uOG__badges span{color:#ffffffc7;font-size:13px}.page-module__bH9uOG__badges{flex-wrap:wrap;justify-content:flex-end}.page-module__bH9uOG__dangerBadge{background:#c5312a47;border:1px solid #ffcd4794;border-radius:999px;padding:4px 9px;font-weight:800;color:#ffd66b!important}.page-module__bH9uOG__seats{grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:10px;display:grid}.page-module__bH9uOG__player{color:#17211b;background:#ffffffeb;border:1px solid #17211b1f;border-radius:8px;align-items:center;gap:10px;min-width:0;padding:8px;display:flex}.page-module__bH9uOG__tablePanel .page-module__bH9uOG__player{color:#fff;background:#ffffff2e}.page-module__bH9uOG__active{outline:3px solid #f3cf5a}.page-module__bH9uOG__winner{outline:3px solid #7be39e}.page-module__bH9uOG__avatar{color:#fff;background:#17211b;border-radius:50%;flex:0 0 40px;place-items:center;width:40px;height:40px;font-size:13px;font-weight:900;display:grid}.page-module__bH9uOG__player strong,.page-module__bH9uOG__player span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.page-module__bH9uOG__player span{opacity:.76;max-width:190px;font-size:12px}.page-module__bH9uOG__centerTable{grid-template-columns:120px minmax(0,1fr) 120px;align-items:center;gap:14px;display:grid}.page-module__bH9uOG__deckBox,.page-module__bH9uOG__playedBox{text-align:center;background:#0b221942;border-radius:8px}.page-module__bH9uOG__deckBox{gap:6px;padding:18px 8px;display:grid}.page-module__bH9uOG__deckBox span{opacity:.75;font-size:13px}.page-module__bH9uOG__deckBox strong{font-size:30px}.page-module__bH9uOG__playedBox{place-items:center;min-height:150px;padding:16px;display:grid}.page-module__bH9uOG__playedCards{flex-wrap:wrap;justify-content:center;gap:8px;margin-top:10px;display:flex}.page-module__bH9uOG__notice{text-align:center;background:#0000002e;border-radius:8px;padding:10px 12px;font-weight:800}.page-module__bH9uOG__resultDetail{gap:4px;font-weight:600;display:grid}.page-module__bH9uOG__resultDetail p{margin:0;font-size:14px}.page-module__bH9uOG__sidePanel{grid-area:side;align-content:start;gap:12px;display:grid}.page-module__bH9uOG__panel{gap:12px;padding:14px;display:grid}.page-module__bH9uOG__panel h3{color:var(--text-primary);margin:0;font-size:15px}.page-module__bH9uOG__scoreMeta{color:var(--text-secondary);justify-content:space-between;font-size:13px}.page-module__bH9uOG__scoreRow{border-top:1px solid var(--glass-border);color:var(--text-primary);justify-content:space-between;padding-top:8px;display:flex}.page-module__bH9uOG__logPanel{max-height:280px;overflow:auto}.page-module__bH9uOG__logPanel p{color:var(--text-secondary);margin:0;font-size:13px;line-height:1.5}.page-module__bH9uOG__handPanel{grid-area:hand;gap:12px;padding:12px;display:grid}.page-module__bH9uOG__hand{gap:8px;min-height:118px;padding:4px 2px 10px;display:flex;overflow-x:auto}.page-module__bH9uOG__cardButton{background:0 0;border:0;border-radius:8px;flex:none;min-height:auto;padding:0;transition:transform .16s}.page-module__bH9uOG__picked{transform:translateY(-14px)}.page-module__bH9uOG__card{color:#17211b;text-align:left;background:#fff;border:1px solid #dbe1dc;border-radius:8px;grid-template-rows:auto 1fr;width:62px;height:92px;padding:7px;display:grid;box-shadow:0 8px 18px #0e16111f}.page-module__bH9uOG__card span{font-size:15px;font-weight:900}.page-module__bH9uOG__card i{place-self:end;font-size:22px;font-style:normal;font-weight:900}.page-module__bH9uOG__red{color:#c93d32}.page-module__bH9uOG__black{color:#17211b}.page-module__bH9uOG__small{width:46px;height:66px;padding:5px}.page-module__bH9uOG__small span{font-size:12px}.page-module__bH9uOG__small i{font-size:15px}.page-module__bH9uOG__actions{flex-wrap:wrap}.page-module__bH9uOG__preview{border:1px solid var(--glass-border);background:var(--bg-primary);min-height:46px;color:var(--text-secondary);border-radius:8px;flex:260px;padding:7px 10px;display:grid}.page-module__bH9uOG__preview strong{color:var(--text-primary);font-size:14px}.page-module__bH9uOG__preview span{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.page-module__bH9uOG__valid{border-color:#176b4d70}@media (max-width:980px){.page-module__bH9uOG__entry{grid-template-columns:1fr;align-content:center}.page-module__bH9uOG__gameGrid{grid-template-columns:1fr;grid-template-areas:"table""hand""side"}}@media (max-width:640px){.page-module__bH9uOG__page{padding:10px}.page-module__bH9uOG__entryBrand{flex-direction:column;align-items:flex-start}.page-module__bH9uOG__entryBrand h1{font-size:42px}.page-module__bH9uOG__cardMark{border-width:6px;flex-basis:100px;width:74px;height:100px;font-size:46px}.page-module__bH9uOG__centerTable{grid-template-columns:1fr}.page-module__bH9uOG__actions>button{flex:110px}}
|