Skip to content

Comments

Draft (in progress): Pandanet integration#112

Draft
ernestasromeika wants to merge 135 commits intoale64bit:mainfrom
ernestasromeika:feature/pandanet-integration
Draft

Draft (in progress): Pandanet integration#112
ernestasromeika wants to merge 135 commits intoale64bit:mainfrom
ernestasromeika:feature/pandanet-integration

Conversation

@ernestasromeika
Copy link

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.

ale64bit and others added 30 commits July 2, 2025 13:58
Ernestas Romeika added 2 commits November 1, 2025 19:05
…mes (first page, 50 games), works with opening the game into sgf viewer, downloading and linking to AI Sensei UI controls
@ale64bit
Copy link
Owner

ale64bit commented Nov 2, 2025

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 igs.joyjoy.net 7777, which seems to currently work and contain help, etc.). Is there an alternative http-based API?

import 'package:wqhub/wq/wq.dart' as wq;
import 'package:wqhub/game_client/game_record.dart';

class PandanetSgfParser {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you having issues with GameRecord.fromSgf()? Happy to help get the shared SGF parser working for Pandanet files (if it's not already)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just opened #131 to make SGF "snapshot" tests - let me know if this looks something like what you had in mind!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Author

@ernestasromeika ernestasromeika Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

https://my.pandanet.co.jp/cgi-bin/cgi.exe?MHkey=HCFGDSUPYMELZNYRBZNVNXMG&pg=DownLoadUGI&v1=7C29BA6CF3A655E09342CEB35F21&v2=7B2BC170FFAD5AE798&mode=sgf

https://my.pandanet.co.jp/cgi-bin/cgi.exe?MHkey=HCFGDSUPYMELZNYRBZNVNXMG&pg=DownLoadUGI&v1=7C29BA6CF3A655E09342CEB35F21&v2=7B2BC168FAA85AE594&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 🙂

Copy link
Contributor

@benjaminpjones benjaminpjones Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh that's pretty gnarly. I took a stab at it (main...benjaminpjones:WeiqiHub:lower-props) and found the following issues:

  • [non-standard] the CoPyright thing
  • 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.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Ernestas Romeika and others added 8 commits November 4, 2025 00:38
… tcp layer instead of the html scape, added a test of pandanet sgf for general parser (not passing)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants