require "./setup"
info = Swars::Agent::Record.new(remote_run: true, key: Swars::BattleKey["Hululudayo-shikacha-20250702_200538"]).fetch
# info = Swars::Agent::Record.new(remote_run: true, key: Swars::BattleKey["KKKRRRYYY-th_1230-20241225_205830"]).fetch
pp info
tp Swars::Agent::PropsAdapter.new(info).to_h
# puts Swars::Battle["KKKRRRYYY-th_1230-20241225_205830"].to_temporary_csa

# >> {"gameHash" =>
# >>   {"name" => "Hululudayo-shikacha-20250702_200538",
# >>    "gtype" => "sf",
# >>    "opponent_type" => 1,
# >>    "init_pos_type" => 0,
# >>    "sente" => "Hululudayo",
# >>    "gote" => "shikacha",
# >>    "sente_dan" => -30,
# >>    "gote_dan" => -30,
# >>    "sente_avatar" => "_",
# >>    "gote_avatar" => "_",
# >>    "result" => "GOTE_WIN_CHECKMATE",
# >>    "handicap" => 0,
# >>    "init_sfen_position" =>
# >>     "lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL b - 1",
# >>    "moves" =>
# >>     [{"t" => 35945, "n" => 0, "m" => "+7776FU"},
# >>      {"t" => 35998, "n" => 1, "m" => "-3334FU"},
# >>      {"t" => 35941, "n" => 2, "m" => "+6766FU"},
# >>      {"t" => 35996, "n" => 3, "m" => "-4344FU"},
# >>      {"t" => 35919, "n" => 4, "m" => "+2868HI"},
# >>      {"t" => 35992, "n" => 5, "m" => "-8242HI"},
# >>      {"t" => 35853, "n" => 6, "m" => "+4958KI"},
# >>      {"t" => 35989, "n" => 7, "m" => "-5162OU"},
# >>      {"t" => 35836, "n" => 8, "m" => "+5949OU"},
# >>      {"t" => 35983, "n" => 9, "m" => "-6272OU"},
# >>      {"t" => 35831, "n" => 10, "m" => "+4938OU"},
# >>      {"t" => 35980, "n" => 11, "m" => "-7282OU"},
# >>      {"t" => 35828, "n" => 12, "m" => "+3828OU"},
# >>      {"t" => 35977, "n" => 13, "m" => "-7172GI"},
# >>      {"t" => 35824, "n" => 14, "m" => "+3938GI"},
# >>      {"t" => 35975, "n" => 15, "m" => "-4152KI"},
# >>      {"t" => 35808, "n" => 16, "m" => "+5859KI"},
# >>      {"t" => 35970, "n" => 17, "m" => "-9394FU"},
# >>      {"t" => 35805, "n" => 18, "m" => "+6958KI"},
# >>      {"t" => 35964, "n" => 19, "m" => "-3132GI"},
# >>      {"t" => 35744, "n" => 20, "m" => "+5949KI"},
# >>      {"t" => 35956, "n" => 21, "m" => "-6364FU"},
# >>      {"t" => 35716, "n" => 22, "m" => "+1716FU"},
# >>      {"t" => 35955, "n" => 23, "m" => "-1314FU"},
# >>      {"t" => 35670, "n" => 24, "m" => "+8977KE"},
# >>      {"t" => 35936, "n" => 25, "m" => "-9495FU"},
# >>      {"t" => 35554, "n" => 26, "m" => "+7978GI"},
# >>      {"t" => 35934, "n" => 27, "m" => "-5263KI"},
# >>      {"t" => 35524, "n" => 28, "m" => "+7867GI"},
# >>      {"t" => 35924, "n" => 29, "m" => "-3243GI"},
# >>      {"t" => 35504, "n" => 30, "m" => "+6756GI"},
# >>      {"t" => 35922, "n" => 31, "m" => "-4354GI"},
# >>      {"t" => 35403, "n" => 32, "m" => "+6665FU"},
# >>      {"t" => 35919, "n" => 33, "m" => "-6465FU"},
# >>      {"t" => 35379, "n" => 34, "m" => "+5665GI"},
# >>      {"t" => 35916, "n" => 35, "m" => "-5465GI"},
# >>      {"t" => 35376, "n" => 36, "m" => "+6865HI"},
# >>      {"t" => 35911, "n" => 37, "m" => "-0064FU"},
# >>      {"t" => 35293, "n" => 38, "m" => "+6525HI"},
# >>      {"t" => 35881, "n" => 39, "m" => "-4243HI"},
# >>      {"t" => 35169, "n" => 40, "m" => "+0055GI"},
# >>      {"t" => 35763, "n" => 41, "m" => "-4445FU"},
# >>      {"t" => 35003, "n" => 42, "m" => "+5546GI"},
# >>      {"t" => 35744, "n" => 43, "m" => "-4546FU"},
# >>      {"t" => 34999, "n" => 44, "m" => "+4746FU"},
# >>      {"t" => 35731, "n" => 45, "m" => "-4346HI"},
# >>      {"t" => 34993, "n" => 46, "m" => "+0047FU"},
# >>      {"t" => 35714, "n" => 47, "m" => "-4676HI"},
# >>      {"t" => 34956, "n" => 48, "m" => "+2523RY"},
# >>      {"t" => 35703, "n" => 49, "m" => "-2277UM"},
# >>      {"t" => 34944, "n" => 50, "m" => "+8877KA"},
# >>      {"t" => 35700, "n" => 51, "m" => "-7677RY"},
# >>      {"t" => 34893, "n" => 52, "m" => "+2321RY"},
# >>      {"t" => 35545, "n" => 53, "m" => "-1113KY"},
# >>      {"t" => 34848, "n" => 54, "m" => "+2122RY"},
# >>      {"t" => 35488, "n" => 55, "m" => "-0066KE"},
# >>      {"t" => 34802, "n" => 56, "m" => "+0055KE"},
# >>      {"t" => 35467, "n" => 57, "m" => "-6362KI"},
# >>      {"t" => 34632, "n" => 58, "m" => "+0063FU"},
# >>      {"t" => 35465, "n" => 59, "m" => "-6252KI"},
# >>      {"t" => 34445, "n" => 60, "m" => "+0041KA"},
# >>      {"t" => 35428, "n" => 61, "m" => "-5251KI"},
# >>      {"t" => 34277, "n" => 62, "m" => "+6362TO"},
# >>      {"t" => 35336, "n" => 63, "m" => "-5162KI"},
# >>      {"t" => 34040, "n" => 64, "m" => "+5563NK"},
# >>      {"t" => 35212, "n" => 65, "m" => "-6263KI"},
# >>      {"t" => 34027, "n" => 66, "m" => "+4163UM"},
# >>      {"t" => 35180, "n" => 67, "m" => "-0052GI"},
# >>      {"t" => 33943, "n" => 68, "m" => "+6352UM"},
# >>      {"t" => 35129, "n" => 69, "m" => "-6171KI"},
# >>      {"t" => 33733, "n" => 70, "m" => "+5263UM"},
# >>      {"t" => 35105, "n" => 71, "m" => "-6658NK"},
# >>      {"t" => 33727, "n" => 72, "m" => "+4958KI"},
# >>      {"t" => 34868, "n" => 73, "m" => "-0055KA"},
# >>      {"t" => 33692, "n" => 74, "m" => "+2213RY"},
# >>      {"t" => 34862, "n" => 75, "m" => "-7263GI"},
# >>      {"t" => 33643, "n" => 76, "m" => "+1312RY"},
# >>      {"t" => 34852, "n" => 77, "m" => "-6372GI"},
# >>      {"t" => 33436, "n" => 78, "m" => "+0036KY"},
# >>      {"t" => 34751, "n" => 79, "m" => "-3435FU"},
# >>      {"t" => 33375, "n" => 80, "m" => "+0026KI"},
# >>      {"t" => 34735, "n" => 81, "m" => "-3536FU"},
# >>      {"t" => 33371, "n" => 82, "m" => "+2636KI"},
# >>      {"t" => 34524, "n" => 83, "m" => "-7779RY"},
# >>      {"t" => 33161, "n" => 84, "m" => "+5756FU"},
# >>      {"t" => 34515, "n" => 85, "m" => "-0039KA"},
# >>      {"t" => 33121, "n" => 86, "m" => "+2818OU"},
# >>      {"t" => 34511, "n" => 87, "m" => "-0028KI"},
# >>      {"t" => 33115, "n" => 88, "m" => "+1817OU"},
# >>      {"t" => 34434, "n" => 89, "m" => "-2819KI"},
# >>      {"t" => 33082, "n" => 90, "m" => "+1726OU"},
# >>      {"t" => 34297, "n" => 91, "m" => "-5544KA"},
# >>      {"t" => 32945, "n" => 92, "m" => "+2625OU"},
# >>      {"t" => 34251, "n" => 93, "m" => "-0033GI"},
# >>      {"t" => 32939, "n" => 94, "m" => "+1213RY"},
# >>      {"t" => 34230, "n" => 95, "m" => "-0021KY"},
# >>      {"t" => 32919, "n" => 96, "m" => "+2514OU"},
# >>      {"t" => 34178, "n" => 97, "m" => "-3324GI"},
# >>      {"t" => 32874, "n" => 98, "m" => "+1324RY"},
# >>      {"t" => 34173, "n" => 99, "m" => "-2124KY"},
# >>      {"t" => 32866, "n" => 100, "m" => "+1424OU"},
# >>      {"t" => 34060, "n" => 101, "m" => "-7999RY"},
# >>      {"t" => 32740, "n" => 102, "m" => "+2413OU"},
# >>      {"t" => 33947, "n" => 103, "m" => "-0021KY"},
# >>      {"t" => 32710, "n" => 104, "m" => "+0012GI"},
# >>      {"t" => 33873, "n" => 105, "m" => "-0033HI"},
# >>      {"t" => 32691, "n" => 106, "m" => "+1314OU"},
# >>      {"t" => 33868, "n" => 107, "m" => "-0013KY"}],
# >>    "sente_time_limit" => 3600,
# >>    "gote_time_limit" => 3600,
# >>    "sente_byoyomi" => 60,
# >>    "gote_byoyomi" => 60},
# >>  "userConfig" =>
# >>   {"imgPieceType" => "ja_single",
# >>    "soundEnable" => true,
# >>    "voiceType" => 0,
# >>    "situationFormat" => "evaluation"},
# >>  "isNeedRealtime" => false,
# >>  "isNeedTargetParent" => false,
# >>  "isNotReload" => false,
# >>  "settings" =>
# >>   {"cdn.image" => "//image-pona.heroz.jp",
# >>    "cdn.sound" => "//sound-pona.heroz.jp",
# >>    "goldengate.match.host" => "wss://shogiwars-game-web.heroz.jp:7012",
# >>    "javascript.log_level" => "error"},
# >>  "version" => "",
# >>  "askWatchGamesOptions" => {"isBotOnly" => false, "closedEventid" => nil}}
# >> |-----------+-----------------------------------------------------------------|
# >> |   対局KEY | Hululudayo-shikacha-20250702_200538                             |
# >> |  対局日時 | 2025-07-02 20:05:38                                             |
# >> |    ルール | カスタム                                                        |
# >> |      種類 | 友達                                                            |
# >> |  開始局面 | 通常                                                            |
# >> |    手合割 | 平手                                                            |
# >> |      結末 | 詰み                                                            |
# >> |  両者名前 | Hululudayo:30級 vs shikacha:30級                                |
# >> |  勝った側 | △                                                              |
# >> | 対局後か? | true                                                            |
# >> | 対局中か? | false                                                           |
# >> | 正常終了? | true                                                            |
# >> | 棋譜有り? | true                                                            |
# >> |  棋譜手数 | 108                                                             |
# >> |  初期配置 | lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL b - 1 |
# >> |-----------+-----------------------------------------------------------------|
