Draft (in progress): Pandanet integration#112
Draft (in progress): Pandanet integration#112ernestasromeika wants to merge 135 commits intoale64bit:mainfrom
Conversation
…mes (first page, 50 games), works with opening the game into sgf viewer, downloading and linking to AI Sensei UI controls
|
Thanks for the contribution! I was wondering: I looked at Panda's API some time ago and it seemed to me that it was telnet-based (namely, at |
| import 'package:wqhub/wq/wq.dart' as wq; | ||
| import 'package:wqhub/game_client/game_record.dart'; | ||
|
|
||
| class PandanetSgfParser { |
There was a problem hiding this comment.
Were you having issues with GameRecord.fromSgf()? Happy to help get the shared SGF parser working for Pandanet files (if it's not already)
There was a problem hiding this comment.
Hey! Yeah, GameRecord.fromSgf() kept giving me all sorts of indentation errors/unexpected character errors and once I changed it enough for pandanet's sgfs to pass, I wasn't sure it would hold the backwards compatibility with tygem/fox/ogs anymore. I had an idea to upload a couple sample sgf files from each server and have a a unit test for each server that would run sgfs through this function, but haven't gotten around to it yet. What do you think?
There was a problem hiding this comment.
Yeah, I think some "golden tests" would be good!
I think the existing unit tests do somewhat represent the OGS and FoxWQ output, so you should have some confidence in a refactor. But some real data cases would definitely solidify the suite!
There was a problem hiding this comment.
I just opened #131 to make SGF "snapshot" tests - let me know if this looks something like what you had in mind!
There was a problem hiding this comment.
Could you share one of the files that gave the unexpected character issues? I tried running an SGF from one of my own Pandanet games, and didn't see the same issues.
If GitHub doesn't allow the file to be shared, maybe you can share via the Discord
There was a problem hiding this comment.
Sure!
Here's my last 3 games on pandanet:
https://my.pandanet.co.jp/cgi-bin/cgi.exe?MHkey=HCFGDSUPYMELZNYRBZNVNXMG&pg=DownLoadUGI&v1=7C29BA6CF3A655E09343CEB35F21&v2=7F31B967FAAA58E8&mode=sgf
I suspect it's this part that's the issue:
(;
GM[1]EV[Internet Go Server game: GoPopz vs Hurakami]
US[Brought to you by IGS PANDANET]
CoPyright[
Copyright (c) PANDANET Inc. 2025
Permission to reproduce this game is given, provided proper credit is given.
No warrantee, implied or explicit, is understood.
Use of this game is an understanding and agreement of this notice.
]
GN[GoPopz-Hurakami(B) IGS]RE[B+Resign]
PW[GoPopz]WR[2k ]NW[27]
PB[Hurakami]BR[1k+]NB[28]
PC[IGS: igs.joyjoy.net 6969]DT[2025-11-12]
SZ[19]TM[3600]KM[6.500000]LT[]
RR[Normal]
;B[pd]BL[3597]C[
Hurakami 1k+: 66 have a nice game
GoPopz 2k : Hi!
]
;W[cp]WL[3595]
;B[pq]BL[3596]C[
GoPopz 2k : have a good game!
]
;W[dc]WL[3577]
;B[ep]BL[3594]
;W[hq]WL[3568]
;B[de]BL[3573]
...
I wonder if GoPanda's sgf editor re-parses this and strips out the CoPyright part... I have to check it when I have some more free time, been a little busy with my main job(s) lately 🙂
There was a problem hiding this comment.
Ohh that's pretty gnarly. I took a stab at it (main...benjaminpjones:WeiqiHub:lower-props) and found the following issues:
- [non-standard] the
CoPyrightthing - newline after the opening
(; - [non-standard]
OS[]field after the game tree
I wonder if GoPanda's sgf editor re-parses this and strips out the CoPyright part
Yeah, I think this must be the case - the file I downloaded from GoPanda2 seemed okay.
I'm confident we can make the parser work for Panda without regressing the other servers (Sabaki does this), though it does feel bad to have to handle all the non-standard junk.
There was a problem hiding this comment.
Yeah I think we should just be as tolerant as possible and call it a day. Nobody follows the standard strictly anyway. Another nasty example is foxwq's 100x multiplier on komi and using player names containing brackets, which forces you to parse nested brackets inside property values.
TCP connector to pandanet (needs testing)
… app to the server. Partial board state management (still fails on loss of socket connection and doesn't set handi correctly).
…tion/rotational issue remaining
… tcp layer instead of the html scape, added a test of pandanet sgf for general parser (not passing)
cae9122 to
3009a61
Compare
Implemented login flow + user info fetching for pandanet. Added new Rank enum value - "unknown", for when rank is provisional or hidden (i.e. '?', '-'), Added rendering of unknown rank to appear as "?". Changed OGS game client to default to "unknown" and not to "6 kyu" when rank can't be determined.
TODO: implement finding game, playing the game flows.