Skip to content

Commit

Permalink
log state
Browse files Browse the repository at this point in the history
  • Loading branch information
tailuge committed Jun 18, 2024
1 parent edca3f1 commit 48123d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/container/browsercontainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export class BrowserContainer {
}

startReplay(replay) {
console.log(replay)
this.breakState = this.parse(decodeURIComponent(replay))
console.log(this.breakState)
if (Date.now() - this.breakState.now < 500000) {
Expand Down
10 changes: 9 additions & 1 deletion test/gen/diamond.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,13 @@ describe("jsonCrush", () => {
done()
})


const bad = `https://tailuge.github.io/billiards/dist/?ruletype=snooker&state=%28%27init%21%5B%24Q%2BT8645T24U%2C-j084380814484855Q21937523769470274T8642%2C0Tk01%2C0Q7208%2C0%2Cj23986553562S715Q144446Z80v39k7Q7879QkUQ8457QU38Q846TU37Q9U3Tk02Q9U9T0668Q9U6Q0671TW8881407667921T5315991337382775Q96u9u91388U81QU3721U5220v6186Q9621970994338601TU35k0Z87930511Q87923Z92584601T2S3344811829063%2Cj3935838802U887T36242749Z0S3755%2Cj09499Z92336568T25596k5281194045%2Cj0187062806539k7Qk09672810906v244%2Cj0206846147370106Q474277737u31935%2Cj15318W68939533Q491u632645063407%5D~shots%21%5B%22XU153153153153153OJ05V6DX8577u7710S3594L3.43875F%24OJ%2B_J0111U49815296408OX299794450130U014D2.84u153657914833L4.9ZNk5Fj07S856047456245OX3432242831158396BY%2AX2991537846886426OX0225u951535704283DXSU339979956484Lj32637N3Fj195955385S56528OX18Zv19336571Z4_X%2FJu666666666666666DJ9297272184550487%25X197335v229013978OX3284082021983u9BY%2AX058834840S145521OJ294v420270727607DX813746341U0Z87%25J9778284764097188OJ26295u2913011u_Xk45045045045045045O%3ADj4067672859559628%25j2890738976838352OJuu27205082U496BP%2AJqX0V59D4.86399653U22461L3.193ZN7Fj3113827327S8073OJ29641064449574744_%20D-2.23384757088ZS%23j245136u85652333OJv5147Z31370v3BP%2A%20D-3.614Z0883627753%23J8669924959388464OJU04646515058k14_%3BOJ21v1v1v1v1v1D-j744S395378U475%23J59157k637636978OJ4928572484523u1B%26J9743Z5kkkk5O0Hd%215%29%5D%29%2A3.1026943625995973e-14OJ3D7.830877308756267L3.684375Fj08245765724S865OJ4S3504218395997_J%2FX05V6Dj3044710484236743L4.666875Fj02248746991187uOX389378615114185UBP%2AXqJ2747747747747748DJ759228Z44662196LJ786kkkkkk1FJ5v6809256108742OX21827769k9923584_X21552S8659v5133OJ20868340765233068DX93143181402U374Lj2772N02FjU2062280u96528OJ2364520805702285BP%2AX13338975553749208OJ2687139243091956D-4.027296110856934%3C8294056426943863OX53Uu4059027643_J09486832980505136OJ2846049894151S1DX9Z110Z15314409Lj52287N2FX18489492220983275OJ3U8261502869WBY%2AJqX0V59DX092509S5147v948%3CZ3S910110618822OX48328893258Wv5_J%2FJZu2u2u2u2u3DJ9676914322439181L2.898375FJ8502325297808555OX510u99880596818BP%2AJ0137470Z2588150SOX099684867242u813D-j59U8108762790ULj91587N2FXv3428431986u51OJ5014595268966328_JW7Z84Z3340419OJ267S8v27v282SD2.706836627322867L2.407Z5FX64329S736669448OX024119869Z309053B%26J7205O0Hd%212%29%5D%29%2AXv849336774U853OJ241Z26195791v01D3.3513931559v8824L2.407Z5Fj2606633514298724OX21577S2074318Z3H%210%29%5D~start%21v187257205S~now%21v18726079Z1~score%2170~wholeGame%21false%29%2A%29%2C%22BH%210%29%2C%28%27type%21%27RERACK%27~ballinfo%21%28%27balls%21%5B%28%27poD~z%210%29~angle%21F~po%26H~z%210%29~iJ0.L~power%21N5kkkk0O~y%21P%26jv9O0Hd%216%29%5D%29Q%2CJS54T%2CXU03V85585585585585W135X-JY%260O0Hd%214%29%5D%29Z12_H%210%2Aj1.k00q049S9S9S9S955Ou16v17%20%3AO%3B%22%28%27type%21%27AIM%27~offset%21%28%27x%21%23L2.21062N3F%24-j0649043227374102%25LJ73687N1F%26s%21%28%27x%21%2BS90706793083953%2F0WWWWW14O%3AJ040S0S0S0S0S%3BJ1U6U6U6U6U6%3CLJ93337N1FJ%01%3C%3B%3A%2F%2B%26%25%24%23%22%20vuqkj_ZYXWVUTSQPONLJHFDB%2A_`

it("decode", (done) => {
const d = decodeURIComponent(bad)
expect(d).to.be.length(2673)
console.log(d)
done()
})

})

0 comments on commit 48123d0

Please sign in to comment.