Debian Codegraph @

src/network/igsconnection.cpp

raw symbols SCIP
1 /***************************************************************************
2 * Copyright (C) 2009 by The qGo Project *
3 * *
4 * This file is part of qGo. *
5 * *
6 * qGo is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, see <http://www.gnu.org/licenses/> *
18 * or write to the Free Software Foundation, Inc., *
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20 ***************************************************************************/
21
22 #include <QtDebug>
23 #include "igsconnection.h"cxx . . $ `<file>/src/network/igsconnection.h`/
24 #include "consoledispatch.h"cxx . . $ `<file>/src/network/consoledispatch.h`/
25 #include "room.h"cxx . . $ `<file>/src/network/room.h`/ // Should not depend on room FIXME
26 #include "boarddispatch.h"cxx . . $ `<file>/src/network/boarddispatch.h`/
27 #include "gamedialog.h"cxx . . $ `<file>/src/network/gamedialog.h`/
28 #include "talk.h"cxx . . $ `<file>/src/network/talk.h`/
29 #include "gamedialogflags.h"cxx . . $ `<file>/src/network/gamedialogflags.h`/
30 #include "playergamelistings.h"cxx . . $ `<file>/src/network/playergamelistings.h`/
31 #include "matchnegotiationstate.h"cxx . . $ `<file>/src/network/matchnegotiationstate.h`/
32
33 #define PLAYERSLISTREFRESH_SECONDScxx . . $ `src/network/igsconnection.cpp:33:9`! 300
34 #define GAMESLISTREFRESH_SECONDScxx . . $ `src/network/igsconnection.cpp:34:9`! 180
35
36 IGSConnectioncxx . . $ IGSConnection#::IGSConnectioncxx . . $ IGSConnection#IGSConnection(231cf4fc7da7cd6f).(const ConnectionCredentialscxx . . $ ConnectionCredentials# credentials)
37 : NetworkConnectioncxx . . $ NetworkConnection#NetworkConnection(231cf4fc7da7cd6f).(credentials)
38 {
39 if(openConnectioncxx . . $ NetworkConnection#openConnection(6f40ee5c4c30d87e).(hostnamecxx . . $ NetworkConnection#hostname.,portcxx . . $ NetworkConnection#port.))
40 {
41 setStatecxx . . $ NetworkConnection#setState(41e728cff2b23034).(Logincxx . . $ Login.);
42 }
43 else
44 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Can't open Connection\n"); //throw error?
45
46 initcxx . . $ IGSConnection#init(49f6e7a06ebc5aa8).();
47 }
48
49 void IGSConnectioncxx . . $ IGSConnection#::initcxx . . $ IGSConnection#init(49f6e7a06ebc5aa8).(void)
50 {
51 keepAliveTimercxx . . $ IGSConnection#keepAliveTimer. = 0;
52 playersListRefreshTimercxx . . $ IGSConnection#playersListRefreshTimer. = 0;
53 gamesListRefreshTimercxx . . $ IGSConnection#gamesListRefreshTimer. = 0;
54 textCodeccxx . . $ IGSConnection#textCodec. = QTextCodeccxx . . $ QTextCodec#::codecForLocalecxx . . $ QTextCodec#codecForLocale(6599407a1b23811).();
55 btimecxx . . $ IGSConnection#btime. = new TimeRecordcxx . . $ TimeRecord#();
56 wtimecxx . . $ IGSConnection#wtime. = new TimeRecordcxx . . $ TimeRecord#();
57 protocol_save_intcxx . . $ IGSConnection#protocol_save_int. = -1;
58 game_were_playingcxx . . $ IGSConnection#game_were_playing. = 0;
59 guestAccountcxx . . $ IGSConnection#guestAccount. = false;
60 needToSendClientTogglecxx . . $ IGSConnection#needToSendClientToggle. = true;
61 }
62
63 IGSConnectioncxx . . $ IGSConnection#::~cxx . . $ IGSConnection#`~IGSConnection`(ced63f7c635d850d).IGSConnectioncxx . . $ IGSConnection#()
64 {
65 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Destroying IGS connection");
66 /* Maybe closeConnection shouldn't be here?
67 * at any rate, if there's been an error it
68 * really shouldn't be here */
69 sendDisconnectcxx . . $ IGSConnection#sendDisconnect(49f6e7a06ebc5aa8).();
70 closeConnectioncxx . . $ NetworkConnection#closeConnection(b45ddcbc8423892c).();
71 delete wtimecxx . . $ IGSConnection#wtime.;
72 delete btimecxx . . $ IGSConnection#btime.;
73 }
74
75 QStringcxx . . $ QString# IGSConnectioncxx . . $ IGSConnection#::getPlaceStringcxx . . $ IGSConnection#getPlaceString(4365c3963150523e).(void)
76 {
77 return "IGS"cxx . . $ QString#QString(85c52e162fed56f9).;
78 }
79
80 void IGSConnectioncxx . . $ IGSConnection#::sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).(QStringcxx . . $ QString# text)
81 {
82 // FIXME We're getting some nonsense on the end of this sometimes for
83 // some reason
84 //text += "\r\n";
85 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "IGSConnection::sendText: " <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). text;
86 QByteArraycxx . . $ QByteArray# raw = textCodeccxx . . $ IGSConnection#textCodec.->fromUnicodecxx . . $ QTextCodec#fromUnicode(e72629479c734b12).(text);
87 if(writecxx . . $ NetworkConnection#write(1df18506ef0a631b).(raw.datacxx . . $ QByteArray#data(41208ce6ca65dd58).(), raw.sizecxx . . $ QByteArray#size(455f465bc33b4cdf).()) < 0)
88 qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!("*** failed sending to host: %s", raw.datacxx . . $ QByteArray#data(41208ce6ca65dd58).());
89 }
90
91 /* This is kind of ugly, but we can't add sending return-newline to
92 * superclass, which means either reallocing text here to send both
93 * or this little flag trick to sneak in a second write when we
94 * got the first through. Note that the real solution would be
95 * to change every sendText command in this file to have a "\r\n"
96 * on it. That is sort of the better way. FIXME
97 * Note also that network connection does readLine in writeFromBuffer
98 * and also write an additional newline...*/
99 void IGSConnectioncxx . . $ IGSConnection#::sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).(const char * text)
100 {
101 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).(QStringcxx . . $ QString#QString(85c52e162fed56f9).(text));
102 }
103
104 void IGSConnectioncxx . . $ IGSConnection#::sendDisconnectcxx . . $ IGSConnection#sendDisconnect(49f6e7a06ebc5aa8).(void)
105 {
106 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("exit\r\n");
107 }
108
109 /* What about a room_id?? */
110 void IGSConnectioncxx . . $ IGSConnection#::sendMsgcxx . . $ IGSConnection#sendMsg(679a3afc1f0f3212).(unsigned int game_id, QStringcxx . . $ QString# text)
111 {
112 BoardDispatchcxx . . $ BoardDispatch# * bd = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(game_id);
113 if(!bd)
114 {
115 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("IGSConnection::sendMsg(): No board dispatch to send message from");
116 return;
117 }
118 GameDatacxx . . $ GameData# * g = bd->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
119 switch(g->gameModecxx . . $ GameData#gameMode.)
120 {
121 case modeReviewcxx . . $ modeReview.:
122 case modeMatchcxx . . $ modeMatch.:
123 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("say " +cxx . . $ operator+(c75c3ae4eb9af1a8). text +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
124 break;
125 case modeObservecxx . . $ modeObserve.:
126 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("kibitz " +cxx . . $ operator+(c75c3ae4eb9af1a8). QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(game_id) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). text +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
127 break;
128 default:
129 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("IGSConnection::sendMsg(): no game type");
130 break;
131 }
132 }
133
134 void IGSConnectioncxx . . $ IGSConnection#::sendMsgcxx . . $ IGSConnection#sendMsg(c3abbc2f7b873519).(PlayerListingcxx . . $ PlayerListing# * player, QStringcxx . . $ QString# text)
135 {
136 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("tell " +cxx . . $ operator+(c75c3ae4eb9af1a8). player->namecxx . . $ PlayerListing#name. +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). text +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
137 }
138
139 void IGSConnectioncxx . . $ IGSConnection#::sendTogglecxx . . $ IGSConnection#sendToggle(37c160c81b6367f7).(const QStringcxx . . $ QString# & param, bool val)
140 {
141 QStringcxx . . $ QString# valuecxx . . $ QString#QString(ced63f7c635d850d).;
142 if (val)
143 value =cxx . . $ QString#`operator=`(d02845eef0c33901). " true";
144 else
145 value =cxx . . $ QString#`operator=`(d02845eef0c33901). " false";
146 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("toggle " +cxx . . $ operator+(c75c3ae4eb9af1a8). param +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). value +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
147 }
148
149 /* If we can observe something besides games,
150 * like rooms or people, then this name is a bit
151 * iffy too... */
152 void IGSConnectioncxx . . $ IGSConnection#::sendObservecxx . . $ IGSConnection#sendObserve(963dc8955d49573e).(const GameListingcxx . . $ GameListing# *game)
153 {
154 unsigned int game_id = game->numbercxx . . $ GameListing#number.;
155 if(getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(game_id)) //don't observe twice, it unobserves
156 return;
157 protocol_save_intcxx . . $ IGSConnection#protocol_save_int. = game_id; //since this isn't always reported back
158 match_negotiation_statecxx . . $ NetworkConnection#match_negotiation_state.->sendJoinRoomcxx . . $ MatchNegotiationState#sendJoinRoom(ed53e3bbd3fa2f69).(game_id);
159 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("observe " +cxx . . $ operator+(c75c3ae4eb9af1a8). QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(game_id) +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
160 }
161
162 void IGSConnectioncxx . . $ IGSConnection#::stopObservingcxx . . $ IGSConnection#stopObserving(963dc8955d49573e).(const GameListingcxx . . $ GameListing# *game)
163 {
164 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("unobserve " +cxx . . $ operator+(c75c3ae4eb9af1a8). QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(game->numbercxx . . $ GameListing#number.) +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
165 }
166
167 void IGSConnectioncxx . . $ IGSConnection#::stopReviewingcxx . . $ IGSConnection#stopReviewing(963dc8955d49573e).(const GameListingcxx . . $ GameListing# * game)
168 {
169 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("review quit " +cxx . . $ operator+(c75c3ae4eb9af1a8). QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(game->numbercxx . . $ GameListing#number.) +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
170 }
171
172 void IGSConnectioncxx . . $ IGSConnection#::sendStatsRequestcxx . . $ IGSConnection#sendStatsRequest(cac334474c82cf3a).(const PlayerListingcxx . . $ PlayerListing# * opponent)
173 {
174 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("stats " +cxx . . $ operator+(c75c3ae4eb9af1a8). opponent->namecxx . . $ PlayerListing#name. +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
175 }
176
177 void IGSConnectioncxx . . $ IGSConnection#::sendPlayersRequestcxx . . $ IGSConnection#sendPlayersRequest(49f6e7a06ebc5aa8).(void)
178 {
179 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("userlist\r\n");
180 }
181
182 void IGSConnectioncxx . . $ IGSConnection#::sendGamesRequestcxx . . $ IGSConnection#sendGamesRequest(49f6e7a06ebc5aa8).(void)
183 {
184 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("games\r\n");
185 }
186
187 void IGSConnectioncxx . . $ IGSConnection#::sendRoomListRequestcxx . . $ IGSConnection#sendRoomListRequest(49f6e7a06ebc5aa8).(void)
188 {
189 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("room\r\n");
190 }
191
192 void IGSConnectioncxx . . $ IGSConnection#::sendJoinRoomcxx . . $ IGSConnection#sendJoinRoom(27567cc4e87be946).(const RoomListingcxx . . $ RoomListing# & room, const char * /*password*/)
193 {
194 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("join " +cxx . . $ operator+(c75c3ae4eb9af1a8). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(room.numbercxx . . $ RoomListing#number.) +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
195 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "IGSConnection::sendJoinRoom(): Joining " <<cxx . . $ QDebug#`operator<<`(6e3b7ae53f380c3). room.numbercxx . . $ RoomListing#number.;
196 setCurrentRoomcxx . . $ IGSConnection#setCurrentRoom(824521e80a967d76).(room); //FIXME unless we get a message after joining?
197 //but then the other send requests should
198 //be there
199 }
200
201 void IGSConnectioncxx . . $ IGSConnection#::sendJoinChannelcxx . . $ IGSConnection#sendJoinChannel(17c16455472eee56).(const ChannelListingcxx . . $ ChannelListing# & room)
202 {
203 if(room.numbercxx . . $ ChannelListing#number. == 0)
204 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("yell \\-1\r\n");
205 else
206 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("yell \\" +cxx . . $ operator+(c75c3ae4eb9af1a8). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(room.numbercxx . . $ ChannelListing#number.) +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
207 //set the current room somehow?
208 }
209
210 void IGSConnectioncxx . . $ IGSConnection#::sendMatchInvitecxx . . $ IGSConnection#sendMatchInvite(cac334474c82cf3a).(const PlayerListingcxx . . $ PlayerListing# * player)
211 {
212 MatchRequestcxx . . $ MatchRequest# * m = 0;
213 /* No match Invites, just popup the dialog */
214 GameDialogcxx . . $ GameDialog# * gd = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(player);
215 if(player->nmatchcxx . . $ PlayerListing#nmatch.)
216 {
217 const PlayerListingcxx . . $ PlayerListing# * us = getOurListingcxx . . $ NetworkConnection#getOurListing(c84291d55c8466c6).();
218 m = new MatchRequestcxx . . $ MatchRequest#();
219 m->opponentcxx . . $ MatchRequest#opponent. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). player->namecxx . . $ PlayerListing#name.;
220 m->opponent_idcxx . . $ MatchRequest#opponent_id. = player->idcxx . . $ PlayerListing#id.;
221 m->their_rankcxx . . $ MatchRequest#their_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). player->rankcxx . . $ PlayerListing#rank.;
222 m->our_namecxx . . $ MatchRequest#our_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). us->namecxx . . $ PlayerListing#name.;
223 m->our_rankcxx . . $ MatchRequest#our_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). us->rankcxx . . $ PlayerListing#rank.;
224
225 m->timeSystemcxx . . $ MatchRequest#timeSystem. = player->nmatch_timeSystemcxx . . $ PlayerListing#nmatch_timeSystem.;
226 m->maintimecxx . . $ MatchRequest#maintime. = player->nmatch_timeMincxx . . $ PlayerListing#nmatch_timeMin.;
227 m->periodtimecxx . . $ MatchRequest#periodtime. = player->nmatch_BYMincxx . . $ PlayerListing#nmatch_BYMin.;
228 m->stones_periodscxx . . $ MatchRequest#stones_periods. = 25;
229 m->nmatch_timeMaxcxx . . $ MatchRequest#nmatch_timeMax. = player->nmatch_timeMaxcxx . . $ PlayerListing#nmatch_timeMax.;
230 m->nmatch_BYMaxcxx . . $ MatchRequest#nmatch_BYMax. = player->nmatch_BYMaxcxx . . $ PlayerListing#nmatch_BYMax.;
231 if(!player->nmatch_handicapMincxx . . $ PlayerListing#nmatch_handicapMin.)
232 m->handicapcxx . . $ MatchRequest#handicap. = 1;
233 else
234 m->handicapcxx . . $ MatchRequest#handicap. = player->nmatch_handicapMincxx . . $ PlayerListing#nmatch_handicapMin.;
235 m->nmatch_handicapMaxcxx . . $ MatchRequest#nmatch_handicapMax. = player->nmatch_handicapMaxcxx . . $ PlayerListing#nmatch_handicapMax.;
236 m->opponent_is_challengercxx . . $ MatchRequest#opponent_is_challenger. = false;
237 m->first_offercxx . . $ MatchRequest#first_offer. = true; //because we're sending it!!
238 //mr->first_offer = false; //because we don't want to toggle to match from nmatch
239 //mr->rated = false;
240 }
241 gd->recvRequestcxx . . $ GameDialog#recvRequest(461bc273ee812ab9).(m, getGameDialogFlagscxx . . $ IGSConnection#getGameDialogFlags(f708dce9a8856c70).());
242 }
243
244 void IGSConnectioncxx . . $ IGSConnection#::sendAddTimecxx . . $ IGSConnection#sendAddTime(d4f767463ce0a6b3).(int minutes)
245 {
246 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("addtime " +cxx . . $ operator+(c75c3ae4eb9af1a8). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(minutes) +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
247 }
248
249 /* I'm thinking you can only play one game at a time on IGS,
250 * but the game_ids are there in case it changes its mind */
251 void IGSConnectioncxx . . $ IGSConnection#::adjournGamecxx . . $ IGSConnection#adjournGame(963dc8955d49573e).(const GameListingcxx . . $ GameListing# */*game_id*/)
252 {
253 /* double check this one */
254 /* There are three of these adjournGame, sendAdjournGame, and sendAdjournRequest FIXME */
255 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("adjourn\r\n");
256 }
257
258 void IGSConnectioncxx . . $ IGSConnection#::sendMovecxx . . $ IGSConnection#sendMove(74f2a753311a2adf).(unsigned int game_id, MoveRecordcxx . . $ MoveRecord# * move)
259 {
260 switch(move->flagscxx . . $ MoveRecord#flags.)
261 {
262 case MoveRecordcxx . . $ MoveRecord#::PASScxx . . $ MoveRecord#PASS.:
263 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("pass\r\n");
264 break;
265 case MoveRecordcxx . . $ MoveRecord#::REQUESTUNDOcxx . . $ MoveRecord#REQUESTUNDO.:
266 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("undoplease\r\n"); //so polite
267 break;
268 case MoveRecordcxx . . $ MoveRecord#::UNDOcxx . . $ MoveRecord#UNDO.:
269 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("undo\r\n");
270 break;
271 case MoveRecordcxx . . $ MoveRecord#::REFUSEUNDOcxx . . $ MoveRecord#REFUSEUNDO.:
272 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("noundo\r\n");
273 break;
274 case MoveRecordcxx . . $ MoveRecord#::RESIGNcxx . . $ MoveRecord#RESIGN.:
275 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("resign\r\n");
276 break;
277 case MoveRecordcxx . . $ MoveRecord#::DONE_SCORINGcxx . . $ MoveRecord#DONE_SCORING.:
278 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("done\r\n");
279 break;
280 case MoveRecordcxx . . $ MoveRecord#::NONEcxx . . $ MoveRecord#NONE.:
281 case MoveRecordcxx . . $ MoveRecord#::REMOVEcxx . . $ MoveRecord#REMOVE.: //handled simply
282 case MoveRecordcxx . . $ MoveRecord#::UNREMOVEcxx . . $ MoveRecord#UNREMOVE.:
283 {
284 char c1 = move->xcxx . . $ MoveRecord#x. - 1 + 'A';
285 if(move->xcxx . . $ MoveRecord#x. > 8) // no I in IGS
286 c1++;
287 BoardDispatchcxx . . $ BoardDispatch# * bd = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(game_id);
288 if(!bd)
289 {
290 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("No board dispatch to send move from");
291 return;
292 }
293 GameDatacxx . . $ GameData# * g = bd->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
294 int c2 = g->board_sizecxx . . $ GameData#board_size. + 1 - move->ycxx . . $ MoveRecord#y.;
295 /* Why do we send the id here but
296 * not with the others? Can we play
297 * multiple games?? */
298 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).(QStringcxx . . $ QString#QString(f2c90172ce699d92).(c1cxx . . $ QChar#QChar(f349c77f591a7878).) +cxx . . $ operator+(fab9b4f80031f353). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(c2) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(game_id) +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
299 }
300 break;
301 default:
302 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("IGSConnection: unhandled type");
303 break;
304 }
305 }
306
307 void IGSConnectioncxx . . $ IGSConnection#::sendMatchRequestcxx . . $ IGSConnection#sendMatchRequest(969a5d62d7a1bd6e).(MatchRequestcxx . . $ MatchRequest# * mr)
308 {
309 QStringcxx . . $ QString# colorcxx . . $ QString#QString(ced63f7c635d850d).;
310 switch(mr->color_requestcxx . . $ MatchRequest#color_request.)
311 {
312 case MatchRequestcxx . . $ MatchRequest#::BLACKcxx . . $ MatchRequest#BLACK.:
313 color =cxx . . $ QString#`operator=`(d02845eef0c33901). " B ";
314 break;
315 case MatchRequestcxx . . $ MatchRequest#::WHITEcxx . . $ MatchRequest#WHITE.:
316 color =cxx . . $ QString#`operator=`(d02845eef0c33901). " W ";
317 break;
318 case MatchRequestcxx . . $ MatchRequest#::NIGIRIcxx . . $ MatchRequest#NIGIRI.:
319 color =cxx . . $ QString#`operator=`(d02845eef0c33901). " N ";
320 break;
321 }
322 /* FIXME nmatch almost shouldn't be a setting on the match
323 * request. We should check the settings here and if they're
324 * fairly simple, change it to match in order to be compatible
325 * with more other clients... we need to check if this is
326 * our first offer as well we don't want to change to match
327 * mid negotiation.
328 * nmatch does have to be a setting though so we can't change
329 * it through negotiation on game dialog*/
330 if(mr->first_offercxx . . $ MatchRequest#first_offer.)
331 {
332 mr->first_offercxx . . $ MatchRequest#first_offer. = false;
333 if(mr->timeSystemcxx . . $ MatchRequest#timeSystem. == canadiancxx . . $ canadian. && color !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). " N ")
334 mr->nmatchcxx . . $ MatchRequest#nmatch. = false;
335 if(mr->handicapcxx . . $ MatchRequest#handicap.)
336 mr->nmatchcxx . . $ MatchRequest#nmatch. = true;
337 }
338 if(mr->nmatchcxx . . $ MatchRequest#nmatch.)
339 {
340 if(mr->timeSystemcxx . . $ MatchRequest#timeSystem. == byoyomicxx . . $ byoyomi.)
341 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("nmatch " +cxx . . $ operator+(c75c3ae4eb9af1a8). mr->opponentcxx . . $ MatchRequest#opponent. +cxx . . $ operator+(fab9b4f80031f353).
342 color +cxx . . $ operator+(fab9b4f80031f353).
343 QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(mr->handicapcxx . . $ MatchRequest#handicap.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
344 QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(mr->board_sizecxx . . $ MatchRequest#board_size.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
345 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(mr->maintimecxx . . $ MatchRequest#maintime.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
346 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(mr->periodtimecxx . . $ MatchRequest#periodtime.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
347 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(mr->stones_periodscxx . . $ MatchRequest#stones_periods.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(3d22f08efddf8107).
348 "0 0 0\r\n");
349 else if(mr->timeSystemcxx . . $ MatchRequest#timeSystem. == canadiancxx . . $ canadian.)
350 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("nmatch " +cxx . . $ operator+(c75c3ae4eb9af1a8). mr->opponentcxx . . $ MatchRequest#opponent. +cxx . . $ operator+(fab9b4f80031f353).
351 color +cxx . . $ operator+(fab9b4f80031f353).
352 QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(mr->handicapcxx . . $ MatchRequest#handicap.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
353 QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(mr->board_sizecxx . . $ MatchRequest#board_size.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
354 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(mr->maintimecxx . . $ MatchRequest#maintime.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
355 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(mr->periodtimecxx . . $ MatchRequest#periodtime.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
356 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(mr->stones_periodscxx . . $ MatchRequest#stones_periods.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(3d22f08efddf8107).
357 "0 0 0\r\n");
358
359 }
360 else
361 {
362 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("match " +cxx . . $ operator+(c75c3ae4eb9af1a8). mr->opponentcxx . . $ MatchRequest#opponent. +cxx . . $ operator+(fab9b4f80031f353).
363 color +cxx . . $ operator+(fab9b4f80031f353).
364 QStringcxx . . $ QString#::numbercxx . . $ QString#number(da83c6b4fd8c0e98).(mr->board_sizecxx . . $ MatchRequest#board_size.) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
365 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(mr->maintimecxx . . $ MatchRequest#maintime. / 60) +cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353).
366 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(mr->periodtimecxx . . $ MatchRequest#periodtime. / 60) +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
367 }
368 match_playerNamecxx . . $ IGSConnection#match_playerName. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). mr->opponentcxx . . $ MatchRequest#opponent.;
369 }
370
371 unsigned long IGSConnectioncxx . . $ IGSConnection#::getGameDialogFlagscxx . . $ IGSConnection#getGameDialogFlags(f708dce9a8856c70).(void)
372 {
373 //GDF_STONES25_FIXED is only set in "match" not "nmatch"
374 //there's also pmatch and tdmatch now I think
375 return (GDF_CANADIANcxx . . $ `src/network/gamedialogflags.h:26:9`! | /*GDF_BYOYOMI |*/ GDF_CANADIAN300cxx . . $ `src/network/gamedialogflags.h:38:9`! | GDF_BY_CAN_MAIN_MINcxx . . $ `src/network/gamedialogflags.h:36:9`! |
376 GDF_NIGIRI_EVENcxx . . $ `src/network/gamedialogflags.h:34:9`! | GDF_KOMI_FIXED6cxx . . $ `src/network/gamedialogflags.h:39:9`!
377 /*| GDF_STONES25_FIXED*/);
378 }
379
380 void IGSConnectioncxx . . $ IGSConnection#::declineMatchOffercxx . . $ IGSConnection#declineMatchOffer(cac334474c82cf3a).(const PlayerListingcxx . . $ PlayerListing# * opponent)
381 {
382 // also possibly a "withdraw" message before opponent has responded FIXME
383 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).("decline " +cxx . . $ operator+(c75c3ae4eb9af1a8). opponent->namecxx . . $ PlayerListing#name. +cxx . . $ operator+(3d22f08efddf8107). "\r\n");
384 }
385
386 void IGSConnectioncxx . . $ IGSConnection#::acceptMatchOffercxx . . $ IGSConnection#acceptMatchOffer(27875a747def42ce).(const PlayerListingcxx . . $ PlayerListing# * /*opponent*/, MatchRequestcxx . . $ MatchRequest# * mr)
387 {
388 /* For IGS, we just send the same match request, assuming it hasn't changed.
389 * It would be bad to have the connection code hold the match request, so
390 * we'll have the gamedialogdispatch pass it along and we will trust
391 * that its the same.*/
392 sendMatchRequestcxx . . $ IGSConnection#sendMatchRequest(969a5d62d7a1bd6e).(mr);
393 }
394
395 QTimecxx . . $ QTime# IGSConnectioncxx . . $ IGSConnection#::gd_checkMainTimecxx . . $ IGSConnection#gd_checkMainTime(71240b9f3410da6b).(TimeSystemcxx . . $ TimeSystem# s, const QTimecxx . . $ QTime# & t)
396 {
397 // match settings are between 1 and 530 with seemingly
398 // infinite byo yomi time
399 // nmatch is 0 to 3600 for byotime
400 // byomoves 0 to 25
401 // koryotimecount 0 - 100
402 // koryosec 0 - 600
403 // preboyoyomi 0 - 10
404 // no handicap nigiri
405 // if byomoves is not 1 koryo count must be 0
406 // if koryosec is not zero koryo count must not be 0
407 // time mod 60, but they're all like that
408 // note that we currently have match settings preventing
409 // pre byoyomi as well as koryo
410 QTimecxx . . $ QTime# c = NetworkConnectioncxx . . $ NetworkConnection#::gd_checkMainTimecxx . . $ NetworkConnection#gd_checkMainTime(71240b9f3410da6b).(s, t);
411 int seconds = (c.minutecxx . . $ QTime#minute(455f465bc33b4cdf).() * 60) + c.secondcxx . . $ QTime#second(455f465bc33b4cdf).();
412 int minutes = c.minutecxx . . $ QTime#minute(455f465bc33b4cdf).();
413 switch(s)
414 {
415 case canadiancxx . . $ canadian.:
416 if(minutes < 1)
417 return QTimecxx . . $ QTime#QTime(748afa4755bc9595).(0, 1, 0);
418 else if(minutes > 530)
419 return QTimecxx . . $ QTime#QTime(748afa4755bc9595).(8, 50, 0);
420 break;
421 case byoyomicxx . . $ byoyomi.:
422 //FIXME isn't only periodtime supposed to be less than 5?
423 if(seconds >= 300)
424 return QTimecxx . . $ QTime#QTime(748afa4755bc9595).(0, 4, 0);
425 else
426 return QTimecxx . . $ QTime#QTime(748afa4755bc9595).(0, c.minutecxx . . $ QTime#minute(455f465bc33b4cdf).(), 0);
427 break;
428 default:
429 break;
430 }
431 return c;
432 }
433
434 QTimecxx . . $ QTime# IGSConnectioncxx . . $ IGSConnection#::gd_checkPeriodTimecxx . . $ IGSConnection#gd_checkPeriodTime(71240b9f3410da6b).(TimeSystemcxx . . $ TimeSystem# s, const QTimecxx . . $ QTime# & t)
435 {
436 int seconds = (t.minutecxx . . $ QTime#minute(455f465bc33b4cdf).() * 60) + t.secondcxx . . $ QTime#second(455f465bc33b4cdf).();
437 switch(s)
438 {
439 case canadiancxx . . $ canadian.:
440 if(seconds < 300)
441 return QTimecxx . . $ QTime#QTime(748afa4755bc9595).(0, 5, 0);
442 break;
443 case byoyomicxx . . $ byoyomi.:
444 if(seconds > 299)
445 return QTimecxx . . $ QTime#QTime(748afa4755bc9595).(0, 4, 59);
446 else if(seconds < 5) //actually should depend on maintime but...
447 return QTimecxx . . $ QTime#QTime(748afa4755bc9595).(0, 0, 5);
448 break;
449 default:
450 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("unsupported IGS time type p");
451 break;
452 }
453 return t;
454 }
455
456 unsigned int IGSConnectioncxx . . $ IGSConnection#::gd_checkPeriodscxx . . $ IGSConnection#gd_checkPeriods(c827b1ce4ef0d032).(TimeSystemcxx . . $ TimeSystem# s, unsigned int p)
457 {
458 switch(s)
459 {
460 case canadiancxx . . $ canadian.:
461 if(p > 25)
462 return 25;
463 else
464 return p;
465 break;
466 case byoyomicxx . . $ byoyomi.:
467 if(p > 100)
468 return 100;
469 else if(p < 1)
470 return 1;
471 else
472 return p;
473 break;
474 default:
475 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("unsupported IGS time type");
476 break;
477 }
478 return p;
479 }
480
481
482 /* Perhaps IGS does not allow multiple games, but this here will be trickier
483 * possibly, with other services that might since there's no game id here */
484 void IGSConnectioncxx . . $ IGSConnection#::sendAdjournRequestcxx . . $ IGSConnection#sendAdjournRequest(49f6e7a06ebc5aa8).(void)
485 {
486 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("adjourn\r\n");
487 }
488
489 void IGSConnectioncxx . . $ IGSConnection#::sendAdjourncxx . . $ IGSConnection#sendAdjourn(49f6e7a06ebc5aa8).(void)
490 {
491 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("adjourn\r\n");
492 }
493
494 void IGSConnectioncxx . . $ IGSConnection#::sendRefuseAdjourncxx . . $ IGSConnection#sendRefuseAdjourn(49f6e7a06ebc5aa8).(void)
495 {
496 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("decline adjourn\r\n");
497 }
498
499 /* There's honestly not much of a reason why we moved this out
500 * of the mainwindow_server except that it doesn't really belong
501 * there and we don't want the mainwindow ui code to be coupled
502 * to the IGS code. That said, since we've yet to add
503 * another seek facility to a different protocol, its completely
504 * tailored to IGS, but I guess its a start */
505 void IGSConnectioncxx . . $ IGSConnection#::sendSeekcxx . . $ IGSConnection#sendSeek(c6d377b4419439f6).(SeekConditioncxx . . $ SeekCondition# * s)
506 {
507 //seek entry 1 19 5 3 0
508 QStringcxx . . $ QString# send_seek = "seek entry " +cxx . . $ operator+(c75c3ae4eb9af1a8).
509 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(s->numbercxx . . $ SeekCondition#number.) +cxx . . $ operator+(3d22f08efddf8107).
510 " 19 " +cxx . . $ operator+(fab9b4f80031f353). s->strength_wishedcxx . . $ SeekCondition#strength_wished. +cxx . . $ operator+(3d22f08efddf8107). "\r\n";
511 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).(send_seekcxx . . $ QString#QString(132dd6869045752b).);
512 }
513
514 void IGSConnectioncxx . . $ IGSConnection#::sendSeekCancelcxx . . $ IGSConnection#sendSeekCancel(49f6e7a06ebc5aa8).(void)
515 {
516 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("seek entry_cancel\r\n");
517 }
518
519 /*void IGSConnection::setAccountAttrib(AccountAttib * aa)
520 {
521
522 }*/
523
524 /* So server sends type codes */
525 void IGSConnectioncxx . . $ IGSConnection#::sendToggleClientOncxx . . $ IGSConnection#sendToggleClientOn(49f6e7a06ebc5aa8).(void)
526 {
527 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("toggle client on\r\n");
528 }
529
530 void IGSConnectioncxx . . $ IGSConnection#::sendListChannelscxx . . $ IGSConnection#sendListChannels(49f6e7a06ebc5aa8).(void)
531 {
532 //could also clear channel list but unnecessary
533 ChannelListingcxx . . $ ChannelListing# * c = new ChannelListingcxx . . $ ChannelListing#();
534 c->numbercxx . . $ ChannelListing#number. = 0;
535 c->namecxx . . $ ChannelListing#name. =cxx . . $ QString#`operator=`(d02845eef0c33901). "No Channel";
536 recvChannelListingcxx . . $ NetworkConnection#recvChannelListing(1317f7c0eb828e93).(c);
537 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("channels\r\n");
538 }
539
540 void IGSConnectioncxx . . $ IGSConnection#::handlePendingDatacxx . . $ IGSConnection#handlePendingData(49f6e7a06ebc5aa8).()
541 {
542 int bytes;
543
544 switch(connectionStatecxx . . $ NetworkConnection#connectionState.)
545 {
546 case Logincxx . . $ Login.:
547 bytes = qsocketcxx . . $ NetworkConnection#qsocket.->bytesAvailablecxx . . $ QAbstractSocket#bytesAvailable(98833e9ab7de59a4).();
548 if(bytes)
549 {
550 QByteArraycxx . . $ QByteArray# data = qsocketcxx . . $ NetworkConnection#qsocket.->readAllcxx . . $ QIODevice#readAll(b3c286cec66e09f4).();
551 handleLogincxx . . $ IGSConnection#handleLogin(7df51288a9ebd664).(QStringcxx . . $ QString#QString(45672f3c6961a244).(data));
552 }
553 break;
554 case Passwordcxx . . $ Password.:
555 bytes = qsocketcxx . . $ NetworkConnection#qsocket.->bytesAvailablecxx . . $ QAbstractSocket#bytesAvailable(98833e9ab7de59a4).();
556 if(bytes)
557 {
558 QByteArraycxx . . $ QByteArray# data = qsocketcxx . . $ NetworkConnection#qsocket.->readAllcxx . . $ QIODevice#readAll(b3c286cec66e09f4).();
559 handlePasswordcxx . . $ IGSConnection#handlePassword(7df51288a9ebd664).(QStringcxx . . $ QString#QString(45672f3c6961a244).(data));
560 }
561 break;
562 case PasswordSentcxx . . $ PasswordSent.:
563 case Connectedcxx . . $ Connected.:
564 while(qsocketcxx . . $ NetworkConnection#qsocket.->canReadLinecxx . . $ QAbstractSocket#canReadLine(50ce9a9e25b4a850).())
565 {
566 QByteArraycxx . . $ QByteArray# data = qsocketcxx . . $ NetworkConnection#qsocket.->readLinecxx . . $ QIODevice#readLine(1117a85f2fd4e5c8).();
567 handleMessagecxx . . $ IGSConnection#handleMessage(7df51288a9ebd664).(QStringcxx . . $ QString#QString(45672f3c6961a244).(data));
568 }
569 break;
570 case AuthFailedcxx . . $ AuthFailed.:
571 qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!("Auth failed");
572 break;
573 case PassFailedcxx . . $ PassFailed.:
574 qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!("Pass failed");
575 break;
576 case ProtocolErrorcxx . . $ ProtocolError.:
577 //wait for someone to destroy the connection
578 //can't imagine why we're even here
579 break;
580 default:
581 qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!("IGSConnection::handlePendingData(): invalid connection state");
582 break;
583 }
584 }
585
586 void IGSConnectioncxx . . $ IGSConnection#::handleLogincxx . . $ IGSConnection#handleLogin(7df51288a9ebd664).(QStringcxx . . $ QString# msg)
587 {
588 if(msg.containscxx . . $ QString#contains(8cce4688c16f48f3).("Login:"cxx . . $ QString#QString(85c52e162fed56f9).) > 0)
589 {
590 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("IGSConnection::handleLogin(): Login found");
591 QStringcxx . . $ QString# u = usernamecxx . . $ NetworkConnection#username. +cxx . . $ operator+(3d22f08efddf8107). "\r\n";
592 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).(u.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
593 setStatecxx . . $ NetworkConnection#setState(41e728cff2b23034).(Passwordcxx . . $ Password.);
594 }
595 else if(msg.containscxx . . $ QString#contains(8cce4688c16f48f3).("sorry"cxx . . $ QString#QString(85c52e162fed56f9).) > 0)
596 {
597 setStatecxx . . $ NetworkConnection#setState(41e728cff2b23034).(AuthFailedcxx . . $ AuthFailed.);
598 if(console_dispatchcxx . . $ NetworkConnection#console_dispatch.)
599 console_dispatchcxx . . $ NetworkConnection#console_dispatch.->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).("Sorry");
600 }
601 else if(console_dispatchcxx . . $ NetworkConnection#console_dispatch.)
602 console_dispatchcxx . . $ NetworkConnection#console_dispatch.->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(msg.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
603 }
604
605 /* FIXME onAuthenticationNegotiated may need to
606 * be called earlier */
607 void IGSConnectioncxx . . $ IGSConnection#::handlePasswordcxx . . $ IGSConnection#handlePassword(7df51288a9ebd664).(QStringcxx . . $ QString# msg)
608 {
609 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "IGSConnection::handlePassword(): " <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). msg;
610 if(msg.containscxx . . $ QString#contains(8cce4688c16f48f3).("Password:"cxx . . $ QString#QString(85c52e162fed56f9).) > 0 || msg.containscxx . . $ QString#contains(8cce4688c16f48f3).("1 1"cxx . . $ QString#QString(85c52e162fed56f9).) > 0)
611 {
612 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Password prompt or 1 1 found");
613 if(passwordcxx . . $ NetworkConnection#password. ==cxx . . $ `operator==`(5bc2975d2d751687). QStringcxx . . $ QString#QString(ced63f7c635d850d).())
614 {
615 onAuthenticationNegotiatedcxx . . $ IGSConnection#onAuthenticationNegotiated(49f6e7a06ebc5aa8).();
616 }
617 else
618 {
619 QStringcxx . . $ QString# p = passwordcxx . . $ NetworkConnection#password. +cxx . . $ operator+(3d22f08efddf8107). "\r\n";
620 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).(p.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
621 }
622 setStatecxx . . $ NetworkConnection#setState(41e728cff2b23034).(PasswordSentcxx . . $ PasswordSent.);
623 }
624 else if(msg.containscxx . . $ QString#contains(8cce4688c16f48f3).("guest"cxx . . $ QString#QString(85c52e162fed56f9).))
625 {
626 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Guest account");
627 setStatecxx . . $ NetworkConnection#setState(41e728cff2b23034).(PasswordSentcxx . . $ PasswordSent.);
628 guestAccountcxx . . $ IGSConnection#guestAccount. = true;
629 }
630 }
631
632 void IGSConnectioncxx . . $ IGSConnection#::onAuthenticationNegotiatedcxx . . $ IGSConnection#onAuthenticationNegotiated(49f6e7a06ebc5aa8).(void)
633 {
634 needToSendClientTogglecxx . . $ IGSConnection#needToSendClientToggle. = false;
635 sendToggleClientOncxx . . $ IGSConnection#sendToggleClientOn(49f6e7a06ebc5aa8).();
636 NetworkConnectioncxx . . $ NetworkConnection#::onAuthenticationNegotiatedcxx . . $ NetworkConnection#onAuthenticationNegotiated(49f6e7a06ebc5aa8).();
637 NetworkConnectioncxx . . $ NetworkConnection#::onReadycxx . . $ NetworkConnection#onReady(49f6e7a06ebc5aa8).();
638 }
639
640 void IGSConnectioncxx . . $ IGSConnection#::onReadycxx . . $ IGSConnection#onReady(49f6e7a06ebc5aa8).(void)
641 {
642 // qDebug() << "IGSConnection::onReady()";
643 if(firstonReadyCallcxx . . $ NetworkConnection#firstonReadyCall.)
644 {
645 /* Check here because I've forgotten exactly which kinds of "1"
646 * msgs might call onReady() and apparently it can happen
647 * after our password has been refused. I'll add this to
648 * WING and LGS as well*/
649 if(connectionStatecxx . . $ NetworkConnection#connectionState. != PasswordSentcxx . . $ PasswordSent.)
650 return;
651 firstonReadyCallcxx . . $ NetworkConnection#firstonReadyCall. = 0;
652 setStatecxx . . $ NetworkConnection#setState(41e728cff2b23034).(Connectedcxx . . $ Connected.);
653 setKeepAlivecxx . . $ IGSConnection#setKeepAlive(d4f767463ce0a6b3).(600);
654 /* This gets called too much, we need a better
655 * way to call it */
656 /* also needs to be earlier */
657 /* Below is kind of round-about. We need the account name in order to make our
658 * name in the players list blue. We could also use something similar to
659 * affect colors of observed or played games, although I'm not sure why we'd
660 * do any of this. But it means setting the account name on the listview model
661 * from the room. The room has no other real use for the account name, so we
662 * pull it from the connection just for that. Its a lot of misdirection just
663 * preserve the encapsulation but I suppose its okay for now. We might
664 * fix it along the lines of the above at some point. */
665 /* Specifically, when we figure out how we're going to deal with rooms in the
666 * future, then we'll find a better place to do this and set the connection
667 * etc.. the idea of a "DefaultRoom" will sort of drop away. FIXME */
668 /* There's a bug here where a person who's name is "" gets painted blue FIXME */
669 //getDefaultRoom()->setAccountName(username);
670
671 QStringcxx . . $ QString# v = "id qGov" +cxx . . $ operator+(c75c3ae4eb9af1a8). QStringcxx . . $ QString#QString(85c52e162fed56f9).(VERSIONcxx . . $ `src/defines.h:33:9`!) +cxx . . $ operator+(3d22f08efddf8107). "\r\n";
672 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).(v.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
673
674 //onAuthenticationNegotiated();
675
676 if(!guestAccountcxx . . $ IGSConnection#guestAccount.)
677 {
678 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("toggle newundo on\r\n"); //undoplease undo requests
679 //sendText("toggle client on\r\n"); //adds type codes, done earlier
680 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("toggle nmatch on\r\n"); //allows nmatch
681 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("toggle seek on\r\n");
682 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("toggle newrating\r\n"); //?s and +s
683
684 //sendText("toggle quiet on\r\n"); //FIXME do we want this?
685 //sendText("toggle quiet off\r\n");
686 //sendText("toggle review on\r\n");
687
688 //sendPlayersRequest();
689
690 sendNmatchParameterscxx . . $ IGSConnection#sendNmatchParameters(49f6e7a06ebc5aa8).();
691 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("seek config_list\r\n");
692 }
693
694 //sendGamesRequest();
695 recvRoomListingcxx . . $ NetworkConnection#recvRoomListing(cd0728ed85364d48).(new RoomListingcxx . . $ RoomListing#(0, "Lobby"cxx . . $ QString#QString(85c52e162fed56f9).));
696 sendRoomListRequestcxx . . $ IGSConnection#sendRoomListRequest(49f6e7a06ebc5aa8).();
697 sendListChannelscxx . . $ IGSConnection#sendListChannels(49f6e7a06ebc5aa8).();
698 }
699 }
700
701 /* In case we want to add updates every so often */
702 void IGSConnectioncxx . . $ IGSConnection#::timerEventcxx . . $ IGSConnection#timerEvent(b9e57d1150f23bf5).(QTimerEventcxx . . $ QTimerEvent#* e)
703 {
704 if(e->timerIdcxx . . $ QTimerEvent#timerId(455f465bc33b4cdf).() == keepAliveTimercxx . . $ IGSConnection#keepAliveTimer.)
705 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).("ayt\r\n");
706 }
707
708 void IGSConnectioncxx . . $ IGSConnection#::setKeepAlivecxx . . $ IGSConnection#setKeepAlive(d4f767463ce0a6b3).(int seconds)
709 {
710 if(keepAliveTimercxx . . $ IGSConnection#keepAliveTimer.)
711 killTimercxx . . $ QObject#killTimer(d4f767463ce0a6b3).(keepAliveTimercxx . . $ IGSConnection#keepAliveTimer.);
712
713 if(seconds > 0)
714 keepAliveTimercxx . . $ IGSConnection#keepAliveTimer. = startTimercxx . . $ QObject#startTimer(cf5d4a693bb15cf1).(seconds * 1000);
715 else
716 keepAliveTimercxx . . $ IGSConnection#keepAliveTimer. = 0;
717 }
718
719 /* Because the IGS protocol is garbage, we have to break encapsulation here
720 * and in BoardDispatch */
721 BoardDispatchcxx . . $ BoardDispatch# * IGSConnectioncxx . . $ IGSConnection#::getBoardFromAttribcxx . . $ IGSConnection#getBoardFromAttrib(ffaef1ed9058626d).(QStringcxx . . $ QString# black_player, unsigned int black_captures, float black_komi, QStringcxx . . $ QString# white_player, unsigned int white_captures, float white_komi)
722 {
723 BoardDispatchcxx . . $ BoardDispatch# * board;
724 QMapcxx . . $ QMap#<unsigned int, class BoardDispatch *>::iteratorcxx . . $ QMap#iterator# icxx . . $ QMap#iterator#iterator(49f6e7a06ebc5aa8).;
725 for(i =cxx . . $ QMap#iterator#`operator=`(b24d7bfed80a1c47). boardDispatchMapcxx . . $ NetworkConnection#boardDispatchMap..begincxx . . $ QMap#begin(2d49d7eeb2586d1c).(); i !=cxx . . $ QMap#iterator#`operator!=`(8a5a4c9a0d42c534). boardDispatchMapcxx . . $ NetworkConnection#boardDispatchMap..endcxx . . $ QMap#end(2d49d7eeb2586d1c).(); i++cxx . . $ QMap#iterator#operator++(7cc628820cfd2204).)
726 {
727 board = i.valuecxx . . $ QMap#iterator#value(51f62fb05f27f6a2).();
728 if(board->isAttribBoardcxx . . $ BoardDispatch#isAttribBoard(261315095228867b).(black_playercxx . . $ QString#QString(132dd6869045752b)., black_captures, black_komi, white_playercxx . . $ QString#QString(132dd6869045752b)., white_captures, white_komi))
729 return board;
730 }
731 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
732 }
733
734 BoardDispatchcxx . . $ BoardDispatch# * IGSConnectioncxx . . $ IGSConnection#::getBoardFromOurOpponentcxx . . $ IGSConnection#getBoardFromOurOpponent(e34a72c20d4e159d).(QStringcxx . . $ QString# opponent)
735 {
736 BoardDispatchcxx . . $ BoardDispatch# * board;
737 QMapcxx . . $ QMap#<unsigned int, class BoardDispatch *>::iteratorcxx . . $ QMap#iterator# icxx . . $ QMap#iterator#iterator(49f6e7a06ebc5aa8).;
738 /* Parser may supply our name from the IGS protocol... this is ugly
739 * but I'm really just trying to reconcile what I think a real
740 * protocol would be like with the IGS protocol */
741 if(opponent ==cxx . . $ `operator==`(5bc2975d2d751687). usernamecxx . . $ NetworkConnection#username.)
742 opponent =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
743 for(i =cxx . . $ QMap#iterator#`operator=`(b24d7bfed80a1c47). boardDispatchMapcxx . . $ NetworkConnection#boardDispatchMap..begincxx . . $ QMap#begin(2d49d7eeb2586d1c).(); i !=cxx . . $ QMap#iterator#`operator!=`(8a5a4c9a0d42c534). boardDispatchMapcxx . . $ NetworkConnection#boardDispatchMap..endcxx . . $ QMap#end(2d49d7eeb2586d1c).(); i++cxx . . $ QMap#iterator#operator++(7cc628820cfd2204).)
744 {
745 board = i.valuecxx . . $ QMap#iterator#value(51f62fb05f27f6a2).();
746 if(board->isOpponentBoardcxx . . $ BoardDispatch#isOpponentBoard(80825a4bb658cac2).(usernamecxx . . $ QString#QString(132dd6869045752b)., opponentcxx . . $ QString#QString(132dd6869045752b).))
747 return board;
748 }
749 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
750 }
751
752 void IGSConnectioncxx . . $ IGSConnection#::requestGameInfocxx . . $ IGSConnection#requestGameInfo(cb2f890c2fdad230).(unsigned int game_id)
753 {
754 char string[20];
755 snprintf(string, 20, "moves %d\r\n", game_id);
756 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).(string);
757 snprintf(string, 20, "all %d\r\n", game_id);
758 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).(string);
759 }
760
761 void IGSConnectioncxx . . $ IGSConnection#::requestGameStatscxx . . $ IGSConnection#requestGameStats(cb2f890c2fdad230).(unsigned int game_id)
762 {
763 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "IGSConnection::requestGameStats " <<cxx . . $ QDebug#`operator<<`(e121dc42ed06808d). game_id;
764 char string[20];
765 snprintf(string, 20, "game %d\r\n", game_id);
766 sendTextcxx . . $ IGSConnection#sendText(85c52e162fed56f9).(string);
767 }
768
769 int IGSConnectioncxx . . $ IGSConnection#::time_to_secondscxx . . $ IGSConnection#time_to_seconds(645d6210e0be3a78).(const QStringcxx . . $ QString# & time)
770 {
771 QRegExpcxx . . $ QRegExp# re = QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("([0-9]{1,2}):([0-9]{1,2})"cxx . . $ QString#QString(85c52e162fed56f9).);
772 int min, sec;
773
774 if(re.indexIncxx . . $ QRegExp#indexIn(46f502bdfc4aeb33).(time) >= 0)
775 {
776 min = re.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(1).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
777 sec = re.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(2).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
778 }
779 else
780 {
781 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("IGSConnection::time_to_seconds(): Bad time string");
782 return 0xffff;
783 }
784
785 return (60 * min) + sec;
786 }
787
788 /* formulas come from old MainWindow::rkToKey for sorting.
789 * might be worth fixing them to match some real score
790 * system*/
791 /* This is a kind of utility function but I'm not sure where to
792 * put it yet. FIXME
793 * If I had to guess, the best place for it is probably on
794 * a rank object or something used in messages... but we don't
795 * want to overload those.*/
796 unsigned int IGSConnectioncxx . . $ IGSConnection#::rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(QStringcxx . . $ QString# rank)
797 {
798 if(rank ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "NR")
799 return 0;
800 if(rank ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "BC") //according to IGS value of 23k
801 return 800;
802
803 QStringcxx . . $ QString# buffer = rankcxx . . $ QString#QString(132dd6869045752b).;
804 //buffer.replace(QRegExp("[pdk+?\\*\\s]"), "");
805 buffer.replacecxx . . $ QString#replace(612862c8abff0ba5).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("[pdk+?]"cxx . . $ QString#QString(85c52e162fed56f9).), ""cxx . . $ QString#QString(85c52e162fed56f9).);
806 int ordinal = buffer.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
807 unsigned int score;
808
809 if(rank.containscxx . . $ QString#contains(8cce4688c16f48f3).("k"cxx . . $ QString#QString(85c52e162fed56f9).))
810 score = (31 - ordinal) * 100;
811 else if(rank.containscxx . . $ QString#contains(8cce4688c16f48f3).("d"cxx . . $ QString#QString(85c52e162fed56f9).))
812 score = 3000 + (ordinal * 100);
813 else if(rank.containscxx . . $ QString#contains(8cce4688c16f48f3).("p"cxx . . $ QString#QString(85c52e162fed56f9).))
814 score = 3600 + (ordinal * 100);
815 else
816 return 0;
817 if(rank.containscxx . . $ QString#contains(8cce4688c16f48f3).("?"cxx . . $ QString#QString(85c52e162fed56f9).))
818 score--;
819 return score;
820 }
821
822 /*
823 * on IGS, sends the 'nmatch'time, BY, handicap ranges
824 * command syntax : "nmatchrange BWN 0-9 19-19 60-60 60-3600 25-25 0 0 0-0"
825 * (B/W/ nigiri) Hcp Sz Main time (secs) BY time (secs) BY stones Koryo time
826 */
827 void IGSConnectioncxx . . $ IGSConnection#::sendNmatchParameterscxx . . $ IGSConnection#sendNmatchParameters(49f6e7a06ebc5aa8).(void)
828 {
829 //note that official client doesn't reload an nmatchrange cancel
830 //until after you reconnect
831 //who the hell knows
832 return;
833 QStringcxx . . $ QString# c = "nmatchrange "cxx . . $ QString#QString(85c52e162fed56f9).;
834 QSettingscxx . . $ QSettings# settingscxx . . $ QSettings#QSettings(749de1b6ae65bddd).;
835
836 c.appendcxx . . $ QString#append(d02845eef0c33901).(preferencescxx . . $ preferences..nmatch_blackcxx . . $ _preferences#nmatch_black. ? "B" : "");
837 c.appendcxx . . $ QString#append(d02845eef0c33901).(preferencescxx . . $ preferences..nmatch_whitecxx . . $ _preferences#nmatch_white. ? "W" : "");
838 c.appendcxx . . $ QString#append(d02845eef0c33901).(preferencescxx . . $ preferences..nmatch_nigiricxx . . $ _preferences#nmatch_nigiri. ? "N" : "");
839 c.appendcxx . . $ QString#append(d02845eef0c33901).(" 0-");
840 c.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(preferencescxx . . $ preferences..nmatch_handicapcxx . . $ _preferences#nmatch_handicap.);
841 c.appendcxx . . $ QString#append(d02845eef0c33901).(" ");
842 c.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(preferencescxx . . $ preferences..default_sizecxx . . $ _preferences#default_size.));
843 c.appendcxx . . $ QString#append(d02845eef0c33901).("-19 ");
844
845 c.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("DEFAULT_TIME"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()*60));
846 c.appendcxx . . $ QString#append(d02845eef0c33901).("-");
847 c.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("NMATCH_MAIN_TIME"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()*60));
848 c.appendcxx . . $ QString#append(d02845eef0c33901).(" ");
849 c.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("DEFAULT_BY"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()*60));
850 c.appendcxx . . $ QString#append(d02845eef0c33901).("-");
851 c.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("NMATCH_BYO_TIME"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).()*60));
852 c.appendcxx . . $ QString#append(d02845eef0c33901).(" 25-25 0 0 0-0\r\n"); //FIXME we need to get and send KORYO time as well, or do we
853 /* If a line is used like below, match requests won't get to client but will be refused
854 * by server with a line like "wants Koryotime count 50 - 50 */
855 //c.append(" 5-25 50 30 1-3\r\n");
856 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "IGSConnection::sendNmatchParameters(): " <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). c;
857 sendTextcxx . . $ IGSConnection#sendText(7df51288a9ebd664).(ccxx . . $ QString#QString(132dd6869045752b).);
858 }
859
860 #define IGS_LOGINMSGcxx . . $ `src/network/igsconnection.cpp:860:9`! 0
861 #define IGS_PROMPTcxx . . $ `src/network/igsconnection.cpp:861:9`! 1
862 #define IGS_BEEPcxx . . $ `src/network/igsconnection.cpp:862:9`! 2
863 #define IGS_DOWNcxx . . $ `src/network/igsconnection.cpp:863:9`! 4
864 #define IGS_ERRORcxx . . $ `src/network/igsconnection.cpp:864:9`! 5
865 #define IGS_GAMEScxx . . $ `src/network/igsconnection.cpp:865:9`! 7
866 #define IGS_FILEcxx . . $ `src/network/igsconnection.cpp:866:9`! 8
867 #define IGS_INFOcxx . . $ `src/network/igsconnection.cpp:867:9`! 9
868 #define IGS_KIBITZcxx . . $ `src/network/igsconnection.cpp:868:9`! 11
869 #define IGS_MESSAGEScxx . . $ `src/network/igsconnection.cpp:869:9`! 14
870 #define IGS_MOVEcxx . . $ `src/network/igsconnection.cpp:870:9`! 15
871 #define IGS_SAYcxx . . $ `src/network/igsconnection.cpp:871:9`! 19
872 #define IGS_SCORE_Mcxx . . $ `src/network/igsconnection.cpp:872:9`! 20
873 #define IGS_SHOUTcxx . . $ `src/network/igsconnection.cpp:873:9`! 21
874 #define IGS_STATUScxx . . $ `src/network/igsconnection.cpp:874:9`! 22
875 #define IGS_STOREDcxx . . $ `src/network/igsconnection.cpp:875:9`! 23
876 #define IGS_TELLcxx . . $ `src/network/igsconnection.cpp:876:9`! 24
877 #define IGS_THISTcxx . . $ `src/network/igsconnection.cpp:877:9`! 25
878 #define IGS_WHOcxx . . $ `src/network/igsconnection.cpp:878:9`! 27
879 #define IGS_UNDOcxx . . $ `src/network/igsconnection.cpp:879:9`! 28
880 #define IGS_YELLcxx . . $ `src/network/igsconnection.cpp:880:9`! 32
881 #define IGS_AUTOMATCHcxx . . $ `src/network/igsconnection.cpp:881:9`! 36
882 #define IGS_SERVERINFOcxx . . $ `src/network/igsconnection.cpp:882:9`! 39
883 #define IGS_DOTcxx . . $ `src/network/igsconnection.cpp:883:9`! 40
884 #define IGS_USERLISTcxx . . $ `src/network/igsconnection.cpp:884:9`! 42
885 #define IGS_REMOVEDcxx . . $ `src/network/igsconnection.cpp:885:9`! 49
886 #define IGS_INGAMESAYcxx . . $ `src/network/igsconnection.cpp:886:9`! 51
887 #define IGS_ADJOURNDECLINEDcxx . . $ `src/network/igsconnection.cpp:887:9`! 53
888 #define IGS_REVIEWcxx . . $ `src/network/igsconnection.cpp:888:9`! 56
889 #define IGS_SEEKcxx . . $ `src/network/igsconnection.cpp:889:9`! 63
890
891 void IGSConnectioncxx . . $ IGSConnection#::handleMessagecxx . . $ IGSConnection#handleMessage(7df51288a9ebd664).(QStringcxx . . $ QString# msg)
892 {
893 unsigned int type = 0;
894 // qDebug() << msg;
895
896 if(msg[cxx . . $ QString#`operator[]`(57436120916eb52c).0].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).() >= '0' && msg[cxx . . $ QString#`operator[]`(57436120916eb52c).0].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).() <= '9')
897 {
898 type = (int)msg[cxx . . $ QString#`operator[]`(57436120916eb52c).0].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).() - '0';
899 }
900 if(msg[cxx . . $ QString#`operator[]`(57436120916eb52c).1].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).() >= '0' && msg[cxx . . $ QString#`operator[]`(57436120916eb52c).1].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).() <= '9')
901 {
902 type *= 10;
903 type += (int)msg[cxx . . $ QString#`operator[]`(57436120916eb52c).1].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).() - '0';
904 }
905
906 if(needToSendClientTogglecxx . . $ IGSConnection#needToSendClientToggle.)
907 onAuthenticationNegotiatedcxx . . $ IGSConnection#onAuthenticationNegotiated(49f6e7a06ebc5aa8).();
908 if(msg.containscxx . . $ QString#contains(8cce4688c16f48f3).("You have logged in as a guest"cxx . . $ QString#QString(85c52e162fed56f9).)) //WING, doesn't work, plus ugly
909 {
910 guestAccountcxx . . $ IGSConnection#guestAccount. = true;
911 setStatecxx . . $ NetworkConnection#setState(41e728cff2b23034).(PasswordSentcxx . . $ PasswordSent.);
912 }
913 if(!type)
914 {
915
916 //line = line.remove(0, 2).trimmed();
917 //if(msg.size() > 4)
918 // qDebug("***%02x %02x %02x %02x", msg[msg.size() - 1].toLatin1(), msg[msg.size() - 2].toLatin1(), msg[msg.size() -3].toLatin1(), msg[msg.size() -4].toLatin1());
919
920 if(msg[cxx . . $ QString#`operator[]`(57436120916eb52c).3].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).() == '1')
921 {
922 msg =cxx . . $ QString#`operator=`(4f35bf974e7f8568). msg.removecxx . . $ QString#remove(6483560ce2afa901).(0,2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
923 handle_promptcxx . . $ IGSConnection#handle_prompt(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
924 return;
925 }
926 if(msg.sizecxx . . $ QString#size(455f465bc33b4cdf).() > 1)
927 {
928 //additional newline unnecessary //0a0d
929 if(msg[cxx . . $ QString#`operator[]`(57436120916eb52c).msg.sizecxx . . $ QString#size(455f465bc33b4cdf).() - 1].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).() == 0x0a)
930 msg =cxx . . $ QString#`operator=`(4f35bf974e7f8568). msg.removecxx . . $ QString#remove(6483560ce2afa901).(msg.sizecxx . . $ QString#size(455f465bc33b4cdf).() - 2, msg.sizecxx . . $ QString#size(455f465bc33b4cdf).()).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
931 }
932 if(console_dispatchcxx . . $ NetworkConnection#console_dispatch. && msg.sizecxx . . $ QString#size(455f465bc33b4cdf).() > 2)
933 console_dispatchcxx . . $ NetworkConnection#console_dispatch.->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(msg.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
934 return;
935 }
936 //qDebug("***Type %d %c %c",type, msg[0].toLatin1(), msg[1].toLatin1());
937 switch(type)
938 {
939 case IGS_LOGINMSGcxx . . $ `src/network/igsconnection.cpp:860:9`!:
940 //FIXME we never get here because !type returns
941 handle_loginmsgcxx . . $ IGSConnection#handle_loginmsg(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
942 break;
943 case IGS_PROMPTcxx . . $ `src/network/igsconnection.cpp:861:9`!:
944 handle_promptcxx . . $ IGSConnection#handle_prompt(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
945 break;
946 case IGS_BEEPcxx . . $ `src/network/igsconnection.cpp:862:9`!:
947 handle_beepcxx . . $ IGSConnection#handle_beep(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
948 break;
949 case IGS_DOWNcxx . . $ `src/network/igsconnection.cpp:863:9`!:
950 handle_downcxx . . $ IGSConnection#handle_down(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
951 break;
952 case IGS_ERRORcxx . . $ `src/network/igsconnection.cpp:864:9`!:
953 handle_errorcxx . . $ IGSConnection#handle_error(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
954 break;
955 case IGS_GAMEScxx . . $ `src/network/igsconnection.cpp:865:9`!:
956 handle_gamescxx . . $ IGSConnection#handle_games(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
957 break;
958 case IGS_FILEcxx . . $ `src/network/igsconnection.cpp:866:9`!:
959 handle_filecxx . . $ IGSConnection#handle_file(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
960 break;
961 case IGS_INFOcxx . . $ `src/network/igsconnection.cpp:867:9`!:
962 handle_infocxx . . $ IGSConnection#handle_info(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
963 break;
964 case IGS_KIBITZcxx . . $ `src/network/igsconnection.cpp:868:9`!:
965 handle_kibitzcxx . . $ IGSConnection#handle_kibitz(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
966 break;
967 case IGS_MESSAGEScxx . . $ `src/network/igsconnection.cpp:869:9`!:
968 handle_messagescxx . . $ IGSConnection#handle_messages(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
969 break;
970 case IGS_MOVEcxx . . $ `src/network/igsconnection.cpp:870:9`!:
971 handle_movecxx . . $ IGSConnection#handle_move(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
972 break;
973 case IGS_SAYcxx . . $ `src/network/igsconnection.cpp:871:9`!:
974 handle_saycxx . . $ IGSConnection#handle_say(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
975 break;
976 case IGS_SCORE_Mcxx . . $ `src/network/igsconnection.cpp:872:9`!:
977 handle_score_mcxx . . $ IGSConnection#handle_score_m(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
978 break;
979 case IGS_SHOUTcxx . . $ `src/network/igsconnection.cpp:873:9`!:
980 handle_shoutcxx . . $ IGSConnection#handle_shout(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
981 break;
982 case IGS_STATUScxx . . $ `src/network/igsconnection.cpp:874:9`!:
983 handle_statuscxx . . $ IGSConnection#handle_status(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
984 break;
985 case IGS_STOREDcxx . . $ `src/network/igsconnection.cpp:875:9`!:
986 handle_storedcxx . . $ IGSConnection#handle_stored(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
987 break;
988 case IGS_TELLcxx . . $ `src/network/igsconnection.cpp:876:9`!:
989 handle_tellcxx . . $ IGSConnection#handle_tell(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
990 break;
991 case IGS_THISTcxx . . $ `src/network/igsconnection.cpp:877:9`!:
992 handle_thistcxx . . $ IGSConnection#handle_thist(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
993 break;
994 case IGS_WHOcxx . . $ `src/network/igsconnection.cpp:878:9`!:
995 handle_whocxx . . $ IGSConnection#handle_who(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
996 break;
997 case IGS_UNDOcxx . . $ `src/network/igsconnection.cpp:879:9`!:
998 handle_undocxx . . $ IGSConnection#handle_undo(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
999 break;
1000 case IGS_YELLcxx . . $ `src/network/igsconnection.cpp:880:9`!:
1001 handle_yellcxx . . $ IGSConnection#handle_yell(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
1002 break;
1003 case IGS_AUTOMATCHcxx . . $ `src/network/igsconnection.cpp:881:9`!:
1004 handle_automatchcxx . . $ IGSConnection#handle_automatch(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
1005 break;
1006 case IGS_SERVERINFOcxx . . $ `src/network/igsconnection.cpp:882:9`!:
1007 handle_serverinfocxx . . $ IGSConnection#handle_serverinfo(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
1008 break;
1009 case IGS_DOTcxx . . $ `src/network/igsconnection.cpp:883:9`!:
1010 handle_dotcxx . . $ IGSConnection#handle_dot(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
1011 break;
1012 case IGS_USERLISTcxx . . $ `src/network/igsconnection.cpp:884:9`!:
1013 handle_userlistcxx . . $ IGSConnection#handle_userlist(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
1014 break;
1015 case IGS_REMOVEDcxx . . $ `src/network/igsconnection.cpp:885:9`!:
1016 handle_removedcxx . . $ IGSConnection#handle_removed(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
1017 break;
1018 case IGS_INGAMESAYcxx . . $ `src/network/igsconnection.cpp:886:9`!:
1019 handle_ingamesaycxx . . $ IGSConnection#handle_ingamesay(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
1020 break;
1021 case IGS_ADJOURNDECLINEDcxx . . $ `src/network/igsconnection.cpp:887:9`!:
1022 handle_adjourndeclinedcxx . . $ IGSConnection#handle_adjourndeclined(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
1023 break;
1024 case IGS_REVIEWcxx . . $ `src/network/igsconnection.cpp:888:9`!:
1025 handle_reviewcxx . . $ IGSConnection#handle_review(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
1026 break;
1027 case IGS_SEEKcxx . . $ `src/network/igsconnection.cpp:889:9`!:
1028 handle_seekcxx . . $ IGSConnection#handle_seek(7df51288a9ebd664).(msgcxx . . $ QString#QString(132dd6869045752b).);
1029 break;
1030 }
1031 }
1032
1033 /* I think it would be neat if the QString was tokenized, just like with a compiler. I mean basically there's
1034 * signed ints and signed floating points, and then there's a few strings, like names, and then everything else
1035 * is specific go related "keywords". So we could process the msg before we pass it to the handler and then the
1036 * handlers wouldn't have any ugly text manipulation stuff... I really like this idea. And then I think it would
1037 * become very clear the messages that require something from a previous message, like the 9s and 15s that we
1038 * had some issues with
1039 *
1040 * Actually, this reminds me a little of "element" in the old parser, except element only did delimited strings
1041 * The one question is whether to do QVariants or have our own simple variant like object. I can imagine the
1042 * code looking like nested case statements.
1043 *
1044 * The thing is, the original parser was kind of ugly, but at least it was consistent. This, I'm not proud of
1045 * because its like the original ugly code, chopped up and made to work in a different form. Its even uglier.
1046 cd* But I think I can make it nicer, and then the individual handlers just become case statements based on the type
1047 * of these element objects... we could call it... TBPToken text based protocol token...
1048 *
1049 * This is a good idea, but since IGS is basically all keywords, the point would just be to take all the string
1050 * manipulation out of the handlers and put it somewhere else where it could be ugly but consistent.
1051 *
1052 * Even though this might ferret out some bugs, its still cosmetic and a big change so I'm going to hold off on it.
1053 *
1054 * Now I'm thinking, instead of this also being a big list of string conditionals, we could instead have, much like
1055 * other protocols protocolcodes header files, we could have a list of strings and following values organized in some
1056 * sensible way. So this would just go through the list and if it was an int or a float, it would go with that,
1057 * otherwise it would find the string from the list and go with that, or just create a string object at the end...*/
1058
1059 /* We want two functions, the tokenizer, and then something that's just a list of std::map adds
1060 * the tokens can be an abstract class with the type within... I got to stop writing things and just
1061 * program them like I used to, but I shouldn't be working on this right now*/
1062
1063 /* I'm having second thoughts about this idea. First, it doesn't make anything faster. We could try to remove
1064 * some of the regular expressions, that would make things a bit faster but that's hardly an issue anyway.
1065 * Second, it does take the text strings out of the function, but we just replace them with "IGS_" defines and a lot
1066 * of token handling and parsing stuff. It might look kind of clean to have a list of text strings with their
1067 * associated defines in another file but... its a significant amount of effort and I'm not sure I can
1068 * see how it would improve the code all that much. I certainly like the idea... I could even return the multiple
1069 * functions to the original parser's giant case statement, except instead of hard coded numbers it would be defines
1070 * all over the place. I think some of the game/move code and updates need to be fixed up but...
1071 * I guess this is just a really low priority.*/
1072 #ifdef FIXME
1073 returnsomekindoflist IGSConnection::tokenize(QString msg)
1074 {
1075
1076 }
1077 #endif //FIXME
1078
1079 /* IGS Protocol messages */
1080 /* I know WING has these 0 messages... move to WING if specific FIXME*/
1081 void IGSConnectioncxx . . $ IGSConnection#::handle_loginmsgcxx . . $ IGSConnection#handle_loginmsg(7df51288a9ebd664).(QStringcxx . . $ QString# line)
1082 {
1083 /* These seem to have extra newlines on them */
1084 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(line.lengthcxx . . $ QString#length(455f465bc33b4cdf).() - 1, line.lengthcxx . . $ QString#length(455f465bc33b4cdf).()).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
1085 if(line.lengthcxx . . $ QString#length(455f465bc33b4cdf).() > 1)
1086 {
1087 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
1088 }
1089 }
1090
1091 void IGSConnectioncxx . . $ IGSConnection#::handle_promptcxx . . $ IGSConnection#handle_prompt(7df51288a9ebd664).(QStringcxx . . $ QString# line)
1092 {
1093 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
1094 /* There's some other ones here, that might be an issue, besides 5 and 8,
1095 * we should consider just calling onReady() here */
1096 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("5"cxx . . $ QString#QString(85c52e162fed56f9).) || line.containscxx . . $ QString#contains(8cce4688c16f48f3).("6"cxx . . $ QString#QString(85c52e162fed56f9).) || line.containscxx . . $ QString#contains(8cce4688c16f48f3).("8"cxx . . $ QString#QString(85c52e162fed56f9).))
1097 {
1098 }
1099 onReadycxx . . $ IGSConnection#onReady(49f6e7a06ebc5aa8).();
1100 /* From NNGS source:
1101 #define STAT_LOGON 0 // Unused
1102 #define STAT_PASSWORD 1 // Unused
1103 #define STAT_PASSWORD_NEW 2 // Unused
1104 #define STAT_PASSWORD_CONFIRM 3 // Unused
1105 #define STAT_REGISTER 4 // Unused
1106 #define STAT_WAITING 5
1107 #define STAT_PLAYING_GO 6
1108 #define STAT_SCORING 7
1109 #define STAT_OBSERVING 8
1110 #define STAT_TEACHING 9 // Unused
1111 #define STAT_COMPLETE 10 // Unused
1112 */
1113 }
1114 // BEEP
1115 void IGSConnectioncxx . . $ IGSConnection#::handle_beepcxx . . $ IGSConnection#handle_beep(7df51288a9ebd664).(QStringcxx . . $ QString# line)
1116 {
1117 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Game saved"cxx . . $ QString#QString(85c52e162fed56f9).))
1118 {
1119 #ifdef FIXME
1120 return IT_OTHER;
1121 #endif //FIXME
1122 }
1123 }
1124
1125 void IGSConnectioncxx . . $ IGSConnection#::handle_downcxx . . $ IGSConnection#handle_down(7df51288a9ebd664).(QStringcxx . . $ QString# line)
1126 {
1127 //4 **** Server shutdown started by admin. ****
1128 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Server shutdown"cxx . . $ QString#QString(85c52e162fed56f9).))
1129 {
1130 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).("Server shutdown started by admin");
1131 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Closing connection in accordance with server shutdown");
1132 closeConnectioncxx . . $ NetworkConnection#closeConnection(b45ddcbc8423892c).();
1133 }
1134 }
1135 // ERROR message
1136 // 5 Player "xxxx" is not open to match requests.
1137 // 5 You cannot observe a game that you are playing.
1138 // 5 You cannot undo in this game
1139 // 5 Opponent's client does not support undoplease
1140 // 5 noldo is currently involved in a match against someone else.
1141 // case 5:
1142 void IGSConnectioncxx . . $ IGSConnection#::handle_errorcxx . . $ IGSConnection#handle_error(7df51288a9ebd664).(QStringcxx . . $ QString# line)
1143 {
1144 static QStringcxx . . $ QString# memory_strcxx . . $ QString#QString(ced63f7c635d850d).;
1145
1146 Roomcxx . . $ Room# * room = getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).();
1147 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "IGSConnection::handle_error()" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). line;
1148 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
1149 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Invalid password"cxx . . $ QString#QString(85c52e162fed56f9).))
1150 {
1151 setStatecxx . . $ NetworkConnection#setState(41e728cff2b23034).(PassFailedcxx . . $ PassFailed.);
1152 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
1153 //closeConnection();
1154 return;
1155 }
1156 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("string you have typed is illegal"cxx . . $ QString#QString(85c52e162fed56f9).))
1157 {
1158 setStatecxx . . $ NetworkConnection#setState(41e728cff2b23034).(ProtocolErrorcxx . . $ ProtocolError.);
1159 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
1160 //closeConnection();
1161 return;
1162 }
1163 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("No user named"cxx . . $ QString#QString(85c52e162fed56f9).))
1164 {
1165 #ifdef FIXME
1166 QString name = element(line, 1, "\"");
1167 // //emit signal_talk(name, "@@@", true);
1168 #endif //FIXME
1169 }
1170 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("is currently involved in a match"cxx . . $ QString#QString(85c52e162fed56f9).) ||
1171 line.containscxx . . $ QString#contains(8cce4688c16f48f3).("is playing a game"cxx . . $ QString#QString(85c52e162fed56f9).) ||
1172 line.containscxx . . $ QString#contains(8cce4688c16f48f3).("is involved in another game"cxx . . $ QString#QString(85c52e162fed56f9).))
1173 {
1174 QStringcxx . . $ QString# oppcxx . . $ QString#QString(ced63f7c635d850d).;
1175 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("is playing a game"cxx . . $ QString#QString(85c52e162fed56f9).)) //WING
1176 opp =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9)., "\""cxx . . $ QString#QString(85c52e162fed56f9).);
1177 else
1178 opp =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1179 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(opp);
1180 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(p);
1181 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(GD_REFUSE_INGAMEcxx . . $ `src/network/networkconnection.h:82:9`!);
1182 }
1183 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("is not open to match requests"cxx . . $ QString#QString(85c52e162fed56f9).))
1184 {
1185 QStringcxx . . $ QString# opp = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "\""cxx . . $ QString#QString(85c52e162fed56f9)., "\""cxx . . $ QString#QString(85c52e162fed56f9).);
1186 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(opp);
1187 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(p);
1188 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(GD_REFUSE_NOTOPENcxx . . $ `src/network/networkconnection.h:79:9`!);
1189 }
1190 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("does not accept direct match"cxx . . $ QString#QString(85c52e162fed56f9).))
1191 {
1192 QStringcxx . . $ QString# opp = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);//, " ");
1193 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(opp);
1194 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(p);
1195 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(GD_REFUSE_NODIRECTcxx . . $ `src/network/networkconnection.h:83:9`!);
1196 }
1197 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("player is currently not accepting matches"cxx . . $ QString#QString(85c52e162fed56f9).))
1198 {
1199 // IGS: 5 That player is currently not accepting matches.
1200 //GameDialog * gameDialog = getGameDialog(opp);
1201 //gameDialog->recvMatchRequest(0, 0);
1202 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("player not currently accepting matches");
1203 /* There's no opponent from this message. A
1204 * message window called from the room makes sense.
1205 * Maybe even like a recvServerAlert function FIXME
1206 * I'll just do this for now*/
1207 if(match_playerNamecxx . . $ IGSConnection#match_playerName..sizecxx . . $ QString#size(455f465bc33b4cdf).())
1208 {
1209 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(match_playerNamecxx . . $ IGSConnection#match_playerName.);
1210 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(p);
1211 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(GD_REFUSE_NOTOPENcxx . . $ `src/network/networkconnection.h:79:9`!);
1212 }
1213 }
1214 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Invalid parameters"cxx . . $ QString#QString(85c52e162fed56f9).))
1215 {
1216 if(match_playerNamecxx . . $ IGSConnection#match_playerName..sizecxx . . $ QString#size(455f465bc33b4cdf).())
1217 {
1218 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(match_playerNamecxx . . $ IGSConnection#match_playerName.);
1219 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(p);
1220 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(GD_INVALID_PARAMETERScxx . . $ `src/network/networkconnection.h:84:9`!);
1221 }
1222 }
1223 //5 Opponent's client does not support nmatch.
1224 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("does not support nmatch"cxx . . $ QString#QString(85c52e162fed56f9).))
1225 {
1226 if(match_playerNamecxx . . $ IGSConnection#match_playerName..sizecxx . . $ QString#size(455f465bc33b4cdf).())
1227 {
1228 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(match_playerNamecxx . . $ IGSConnection#match_playerName.);
1229 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(p);
1230 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(GD_OPP_NO_NMATCHcxx . . $ `src/network/networkconnection.h:85:9`!);
1231 }
1232 }
1233 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("You cannot undo"cxx . . $ QString#QString(85c52e162fed56f9).) || line.containscxx . . $ QString#contains(8cce4688c16f48f3).("client does not support undoplease"cxx . . $ QString#QString(85c52e162fed56f9).))
1234 {
1235 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(game_were_playingcxx . . $ IGSConnection#game_were_playing.);
1236 if(boarddispatch)
1237 {
1238 boarddispatch->recvKibitzcxx . . $ BoardDispatch#recvKibitz(3458fe3960d5051).(0cxx . . $ QString#QString(85c52e162fed56f9)., linecxx . . $ QString#QString(132dd6869045752b).);
1239 boarddispatch->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).()->undoAllowedcxx . . $ GameData#undoAllowed. = false;
1240 }
1241 //maybe should be a message box? FIXME
1242 }
1243 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("There is no such game"cxx . . $ QString#QString(85c52e162fed56f9).) || line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Invalid game number"cxx . . $ QString#QString(85c52e162fed56f9).))
1244 {
1245 /* This comes from both observe and unobserve messages,
1246 * meaning that we can't quite use it to remove gamelistings
1247 * unless we fix up the protocol_save_int stuff a little
1248 * which needs it anyhow. FIXME */
1249 //connection->protocol_save_int
1250 }
1251 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Setting you open for matches"cxx . . $ QString#QString(85c52e162fed56f9).))
1252 room->recvTogglecxx . . $ Room#recvToggle(918ebd27a9ddbad3).(0, true);
1253
1254 // 5 There is a dispute regarding your nmatch:
1255 // 5 yfh2test request: B 3 19 420 900 25 0 0 0
1256 // 5 yfh22 request: W 3 19 600 900 25 0 0 0
1257 //
1258 // 5 There is a dispute regarding your match:
1259 // 5 yfh2test wants White on a 19x19 in 10 mins (10 byoyomi).
1260 // 5 eb5 wants Black on a 19x19 in 10 mins (12 byoyomi).
1261
1262 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("wants Time"cxx . . $ QString#QString(85c52e162fed56f9).))
1263 {
1264 /* FIXME note that we should really look up their match conditions
1265 * before even creating game dialog !!! */
1266 //5 lemon wants Time 60 - 60.
1267 //5 seinosuke wants Time 300 - 300
1268 QStringcxx . . $ QString# opponent = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1269 PlayerListingcxx . . $ PlayerListing# * pl = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(opponent);
1270 //QString timetochange = element(line, 2, " ");
1271 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(pl);
1272 MatchRequestcxx . . $ MatchRequest# * m = gameDialog->getMatchRequestcxx . . $ GameDialog#getMatchRequest(bd616a0a6add31e0).();
1273 MatchRequestcxx . . $ MatchRequest# * aMatch = new MatchRequestcxx . . $ MatchRequest#(*m);
1274 aMatch->maintimecxx . . $ MatchRequest#maintime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1275 aMatch->periodtimecxx . . $ MatchRequest#periodtime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9)., "."cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1276 if(aMatch->periodtimecxx . . $ MatchRequest#periodtime. > 299)
1277 aMatch->timeSystemcxx . . $ MatchRequest#timeSystem. = canadiancxx . . $ canadian.;
1278 else
1279 aMatch->timeSystemcxx . . $ MatchRequest#timeSystem. = byoyomicxx . . $ byoyomi.;
1280 gameDialog->recvRequestcxx . . $ GameDialog#recvRequest(461bc273ee812ab9).(aMatch);
1281 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(GD_RESETcxx . . $ `src/network/networkconnection.h:86:9`!);
1282 }
1283 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("wants Byomoves"cxx . . $ QString#QString(85c52e162fed56f9).))
1284 {
1285 //5 x wants Byomoves 1 - 1.
1286 QStringcxx . . $ QString# opponent = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1287 PlayerListingcxx . . $ PlayerListing# * pl = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(opponent);
1288 //QString timetochange = element(line, 2, " ");
1289 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(pl);
1290 MatchRequestcxx . . $ MatchRequest# * m = gameDialog->getMatchRequestcxx . . $ GameDialog#getMatchRequest(bd616a0a6add31e0).();
1291 MatchRequestcxx . . $ MatchRequest# * aMatch = new MatchRequestcxx . . $ MatchRequest#(*m);
1292 aMatch->stones_periodscxx . . $ MatchRequest#stones_periods. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1293 gameDialog->recvRequestcxx . . $ GameDialog#recvRequest(461bc273ee812ab9).(aMatch);
1294 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(GD_RESETcxx . . $ `src/network/networkconnection.h:86:9`!);
1295 }
1296 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("wants Byotime"cxx . . $ QString#QString(85c52e162fed56f9).))
1297 {
1298 //5 x wants Byomoves 1 - 1.
1299 QStringcxx . . $ QString# opponent = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1300 PlayerListingcxx . . $ PlayerListing# * pl = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(opponent);
1301 //QString timetochange = element(line, 2, " ");
1302 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(pl);
1303 MatchRequestcxx . . $ MatchRequest# * m = gameDialog->getMatchRequestcxx . . $ GameDialog#getMatchRequest(bd616a0a6add31e0).();
1304 MatchRequestcxx . . $ MatchRequest# * aMatch = new MatchRequestcxx . . $ MatchRequest#(*m);
1305 aMatch->periodtimecxx . . $ MatchRequest#periodtime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1306 gameDialog->recvRequestcxx . . $ GameDialog#recvRequest(461bc273ee812ab9).(aMatch);
1307 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(GD_RESETcxx . . $ `src/network/networkconnection.h:86:9`!);
1308 }
1309 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("wants Handicap"cxx . . $ QString#QString(85c52e162fed56f9).))
1310 {
1311 //5 x wants Handicap 0 - 0.
1312 QStringcxx . . $ QString# opponent = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1313 PlayerListingcxx . . $ PlayerListing# * pl = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(opponent);
1314 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(pl);
1315 MatchRequestcxx . . $ MatchRequest# * m = gameDialog->getMatchRequestcxx . . $ GameDialog#getMatchRequest(bd616a0a6add31e0).();
1316 MatchRequestcxx . . $ MatchRequest# * aMatch = new MatchRequestcxx . . $ MatchRequest#(*m);
1317 aMatch->handicapcxx . . $ MatchRequest#handicap. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1318 gameDialog->recvRequestcxx . . $ GameDialog#recvRequest(461bc273ee812ab9).(aMatch);
1319 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(GD_RESETcxx . . $ `src/network/networkconnection.h:86:9`!);
1320 }
1321 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("request:"cxx . . $ QString#QString(85c52e162fed56f9).) || line.containscxx . . $ QString#contains(8cce4688c16f48f3).("wants"cxx . . $ QString#QString(85c52e162fed56f9).))
1322 {
1323 QStringcxx . . $ QString# p = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1324 if (p ==cxx . . $ `operator==`(5bc2975d2d751687). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).())
1325 {
1326 memory_str =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). line;
1327 return;
1328 }
1329
1330 if (memory_str.containscxx . . $ QString#contains(8cce4688c16f48f3).(getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).() +cxx . . $ operator+(3d22f08efddf8107). " request"))
1331 {
1332 memory_str =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
1333 return;
1334 }
1335 MatchRequestcxx . . $ MatchRequest# * aMatch = 0;
1336 GameDialogcxx . . $ GameDialog# * gameDialog = 0;
1337 PlayerListingcxx . . $ PlayerListing# * pl = 0;
1338 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("wants"cxx . . $ QString#QString(85c52e162fed56f9).)) //match
1339 {
1340 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("turn"cxx . . $ QString#QString(85c52e162fed56f9).))
1341 {
1342 pl = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(p);
1343 gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(pl);
1344 MatchRequestcxx . . $ MatchRequest# * m = gameDialog->getMatchRequestcxx . . $ GameDialog#getMatchRequest(bd616a0a6add31e0).();
1345 aMatch = new MatchRequestcxx . . $ MatchRequest#(*m);
1346 if(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "[B]")
1347 {
1348 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::BLACKcxx . . $ MatchRequest#BLACK.;
1349 }
1350 else if(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "[W]")
1351 {
1352 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::WHITEcxx . . $ MatchRequest#WHITE.;
1353 }
1354 else
1355 {
1356 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Unknown: %s", line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
1357 delete aMatch;
1358 return;
1359 }
1360 }
1361 else
1362 {
1363 aMatch = new MatchRequestcxx . . $ MatchRequest#();
1364 aMatch->opponentcxx . . $ MatchRequest#opponent. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). p;
1365 aMatch->nmatchcxx . . $ MatchRequest#nmatch. = false;
1366
1367 if(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "Black")
1368 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::BLACKcxx . . $ MatchRequest#BLACK.;
1369 else if(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "Nigiri")//IGS handles this??
1370 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::NIGIRIcxx . . $ MatchRequest#NIGIRI.;
1371 else
1372 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::WHITEcxx . . $ MatchRequest#WHITE.;
1373 QStringcxx . . $ QString# s = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 5, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1374
1375 aMatch->board_sizecxx . . $ MatchRequest#board_size. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(s, 0, "x"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1376 aMatch->maintimecxx . . $ MatchRequest#maintime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 7, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).() * 60;
1377 s =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 9, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1378 aMatch->periodtimecxx . . $ MatchRequest#periodtime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(s, 1, "("cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1379 aMatch->stones_periodscxx . . $ MatchRequest#stones_periods. = 25; // I assume IGS assumes this is always 25
1380 if(getCurrentRoomcxx . . $ IGSConnection#getCurrentRoom(cde9ef8adcea6063).()->namecxx . . $ RoomListing#name..containscxx . . $ QString#contains(8cce4688c16f48f3).("No rated"cxx . . $ QString#QString(85c52e162fed56f9).))
1381 aMatch->free_ratedcxx . . $ MatchRequest#free_rated. = FREEcxx . . $ FREE.;
1382 else
1383 aMatch->free_ratedcxx . . $ MatchRequest#free_rated. = RATEDcxx . . $ RATED.;
1384 }
1385 }
1386 else //nmatch
1387 {
1388 aMatch = new MatchRequestcxx . . $ MatchRequest#();
1389 aMatch->opponentcxx . . $ MatchRequest#opponent. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). p;
1390 aMatch->nmatchcxx . . $ MatchRequest#nmatch. = true;
1391 if(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "B")
1392 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::BLACKcxx . . $ MatchRequest#BLACK.;
1393 else if(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "N")//IGS handles this??
1394 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::NIGIRIcxx . . $ MatchRequest#NIGIRI.;
1395 else
1396 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::WHITEcxx . . $ MatchRequest#WHITE.;
1397 //N 0 9 120 30 1 3 1 0
1398
1399 aMatch->handicapcxx . . $ MatchRequest#handicap. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1400 aMatch->board_sizecxx . . $ MatchRequest#board_size. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1401 aMatch->maintimecxx . . $ MatchRequest#maintime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 5, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1402 aMatch->periodtimecxx . . $ MatchRequest#periodtime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 6, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1403 aMatch->stones_periodscxx . . $ MatchRequest#stones_periods. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 7, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1404 if(aMatch->periodtimecxx . . $ MatchRequest#periodtime. >= 300)
1405 aMatch->timeSystemcxx . . $ MatchRequest#timeSystem. = canadiancxx . . $ canadian.;
1406 else
1407 aMatch->timeSystemcxx . . $ MatchRequest#timeSystem. = byoyomicxx . . $ byoyomi.;
1408 if(getCurrentRoomcxx . . $ IGSConnection#getCurrentRoom(cde9ef8adcea6063).()->namecxx . . $ RoomListing#name..containscxx . . $ QString#contains(8cce4688c16f48f3).("No rated"cxx . . $ QString#QString(85c52e162fed56f9).))
1409 aMatch->free_ratedcxx . . $ MatchRequest#free_rated. = FREEcxx . . $ FREE.;
1410 else
1411 aMatch->free_ratedcxx . . $ MatchRequest#free_rated. = RATEDcxx . . $ RATED.;
1412 }
1413
1414 if(!pl)
1415 pl = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(aMatch->opponentcxx . . $ MatchRequest#opponent.);
1416 const PlayerListingcxx . . $ PlayerListing# * us = getOurListingcxx . . $ NetworkConnection#getOurListing(c84291d55c8466c6).();
1417 if(us)
1418 {
1419 aMatch->our_namecxx . . $ MatchRequest#our_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). us->namecxx . . $ PlayerListing#name.;
1420 aMatch->our_rankcxx . . $ MatchRequest#our_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). us->rankcxx . . $ PlayerListing#rank.;
1421 }
1422 aMatch->their_rankcxx . . $ MatchRequest#their_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). pl->rankcxx . . $ PlayerListing#rank.;
1423
1424 if(!gameDialog)
1425 gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(pl);
1426 gameDialog->recvRequestcxx . . $ GameDialog#recvRequest(461bc273ee812ab9).(aMatch);
1427 delete aMatch;
1428 }
1429 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("is a private game"cxx . . $ QString#QString(85c52e162fed56f9).))
1430 {
1431 /* FIXME we need a dialog box saying that its a private game */
1432 int number = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1433 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("%d is a private game", number);
1434 }
1435 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Could not add you to the channel"cxx . . $ QString#QString(85c52e162fed56f9).))
1436 {
1437 //i.e., trying to join pro channel
1438 //actually should change back to the channel we were in probably
1439 //but to do that FIXME, we'd have to set that when we actually
1440 //entered a channel and I haven't seen a msg for that
1441 changeChannelcxx . . $ NetworkConnection#changeChannel(3520e46b33348bf6).("No Channel"cxx . . $ QString#QString(85c52e162fed56f9).);
1442 }
1443 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
1444 }
1445 // games
1446 // 7 [##] white name [ rk ] black name [ rk ] (Move size H Komi BY FR) (###)
1447 // 7 [41] xxxx10 [ 1k*] vs. xxxx12 [ 1k*] (295 19 0 5.5 12 I) ( 1)
1448 // 7 [118] larske [ 7k*] vs. T08811 [ 7k*] (208 19 0 5.5 10 I) ( 0)
1449 // 7 [255] YK [ 7d*] vs. SOJ [ 7d*] ( 56 19 0 5.5 4 I) ( 18)
1450 // 7 [42] TetsuyaK [ 1k*] vs. ezawa [ 1k*] ( 46 19 0 5.5 8 I) ( 0)
1451 // 7 [237] s2884 [ 3d*] vs. csc [ 2d*] (123 19 0 0.5 6 I) ( 0)
1452 // 7 [67] atsukann [14k*] vs. mitsuo45 [15k*] ( 99 19 0 0.5 10 I) ( 0)
1453 // 7 [261] lbeach [ 3k*] vs. yurisuke [ 3k*] (194 19 0 5.5 3 I) ( 0)
1454 // 7 [29] ppmmuu [ 1k*] vs. Natta [ 2k*] (141 19 0 0.5 2 I) ( 0)
1455 // 7 [105] Clarky [ 2k*] vs. gaosg [ 2k*] ( 65 19 0 5.5 10 I) ( 1)
1456 //case 7:
1457 void IGSConnectioncxx . . $ IGSConnection#::handle_gamescxx . . $ IGSConnection#handle_games(7df51288a9ebd664).(QStringcxx . . $ QString# line)
1458 {
1459 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("##"cxx . . $ QString#QString(85c52e162fed56f9).))
1460 // skip first line
1461 return;
1462 line.removecxx . . $ QString#remove(a3887f610da99e5a).(QRegularExpressioncxx . . $ QRegularExpression#QRegularExpression(4279d2539df7cd4a).("[\\[\\]\\(\\)]"cxx . . $ QString#QString(85c52e162fed56f9).));
1463 QStringListcxx . . $ QStringList# words = line.splitcxx . . $ QString#split(2ba03f79dd8e9c12).(QCharcxx . . $ QChar#(' '),QStringcxx . . $ QString#::SkipEmptyPartscxx . . $ QString#SkipEmptyParts.);
1464 bool ok;
1465 int number = words.atcxx . . $ QList#at(e2681f9bb6b2f357).(1).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(&ok);
1466 if (!ok)
1467 return;
1468 GameListingcxx . . $ GameListing# * aGame = getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).()->getGameListingcxx . . $ Room#getGameListing(d402167d8f57cf00).(number);
1469
1470 aGame->_white_namecxx . . $ GameListing#_white_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). words.atcxx . . $ QList#at(e2681f9bb6b2f357).(2);
1471 aGame->_white_rankcxx . . $ GameListing#_white_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). words.atcxx . . $ QList#at(e2681f9bb6b2f357).(3);
1472 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(aGame->_white_rankcxx . . $ GameListing#_white_rank.));
1473 // skip "vs."
1474 aGame->_black_namecxx . . $ GameListing#_black_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). words.atcxx . . $ QList#at(e2681f9bb6b2f357).(5);
1475 aGame->_black_rankcxx . . $ GameListing#_black_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). words.atcxx . . $ QList#at(e2681f9bb6b2f357).(6);
1476 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(aGame->_black_rankcxx . . $ GameListing#_black_rank.));
1477 aGame->movescxx . . $ GameListing#moves. = words.atcxx . . $ QList#at(e2681f9bb6b2f357).(7).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1478 aGame->board_sizecxx . . $ GameListing#board_size. = words.atcxx . . $ QList#at(e2681f9bb6b2f357).(8).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1479 aGame->handicapcxx . . $ GameListing#handicap. = words.atcxx . . $ QList#at(e2681f9bb6b2f357).(9).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1480 aGame->komicxx . . $ GameListing#komi. = words.atcxx . . $ QList#at(e2681f9bb6b2f357).(10).toFloatcxx . . $ QString#toFloat(abac0204e50f9cf0).();
1481 aGame->Bycxx . . $ GameListing#By. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). words.atcxx . . $ QList#at(e2681f9bb6b2f357).(11);
1482 aGame->FRcxx . . $ GameListing#FR. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). words.atcxx . . $ QList#at(e2681f9bb6b2f357).(12);
1483 aGame->observerscxx . . $ GameListing#observers. = words.atcxx . . $ QList#at(e2681f9bb6b2f357).(13).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1484
1485 aGame->whitecxx . . $ GameListing#white. = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(aGame->_white_namecxx . . $ GameListing#_white_name.);
1486 aGame->blackcxx . . $ GameListing#black. = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(aGame->_black_namecxx . . $ GameListing#_black_name.);
1487
1488 aGame->runningcxx . . $ GameListing#running. = true;
1489 #ifdef FIXME
1490 aGame->oneColorGo = false ;
1491 #endif //FIXME
1492
1493 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! gameListingReceivedcxx . . $ NetworkConnection#gameListingReceived(9a447f3b9a8a5041).(aGame);
1494 if(protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "restoring")
1495 {
1496 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch = getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(number);
1497 /* This is ugly, we can get bad info here so we have
1498 * to create a half record to send. FIXME*/
1499 GameDatacxx . . $ GameData# * aGameData = boarddispatch->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
1500 aGameData->numbercxx . . $ GameData#number. = aGame->numbercxx . . $ GameListing#number.;
1501 aGameData->white_namecxx . . $ GameData#white_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). aGame->white_namecxx . . $ GameListing#white_name(a2fb7a6ce195d51).();
1502 aGameData->black_namecxx . . $ GameData#black_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). aGame->black_namecxx . . $ GameListing#black_name(a2fb7a6ce195d51).();
1503 aGameData->white_rankcxx . . $ GameData#white_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). aGame->white_rankcxx . . $ GameListing#white_rank(a2fb7a6ce195d51).();
1504 aGameData->black_rankcxx . . $ GameData#black_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). aGame->black_rankcxx . . $ GameListing#black_rank(a2fb7a6ce195d51).();
1505 aGameData->board_sizecxx . . $ GameData#board_size. = aGame->board_sizecxx . . $ GameListing#board_size.;
1506 aGameData->handicapcxx . . $ GameData#handicap. = aGame->handicapcxx . . $ GameListing#handicap.;
1507 aGameData->komicxx . . $ GameData#komi. = aGame->komicxx . . $ GameListing#komi.;
1508 boarddispatch->openBoardcxx . . $ BoardDispatch#openBoard(49f6e7a06ebc5aa8).();
1509
1510 requestGameInfocxx . . $ IGSConnection#requestGameInfo(cb2f890c2fdad230).(number);
1511 protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).();
1512 }
1513 }
1514 // "8 File"
1515 // case 8:
1516 void IGSConnectioncxx . . $ IGSConnection#::handle_filecxx . . $ IGSConnection#handle_file(7df51288a9ebd664).(QStringcxx . . $ QString# line)
1517 {
1518 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). line;
1519 }
1520 // INFO: stats, channelinfo
1521 // NNGS, LGS: (NNGS new: 2nd line w/o number!)
1522 // 9 Channel 20 Topic: [xxx] don't pay your NIC bill and only get two players connected
1523 // 9 xxxx1 xxxx2 xxxx3 xxxx4 frosla
1524 // 9 Channel 49 Topic: Der deutsche Kanal (German)
1525 // 9 frosla
1526 //
1527 // --> channel 49
1528 // 9 Channel 49 turned on.
1529 // 9 Channel 49 Title:
1530 //
1531 // 9 guest has left channel 49.
1532 //
1533 // 9 Komi set to -3.5 in match 10
1534 // - in my game:
1535 // - opponent:
1536 // 9 Komi is now set to -3.5
1537 // - me:
1538 // 9 Set the komi to -3.5
1539 // NNGS, LGS:
1540 // 9 I suggest that ditto play White against made:
1541 // 9 For 19x19: Play an even game and set komi to 1.5.
1542 // 9 For 13x13: Play an even game and set komi to 6.5.
1543 // 9 For 9x9: Play an even game and set komi to 4.5.
1544 // or:
1545 // 9 I suggest that pem play Black against eek:
1546 // For 19x19: Take 3 handicap stones and set komi to -2.5.
1547 // For 13x13: Take 1 handicap stones and set komi to -6.5.
1548 // For 9x9: Take 1 handicap stones and set komi to 0.5.
1549 // or:
1550 // I suggest that you play White against Cut:
1551 //
1552 // 9 Match [19x19] in 1 minutes requested with xxxx as White.
1553 // 9 Use <match xxxx B 19 1 10> or <decline xxxx> to respond.
1554 //
1555 // 9 Match [5] with guest17 in 1 accepted.
1556 // 9 Creating match [5] with guest17.
1557 //
1558 // 9 Requesting match in 10 min with frosla as Black.
1559 // 9 guest17 declines your request for a match.
1560 // 9 frosla withdraws the match offer.
1561 //
1562 // 9 You can check your score with the score command
1563 // 9 You can check your score with the score command, type 'done' when finished.
1564 // 9 Removing @ K8
1565 //
1566 // 9 Use adjourn to adjourn the game.
1567 //
1568 // NNGS: cmd 'user' NOT PARSED!
1569 // 9 Info Name Rank 19 9 Idle Rank Info
1570 // 9 -------- ---------- ---- --- --- ---- ---------------------------------
1571 // 9 Q -- 5 hhhsss 2k* 0 0 1s NR
1572 // 9 -- 5 saturn 2k 0 0 18s 2k
1573 // 9 -- 6 change1 1k* 0 0 7s NR
1574 // 9 S -- -- mikke 1d 0 18 30s shodan in sweden
1575 // 9 X -- -- ksonney NR 0 0 56s NR
1576 // 9 -- -- kou 6k* 0 0 23s NR
1577 // 9 SQ! -- -- GnuGo 11k* 0 0 5m Estimation based on NNGS rating early
1578 // 9 X -- -- Maurice 3k* 0 0 24s 2d at Hamilton Go Club, Canada; 3d in
1579 void IGSConnectioncxx . . $ IGSConnection#::handle_infocxx . . $ IGSConnection#handle_info(7df51288a9ebd664).(QStringcxx . . $ QString# line)
1580 {
1581 static PlayerListingcxx . . $ PlayerListing# * statsPlayer;
1582 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch;
1583 Roomcxx . . $ Room# * room = getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).();
1584 static QStringcxx . . $ QString# memory_strcxx . . $ QString#QString(ced63f7c635d850d).;
1585 static int memory = 0;
1586 //qDebug("9: %s", line.toLatin1().constData());
1587 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
1588 // status messages
1589 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Set open to be"cxx . . $ QString#QString(85c52e162fed56f9).))
1590 {
1591 bool val = (line.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("False"cxx . . $ QString#QString(85c52e162fed56f9).) == -1);
1592 room->recvTogglecxx . . $ Room#recvToggle(918ebd27a9ddbad3).(0, val);
1593 }
1594 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Setting you open for matches"cxx . . $ QString#QString(85c52e162fed56f9).))
1595 room->recvTogglecxx . . $ Room#recvToggle(918ebd27a9ddbad3).(0, true);
1596 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Set looking to be"cxx . . $ QString#QString(85c52e162fed56f9).))
1597 {
1598 bool val = (line.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("False"cxx . . $ QString#QString(85c52e162fed56f9).) == -1);
1599 room->recvTogglecxx . . $ Room#recvToggle(918ebd27a9ddbad3).(1, val);
1600 }
1601 // 9 Set quiet to be False.
1602 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Set quiet to be"cxx . . $ QString#QString(85c52e162fed56f9).))
1603 {
1604 bool val = (line.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("False"cxx . . $ QString#QString(85c52e162fed56f9).) == -1);
1605 room->recvTogglecxx . . $ Room#recvToggle(918ebd27a9ddbad3).(2, val);
1606 }
1607 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Welcome to the game room"cxx . . $ QString#QString(85c52e162fed56f9).))
1608 {
1609 QStringcxx . . $ QString# buffer = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 6, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1610 int number = buffer.removecxx . . $ QString#remove(6483560ce2afa901).(0,1).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1611 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Joined room number %d", number);
1612 //FIXME, we need to reload the player
1613 //and games lists here
1614 //potentially something else does this? doublecheck
1615 }
1616 else if (line.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("Channel"cxx . . $ QString#QString(85c52e162fed56f9).) == 0)
1617 {
1618 #ifdef FIXME
1619 // channel messages
1620 QString e1 = element(line, 1, " ");
1621 if (e1.at(e1.length()-1) == ':')
1622 e1.truncate(e1.length()-1);
1623 int nr = e1.toInt();
1624
1625 if (line.contains("turned on."))
1626 {
1627 // turn on channel
1628 emit signal_channelinfo(nr, QString("*on*"));
1629 }
1630 else if (line.contains("turned off."))
1631 {
1632 // turn off channel
1633 emit signal_channelinfo(nr, QString("*off*"));
1634 }
1635 else if (!line.contains("Title:") || gsName == GS_UNKNOWN)
1636 {
1637 // keep in memory to parse next line correct
1638 memory = nr;
1639 emit signal_channelinfo(memory, line);
1640 memory_str = "CHANNEL";
1641 }
1642 #endif //FIXME
1643 // return IT_OTHER;
1644 }
1645 #ifdef FIXME
1646 else if (memory != 0 && !memory_str.isEmpty() && memory_str == "CHANNEL")
1647 {
1648 //emit signal_channelinfo(memory, line);
1649
1650 // reset memory
1651 memory = 0;
1652 memory_str = QString();
1653 // return IT_OTHER;
1654 }
1655 #endif //FIXME
1656 // IGS: channelinfo
1657 // 9 #42 Title: Untitled -- Open
1658 // 9 #42 broesel zero815 Granit
1659 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("#"cxx . . $ QString#QString(85c52e162fed56f9).))
1660 {
1661 QStringcxx . . $ QString# msg = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9)., "EOL"cxx . . $ QString#QString(85c52e162fed56f9).);
1662
1663 if(msg.containscxx . . $ QString#contains(8cce4688c16f48f3).("Title:"cxx . . $ QString#QString(85c52e162fed56f9).))
1664 {
1665 channelcxx . . $ IGSConnection#channel. = new ChannelListingcxx . . $ ChannelListing#();
1666 channelcxx . . $ IGSConnection#channel.->numbercxx . . $ ChannelListing#number. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "#"cxx . . $ QString#QString(85c52e162fed56f9)., " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1667 channelcxx . . $ IGSConnection#channel.->namecxx . . $ ChannelListing#name. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1668 }
1669 else if(channelcxx . . $ IGSConnection#channel.)
1670 {
1671 //parse member list FIXME
1672 channelcxx . . $ IGSConnection#channel. = 0;
1673 }
1674 if(channelcxx . . $ IGSConnection#channel.)
1675 recvChannelListingcxx . . $ NetworkConnection#recvChannelListing(1317f7c0eb828e93).(channelcxx . . $ IGSConnection#channel.);
1676 }
1677 // NNGS: channels
1678 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("has left channel"cxx . . $ QString#QString(85c52e162fed56f9).) || line.containscxx . . $ QString#contains(8cce4688c16f48f3).("has joined channel"cxx . . $ QString#QString(85c52e162fed56f9).))
1679 {
1680 #ifdef FIXME
1681 QString e1 = element(line, 3, " ", ".");
1682 int nr = e1.toInt();
1683
1684 // turn on channel to get full info
1685 emit signal_channelinfo(nr, QString("*on*"));
1686 #endif //FIXME
1687 }
1688 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Game is titled:"cxx . . $ QString#QString(85c52e162fed56f9).))
1689 {
1690 #ifdef FIXME
1691 QString t = element(line, 0, ":", "EOL");
1692 emit signal_title(t);
1693 #endif //FIXME
1694 return;
1695 }
1696 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("offers a new komi "cxx . . $ QString#QString(85c52e162fed56f9).))
1697 {
1698 #ifdef FIXME
1699 // NNGS: 9 physician offers a new komi of 1.5.
1700 QString komi = element(line, 6, " ");
1701 if (komi.at(komi.length()-1) == '.')
1702 komi.truncate(komi.length() - 1);
1703 QString opponent = element(line, 0, " ");
1704
1705 // true: request
1706 emit signal_komi(opponent, komi, true);
1707 #endif //FIXME
1708 }
1709 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Komi set to"cxx . . $ QString#QString(85c52e162fed56f9).))
1710 {
1711 #ifdef FIXME
1712 // NNGS: 9 Komi set to -3.5 in match 10
1713 QString komi = element(line, 3, " ");
1714 QString game_id = element(line, 6, " ");
1715
1716 // false: no request
1717 emit signal_komi(game_id, komi, false);
1718 #endif //FIXME
1719 }
1720 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("wants the komi to be"cxx . . $ QString#QString(85c52e162fed56f9).))
1721 {
1722 #ifdef FIXME
1723 // IGS: 9 qGoDev wants the komi to be 1.5
1724 QString komi = element(line, 6, " ");
1725 QString opponent = element(line, 0, " ");
1726
1727 // true: request
1728 emit signal_komi(opponent, komi, true);
1729 #endif //FIXME
1730 }
1731 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Komi is now set to"cxx . . $ QString#QString(85c52e162fed56f9).))
1732 {
1733 #ifdef FIXME
1734 // 9 Komi is now set to -3.5. -> oppenent set for our game
1735 QString komi = element(line, 5, " ");
1736 // error? "9 Komi is now set to -3.5.9 Komi is now set to -3.5"
1737 if (komi.contains(".9"))
1738 komi = komi.left(komi.length() - 2);
1739
1740 // false: no request
1741 emit signal_komi(QString(), komi, false);
1742 #endif //FIXME
1743 }
1744 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Set the komi to"cxx . . $ QString#QString(85c52e162fed56f9).))
1745 {
1746 #ifdef FIXME
1747 // NNGS: 9 Set the komi to -3.5 - I set for own game
1748 QString komi = element(line, 4, " ");
1749
1750 // false: no request
1751 emit signal_komi(QString(), komi, false);
1752 #endif //FIXME
1753 }
1754 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("game will count"cxx . . $ QString#QString(85c52e162fed56f9).))
1755 {
1756 #ifdef FIXME
1757 // IGS: 9 Game will not count towards ratings.
1758 // 9 Game will count towards ratings.
1759 emit signal_freegame(false);
1760 #endif //FIXME
1761 }
1762 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("game will not count"cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.))
1763 {
1764 #ifdef FIXME
1765 // IGS: 9 Game will not count towards ratings.
1766 // 9 Game will count towards ratings.
1767 emit signal_freegame(true);
1768 #endif //FIXME
1769 }
1770 else if ((line.containscxx . . $ QString#contains(8cce4688c16f48f3).("["cxx . . $ QString#QString(85c52e162fed56f9).) || line.containscxx . . $ QString#contains(8cce4688c16f48f3).("yes"cxx . . $ QString#QString(85c52e162fed56f9).)) && line.lengthcxx . . $ QString#length(455f465bc33b4cdf).() < 6)
1771 {
1772 // 9 [20] ... channelinfo
1773 // 9 yes ... ayt
1774 return;
1775 }
1776 // WING has "as" instead of "has"
1777 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("as restarted your game"cxx . . $ QString#QString(85c52e162fed56f9).) ||
1778 line.containscxx . . $ QString#contains(8cce4688c16f48f3).("has restored your old game"cxx . . $ QString#QString(85c52e162fed56f9).))
1779 {
1780 // FIXME, we probably need to set something up here, though
1781 // for instance with WING, its a 21 message that really
1782 // heralds things/info
1783 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("restarted"cxx . . $ QString#QString(85c52e162fed56f9).))
1784 // memory_str -> see case 15 for continuation
1785 protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1786 }
1787 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("I suggest that"cxx . . $ QString#QString(85c52e162fed56f9).))
1788 {
1789 memory_str =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). line;
1790 return;
1791 }
1792 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("and set komi to"cxx . . $ QString#QString(85c52e162fed56f9).))
1793 {
1794 #ifdef FIXME
1795 //this might be NNGS, LGS only
1796 // suggest message ...
1797 if (!memory_str.isEmpty())
1798 // something went wrong...
1799 return;
1800
1801 line = line.simplified();
1802
1803 QString p1 = element(memory_str, 3, " ");
1804 QString p2 = element(memory_str, 6, " ", ":");
1805 bool p1_play_white = memory_str.contains("play White");
1806
1807 QString h, k;
1808 if (line.contains("even game"))
1809 h = "0";
1810 else
1811 h = element(line, 3, " ");
1812
1813 k = element(line, 9, " ", ".");
1814
1815 int size = 19;
1816 if (line.contains("13x13"))
1817 size = 13;
1818 else if (line.contains("9x 9"))
1819 {
1820 size = 9;
1821 memory_str = QString();
1822 }
1823 if (p1_play_white)
1824 emit signal_suggest(p1, p2, h, k, size);
1825 else
1826 emit signal_suggest(p2, p1, h, k, size);
1827 #endif //FIXME
1828 return;
1829 }
1830 // 9 Match [19x19] in 1 minutes requested with xxxx as White.
1831 // 9 Use <match xxxx B 19 1 10> or <decline xxxx> to respond.
1832 // 9 NMatch requested with yfh2test(B 3 19 60 600 25 0 0 0).
1833 // 9 Use <nmatch yfh2test B 3 19 60 600 25 0 0 0> or <decline yfh2test> to respond.
1834 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("<decline"cxx . . $ QString#QString(85c52e162fed56f9).) && line.containscxx . . $ QString#contains(8cce4688c16f48f3).("match"cxx . . $ QString#QString(85c52e162fed56f9).))
1835 {
1836 // false -> not my request: used in mainwin.cpp
1837 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "<"cxx . . $ QString#QString(85c52e162fed56f9)., ">"cxx . . $ QString#QString(85c52e162fed56f9).);
1838 MatchRequestcxx . . $ MatchRequest# * aMatch = new MatchRequestcxx . . $ MatchRequest#();
1839 unsigned long flags = 0;
1840 /* All games are rated except for ones in free room on IGS */
1841 if(getCurrentRoomcxx . . $ IGSConnection#getCurrentRoom(cde9ef8adcea6063).()->namecxx . . $ RoomListing#name..containscxx . . $ QString#contains(8cce4688c16f48f3).("No rated"cxx . . $ QString#QString(85c52e162fed56f9).))
1842 aMatch->free_ratedcxx . . $ MatchRequest#free_rated. = FREEcxx . . $ FREE.;
1843 else
1844 aMatch->free_ratedcxx . . $ MatchRequest#free_rated. = RATEDcxx . . $ RATED.;
1845 aMatch->opponentcxx . . $ MatchRequest#opponent. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9)., 1, 1);
1846 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("as White"cxx . . $ QString#QString(85c52e162fed56f9).))
1847 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::BLACKcxx . . $ MatchRequest#BLACK.;
1848 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("as Black"cxx . . $ QString#QString(85c52e162fed56f9).))
1849 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::WHITEcxx . . $ MatchRequest#WHITE.;
1850 else if(line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9).,2,2) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "B")
1851 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::BLACKcxx . . $ MatchRequest#BLACK.;
1852 else if(line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9).,2,2) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "N")
1853 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::NIGIRIcxx . . $ MatchRequest#NIGIRI.;
1854 else
1855 aMatch->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::WHITEcxx . . $ MatchRequest#WHITE.;
1856 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("nmatch"cxx . . $ QString#QString(85c52e162fed56f9).))
1857 {
1858 aMatch->handicapcxx . . $ MatchRequest#handicap. = line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9).,3,3).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1859 aMatch->board_sizecxx . . $ MatchRequest#board_size. = line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9).,4,4).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1860 //what kind of time? var name?
1861 //aMatch->maintime = line.section(" ",5,5).toInt();
1862 //aMatch->byoperiodtime = line.section(" ",6,6).toInt();
1863 //aMatch->byoperiods = line.section(" " ,7,7).toInt();
1864 flags = getGameDialogFlagscxx . . $ IGSConnection#getGameDialogFlags(f708dce9a8856c70).();
1865 aMatch->maintimecxx . . $ MatchRequest#maintime. = line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9).,5,5).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1866 aMatch->periodtimecxx . . $ MatchRequest#periodtime. = line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9).,6,6).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1867 aMatch->stones_periodscxx . . $ MatchRequest#stones_periods. = line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9). ,7,7).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1868 if(aMatch->periodtimecxx . . $ MatchRequest#periodtime. < 300)
1869 aMatch->timeSystemcxx . . $ MatchRequest#timeSystem. = byoyomicxx . . $ byoyomi.;
1870 else
1871 aMatch->timeSystemcxx . . $ MatchRequest#timeSystem. = canadiancxx . . $ canadian.;
1872 aMatch->nmatchcxx . . $ MatchRequest#nmatch. = true;
1873 }
1874 else
1875 {
1876 aMatch->timeSystemcxx . . $ MatchRequest#timeSystem. = canadiancxx . . $ canadian.;
1877 aMatch->board_sizecxx . . $ MatchRequest#board_size. = line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9).,3,3).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
1878 aMatch->maintimecxx . . $ MatchRequest#maintime. = line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9).,4,4).toIntcxx . . $ QString#toInt(d7972accae11ee1f).() * 60;
1879 aMatch->periodtimecxx . . $ MatchRequest#periodtime. = line.sectioncxx . . $ QString#section(eae3fc215228815e).(" "cxx . . $ QString#QString(85c52e162fed56f9).,5,5).toIntcxx . . $ QString#toInt(d7972accae11ee1f).() * 60;
1880 aMatch->stones_periodscxx . . $ MatchRequest#stones_periods. = 25;
1881 flags |= GDF_CANADIANcxx . . $ `src/network/gamedialogflags.h:26:9`!;
1882 flags |= GDF_STONES25_FIXEDcxx . . $ `src/network/gamedialogflags.h:29:9`!;
1883 aMatch->nmatchcxx . . $ MatchRequest#nmatch. = false;
1884 }
1885 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(aMatch->opponentcxx . . $ MatchRequest#opponent.);
1886 const PlayerListingcxx . . $ PlayerListing# * us = getOurListingcxx . . $ NetworkConnection#getOurListing(c84291d55c8466c6).();
1887 if(us)
1888 {
1889 aMatch->our_namecxx . . $ MatchRequest#our_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). us->namecxx . . $ PlayerListing#name.;
1890 aMatch->our_rankcxx . . $ MatchRequest#our_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). us->rankcxx . . $ PlayerListing#rank.;
1891 }
1892 aMatch->their_rankcxx . . $ MatchRequest#their_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). p->rankcxx . . $ PlayerListing#rank.;
1893
1894 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(p);
1895 gameDialog->recvRequestcxx . . $ GameDialog#recvRequest(461bc273ee812ab9).(aMatch, flags);
1896 delete aMatch;
1897 }
1898 // 9 Match [5] with guest17 in 1 accepted.
1899 // 9 Creating match [5] with guest17.
1900 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Creating match"cxx . . $ QString#QString(85c52e162fed56f9).))
1901 {
1902 QStringcxx . . $ QString# nr = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "["cxx . . $ QString#QString(85c52e162fed56f9)., "]"cxx . . $ QString#QString(85c52e162fed56f9).);
1903 // maybe there's a blank within the brackets: ...[ 5]...
1904 QStringcxx . . $ QString# dummy = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "]"cxx . . $ QString#QString(85c52e162fed56f9)., "."cxx . . $ QString#QString(85c52e162fed56f9).).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
1905 QStringcxx . . $ QString# opp = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(dummy, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1906
1907 // We let the 15 game record message create the board
1908 //GameDialog * gameDialog = connection->getGameDialog(opp);
1909 //gameDialog->closeAndCreate();
1910 //GameDialog * gameDialog =
1911 // connection->getGameDialog(opp);
1912 //MatchRequest * mr = gameDialog->getMatchRequest();
1913 //created_match_request = new MatchRequest(*mr);
1914 //connection->closeGameDialog(opp);
1915 ////emit signal_matchCreate(nr, opp);
1916 // automatic opening of a dialog tab for further conversation
1917 ////emit signal_talk(opp, "", true);
1918 }
1919 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Match"cxx . . $ QString#QString(85c52e162fed56f9).) && line.containscxx . . $ QString#contains(8cce4688c16f48f3).("accepted"cxx . . $ QString#QString(85c52e162fed56f9).))
1920 {
1921 QStringcxx . . $ QString# nr = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "["cxx . . $ QString#QString(85c52e162fed56f9)., "]"cxx . . $ QString#QString(85c52e162fed56f9).);
1922 QStringcxx . . $ QString# opp = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1923 ////emit signal_matchCreate(nr, opp);
1924 /* FIXME, this is probably where we should be doing something?
1925 * assuming its reliable */
1926
1927 }
1928 // 9 frosla withdraws the match offer.
1929 // 9 guest17 declines your request for a match.
1930 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("declines your request for a match"cxx . . $ QString#QString(85c52e162fed56f9).) ||
1931 line.containscxx . . $ QString#contains(8cce4688c16f48f3).("withdraws the match offer"cxx . . $ QString#QString(85c52e162fed56f9).))
1932 {
1933 QStringcxx . . $ QString# opp = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1934 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(opp);
1935 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(p);
1936 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(1);
1937 }
1938 //9 yfh2test declines undo
1939 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("declines undo"cxx . . $ QString#QString(85c52e162fed56f9).))
1940 {
1941 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("%s", line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).()); //FIXME
1942 // not the cleanest way : we should send this to a message box
1943 //emit signal_kibitz(0, element(line, 0, " "), line);
1944 return;
1945 }
1946
1947 //9 yfh2test left this room
1948 //9 yfh2test entered this room
1949 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("this room"cxx . . $ QString#QString(85c52e162fed56f9).))
1950 {} //emit signal_refresh(10);
1951
1952 //9 Requesting match in 10 min with frosla as Black.
1953 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Requesting match in"cxx . . $ QString#QString(85c52e162fed56f9).))
1954 {
1955 QStringcxx . . $ QString# opp = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 6, " "cxx . . $ QString#QString(85c52e162fed56f9).);
1956 //emit signal_opponentopen(opp);
1957 }
1958 // NNGS: 9 Removing @ K8
1959 // IGS: 9 Removing @ B5
1960 // 49 Game 265 qGoDev is removing @ B5
1961 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("emoving @"cxx . . $ QString#QString(85c52e162fed56f9).))
1962 {
1963 /* FIXME DOUBLE CHECK!!! */
1964 /*if (gsName != IGS)
1965 {
1966 QString pt = element(line, 2, " ");
1967 //emit signal_reStones(pt, 0);
1968 }*/
1969 /* 49 handles this for IGS... but what about observed games? */
1970 #ifdef FIXME
1971
1972 if(protocol_save_int < 0)
1973 {
1974 qDebug("Received stone removal message without game in scoring mode");
1975 return;
1976 }
1977 else
1978 {
1979 QString pt = element(line, 2, " ");
1980 handleRemovingAt(protocol_save_int, pt);
1981 // FIXME Set protocol_save_int to -1???
1982 }
1983 #endif //FIXME
1984
1985 }
1986 // 9 You can check your score with the score command, type 'done' when finished.
1987 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("check your score with the score command"cxx . . $ QString#QString(85c52e162fed56f9).))
1988 {
1989 // if (gsName == IGS)
1990 // IGS: store and wait until game number is known
1991 // memory_str = QString("rmv@"); // -> continuation see 15
1992 // else
1993 ////emit signal_restones(0, 0);
1994 ////emit signal_enterScoreMode();
1995 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Getting boarddispatch from memory: %d", protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
1996 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
1997 if(boarddispatch)
1998 {
1999 boarddispatch->recvEnterScoreModecxx . . $ BoardDispatch#recvEnterScoreMode(49f6e7a06ebc5aa8).();
2000 //connection->protocol_save_string = QString("rmv@");
2001 }
2002 }
2003 // IGS: 9 Board is restored to what it was when you started scoring
2004 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("what it was when you"cxx . . $ QString#QString(85c52e162fed56f9).))
2005 {
2006 //emit signal_restoreScore();
2007 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Getting boarddispatch from memory: %d", protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
2008 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
2009 if(boarddispatch)
2010 {
2011 MoveRecordcxx . . $ MoveRecord# * move = new MoveRecordcxx . . $ MoveRecord#();
2012 move->flagscxx . . $ MoveRecord#flags. = MoveRecordcxx . . $ MoveRecord#::UNDO_TERRITORYcxx . . $ MoveRecord#UNDO_TERRITORY.;
2013 boarddispatch->recvMovecxx . . $ BoardDispatch#recvMove(d174a3d9cfb0dd75).(move);
2014 delete move;
2015 boarddispatch->recvKibitzcxx . . $ BoardDispatch#recvKibitz(3458fe3960d5051).(""cxx . . $ QString#QString(85c52e162fed56f9)., linecxx . . $ QString#QString(132dd6869045752b).);
2016 }
2017 }
2018 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("has typed done"cxx . . $ QString#QString(85c52e162fed56f9).))
2019 {
2020 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Getting boarddispatch from memory: %d", protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
2021 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
2022 if(boarddispatch)
2023 boarddispatch->recvKibitzcxx . . $ BoardDispatch#recvKibitz(3458fe3960d5051).(""cxx . . $ QString#QString(85c52e162fed56f9)., linecxx . . $ QString#QString(132dd6869045752b).);
2024 }
2025 // WING: 9 Use <adjourn> to adjourn, or <decline adjourn> to decline.
2026 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Use adjourn to"cxx . . $ QString#QString(85c52e162fed56f9).) || line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Use <adjourn> to"cxx . . $ QString#QString(85c52e162fed56f9).))
2027 {
2028 ////emit signal_requestDialog("adjourn", "decline adjourn", 0, 0);
2029 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(match_negotiation_statecxx . . $ NetworkConnection#match_negotiation_state.->getGameIdcxx . . $ MatchNegotiationState#getGameId(32a7769d58713265).());
2030 if(boarddispatch)
2031 boarddispatch->recvRequestAdjourncxx . . $ BoardDispatch#recvRequestAdjourn(49f6e7a06ebc5aa8).();
2032 }
2033 // 9 frosla requests to pause the game.
2034 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("requests to pause"cxx . . $ QString#QString(85c52e162fed56f9).))
2035 {
2036 //emit signal_requestDialog("pause", 0, 0, 0);
2037 }
2038 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("been adjourned"cxx . . $ QString#QString(85c52e162fed56f9).))
2039 {
2040 // re game from list - special case: own game
2041 #ifdef FIXME
2042 aGame->nr = "@";
2043 aGame->running = false;
2044
2045 //emit signal_game(aGame);
2046 #endif //FIXME
2047 /* There's several after the fact server INFO messages about
2048 * games adjourning so we only need to close for one of them
2049 * The 21 message might actually be better FIXME*/
2050 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
2051 if(boarddispatch)
2052 {
2053 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("adjourning game!!");
2054 boarddispatch->adjournGamecxx . . $ BoardDispatch#adjournGame(49f6e7a06ebc5aa8).();
2055 closeBoardDispatchcxx . . $ NetworkConnection#closeBoardDispatch(cb2f890c2fdad230).(protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
2056 }
2057 }
2058 // 9 Game 22: frosla vs frosla has adjourned.
2059 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("has adjourned"cxx . . $ QString#QString(85c52e162fed56f9).))
2060 {
2061 int number = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9)., ":"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2062 GameListingcxx . . $ GameListing# * aGame = room->getGameListingcxx . . $ Room#getGameListing(d402167d8f57cf00).(number);
2063 aGame->runningcxx . . $ GameListing#running. = false;
2064
2065 // for information
2066 //aGame->Sz = "has adjourned.";
2067
2068 #ifdef OLD
2069 //emit signal_game(aGame);
2070 // //emit signal_(aGame);
2071 #endif //OLD
2072 // No need to get existing listing because
2073 // this is just to falsify the listing
2074 room->recvGameListingcxx . . $ Room#recvGameListing(9a447f3b9a8a5041).(aGame);
2075 /* Also notify board if we're watching */
2076 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(aGame->numbercxx . . $ GameListing#number.);
2077 if(boarddispatch)
2078 {
2079 boarddispatch->adjournGamecxx . . $ BoardDispatch#adjournGame(49f6e7a06ebc5aa8).();
2080 closeBoardDispatchcxx . . $ NetworkConnection#closeBoardDispatch(cb2f890c2fdad230).(aGame->numbercxx . . $ GameListing#number.);
2081 }
2082 }
2083 // 9 Removing game 30 from observation list.
2084 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("from observation list"cxx . . $ QString#QString(85c52e162fed56f9).))
2085 {
2086 // is done from qGoIF
2087 // //emit signal_addToObservationList(-1);
2088 // aGame->nr = element(line, 2, " ").toInt();
2089 // aGame->Sz = "-";
2090 // aGame->running = false;
2091 //emit signal_observedGameClosed(element(line, 2, " ").toInt());
2092 return;
2093 }
2094 // 9 Adding game to observation list.
2095 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("to observation list"cxx . . $ QString#QString(85c52e162fed56f9).))
2096 {
2097 /* Unfortunately, LGS and IGS have no number here, so
2098 * we have to either guess or get it from the observe send
2099 * which is easiest */
2100 getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
2101 protocol_save_intcxx . . $ IGSConnection#protocol_save_int. = -1;
2102 return;
2103 }
2104 // 9 Games currently being observed: 31, 36, 45.
2105 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Games currently being observed"cxx . . $ QString#QString(85c52e162fed56f9).))
2106 {
2107 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("None"cxx . . $ QString#QString(85c52e162fed56f9).))
2108 {
2109 //emit signal_addToObservationList(0);
2110 }
2111 else
2112 {
2113 #ifdef FIXME
2114 // don't work correct at IGS!!!
2115 int i = line.count(',');
2116
2117 qDebug(QString("observing %1 games").arg(i+1).toLatin1());
2118 #endif //FIXME
2119 // //emit signal_addToObservationList(i+1);
2120 }
2121
2122 // return IT_OTHER;
2123 }
2124 // 9 1 minutes were added to your opponents clock
2125 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("minutes were added"cxx . . $ QString#QString(85c52e162fed56f9).))
2126 {
2127 //boarddispatch = getIfBoardDispatch(protocol_save_int);
2128 //need to see this in action FIXME addTime
2129 //also check LGS/WING code
2130 int t = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2131 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(match_negotiation_statecxx . . $ NetworkConnection#match_negotiation_state.->getGameIdcxx . . $ MatchNegotiationState#getGameId(32a7769d58713265).());
2132 if(boarddispatch)
2133 boarddispatch->recvAddTimecxx . . $ BoardDispatch#recvAddTime(909c33aa10af95dd).(t, boarddispatch->getOpponentNamecxx . . $ BoardDispatch#getOpponentName(4365c3963150523e).());
2134
2135 }
2136 // 9 Your opponent has added 1 minutes to your clock.
2137 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("opponent has added"cxx . . $ QString#QString(85c52e162fed56f9).))
2138 {
2139 int t = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2140 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(match_negotiation_statecxx . . $ NetworkConnection#match_negotiation_state.->getGameIdcxx . . $ MatchNegotiationState#getGameId(32a7769d58713265).());
2141 if(boarddispatch)
2142 boarddispatch->recvAddTimecxx . . $ BoardDispatch#recvAddTime(909c33aa10af95dd).(t, getUsernamecxx . . $ QString#QString(132dd6869045752b).());
2143 }
2144 // NNGS: 9 Game clock paused. Use "unpause" to resume.
2145 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Game clock paused"cxx . . $ QString#QString(85c52e162fed56f9).))
2146 {
2147 #ifdef FIXME
2148 emit signal_timeAdded(-1, true);
2149 #endif //FIXME
2150 }
2151 // NNGS: 9 Game clock resumed.
2152 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Game clock resumed"cxx . . $ QString#QString(85c52e162fed56f9).))
2153 {
2154 #ifdef FIXME
2155 emit signal_timeAdded(-1, false);
2156 #endif //FIXME
2157 }
2158 // 9 Increase frosla's time by 1 minute
2159 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("s time by"cxx . . $ QString#QString(85c52e162fed56f9).))
2160 {
2161 //not sure how this works if we're observing the game FIXME
2162 int t = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2163 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(match_negotiation_statecxx . . $ NetworkConnection#match_negotiation_state.->getGameIdcxx . . $ MatchNegotiationState#getGameId(32a7769d58713265).());
2164 if(boarddispatch)
2165 {
2166 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).(getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).()))
2167 boarddispatch->recvAddTimecxx . . $ BoardDispatch#recvAddTime(909c33aa10af95dd).(t, getUsernamecxx . . $ QString#QString(132dd6869045752b).());
2168 else
2169 boarddispatch->recvAddTimecxx . . $ BoardDispatch#recvAddTime(909c33aa10af95dd).(t, boarddispatch->getOpponentNamecxx . . $ BoardDispatch#getOpponentName(4365c3963150523e).());
2170 }
2171 }
2172 // 9 Setting your . to Banana [text] (idle: 0 minutes)
2173 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Setting your . to"cxx . . $ QString#QString(85c52e162fed56f9).))
2174 {
2175 QStringcxx . . $ QString# busy = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "["cxx . . $ QString#QString(85c52e162fed56f9)., "]"cxx . . $ QString#QString(85c52e162fed56f9).);
2176 if (!busy.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
2177 {
2178 QStringcxx . . $ QString# player = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2179 // true = player
2180 ////emit signal_talk(player, "[" + busy + "]", true);
2181 }
2182 }
2183 /* I'm pretty sure, as with LGS and WING, we want to
2184 * update the game lists here but not use 9 messages
2185 * for the board
2186 * 9 message maybe only score with IGS and if we can't
2187 * reliably use 22... because of internal difficulties...*/
2188 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("resigns."cxx . . $ QString#QString(85c52e162fed56f9).) ||
2189 line.containscxx . . $ QString#contains(8cce4688c16f48f3).("adjourned."cxx . . $ QString#QString(85c52e162fed56f9).) ||
2190 //don't intefere with status UNLESS IGS (real solution is to
2191 // interpret status message and ignore here FIXME FIXME)
2192 line.containscxx . . $ QString#contains(8cce4688c16f48f3).(" : W "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.) ||
2193 line.containscxx . . $ QString#contains(8cce4688c16f48f3).(" : B "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.) ||
2194 line.containscxx . . $ QString#contains(8cce4688c16f48f3).("forfeits on"cxx . . $ QString#QString(85c52e162fed56f9).) ||
2195 line.containscxx . . $ QString#contains(8cce4688c16f48f3).("lost by"cxx . . $ QString#QString(85c52e162fed56f9).))
2196 {
2197 GameResultcxx . . $ GameResult# * aGameResult;
2198 int number = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9)., ":"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2199 GameListingcxx . . $ GameListing# * aGame = room->getGameListingcxx . . $ Room#getGameListing(d402167d8f57cf00).(number);
2200 aGame->runningcxx . . $ GameListing#running. = false;
2201 // for information
2202 aGame->resultcxx . . $ GameListing#result. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9)., "}"cxx . . $ QString#QString(85c52e162fed56f9).);
2203
2204 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(aGame->numbercxx . . $ GameListing#number.);
2205 /* FIXME: This shouldn't create a new board if
2206 * we're not watching it.
2207 * Also WING sometimes sends 9 and sometimes sends 21 perhaps
2208 * depending on whether its observed or resign versus score/result
2209 * we don't want to send double messages.*/
2210 if(boarddispatch)
2211 {
2212 aGameResult = new GameResultcxx . . $ GameResult#();
2213
2214 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).(" : W "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.) ||
2215 line.containscxx . . $ QString#contains(8cce4688c16f48f3).(" : B "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.))
2216 {
2217 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::SCOREcxx . . $ GameResult#SCORE.;
2218
2219 int posw, posb;
2220 posw = aGame->resultcxx . . $ GameListing#result..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("W "cxx . . $ QString#QString(85c52e162fed56f9).);
2221 posb = aGame->resultcxx . . $ GameListing#result..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("B "cxx . . $ QString#QString(85c52e162fed56f9).);
2222 bool wfirst = posw < posb;
2223 float sc1, sc2;
2224 sc1 = aGame->resultcxx . . $ GameListing#result..midcxx . . $ QString#mid(44b7563da18aea72).(posw+1, posb-posw-2).toFloatcxx . . $ QString#toFloat(abac0204e50f9cf0).();
2225 //sc2 = aGame->result.right(aGame->result.length()-posb-1).toFloat();
2226 /* FIXME This may be right for IGS and wrong for WING */
2227 //sc2 = aGame->result.mid(posb +1, posb + 6).toFloat();
2228 sc2 = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(aGame->resultcxx . . $ GameListing#result., 4, " "cxx . . $ QString#QString(85c52e162fed56f9).).toFloatcxx . . $ QString#toFloat(abac0204e50f9cf0).();
2229 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("sc1: %f sc2: %f\n", sc1, sc2);
2230 if(sc1 > sc2)
2231 {
2232 aGameResult->winner_scorecxx . . $ GameResult#winner_score. = sc1;
2233 aGameResult->loser_scorecxx . . $ GameResult#loser_score. = sc2;
2234 }
2235 else
2236 {
2237 aGameResult->winner_scorecxx . . $ GameResult#winner_score. = sc2;
2238 aGameResult->loser_scorecxx . . $ GameResult#loser_score. = sc1;
2239
2240 }
2241
2242 if (!wfirst)
2243 {
2244 int h = posw;
2245 posw = posb;
2246 posb = h;
2247 if(sc2 > sc1)
2248
2249 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
2250 else
2251 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
2252 }
2253 else
2254 {
2255 if(sc1 > sc2)
2256 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
2257 else
2258 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
2259 }
2260
2261
2262 }
2263 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("forfeits on time"cxx . . $ QString#QString(85c52e162fed56f9).))
2264 {
2265 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::TIMEcxx . . $ GameResult#TIME.;
2266 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Black"cxx . . $ QString#QString(85c52e162fed56f9).))
2267 {
2268 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
2269 }
2270 else
2271 {
2272 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
2273 }
2274 }
2275 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("resign"cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.))
2276 {
2277 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::RESIGNcxx . . $ GameResult#RESIGN.;
2278 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Black"cxx . . $ QString#QString(85c52e162fed56f9).))
2279 {
2280 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
2281 }
2282 else
2283 {
2284 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
2285 }
2286 }
2287 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("lost by"cxx . . $ QString#QString(85c52e162fed56f9).))
2288 {
2289 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::SCOREcxx . . $ GameResult#SCORE.;
2290 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Black"cxx . . $ QString#QString(85c52e162fed56f9).))
2291 {
2292 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
2293 }
2294 else
2295 {
2296 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
2297
2298 }
2299
2300 }
2301 }
2302
2303
2304 if (aGame->resultcxx . . $ GameListing#result..isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
2305 aGame->resultcxx . . $ GameListing#result. =cxx . . $ QString#`operator=`(d02845eef0c33901). "-";
2306 else if (aGame->resultcxx . . $ GameListing#result..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(":"cxx . . $ QString#QString(85c52e162fed56f9).) != -1)
2307 aGame->resultcxx . . $ GameListing#result..removecxx . . $ QString#remove(6483560ce2afa901).(0,2);
2308
2309 if(boarddispatch)
2310 {
2311 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Receiving result!!!");
2312 boarddispatch->recvResultcxx . . $ BoardDispatch#recvResult(c72a8b5aed169521).(aGameResult);
2313 /* is kibitzing this here what we want?*/
2314 /* FIXME... should be a shortened list, not the full
2315 * result msg kibitz */
2316 /* More, looks like there is possible
2317 * crash here if we already received a result
2318 * and there's no good way to turn this off.
2319 * FIXME All of the recvResult stuff needs
2320 * to be cleaned up really */
2321 //boarddispatch->recvKibitz("", line);
2322 }
2323 room->recvGameListingcxx . . $ Room#recvGameListing(9a447f3b9a8a5041).(aGame);
2324 return;
2325 }
2326 // NNGS: 9 Messages: (after 'message' cmd)
2327 // 8 File
2328 // <msg>
2329 // 8 File
2330 // 9 Please type "erase" to erase your messages after reading
2331 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Messages:"cxx . . $ QString#QString(85c52e162fed56f9).))
2332 {
2333 // parse like IGS cmd nr 14: Messages
2334 memory = 14;
2335 }
2336 // IGS: 9 You have a message. To read your messages, type: message
2337 // NNGS: 9 You have 1 messages. Type "messages" to display them
2338 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("You have"cxx . . $ QString#QString(85c52e162fed56f9).) && line.containscxx . . $ QString#contains(8cce4688c16f48f3).("messages"cxx . . $ QString#QString(85c52e162fed56f9).))
2339 {
2340 // re cmd nr
2341 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
2342 line =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2);
2343 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
2344 return;
2345 }
2346 // 9 Observing game 2 (chmeng vs. myao) :
2347 // 9 shanghai 9k* henry 15k
2348 // 9 Found 2 observers.
2349 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Observing game "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.))
2350 {
2351 // right now: only need for observers of teaching game
2352 // game number
2353 bool ok;
2354 memory = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(&ok);
2355 if (ok)
2356 {
2357 memory_str =cxx . . $ QString#`operator=`(d02845eef0c33901). "observe";
2358 // FIXME
2359 //emit signal_clearObservers(memory);
2360 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(memory);
2361 if(boarddispatch)
2362 {
2363 GameDatacxx . . $ GameData# * g = boarddispatch->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
2364 g->white_namecxx . . $ GameData#white_name. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "("cxx . . $ QString#QString(85c52e162fed56f9)., " "cxx . . $ QString#QString(85c52e162fed56f9).);
2365 g->black_namecxx . . $ GameData#black_name. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9)., ")"cxx . . $ QString#QString(85c52e162fed56f9).);
2366 boarddispatch->gameDataChangedcxx . . $ BoardDispatch#gameDataChanged(49f6e7a06ebc5aa8).();
2367 }
2368 return;
2369 }
2370 }
2371 else if (!memory_str.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() && memory_str ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "observe" && line.containscxx . . $ QString#contains(8cce4688c16f48f3).("."cxx . . $ QString#QString(85c52e162fed56f9).))
2372 {
2373 // QString cnt = element(line, 1, " ");
2374 // //emit signal_kibitz(memory, "00", "");
2375
2376 memory = 0;
2377 memory_str =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).();
2378
2379 return;
2380 }
2381 else if (!memory_str.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() && memory_str ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "observe")
2382 {
2383 QStringcxx . . $ QString# name = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2384 QStringcxx . . $ QString# rankcxx . . $ QString#QString(ced63f7c635d850d).;
2385 boarddispatch = getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(memory);
2386 if(!boarddispatch)
2387 {
2388 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("No boarddispatch for observer list\n");
2389 return;
2390 }
2391
2392 for (int i = 1; ! name.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).(); i++)
2393 {
2394 rank =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, i, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2395 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&rank);
2396 // send as kibitz from "0"
2397 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(name);
2398 boarddispatch->recvObservercxx . . $ BoardDispatch#recvObserver(fcd883ebbd0934ee).(p, true);
2399 name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, ++i , " "cxx . . $ QString#QString(85c52e162fed56f9).);
2400 }
2401
2402 return;
2403 }
2404 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Found"cxx . . $ QString#QString(85c52e162fed56f9).) && line.containscxx . . $ QString#contains(8cce4688c16f48f3).("observers"cxx . . $ QString#QString(85c52e162fed56f9).))
2405 {
2406 memory = 0;
2407 memory_str =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).();
2408 }
2409 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("****"cxx . . $ QString#QString(85c52e162fed56f9).) && line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Players"cxx . . $ QString#QString(85c52e162fed56f9).))
2410 {
2411 return;
2412 }
2413 // 9 qGoDev has resigned the game.
2414 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("has resigned the game"cxx . . $ QString#QString(85c52e162fed56f9).))
2415 {
2416 if(!protocol_save_intcxx . . $ IGSConnection#protocol_save_int.)
2417 {
2418 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("no memory for resign game message");
2419 return;
2420 }
2421 /* If this is our game, there's a 21 message maybe later that
2422 * should be handling it FIXME */
2423 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
2424 if(!boarddispatch)
2425 {
2426 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("No board dispatch for \"resigned the game\"\n");
2427 return;
2428 }
2429 #ifdef FIXME
2430 aGame->running = false;
2431 #endif //FIXME
2432
2433 GameResultcxx . . $ GameResult# * aGameResult = new GameResultcxx . . $ GameResult#();
2434 aGameResult->loser_namecxx . . $ GameResult#loser_name. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2435 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::RESIGNcxx . . $ GameResult#RESIGN.;
2436 /* We need to set unknown/none color here */
2437 boarddispatch->recvResultcxx . . $ BoardDispatch#recvResult(c72a8b5aed169521).(aGameResult);
2438 return;
2439
2440 }
2441 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("has run out of time"cxx . . $ QString#QString(85c52e162fed56f9).))
2442 {
2443 boarddispatch = getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
2444 if(!boarddispatch)
2445 {
2446 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("No board dispatch for \"has run out of time\"\n");
2447 return;
2448 }
2449 #ifdef FIXME
2450 aGame->running = false;
2451 #endif //FIXME
2452
2453 GameResultcxx . . $ GameResult# * aGameResult = new GameResultcxx . . $ GameResult#();
2454 aGameResult->loser_namecxx . . $ GameResult#loser_name. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2455 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::TIMEcxx . . $ GameResult#TIME.;
2456 /* We need to set unknown/none color here */
2457 boarddispatch->recvResultcxx . . $ BoardDispatch#recvResult(c72a8b5aed169521).(aGameResult);
2458 return;
2459
2460 }
2461
2462
2463
2464 //9 Player: yfh2
2465 //9 Game: go (1)
2466 //9 Language: default
2467 //9 Rating: 6k* 23
2468 //9 Rated Games: 21
2469 //9 Rank: 8k 21
2470 //9 Wins: 13
2471 //9 Losses: 16
2472 //9 Idle Time: (On server) 0s
2473 //9 Address: [email protected]
2474 //9 Country: France
2475 //9 Reg date: Tue Nov 18 04:01:05 2003
2476 //9 Info: yfh2
2477 //9 Defaults (help defs): time 0, size 0, byo-yomi time 0, byo-yomi stones 0
2478 //9 Verbose Bell Quiet Shout Automail Open Looking Client Kibitz Chatter
2479 //9 Off On On On On Off Off On On On
2480
2481 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Player:"cxx . . $ QString#QString(85c52e162fed56f9).))
2482 {
2483 //statsPlayer = new PlayerListing();
2484 QStringcxx . . $ QString# name = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2485 statsPlayer = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(name);
2486 #ifdef FIXME
2487 /* So this would have cleared the structure, but
2488 * we're just creating a new empty object later.
2489 * One HUGE FIXME question is what we might be
2490 * overriding on the other side. Maybe we need
2491 * a bit vector specifying what has updated when
2492 * the message is passed. So the notion before
2493 * was that the structure was held until
2494 * completely filled and then passed up*/
2495
2496 statsPlayer->extInfo = "";
2497 statsPlayer->won = "";
2498 statsPlayer->lost = "";
2499 statsPlayer->country = "";
2500 statsPlayer->nmatch_settings = "";
2501 statsPlayer->rank = "";
2502 statsPlayer->info = "";
2503 statsPlayer->address = "";
2504 statsPlayer->play_str = "";
2505 statsPlayer->obs_str = "";
2506 statsPlayer->idle = "";
2507 statsPlayer->rated = "";
2508 // not sure it is the best way : above code seem to make use of "signal"
2509 // but we don't need this apparently for handling stats
2510 #endif //FIXME
2511 protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. =cxx . . $ QString#`operator=`(d02845eef0c33901). "STATS";
2512 return;
2513 }
2514
2515 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Address:"cxx . . $ QString#QString(85c52e162fed56f9).))
2516 {
2517 statsPlayer->email_addresscxx . . $ PlayerListing#email_address. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2518 return;
2519 }
2520
2521 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Last Access"cxx . . $ QString#QString(85c52e162fed56f9).))
2522 {
2523 statsPlayer->idletimecxx . . $ PlayerListing#idletime. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).)+cxx . . $ operator+(3d22f08efddf8107). " " +cxx . . $ operator+(fab9b4f80031f353). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 5, " "cxx . . $ QString#QString(85c52e162fed56f9).)+cxx . . $ operator+(3d22f08efddf8107)." " +cxx . . $ operator+(fab9b4f80031f353). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 6, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2524 statsPlayer->seconds_idlecxx . . $ PlayerListing#seconds_idle. = idleTimeToSecondscxx . . $ IGSConnection#idleTimeToSeconds(9d92bb507a34628c).(statsPlayercxx . . $ QString#QString(132dd6869045752b).->idletimecxx . . $ PlayerListing#idletime.);
2525 return;
2526 }
2527
2528 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Rating:"cxx . . $ QString#QString(85c52e162fed56f9).))
2529 {
2530 statsPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2531 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(statsPlayer->rankcxx . . $ PlayerListing#rank.));
2532 statsPlayer->rank_scorecxx . . $ PlayerListing#rank_score. = rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(statsPlayercxx . . $ QString#QString(132dd6869045752b).->rankcxx . . $ PlayerListing#rank.);
2533 return;
2534 }
2535
2536 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Wins:"cxx . . $ QString#QString(85c52e162fed56f9).))
2537 {
2538 statsPlayer->winscxx . . $ PlayerListing#wins. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2539 return;
2540 }
2541
2542 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Losses:"cxx . . $ QString#QString(85c52e162fed56f9).))
2543 {
2544 statsPlayer->lossescxx . . $ PlayerListing#losses. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2545 return;
2546 }
2547
2548 else if ((line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Country:"cxx . . $ QString#QString(85c52e162fed56f9).))||(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("From:"cxx . . $ QString#QString(85c52e162fed56f9).))) //IGS || LGS
2549 {
2550 statsPlayer->countrycxx . . $ PlayerListing#country. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).,"EOL"cxx . . $ QString#QString(85c52e162fed56f9).);
2551 return;
2552 }
2553
2554 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Defaults"cxx . . $ QString#QString(85c52e162fed56f9).)) //IGS
2555 {
2556 statsPlayer->extInfocxx . . $ PlayerListing#extInfo. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).,"EOL"cxx . . $ QString#QString(85c52e162fed56f9).);
2557 Talkcxx . . $ Talk# * talk = getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).()->getTalkcxx . . $ Room#getTalk(e709c6e389e35213).(statsPlayer);
2558 if(talk)
2559 talk->updatePlayerListingcxx . . $ Talk#updatePlayerListing(49f6e7a06ebc5aa8).();
2560 statsPlayer = 0;
2561 return;
2562 }
2563 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("User Level:"cxx . . $ QString#QString(85c52e162fed56f9).)) //LGS
2564 {
2565 statsPlayer->extInfocxx . . $ PlayerListing#extInfo. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). line;
2566 return;
2567 }
2568
2569
2570 else if ((line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Info:"cxx . . $ QString#QString(85c52e162fed56f9).))&& !(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Rank Info:"cxx . . $ QString#QString(85c52e162fed56f9).)))
2571 {
2572 #ifdef FIXME
2573 if (! statsPlayer->info.isEmpty())
2574 statsPlayer->info.append("\n");
2575 statsPlayer->info.append(line);
2576 //emit signal_statsPlayer(statsPlayer);
2577 #endif //FIXME
2578 return;
2579 }
2580
2581 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Playing in game:"cxx . . $ QString#QString(85c52e162fed56f9).)) //IGS and LGS
2582 {
2583 statsPlayer->playingcxx . . $ PlayerListing#playing. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2584
2585 return;
2586 }
2587 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Rated Games:"cxx . . $ QString#QString(85c52e162fed56f9).))
2588 {
2589 statsPlayer->rated_gamescxx . . $ PlayerListing#rated_games. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2590 return;
2591 }
2592 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Idle Time:"cxx . . $ QString#QString(85c52e162fed56f9).))
2593 {
2594 statsPlayer->idletimecxx . . $ PlayerListing#idletime. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2595 statsPlayer->seconds_idlecxx . . $ PlayerListing#seconds_idle. = idleTimeToSecondscxx . . $ IGSConnection#idleTimeToSeconds(9d92bb507a34628c).(statsPlayercxx . . $ QString#QString(132dd6869045752b).->idletimecxx . . $ PlayerListing#idletime.);
2596 return;
2597 }
2598
2599 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Last Access"cxx . . $ QString#QString(85c52e162fed56f9).))
2600 {
2601 statsPlayer->idletimecxx . . $ PlayerListing#idletime. =cxx . . $ QString#`operator=`(d02845eef0c33901). "not on";
2602 return;
2603 }
2604
2605 else if (line.leftcxx . . $ QString#left(3f3c3d0e9c0eb37f).(5) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "19x19") //LGS syntax
2606 {
2607 statsPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2608 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(statsPlayer->rankcxx . . $ PlayerListing#rank.));
2609 statsPlayer->rank_scorecxx . . $ PlayerListing#rank_score. = rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(statsPlayercxx . . $ QString#QString(132dd6869045752b).->rankcxx . . $ PlayerListing#rank.);
2610 statsPlayer->rated_gamescxx . . $ PlayerListing#rated_games. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 7, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2611 return;
2612 }
2613
2614 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Wins/Losses"cxx . . $ QString#QString(85c52e162fed56f9).)) //LGS syntax
2615 {
2616 statsPlayer->winscxx . . $ PlayerListing#wins. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2617 statsPlayer->lossescxx . . $ PlayerListing#losses. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2618 return;
2619 }
2620 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Off"cxx . . $ QString#QString(85c52e162fed56f9).) || line.containscxx . . $ QString#contains(8cce4688c16f48f3).("On"cxx . . $ QString#QString(85c52e162fed56f9).))
2621 {
2622 /* Scratch this, we're claiming "Defaults" is the last line */
2623 /*Talk * talk = connection->getTalk(statsPlayer->name);
2624 if(talk)
2625 talk->recvPlayerListing(statsPlayer);
2626 //talk->recvTalk(e2);
2627
2628 delete statsPlayer;
2629 statsPlayer = 0;*/
2630 }
2631
2632 //9 ROOM 01: FREE GAME ROOM;PSMNYACF;自由対局室;19;1;10;1,19,60,600,30,25,10,60,0
2633 //9 ROOM 10: SLOW GAME ROOM;PSMNYACF;スロー対局室;19;1;20
2634 //9 ROOM 92: PANDA OPEN ROOM;X;月例大会;19;10;15
2635 else if (! line.leftcxx . . $ QString#left(3f3c3d0e9c0eb37f).(5).comparecxx . . $ QString#compare(c6f75f9b1a93e019).("ROOM "cxx . . $ QString#QString(85c52e162fed56f9).))
2636 {
2637 QStringcxx . . $ QString# room = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).,";"cxx . . $ QString#QString(85c52e162fed56f9).);
2638 RoomListingcxx . . $ RoomListing# * r = new RoomListingcxx . . $ RoomListing#(room.sectioncxx . . $ QString#section(eae3fc215228815e).(":"cxx . . $ QString#QString(85c52e162fed56f9)., 0, 0).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(),
2639 room.sectioncxx . . $ QString#section(eae3fc215228815e).(": "cxx . . $ QString#QString(85c52e162fed56f9)., 1, 1));
2640 r->lockedcxx . . $ RoomListing#locked. = (elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1,";"cxx . . $ QString#QString(85c52e162fed56f9).)==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."X") || (elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1,";"cxx . . $ QString#QString(85c52e162fed56f9).)==cxx . . $ QString#`operator==`(7d4bdb1abc417636)."P");
2641 recvRoomListingcxx . . $ NetworkConnection#recvRoomListing(cd0728ed85364d48).(r);
2642 //dont delete r
2643 return;
2644 }
2645 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("File"cxx . . $ QString#QString(85c52e162fed56f9).))
2646 return;
2647 if (protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "STATS") //FIXME
2648 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
2649 }
2650
2651 // 11 Kibitz Achim [ 3d*]: Game TELRUZU vs Anacci [379]
2652 // 11 will B resign?
2653 //case 11:
2654 void IGSConnectioncxx . . $ IGSConnection#::handle_kibitzcxx . . $ IGSConnection#handle_kibitz(7df51288a9ebd664).(QStringcxx . . $ QString# line)
2655 {
2656 static QStringcxx . . $ QString# memory_strcxx . . $ QString#QString(ced63f7c635d850d).;
2657 static int memory = 0;
2658 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
2659 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch;
2660 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Kibitz"cxx . . $ QString#QString(85c52e162fed56f9).))
2661 {
2662 // who is kibitzer
2663 memory_str =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9)., ":"cxx . . $ QString#QString(85c52e162fed56f9).);
2664 // game number
2665 memory = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, "["cxx . . $ QString#QString(85c52e162fed56f9)., "]"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2666 }
2667 else
2668 {
2669 if (memory_str.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
2670 // something went wrong...
2671 return;
2672
2673 //emit signal_kibitz(memory, memory_str, line);
2674 boarddispatch = getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(memory);
2675 if(boarddispatch)
2676 boarddispatch->recvKibitzcxx . . $ BoardDispatch#recvKibitz(3458fe3960d5051).(memory_strcxx . . $ QString#QString(132dd6869045752b)., linecxx . . $ QString#QString(132dd6869045752b).);
2677 memory = 0;
2678 memory_str.clearcxx . . $ QString#clear(49f6e7a06ebc5aa8).();
2679 }
2680 }
2681
2682 // messages
2683 // 14 File
2684 // frosla 11/15/02 14:00: Hallo
2685 // 14 File
2686 void IGSConnectioncxx . . $ IGSConnection#::handle_messagescxx . . $ IGSConnection#handle_messages(7df51288a9ebd664).(QStringcxx . . $ QString# line)
2687 {
2688 }
2689
2690 // MOVE
2691 // 15 Game 43 I: xxxx (4 223 16) vs yyyy (5 59 13)
2692 // 15 TIME:21:lowlow(W): 1 0/60 479/600 14/25 0/0 0/0 0/0
2693 // 15 TIME:442:MIYASAN(W): 1 0/60 18/30 0/1 10/10 0/60 0/0
2694 // 15 144(B): B12
2695 // IGS: teaching game:
2696 // 15 Game 167 I: qGoDev (0 0 -1) vs qGoDev (0 0 -1)
2697 void IGSConnectioncxx . . $ IGSConnection#::handle_movecxx . . $ IGSConnection#handle_move(7df51288a9ebd664).(QStringcxx . . $ QString# line)
2698 {
2699 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch;
2700 //case 15:
2701 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "IGSConnection::handle_move():" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). line;
2702 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
2703 static bool need_time = false;
2704 int number;
2705 QStringcxx . . $ QString# whitecxx . . $ QString#QString(ced63f7c635d850d)., blackcxx . . $ QString#QString(ced63f7c635d850d).;
2706 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Game"cxx . . $ QString#QString(85c52e162fed56f9).))
2707 {
2708 number = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2709 white =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2710 black =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 8, " "cxx . . $ QString#QString(85c52e162fed56f9).);
2711 /* Check if we're reloading the game */
2712 /* Other problem, with IGS, this might be all we get
2713 * for a restarted game Is this okay here? Maybe doesn't
2714 * always get called? It could have a listing already.*/
2715 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(number);
2716 if(!boarddispatch)
2717 {
2718
2719 if(white ==cxx . . $ `operator==`(5bc2975d2d751687). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).() || black ==cxx . . $ `operator==`(5bc2975d2d751687). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).())
2720 {
2721 if(protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. ==cxx . . $ `operator==`(5bc2975d2d751687). white || protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. ==cxx . . $ `operator==`(5bc2975d2d751687). black)
2722 {
2723 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("starting to restore");
2724 requestGameStatscxx . . $ IGSConnection#requestGameStats(cb2f890c2fdad230).(number);
2725 /* Stats will pick up the info and create the board, otherwise
2726 * boardsize can get lost, etc. */
2727 protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. =cxx . . $ QString#`operator=`(d02845eef0c33901). "restoring";
2728 protocol_save_intcxx . . $ IGSConnection#protocol_save_int. = number;
2729 game_were_playingcxx . . $ IGSConnection#game_were_playing. = number;
2730 }
2731 else
2732 {
2733 /* accept? */
2734 protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).();
2735 /* This code should be unified from that from the other case, msg 9
2736 * that does this same thing, maybe the 9 should be removed.. FIXME */
2737 QStringcxx . . $ QString# opp = (cxx . . $ QString#QString(132dd6869045752b).white ==cxx . . $ `operator==`(5bc2975d2d751687). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).() ? black : white);
2738 if((white ==cxx . . $ `operator==`(5bc2975d2d751687). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).() || black ==cxx . . $ `operator==`(5bc2975d2d751687). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).()) && !getBoardFromOurOpponentcxx . . $ IGSConnection#getBoardFromOurOpponent(e34a72c20d4e159d).(oppcxx . . $ QString#QString(132dd6869045752b).))
2739 {
2740 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(opp);
2741 MatchRequestcxx . . $ MatchRequest# * mr = getAndCloseGameDialogcxx . . $ NetworkConnection#getAndCloseGameDialog(847f6df3a908f59b).(p);
2742 if(mr)
2743 {
2744 boarddispatch = getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(number);
2745 GameDatacxx . . $ GameData# * aGameData = boarddispatch->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
2746
2747 aGameData->numbercxx . . $ GameData#number. = number;
2748 aGameData->white_namecxx . . $ GameData#white_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). white;
2749 aGameData->black_namecxx . . $ GameData#black_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). black;
2750 aGameData->board_sizecxx . . $ GameData#board_size. = mr->board_sizecxx . . $ MatchRequest#board_size.;
2751 aGameData->komicxx . . $ GameData#komi. = mr->komicxx . . $ MatchRequest#komi.;
2752 aGameData->handicapcxx . . $ GameData#handicap. = mr->handicapcxx . . $ MatchRequest#handicap.;
2753 aGameData->maintimecxx . . $ GameData#maintime. = mr->maintimecxx . . $ MatchRequest#maintime.;
2754 aGameData->periodtimecxx . . $ GameData#periodtime. = mr->periodtimecxx . . $ MatchRequest#periodtime.;
2755 aGameData->stones_periodscxx . . $ GameData#stones_periods. = mr->stones_periodscxx . . $ MatchRequest#stones_periods.;
2756 aGameData->undoAllowedcxx . . $ GameData#undoAllowed. = true;
2757 if(aGameData->white_namecxx . . $ GameData#white_name. ==cxx . . $ `operator==`(5bc2975d2d751687). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).())
2758 {
2759 aGameData->white_rankcxx . . $ GameData#white_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). mr->our_rankcxx . . $ MatchRequest#our_rank.;
2760 aGameData->black_rankcxx . . $ GameData#black_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). mr->their_rankcxx . . $ MatchRequest#their_rank.;
2761 }
2762 else
2763 {
2764 aGameData->white_rankcxx . . $ GameData#white_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). mr->their_rankcxx . . $ MatchRequest#their_rank.;
2765 aGameData->black_rankcxx . . $ GameData#black_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). mr->our_rankcxx . . $ MatchRequest#our_rank.;
2766 }
2767 boarddispatch->openBoardcxx . . $ BoardDispatch#openBoard(49f6e7a06ebc5aa8).();
2768 }
2769 else
2770 {
2771 PlayerListingcxx . . $ PlayerListing# * blackPlayer = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(black);
2772 PlayerListingcxx . . $ PlayerListing# * whitePlayer = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(white);
2773 boarddispatch = getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(number);
2774 GameDatacxx . . $ GameData# * aGameData = boarddispatch->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
2775 aGameData->numbercxx . . $ GameData#number. = number;
2776 aGameData->white_namecxx . . $ GameData#white_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). white;
2777 aGameData->black_namecxx . . $ GameData#black_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). black;
2778 aGameData->black_rankcxx . . $ GameData#black_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). blackPlayer->rankcxx . . $ PlayerListing#rank.;
2779 aGameData->white_rankcxx . . $ GameData#white_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). whitePlayer->rankcxx . . $ PlayerListing#rank.;
2780 aGameData->undoAllowedcxx . . $ GameData#undoAllowed. = true;
2781 // Could be from seek opponent !!!
2782
2783 boarddispatch->openBoardcxx . . $ BoardDispatch#openBoard(49f6e7a06ebc5aa8).();
2784 need_time = true;
2785 }
2786 protocol_save_intcxx . . $ IGSConnection#protocol_save_int. = number;
2787 game_were_playingcxx . . $ IGSConnection#game_were_playing. = number;
2788 }
2789 /* We probably just accepted a match */
2790
2791 }
2792 match_negotiation_statecxx . . $ NetworkConnection#match_negotiation_state.->setGameIdcxx . . $ MatchNegotiationState#setGameId(ed53e3bbd3fa2f69).(number);
2793 //requestGameInfo(game_number);
2794 return;
2795 }
2796 else
2797 {
2798 /* In order to allow observing by console
2799 * This all needs to be cleaned up,
2800 * FIXME, like the above should be moved below, I think
2801 * we only added it haphazardly because we were half working
2802 * with the old code and half making allowances for things
2803 * like restores.*/
2804 /* One FIXME major issue though, probably why
2805 * we added that thing to sendObserve in the first
2806 * place is because if we do this here, then closing
2807 * a board isn't enough, if it hits at the wrong
2808 * time, a move can pop the board back open again
2809 * and then nothing more. */
2810 if(match_negotiation_statecxx . . $ NetworkConnection#match_negotiation_state.->sentJoinRoomcxx . . $ MatchNegotiationState#sentJoinRoom(c9857a73d68e59ba).()) //so no observing by console
2811 boarddispatch = getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(number);
2812 }
2813 //return;
2814 }
2815
2816 GameDatacxx . . $ GameData# * aGameData = boarddispatch->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
2817 aGameData->numbercxx . . $ GameData#number. = number;
2818
2819 protocol_save_intcxx . . $ IGSConnection#protocol_save_int. = number;
2820 //aGameData->type = element(line, 1, " ", ":");
2821
2822 aGameData->white_prisonerscxx . . $ GameData#white_prisoners. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "("cxx . . $ QString#QString(85c52e162fed56f9)., " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2823 wtimecxx . . $ IGSConnection#wtime.->timecxx . . $ TimeRecord#time. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 5, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2824 wtimecxx . . $ IGSConnection#wtime.->stones_periodscxx . . $ TimeRecord#stones_periods. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 5, " "cxx . . $ QString#QString(85c52e162fed56f9)., ")"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2825
2826 aGameData->black_prisonerscxx . . $ GameData#black_prisoners. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, "("cxx . . $ QString#QString(85c52e162fed56f9)., " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2827 btimecxx . . $ IGSConnection#btime.->timecxx . . $ TimeRecord#time. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 10, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2828 btimecxx . . $ IGSConnection#btime.->stones_periodscxx . . $ TimeRecord#stones_periods. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 10, " "cxx . . $ QString#QString(85c52e162fed56f9)., ")"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2829 /* FIXME Doublecheck in WING */
2830 /* Is this a new game?
2831 * This is this ugly, convoluted way of checking, but I guess
2832 * it gets around the IGS protocol, maybe I'll think of another way later.
2833 * We can use the game listing for the s later, but here, there may
2834 * not be a game listing if its a new game. This may be the listing, in
2835 * a sense. */
2836 /* Another issue here is that we do not want to call this when
2837 * restoring a game since there really isn't a gamedialog... FIXME */
2838 //openBoard obviously has to be done first
2839 boarddispatch->openBoardcxx . . $ BoardDispatch#openBoard(49f6e7a06ebc5aa8).();
2840 boarddispatch->recvTimecxx . . $ BoardDispatch#recvTime(63f8d2dcefae8817).(*wtimecxx . . $ IGSConnection#wtime., *btimecxx . . $ IGSConnection#btime.);
2841 boarddispatch->gameDataChangedcxx . . $ BoardDispatch#gameDataChanged(49f6e7a06ebc5aa8).();
2842 }
2843 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("TIME"cxx . . $ QString#QString(85c52e162fed56f9).))
2844 {
2845 number = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, ":"cxx . . $ QString#QString(85c52e162fed56f9).,":"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2846 // FIXME Does WING have these messages???
2847 // Might not need game record here!!!
2848
2849 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(number);
2850 if(!boarddispatch)
2851 {
2852 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("TIME message received but no board");
2853 return;
2854 }
2855 protocol_save_intcxx . . $ IGSConnection#protocol_save_int. = number;
2856
2857 GameDatacxx . . $ GameData# * aGameData = boarddispatch->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
2858 #ifdef FIXME
2859 aGameData->mv_col = "T";
2860 #endif //FIXME
2861 aGameData->numbercxx . . $ GameData#number. = number;
2862 QStringcxx . . $ QString# time1 = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).,"/"cxx . . $ QString#QString(85c52e162fed56f9).);
2863 QStringcxx . . $ QString# time2 = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).,"/"cxx . . $ QString#QString(85c52e162fed56f9).);
2864 QStringcxx . . $ QString# stones = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).,"/"cxx . . $ QString#QString(85c52e162fed56f9).);
2865
2866 if(need_time)
2867 {
2868 need_time = false;
2869 /* This is if we get here from a seek game FIXME
2870 * it would obviously make sense to standardize this
2871 * somehow but the protocol isn't too consistent
2872 * not to mention the official client having
2873 * occasional bugs so... */
2874 if(1) //FIXME when you see a byoyomi game here
2875 {
2876 aGameData->timeSystemcxx . . $ GameData#timeSystem. = canadiancxx . . $ canadian.;
2877 aGameData->maintimecxx . . $ GameData#maintime. = time1.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2878 aGameData->periodtimecxx . . $ GameData#periodtime. = time2.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2879 aGameData->stones_periodscxx . . $ GameData#stones_periods. = stones.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2880 }
2881 else
2882 {
2883 aGameData->timeSystemcxx . . $ GameData#timeSystem. = byoyomicxx . . $ byoyomi.;
2884 }
2885 }
2886 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("(W)"cxx . . $ QString#QString(85c52e162fed56f9).))
2887 {
2888 aGameData->white_namecxx . . $ GameData#white_name. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, ":"cxx . . $ QString#QString(85c52e162fed56f9).,"("cxx . . $ QString#QString(85c52e162fed56f9).);
2889 wtimecxx . . $ IGSConnection#wtime.->timecxx . . $ TimeRecord#time. = (time1.toIntcxx . . $ QString#toInt(d7972accae11ee1f).()==0 ? time2 : time1).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2890 wtimecxx . . $ IGSConnection#wtime.->stones_periodscxx . . $ TimeRecord#stones_periods. = (time1.toIntcxx . . $ QString#toInt(d7972accae11ee1f).()==0 ?stonescxx . . $ QString#QString(132dd6869045752b).: "-1"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2891 }
2892 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("(B)"cxx . . $ QString#QString(85c52e162fed56f9).))
2893 {
2894 aGameData->black_namecxx . . $ GameData#black_name. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, ":"cxx . . $ QString#QString(85c52e162fed56f9).,"("cxx . . $ QString#QString(85c52e162fed56f9).);
2895 btimecxx . . $ IGSConnection#btime.->timecxx . . $ TimeRecord#time. = (time1.toIntcxx . . $ QString#toInt(d7972accae11ee1f).()==0 ? time2 : time1).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2896 btimecxx . . $ IGSConnection#btime.->stones_periodscxx . . $ TimeRecord#stones_periods. = (time1.toIntcxx . . $ QString#toInt(d7972accae11ee1f).()==0 ? stonescxx . . $ QString#QString(132dd6869045752b).:"-1"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2897 /* IGS seems to do W and then B, each time */
2898 boarddispatch->recvTimecxx . . $ BoardDispatch#recvTime(63f8d2dcefae8817).(*wtimecxx . . $ IGSConnection#wtime., *btimecxx . . $ IGSConnection#btime.);
2899 }
2900 else //never know with IGS ...
2901 return;
2902
2903 //boarddispatch->recvTime(*wtime, *btime);
2904 //gameDataChanged necessary if above white_name, black_name is issue
2905 //FIXME
2906 //boarddispatch->gameDataChanged();
2907 }
2908 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("GAMERPROPS"cxx . . $ QString#QString(85c52e162fed56f9).))
2909 {
2910 QStringListcxx . . $ QStringList# words = line.splitcxx . . $ QString#split(adb5851779672058).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("[ :]"cxx . . $ QString#QString(85c52e162fed56f9).), QStringcxx . . $ QString#::SkipEmptyPartscxx . . $ QString#SkipEmptyParts.);
2911 GameDatacxx . . $ GameData# * gd;
2912 int game_number = words[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).2].toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2913
2914 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(game_number);
2915 if(boarddispatch)
2916 {
2917 gd = boarddispatch->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
2918 /* We need this for komi in our own games sometimes it seems
2919 * or do we... */
2920 //GAMERPROPS:86: 9 0 6.50
2921 gd->board_sizecxx . . $ GameData#board_size. = words[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).3].toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2922 gd->handicapcxx . . $ GameData#handicap. = words[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).4].toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2923 gd->komicxx . . $ GameData#komi. = words[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).5].toFloatcxx . . $ QString#toFloat(abac0204e50f9cf0).();
2924 }
2925 return;
2926 }
2927 else if(protocol_save_intcxx . . $ IGSConnection#protocol_save_int. < 0)
2928 {
2929 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Ignoring boardless move");
2930 return;
2931 }
2932 else
2933 {
2934 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
2935 if(!boarddispatch)
2936 {
2937 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Possible move messages received but no board dispatch");
2938 return;
2939 }
2940 /* If we're getting moves that we can use, then
2941 * they have some existing board, which means a boardrecord
2942 * which should be more reliable than the listing */
2943 GameDatacxx . . $ GameData# * r = boarddispatch->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
2944 //GameListing * l = room->getGameListing(protocol_save_int);
2945 if(!r)
2946 {
2947 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Move for unlisted game");
2948 return;
2949 }
2950
2951 /* Not sure what undos look like anymore FIXME */
2952
2953 /* If there's multiple moves on a line, the ones
2954 * after the first are captures */
2955 MoveRecordcxx . . $ MoveRecord# * aMove = new MoveRecordcxx . . $ MoveRecord#();
2956 aMove->flagscxx . . $ MoveRecord#flags. = MoveRecordcxx . . $ MoveRecord#::NONEcxx . . $ MoveRecord#NONE.;
2957 aMove->numbercxx . . $ MoveRecord#number. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "("cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2958 QStringcxx . . $ QString# point = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9)., "EOL"cxx . . $ QString#QString(85c52e162fed56f9).);
2959 if(aMove->numbercxx . . $ MoveRecord#number. == 0)
2960 r->move_list_receivedcxx . . $ GameData#move_list_received. = true;
2961 else if(!r->move_list_receivedcxx . . $ GameData#move_list_received.)
2962 {
2963 delete aMove;
2964 return;
2965 }
2966 if(point.containscxx . . $ QString#contains(8cce4688c16f48f3).("Handicap"cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.))
2967 {
2968 /* As long as handicap is
2969 * set in game data... actually
2970 * this is useful since sending
2971 * 0 sets tree properly*/
2972 aMove->flagscxx . . $ MoveRecord#flags. = MoveRecordcxx . . $ MoveRecord#::HANDICAPcxx . . $ MoveRecord#HANDICAP.;
2973 aMove->xcxx . . $ MoveRecord#x. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9)., "EOL"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
2974 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("handicap %d", aMove->xcxx . . $ MoveRecord#x.);
2975 /*if(aMove->x != 0)
2976 {
2977 GameData * r = boarddispatch->getGameData();
2978 r->handicap = aMove->x;
2979 boarddispatch->gameDataChanged();
2980 }*/
2981 /* Don't want to set this here because it will
2982 * prevent the handicap from being set here.
2983 * something in boardwindow, etc., code has to
2984 * prevent double setting the handicap so its
2985 * !handicap*/
2986 }
2987 else if(point.containscxx . . $ QString#contains(8cce4688c16f48f3).("Pass"cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.))
2988 {
2989 aMove->flagscxx . . $ MoveRecord#flags. = MoveRecordcxx . . $ MoveRecord#::PASScxx . . $ MoveRecord#PASS.;
2990 }
2991 else
2992 {
2993 if(!r->handicapcxx . . $ GameData#handicap.)
2994 aMove->numbercxx . . $ MoveRecord#number.++;
2995 //qDebug("board size from record: %d", r->board_size);
2996 aMove->xcxx . . $ MoveRecord#x. = (int)(point.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().atcxx . . $ QByteArray#at(ed855a77b1899856).(0));
2997 aMove->xcxx . . $ MoveRecord#x. -= 'A';
2998 point.removecxx . . $ QString#remove(6483560ce2afa901).(0,1);
2999 //qDebug("move number: %d\n", aMove->number);
3000 aMove->ycxx . . $ MoveRecord#y. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(point, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3001
3002 if(aMove->xcxx . . $ MoveRecord#x. < 9) //no I on IGS
3003 aMove->xcxx . . $ MoveRecord#x.++;
3004 //if(l->board_size > 9)
3005 //{
3006 aMove->ycxx . . $ MoveRecord#y. = r->board_sizecxx . . $ GameData#board_size. + 1 - aMove->ycxx . . $ MoveRecord#y.;
3007 //}
3008 //qDebug("%d %d\n", aMove->x, aMove->y);
3009 if(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "("cxx . . $ QString#QString(85c52e162fed56f9)., ")"cxx . . $ QString#QString(85c52e162fed56f9).) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "W")
3010 aMove->colorcxx . . $ MoveRecord#color. = stoneWhitecxx . . $ stoneWhite.;
3011 else
3012 aMove->colorcxx . . $ MoveRecord#color. = stoneBlackcxx . . $ stoneBlack.;
3013 }
3014 /* Any other color options ??? */
3015 boarddispatch->recvMovecxx . . $ BoardDispatch#recvMove(d174a3d9cfb0dd75).(aMove);
3016 delete aMove;
3017 return;
3018 }
3019 //ugly, redundant but IGS doesn't give us a good way to know when
3020 //to do this otherwise
3021 //if(boarddispatch)
3022 // boarddispatch->openBoard();
3023 }
3024 // SAY
3025 // 19 *xxxx*: whish you a nice game :)
3026 // NNGS - new:
3027 // 19 --> frosla hallo
3028 void IGSConnectioncxx . . $ IGSConnection#::handle_saycxx . . $ IGSConnection#handle_say(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3029 {
3030 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch;
3031 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
3032 //case 19:
3033 // if (line.contains("-->"))
3034 // //emit signal_kibitz(0, 0, element(line, 1, " ", "EOL"));
3035 // else
3036 boarddispatch = getBoardFromOurOpponentcxx . . $ IGSConnection#getBoardFromOurOpponent(e34a72c20d4e159d).(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "*"cxx . . $ QString#QString(85c52e162fed56f9)., "*"cxx . . $ QString#QString(85c52e162fed56f9).));
3037 if(boarddispatch)
3038 boarddispatch->recvKibitzcxx . . $ BoardDispatch#recvKibitz(3458fe3960d5051).(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "*"cxx . . $ QString#QString(85c52e162fed56f9)., "*"cxx . . $ QString#QString(85c52e162fed56f9).), elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, ":"cxx . . $ QString#QString(85c52e162fed56f9)., "EOL"cxx . . $ QString#QString(85c52e162fed56f9).));
3039 else
3040 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Received kibitz without board for player");
3041
3042 }
3043
3044 /* This is tricky but since 21 reports game status anyway,
3045 * for observed and played, we don't really need 20. */
3046 void IGSConnectioncxx . . $ IGSConnection#::handle_score_mcxx . . $ IGSConnection#handle_score_m(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3047 {
3048 //20 yfh2 (W:O): 4.5 to NaiWei (B:#): 4.0
3049 //case 20:
3050 //qDebug("Ignoring IGS_score_m message");
3051 //return;
3052 /* we seem to need this message, especially if its our game */
3053 GameResultcxx . . $ GameResult# * aGameResult = new GameResultcxx . . $ GameResult#();
3054 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch;
3055 bool firstname;
3056 // aGame->nr = "@";
3057 // aGame->running = false;
3058 QStringcxx . . $ QString# rescxx . . $ QString#QString(ced63f7c635d850d).;
3059 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
3060 QStringcxx . . $ QString# player = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3061 if (player ==cxx . . $ `operator==`(5bc2975d2d751687). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).())
3062 {
3063 player =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3064 firstname = 1;
3065 }
3066 else
3067 firstname = 0;
3068 aGameResult->winner_namecxx . . $ GameResult#winner_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). player;
3069 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::SCOREcxx . . $ GameResult#SCORE.;
3070 boarddispatch = getBoardFromOurOpponentcxx . . $ IGSConnection#getBoardFromOurOpponent(e34a72c20d4e159d).(playercxx . . $ QString#QString(132dd6869045752b).);
3071 if(!boarddispatch)
3072 {
3073 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Can't find board for result message!\n");
3074 return;
3075 }
3076
3077 aGameResult->winner_scorecxx . . $ GameResult#winner_score. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).).toFloatcxx . . $ QString#toFloat(abac0204e50f9cf0).();
3078 aGameResult->loser_scorecxx . . $ GameResult#loser_score. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 6, " "cxx . . $ QString#QString(85c52e162fed56f9).).toFloatcxx . . $ QString#toFloat(abac0204e50f9cf0).();
3079 if(aGameResult->winner_scorecxx . . $ GameResult#winner_score. > aGameResult->loser_scorecxx . . $ GameResult#loser_score.)
3080 {
3081 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
3082 if(firstname)
3083 aGameResult->winner_namecxx . . $ GameResult#winner_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).();
3084 }
3085 else
3086 {
3087 float temp = aGameResult->winner_scorecxx . . $ GameResult#winner_score.;
3088 aGameResult->winner_scorecxx . . $ GameResult#winner_score. = aGameResult->loser_scorecxx . . $ GameResult#loser_score.;
3089 aGameResult->loser_scorecxx . . $ GameResult#loser_score. = temp;
3090 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
3091 if(!firstname)
3092 aGameResult->winner_namecxx . . $ GameResult#winner_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).();
3093 }
3094 boarddispatch->recvResultcxx . . $ BoardDispatch#recvResult(c72a8b5aed169521).(aGameResult);
3095 game_were_playingcxx . . $ IGSConnection#game_were_playing. = 0;
3096 delete aGameResult;
3097 }
3098
3099 /* Note that we get shouts on games and players in other rooms,
3100 * either that, or only the lobby. Find out which. */
3101 // SHOUT - a info from the server
3102 //case 21:
3103 void IGSConnectioncxx . . $ IGSConnection#::handle_shoutcxx . . $ IGSConnection#handle_shout(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3104 {
3105 Roomcxx . . $ Room# * room = getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).();
3106 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch;
3107 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
3108
3109 // case sensitive
3110 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).(" connected.}"cxx . . $ QString#QString(85c52e162fed56f9).))
3111 {
3112 // {guest1381 [NR ] has connected.}
3113 //line.replace(QRegExp(" "), "");
3114 QStringcxx . . $ QString# name = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "{"cxx . . $ QString#QString(85c52e162fed56f9)., " "cxx . . $ QString#QString(85c52e162fed56f9).);
3115 PlayerListingcxx . . $ PlayerListing# * aPlayer = room->getPlayerListingcxx . . $ Room#getPlayerListing(d3f53ac2de9f0b45).(name);
3116 aPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "["cxx . . $ QString#QString(85c52e162fed56f9)., "]"cxx . . $ QString#QString(85c52e162fed56f9)., true);
3117 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(aPlayer->rankcxx . . $ PlayerListing#rank.));
3118 aPlayer->rank_scorecxx . . $ PlayerListing#rank_score. = rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(aPlayercxx . . $ QString#QString(132dd6869045752b).->rankcxx . . $ PlayerListing#rank.);
3119 aPlayer->infocxx . . $ PlayerListing#info. =cxx . . $ QString#`operator=`(d02845eef0c33901). "??";
3120 aPlayer->playingcxx . . $ PlayerListing#playing. = 0;
3121 aPlayer->observingcxx . . $ PlayerListing#observing. = 0;
3122 aPlayer->idletimecxx . . $ PlayerListing#idletime. =cxx . . $ QString#`operator=`(d02845eef0c33901). "-";
3123 aPlayer->onlinecxx . . $ PlayerListing#online. = true;
3124 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! playerListingReceivedcxx . . $ NetworkConnection#playerListingReceived(122195e397f39e1b).(aPlayer);
3125 return;
3126 }
3127 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("has disconnected"cxx . . $ QString#QString(85c52e162fed56f9).))
3128 {
3129 // {xxxx has disconnected}
3130 PlayerListingcxx . . $ PlayerListing# * aPlayer = room->getPlayerListingcxx . . $ Room#getPlayerListing(d3f53ac2de9f0b45).(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "{"cxx . . $ QString#QString(85c52e162fed56f9)., " "cxx . . $ QString#QString(85c52e162fed56f9).));
3131 aPlayer->onlinecxx . . $ PlayerListing#online. = false;
3132 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! playerListingReceivedcxx . . $ NetworkConnection#playerListingReceived(122195e397f39e1b).(aPlayer);
3133 return;
3134 }
3135 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("{Game"cxx . . $ QString#QString(85c52e162fed56f9).))
3136 {
3137 // {Game 198: xxxx1 vs xxxx2 @ Move 33}
3138 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("@"cxx . . $ QString#QString(85c52e162fed56f9).))
3139 {
3140 /* FIXME: This may mean that an old game was just restarted
3141 * and so we might want to set it up here */
3142 /* We also get this message at weird times that makes
3143 * boards we're not watching pop up!! FIXME */
3144 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "IGSConnection::handle_shout(" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). line <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). ")";
3145
3146 int game_number = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9)., ":"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3147 QStringcxx . . $ QString# white = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3148 QStringcxx . . $ QString# black = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3149
3150 if(white ==cxx . . $ `operator==`(5bc2975d2d751687). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).() || black ==cxx . . $ `operator==`(5bc2975d2d751687). getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).())
3151 {
3152 if(protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. ==cxx . . $ `operator==`(5bc2975d2d751687). white || protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. ==cxx . . $ `operator==`(5bc2975d2d751687). black)
3153 {
3154 /* Then this is a restarted game, create
3155 * board dispatch */
3156 //getBoardDispatch(game_number);
3157
3158 //boarddispatch = getBoardDispatch(aGame->nr);
3159 //boarddispatch->recvGameListing(aGame);
3160 requestGameStatscxx . . $ IGSConnection#requestGameStats(cb2f890c2fdad230).(game_number);
3161 /* Stats will pick up the info and create the board, otherwise
3162 * boardsize can get lost, etc. */
3163 protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. =cxx . . $ QString#`operator=`(d02845eef0c33901). "restoring";
3164 }
3165 else
3166 protocol_save_stringcxx . . $ IGSConnection#protocol_save_string. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).();
3167 //requestGameInfo(game_number);
3168 }
3169 return;
3170 }
3171
3172 // {Game 155: xxxx vs yyyy has adjourned.}
3173 // {Game 76: xxxx vs yyyy : W 62.5 B 93.0}
3174 // {Game 173: xxxx vs yyyy : White forfeits on time.}
3175 // {Game 116: xxxx17 vs yyyy49 : Black resigns.}
3176 // IGS:
3177 // 21 {Game 124: Redmond* vs NaiWei* : Black lost by Resign}
3178 // 21 {Game 184: Redmond* vs NaiWei* : White lost by 1.0}
3179 /* This results in double kibitz on LGS, maybe we drop it
3180 * altogether? */
3181 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("resigns."cxx . . $ QString#QString(85c52e162fed56f9).) ||
3182 line.containscxx . . $ QString#contains(8cce4688c16f48f3).("adjourned."cxx . . $ QString#QString(85c52e162fed56f9).) ||
3183 line.containscxx . . $ QString#contains(8cce4688c16f48f3).(" : W "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.) ||
3184 line.containscxx . . $ QString#contains(8cce4688c16f48f3).(" : B "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.) ||
3185 line.containscxx . . $ QString#contains(8cce4688c16f48f3).("forfeits on"cxx . . $ QString#QString(85c52e162fed56f9).) ||
3186 line.containscxx . . $ QString#contains(8cce4688c16f48f3).("lost by"cxx . . $ QString#QString(85c52e162fed56f9).))
3187 {
3188 GameResultcxx . . $ GameResult# * aGameResult;
3189 int number = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9)., ":"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3190 GameListingcxx . . $ GameListing# * aGame = room->getGameListingcxx . . $ Room#getGameListing(d402167d8f57cf00).(number);
3191 aGame->runningcxx . . $ GameListing#running. = false;
3192 // for information
3193 aGame->resultcxx . . $ GameListing#result. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9)., "}"cxx . . $ QString#QString(85c52e162fed56f9).);
3194
3195 boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(aGame->numbercxx . . $ GameListing#number.);
3196 if(boarddispatch)
3197 {
3198 aGameResult = new GameResultcxx . . $ GameResult#();
3199
3200 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).(" : W "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.) ||
3201 line.containscxx . . $ QString#contains(8cce4688c16f48f3).(" : B "cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseSensitivecxx . . $ Qt/CaseSensitive.))
3202 {
3203 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::SCOREcxx . . $ GameResult#SCORE.;
3204
3205 int posw, posb;
3206 posw = aGame->resultcxx . . $ GameListing#result..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("W "cxx . . $ QString#QString(85c52e162fed56f9).);
3207 posb = aGame->resultcxx . . $ GameListing#result..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("B "cxx . . $ QString#QString(85c52e162fed56f9).);
3208 bool wfirst = posw < posb;
3209 float sc1, sc2;
3210 sc1 = aGame->resultcxx . . $ GameListing#result..midcxx . . $ QString#mid(44b7563da18aea72).(posw+1, posb-posw-2).toFloatcxx . . $ QString#toFloat(abac0204e50f9cf0).();
3211 //sc2 = aGame->result.right(aGame->result.length()-posb-1).toFloat();
3212 /* FIXME This may be right for IGS and wrong for WING */
3213 //sc2 = aGame->result.mid(posb +1, posb + 6).toFloat();
3214 sc2 = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(aGame->resultcxx . . $ GameListing#result., 4, " "cxx . . $ QString#QString(85c52e162fed56f9).).toFloatcxx . . $ QString#toFloat(abac0204e50f9cf0).();
3215 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("sc1: %f sc2: %f\n", sc1, sc2);
3216 if(sc1 > sc2)
3217 {
3218 aGameResult->winner_scorecxx . . $ GameResult#winner_score. = sc1;
3219 aGameResult->loser_scorecxx . . $ GameResult#loser_score. = sc2;
3220 }
3221 else
3222 {
3223 aGameResult->winner_scorecxx . . $ GameResult#winner_score. = sc2;
3224 aGameResult->loser_scorecxx . . $ GameResult#loser_score. = sc1;
3225
3226 }
3227
3228 if (!wfirst)
3229 {
3230 int h = posw;
3231 posw = posb;
3232 posb = h;
3233 if(sc2 > sc1)
3234
3235 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
3236 else
3237 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
3238 }
3239 else
3240 {
3241 if(sc1 > sc2)
3242 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
3243 else
3244 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
3245 }
3246 }
3247 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("forfeits on time"cxx . . $ QString#QString(85c52e162fed56f9).))
3248 {
3249 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::TIMEcxx . . $ GameResult#TIME.;
3250 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Black"cxx . . $ QString#QString(85c52e162fed56f9).))
3251 {
3252 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
3253 }
3254 else
3255 {
3256 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
3257 }
3258 }
3259 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("resign"cxx . . $ QString#QString(85c52e162fed56f9)., Qtcxx . . $ Qt/::CaseInsensitivecxx . . $ Qt/CaseInsensitive.))
3260 {
3261 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::RESIGNcxx . . $ GameResult#RESIGN.;
3262 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Black"cxx . . $ QString#QString(85c52e162fed56f9).))
3263 {
3264 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
3265 }
3266 else
3267 {
3268 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
3269 }
3270 }
3271 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("lost by"cxx . . $ QString#QString(85c52e162fed56f9).))
3272 {
3273 aGameResult->resultcxx . . $ GameResult#result. = GameResultcxx . . $ GameResult#::SCOREcxx . . $ GameResult#SCORE.;
3274 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Black"cxx . . $ QString#QString(85c52e162fed56f9).))
3275 {
3276 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneWhitecxx . . $ stoneWhite.;
3277 }
3278 else
3279 {
3280 aGameResult->winner_colorcxx . . $ GameResult#winner_color. = stoneBlackcxx . . $ stoneBlack.;
3281
3282 }
3283
3284 }
3285 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("adjourned"cxx . . $ QString#QString(85c52e162fed56f9).))
3286 {
3287 /* A little ugly to have this and return here
3288 * but if it works with protocol... */
3289 boarddispatch->adjournGamecxx . . $ BoardDispatch#adjournGame(49f6e7a06ebc5aa8).();
3290 closeBoardDispatchcxx . . $ NetworkConnection#closeBoardDispatch(cb2f890c2fdad230).(aGame->numbercxx . . $ GameListing#number.);
3291 delete aGameResult;
3292 return;
3293 }
3294 }
3295
3296
3297 if (aGame->resultcxx . . $ GameListing#result..isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
3298 aGame->resultcxx . . $ GameListing#result. =cxx . . $ QString#`operator=`(d02845eef0c33901). "-";
3299 else if (aGame->resultcxx . . $ GameListing#result..indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).(":"cxx . . $ QString#QString(85c52e162fed56f9).) != -1)
3300 aGame->resultcxx . . $ GameListing#result..removecxx . . $ QString#remove(6483560ce2afa901).(0,2);
3301
3302 if(boarddispatch)
3303 {
3304 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Receiving 21 result!!!");
3305 /* This can be redundant with 21 */
3306 boarddispatch->recvResultcxx . . $ BoardDispatch#recvResult(c72a8b5aed169521).(aGameResult);
3307 delete aGameResult; //conditional on boarddispatch!
3308 /* is kibitzing this here what we want?*/
3309 boarddispatch->recvKibitzcxx . . $ BoardDispatch#recvKibitz(3458fe3960d5051).(""cxx . . $ QString#QString(85c52e162fed56f9)., linecxx . . $ QString#QString(132dd6869045752b).);
3310 }
3311 room->recvGameListingcxx . . $ Room#recvGameListing(9a447f3b9a8a5041).(aGame);
3312 return;
3313 }
3314 }
3315 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("{Match"cxx . . $ QString#QString(85c52e162fed56f9).))
3316 {
3317 // {Match 116: xxxx [19k*] vs. yyyy1 [18k*] }
3318 // {116:xxxx[19k*]yyyy1[18k*]}
3319 // WING: {Match 41: o4641 [10k*] vs. Urashima [11k*] H:2 Komi:3.5}
3320 line.replacecxx . . $ QString#replace(612862c8abff0ba5).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("vs. "cxx . . $ QString#QString(85c52e162fed56f9).), ""cxx . . $ QString#QString(85c52e162fed56f9).);
3321 line.replacecxx . . $ QString#replace(612862c8abff0ba5).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("Match "cxx . . $ QString#QString(85c52e162fed56f9).), ""cxx . . $ QString#QString(85c52e162fed56f9).);
3322 line.replacecxx . . $ QString#replace(612862c8abff0ba5).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).(" "cxx . . $ QString#QString(85c52e162fed56f9).), ""cxx . . $ QString#QString(85c52e162fed56f9).);
3323 int number = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "{"cxx . . $ QString#QString(85c52e162fed56f9)., ":"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3324
3325 GameListingcxx . . $ GameListing# * aGame = room->getGameListingcxx . . $ Room#getGameListing(d402167d8f57cf00).(number);
3326 /* No reason to wait for player listing since info is here */
3327 QStringcxx . . $ QString# name = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, ":"cxx . . $ QString#QString(85c52e162fed56f9)., "["cxx . . $ QString#QString(85c52e162fed56f9).);
3328 aGame->whitecxx . . $ GameListing#white. = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(name);
3329 aGame->_white_namecxx . . $ GameListing#_white_name. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, ":"cxx . . $ QString#QString(85c52e162fed56f9)., "["cxx . . $ QString#QString(85c52e162fed56f9).);
3330 aGame->_white_rankcxx . . $ GameListing#_white_rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "["cxx . . $ QString#QString(85c52e162fed56f9)., "]"cxx . . $ QString#QString(85c52e162fed56f9).);
3331 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(aGame->_white_rankcxx . . $ GameListing#_white_rank.));
3332 aGame->_white_rank_scorecxx . . $ GameListing#_white_rank_score. = rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(aGamecxx . . $ QString#QString(132dd6869045752b).->_white_rankcxx . . $ GameListing#_white_rank.);
3333 name =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "]"cxx . . $ QString#QString(85c52e162fed56f9)., "["cxx . . $ QString#QString(85c52e162fed56f9).);
3334 aGame->blackcxx . . $ GameListing#black. = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(name);
3335 aGame->_black_namecxx . . $ GameListing#_black_name. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "]"cxx . . $ QString#QString(85c52e162fed56f9)., "["cxx . . $ QString#QString(85c52e162fed56f9).);
3336 aGame->_black_rankcxx . . $ GameListing#_black_rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, "["cxx . . $ QString#QString(85c52e162fed56f9)., "]"cxx . . $ QString#QString(85c52e162fed56f9).);
3337 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(aGame->_black_rankcxx . . $ GameListing#_black_rank.));
3338 aGame->_black_rank_scorecxx . . $ GameListing#_black_rank_score. = rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(aGamecxx . . $ QString#QString(132dd6869045752b).->_black_rankcxx . . $ GameListing#_black_rank.);
3339
3340 aGame->movescxx . . $ GameListing#moves. = 0; //right???
3341 //aGame->s = "-";
3342 //aGame->Sz = "-";
3343 //aGame->handicap = QString();
3344 aGame->runningcxx . . $ GameListing#running. = true;
3345
3346 #ifdef OLD
3347 if (gsName == WING && aGame->wname == aGame->bname)
3348 // WING doesn't send 'create match' msg in case of teaching game
3349 //emit signal_matchCreate(aGame->nr, aGame->bname);
3350
3351 //emit signal_game(aGame);
3352 #endif //OLD
3353 room->recvGameListingcxx . . $ Room#recvGameListing(9a447f3b9a8a5041).(aGame);
3354 return;
3355 }
3356 else if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Match"cxx . . $ QString#QString(85c52e162fed56f9).))
3357 {
3358 //Match 220 gogal gogal
3359 //what is this? a request?
3360 }
3361 // !xxxx!: a game anyone ?
3362 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("!: "cxx . . $ QString#QString(85c52e162fed56f9).))
3363 {
3364 QStringcxx . . $ QString# player = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "!"cxx . . $ QString#QString(85c52e162fed56f9).);
3365 //emit signal_shout(player, line);
3366 return;
3367 }
3368 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3369 }
3370
3371 void IGSConnectioncxx . . $ IGSConnection#::handle_statuscxx . . $ IGSConnection#handle_status(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3372 {
3373 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "IGSConnection::handle_status " <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). line;
3374 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
3375 // CURRENT GAME STATUS
3376 // 22 Pinkie 3d* 21 218 9 T 5.5 0
3377 // 22 aura 3d* 24 276 16 T 5.5 0
3378 // 22 0: 4441000555033055001
3379 // 22 1: 1441100000011000011
3380 // 22 2: 4141410105013010144
3381 // 22 3: 1411411100113011114
3382 // 22 4: 1131111111100001444
3383 // 22 5: 0100010001005011111
3384 // 22 6: 0055000101105000010
3385 // 22 7: 0050011110055555000
3386 // 22 8: 1005000141005055010
3387 // 22 9: 1100113114105500011
3388 // 22 10: 1111411414105010141
3389 // 22 11: 4144101101100111114
3390 // 22 12: 1411300103100000144
3391 // 22 13: 1100005000101001144
3392 // 22 14: 1050505550101011144
3393 // 22 15: 0505505001111001444
3394 // 22 16: 0050050111441011444
3395 // 22 17: 5550550001410001144
3396 // 22 18: 5555000111411300144
3397 //case 22:
3398 /* Status messages are a bit screwy:
3399 * the columns are actually the y axis on the board
3400 * and the rows the x axis, so for instance on our
3401 * board p19 would appear on their board as 0,14
3402 * In addition, some things are marked wrong like
3403 * false eyes that are surrounded by stones are
3404 * marked as territory when they shouldn't be, but
3405 * that's not our problem.
3406 * 0 is a black stone, 1 is a white stone, 3 is
3407 * dame (no territory (did I get term right?)) 4 is
3408 * white territory, 5 is black territory */
3409 static QStringcxx . . $ QString# player = ""cxx . . $ QString#QString(85c52e162fed56f9).;
3410 static int cap;
3411 static float komi;
3412 static BoardDispatchcxx . . $ BoardDispatch# * statusDispatch;
3413 if (!line.containscxx . . $ QString#contains(8cce4688c16f48f3).(":"cxx . . $ QString#QString(85c52e162fed56f9).))
3414 {
3415 if(player ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "")
3416 {
3417 player =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3418 cap = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3419 komi = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 6, " "cxx . . $ QString#QString(85c52e162fed56f9).).toFloatcxx . . $ QString#toFloat(abac0204e50f9cf0).();
3420 }
3421 else
3422 {
3423 statusDispatch = getBoardFromAttribcxx . . $ IGSConnection#getBoardFromAttrib(ffaef1ed9058626d).(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).), elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(), elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 6, " "cxx . . $ QString#QString(85c52e162fed56f9).).toFloatcxx . . $ QString#toFloat(abac0204e50f9cf0).(), playercxx . . $ QString#QString(132dd6869045752b)., cap, komi);
3424 if(!statusDispatch)
3425 {
3426 // FIXME this happens an awful lot. I think
3427 // every time we play a game, though perhaps
3428 // observing games is okay... anyway, either
3429 // we need to change something so that we don't
3430 // even check here, or this doesn't warrant
3431 // a debug message
3432 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("No status board found!!!\n");
3433 player =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
3434 return;
3435 }
3436 statusDispatch->recvEnterScoreModecxx . . $ BoardDispatch#recvEnterScoreMode(49f6e7a06ebc5aa8).();
3437 player =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
3438 }
3439 }
3440 else
3441 {
3442 if(!statusDispatch)
3443 return;
3444 int row = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, ":"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3445 QStringcxx . . $ QString# results = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3446 /* X and Y are swapped below */
3447 MoveRecordcxx . . $ MoveRecord# * aMove = new MoveRecordcxx . . $ MoveRecord#();
3448 aMove->xcxx . . $ MoveRecord#x. = row + 1;
3449 aMove->flagscxx . . $ MoveRecord#flags. = MoveRecordcxx . . $ MoveRecord#::TERRITORYcxx . . $ MoveRecord#TERRITORY.;
3450 for(int column = 1; column <= results.lengthcxx . . $ QString#length(455f465bc33b4cdf).(); column++)
3451 {
3452 aMove->ycxx . . $ MoveRecord#y. = column;
3453 if(results.atcxx . . $ QString#at(13af7ae5a875439e).(column - 1) ==cxx . . $ `operator==`(a468b2f18a3afe8). '4'cxx . . $ QChar#QChar(f349c77f591a7878).)
3454 aMove->colorcxx . . $ MoveRecord#color. = stoneWhitecxx . . $ stoneWhite.;
3455 else if(results.atcxx . . $ QString#at(13af7ae5a875439e).(column - 1) ==cxx . . $ `operator==`(a468b2f18a3afe8). '5'cxx . . $ QChar#QChar(f349c77f591a7878).)
3456 aMove->colorcxx . . $ MoveRecord#color. = stoneBlackcxx . . $ stoneBlack.;
3457 else
3458 continue;
3459 statusDispatch->recvMovecxx . . $ BoardDispatch#recvMove(d174a3d9cfb0dd75).(aMove);
3460 }
3461
3462 /* FIXME If there's no more moves, and there's no result
3463 * on the game (like an earlier resign at the same time? etc.,
3464 * before it? Then we need to recvResult here */
3465 if(row + 1 == results.lengthcxx . . $ QString#length(455f465bc33b4cdf).())
3466 {
3467 /* Since its a square board */
3468 aMove->flagscxx . . $ MoveRecord#flags. = MoveRecordcxx . . $ MoveRecord#::DONE_SCORINGcxx . . $ MoveRecord#DONE_SCORING.;
3469 statusDispatch->recvMovecxx . . $ BoardDispatch#recvMove(d174a3d9cfb0dd75).(aMove);
3470 }
3471 delete aMove;
3472 }
3473
3474 // //emit signal_message(line);
3475 }
3476
3477 void IGSConnectioncxx . . $ IGSConnection#::handle_storedcxx . . $ IGSConnection#handle_stored(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3478 {
3479 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("%s", line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3480 // STORED
3481 // 9 Stored games for frosla:
3482 // 23 frosla-physician
3483 //TODO case 23:
3484 //TODO break;
3485 }
3486
3487 void IGSConnectioncxx . . $ IGSConnection#::handle_tellcxx . . $ IGSConnection#handle_tell(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3488 {
3489 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
3490 // 24 *xxxx*: CLIENT: <cgoban 1.9.12> match xxxx wants handicap 0, komi 5.5, free
3491 // 24 *jirong*: CLIENT: <cgoban 1.9.12> match jirong wants handicap 0, komi 0.5
3492 // 24 *SYSTEM*: shoei canceled the nmatch request.
3493 // 24 *SYSTEM*: xxx requests undo.
3494
3495 // NNGS - new version:
3496 // 24 --> frosla CLIENT: <qGo 0.0.15b7> match frosla wants handicap 0, komi 0.5, free
3497 // 24 --> frosla Hallo
3498 //case 24:
3499 //{
3500 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("24: %s", line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3501 int pos;
3502 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch;
3503 #ifdef FIXME
3504 if (((((pos = line.indexOf("*")) != -1) && (pos < 3)) ||
3505 (((pos = line.indexOf("-->")) != -1) && (pos < 3) &&
3506 line.contains("CLIENT:"))))
3507 {
3508
3509 line = line.simplified();
3510 QString opp = element(line, 1, "*");
3511 int offset = 0;
3512 if (opp.isEmpty())
3513 {
3514 offset++;
3515 opp = element(line, 1, " ");
3516 }
3517
3518 QString h = element(line, 7+offset, " ", ",");
3519 QString k = element(line, 10+offset, " ");
3520
3521 if (k.at(k.length()-1) == ',')
3522 k.truncate(k.length() - 1);
3523 int komi = (int) (k.toFloat() * 10);
3524
3525 bool free;
3526 if (line.contains("free"))
3527 free = true;
3528 else
3529 free = false;
3530
3531 emit signal_komirequest(opp, h.toInt(), komi, free);
3532 getConsoleDispatch()->recvText(line.toLatin1().constData());
3533
3534 // it's tell, but don't open a window for that kind of message...
3535 return;
3536 }
3537 #endif //FIXME
3538
3539 //check for cancelled game offer
3540 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("*SYSTEM*"cxx . . $ QString#QString(85c52e162fed56f9).))
3541 {
3542 QStringcxx . . $ QString# opp = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3543 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(opp);
3544 line =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). line.removecxx . . $ QString#remove(6483560ce2afa901).(0,10);
3545 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3546
3547 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("canceled"cxx . . $ QString#QString(85c52e162fed56f9).) && line.containscxx . . $ QString#contains(8cce4688c16f48f3).("match request"cxx . . $ QString#QString(85c52e162fed56f9).))
3548 {
3549 /* FIXME We need to close any open gamedialog boxes
3550 * pertaining to this opponent. We'll assume
3551 * one is created I guess */
3552
3553 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(p);
3554 gameDialog->recvRefuseMatchcxx . . $ GameDialog#recvRefuseMatch(d4f767463ce0a6b3).(2);
3555 ////emit signal_matchCanceled(opp);
3556 }
3557 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("requests undo"cxx . . $ QString#QString(85c52e162fed56f9).))
3558 {
3559 boarddispatch = getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(protocol_save_intcxx . . $ IGSConnection#protocol_save_int.);
3560 if(!boarddispatch)
3561 {
3562 printf("No boarddispatch for undo message");
3563 return;
3564 }
3565 MoveRecordcxx . . $ MoveRecord# * aMove = new MoveRecordcxx . . $ MoveRecord#();
3566 aMove->flagscxx . . $ MoveRecord#flags. = MoveRecordcxx . . $ MoveRecord#::REQUESTUNDOcxx . . $ MoveRecord#REQUESTUNDO.;
3567 boarddispatch->recvMovecxx . . $ BoardDispatch#recvMove(d174a3d9cfb0dd75).(aMove);
3568 delete aMove;
3569 ////emit signal_requestDialog("undo","noundo",0,opp);
3570 }
3571 return;
3572 }
3573
3574 // check for NNGS type of msg
3575 QStringcxx . . $ QString# e1cxx . . $ QString#QString(ced63f7c635d850d).,e2cxx . . $ QString#QString(ced63f7c635d850d).;
3576 if ((pos = line.indexOfcxx . . $ QString#indexOf(a1e52806cd31c200).("-->"cxx . . $ QString#QString(85c52e162fed56f9).)) != -1 && pos < 3)
3577 {
3578 e1 =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3579 //e2 = "> " + element(line, 1, " ", "EOL").trimmed();
3580 e2 =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9)., "EOL"cxx . . $ QString#QString(85c52e162fed56f9).).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
3581 }
3582 else
3583 {
3584 e1 =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "*"cxx . . $ QString#QString(85c52e162fed56f9)., "*"cxx . . $ QString#QString(85c52e162fed56f9).);
3585 //e2 = "> " + element(line, 0, ":", "EOL").trimmed();
3586 e2 =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, ":"cxx . . $ QString#QString(85c52e162fed56f9)., "EOL"cxx . . $ QString#QString(85c52e162fed56f9).).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
3587 }
3588
3589 /* FIXME, what's weird here is that this is usually where you get "Thanks for game"
3590 * not in the board window and I'm not sure that's appropriate. */
3591 // //emit player + message + true (=player)
3592 ////emit signal_talk(e1, e2, true);
3593 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(e1);
3594 Talkcxx . . $ Talk# * talk = getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).()->getIfTalkcxx . . $ Room#getIfTalk(b72f705c6951e6b6).(p);
3595 if(!talk)
3596 {
3597 sendStatsRequestcxx . . $ IGSConnection#sendStatsRequest(cac334474c82cf3a).(p);
3598 talk = getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).()->getTalkcxx . . $ Room#getTalk(e709c6e389e35213).(p);
3599 }
3600 if(talk)
3601 talk->recvTalkcxx . . $ Talk#recvTalk(7df51288a9ebd664).(e2cxx . . $ QString#QString(132dd6869045752b).);
3602 }
3603
3604
3605 // results
3606 //25 File
3607 //curio [ 5d*](W) : lllgolll [ 4d*](B) H 0 K 0.5 19x19 W+Resign 22-04-47 R
3608 //curio [ 5d*](W) : was [ 4d*](B) H 0 K 0.5 19x19 W+Time 22-05-06 R
3609 //25 File
3610 //case 25:
3611 void IGSConnectioncxx . . $ IGSConnection#::handle_thistcxx . . $ IGSConnection#handle_thist(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3612 {
3613 //FIXME if this is something that happens then
3614 // we should be picking it up
3615 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("%s", line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3616 }
3617 // who
3618 // 27 Info Name Idle Rank | Info Name Idle Rank
3619 // 27 SX -- -- xxxx03 1m NR | Q! -- -- xxxx101 33s NR
3620 // 0 4 6 11 15 26 33 38 41
3621 // 27 -- 221 DAISUKEY 33s 8k | X172 -- hiyocco 2m 19k*
3622 // 27 Q -- 216 Saiden 7s 1k* | -- 53 toshiao 11s 10k
3623 // 27 48 -- kyouji 3m 11k* | -- 95 bengi 5s 4d*
3624 // IGS:
3625 // -- -- kimisa 1m 2k* | Q -- 206 takabo 45s 1k*
3626 // X 39 -- Marin 5m 2k* | -- 53 KT713 18s 2d*
3627 // -- 34 mat21 2m 14k* | -- 9 entropy 28s 4d
3628 // NNGS:
3629 // 27 X -- -- arndt 21s 5k | X -- -- biogeek 58s 20k
3630 // 27 X -- -- buffel 21s 4k | S -- 5 frosla 12s 7k
3631 // 27 S -- -- GoBot 1m NR | -- 5 guest17 0s NR
3632 // 27 -- 3 hama 3s 15k | -- -- niki 5m NR
3633 // 27 ! -- -- viking4 55s 19k* | S -- 3 GnuGo 6s 14k*
3634 // 27 X -- -- kossa 21m 5k | X -- -- leif 5m 3k*
3635 // 27 -- 6 ppp 18s 2k* | -- 6 chmeng 20s 1d*
3636 // 27 ******** 14 Players 3 Total Games ********
3637
3638 // WING:
3639 // 0 9 14 38 46 51
3640 // 27 X 13 -- takeo6 1m 2k | ! 26 -- ooide 6m 2k*
3641 // 27 ! -- -- hide1234 9m 2k* | QX -- -- yochi 0s 2k*
3642 // 27 g -- 86 karasu 45s 2k* | Sg -- 23 denakechi 16s 1k*
3643 // 27 g 23 43 kH03 11s 1k* | g -- 43 kazusige 24s 1k*
3644 // 27 g -- 50 jan 24s 1k* | QX -- -- maigo 32s 1d
3645 // 27 g -- 105 kume1 5s 1d* | g -- 30 yasumitu 24s 1d
3646 // 27 Qf -- 13 motono 2m 1d* | X 13 -- tak7 57s 1d*
3647 // 27 ! 50 -- okiek 8m 1d* | X -- -- DrO 11s 1d*
3648 // 27 f -- 103 hiratake 35s 8k | g -- 33 kushinn 21s 8k*
3649 // 27 g -- 102 teacup 1m 1d* | g -- 102 Tadao 32s 1d*
3650 //case 27:
3651 void IGSConnectioncxx . . $ IGSConnection#::handle_whocxx . . $ IGSConnection#handle_who(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3652 {
3653 PlayerListingcxx . . $ PlayerListing# * aPlayer = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3654 Roomcxx . . $ Room# * room = getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).();
3655 int pos;
3656 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("****"cxx . . $ QString#QString(85c52e162fed56f9).) && line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Players"cxx . . $ QString#QString(85c52e162fed56f9).))
3657 return;
3658 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Info"cxx . . $ QString#QString(85c52e162fed56f9).) && line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Idle"cxx . . $ QString#QString(85c52e162fed56f9).))
3659 return;
3660
3661 if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).15] !=cxx . . $ `operator!=`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
3662 {
3663 //27 X -- -- truetest 7m 1d* | X -- -- aajjoo 6s 9k
3664 // parse line
3665 QStringcxx . . $ QString# info = line.midcxx . . $ QString#mid(44b7563da18aea72).(4,2);
3666 int observing = line.midcxx . . $ QString#mid(44b7563da18aea72).(6,3).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3667 int playing = line.midcxx . . $ QString#mid(44b7563da18aea72).(11,3).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3668 QStringcxx . . $ QString# name = line.midcxx . . $ QString#mid(44b7563da18aea72).(15,11).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
3669 aPlayer = room->getPlayerListingcxx . . $ Room#getPlayerListing(d3f53ac2de9f0b45).(name);
3670 aPlayer->onlinecxx . . $ PlayerListing#online. = true;
3671 aPlayer->infocxx . . $ PlayerListing#info. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). info;
3672 aPlayer->observingcxx . . $ PlayerListing#observing. = observing;
3673 aPlayer->playingcxx . . $ PlayerListing#playing. = playing;
3674 aPlayer->idletimecxx . . $ PlayerListing#idletime. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.midcxx . . $ QString#mid(44b7563da18aea72).(26,3);
3675 aPlayer->seconds_idlecxx . . $ PlayerListing#seconds_idle. = idleTimeToSecondscxx . . $ IGSConnection#idleTimeToSeconds(9d92bb507a34628c).(aPlayercxx . . $ QString#QString(132dd6869045752b).->idletimecxx . . $ PlayerListing#idletime.);
3676 //aPlayer->nmatch = false;
3677 if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).33] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
3678 {
3679 if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).36] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
3680 aPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.midcxx . . $ QString#mid(44b7563da18aea72).(34,2);
3681 else
3682 aPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.midcxx . . $ QString#mid(44b7563da18aea72).(34,3);
3683 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(aPlayer->rankcxx . . $ PlayerListing#rank.));
3684 aPlayer->rank_scorecxx . . $ PlayerListing#rank_score. = rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(aPlayercxx . . $ QString#QString(132dd6869045752b).->rankcxx . . $ PlayerListing#rank.);
3685 }
3686 else
3687 {
3688 if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).36] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
3689 aPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.midcxx . . $ QString#mid(44b7563da18aea72).(33,3);
3690 else
3691 aPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.midcxx . . $ QString#mid(44b7563da18aea72).(33,4);
3692 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(aPlayer->rankcxx . . $ PlayerListing#rank.));
3693 aPlayer->rank_scorecxx . . $ PlayerListing#rank_score. = rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(aPlayercxx . . $ QString#QString(132dd6869045752b).->rankcxx . . $ PlayerListing#rank.);
3694 }
3695
3696 // check if line ok, true -> cmd "players" preceded
3697 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! playerListingReceivedcxx . . $ NetworkConnection#playerListingReceived(122195e397f39e1b).(aPlayer);
3698 }
3699 #ifdef FIXME
3700 else
3701 qDebug("player27 dropped (1): %s" + line.toLatin1());
3702 #endif //FIXME
3703
3704 // position of delimiter between two players
3705 pos = line.indexOfcxx . . $ QString#indexOf(75b556ba78e4903c).('|'cxx . . $ QChar#QChar(f349c77f591a7878).);
3706 // check if 2nd player in a line && player (name) exists
3707 if (pos != -1 && line[cxx . . $ QString#`operator[]`(57436120916eb52c).52] !=cxx . . $ `operator!=`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
3708 {
3709 // parse line
3710 QStringcxx . . $ QString# info = line.midcxx . . $ QString#mid(44b7563da18aea72).(41,2);
3711 int observing = line.midcxx . . $ QString#mid(44b7563da18aea72).(43,3).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3712 int playing = line.midcxx . . $ QString#mid(44b7563da18aea72).(48,3).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3713 QStringcxx . . $ QString# name = line.midcxx . . $ QString#mid(44b7563da18aea72).(52,11).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
3714 aPlayer = room->getPlayerListingcxx . . $ Room#getPlayerListing(d3f53ac2de9f0b45).(name);
3715 aPlayer->onlinecxx . . $ PlayerListing#online. = true;
3716 aPlayer->infocxx . . $ PlayerListing#info. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). info;
3717 aPlayer->observingcxx . . $ PlayerListing#observing. = observing;
3718 aPlayer->playingcxx . . $ PlayerListing#playing. = playing;
3719 aPlayer->idletimecxx . . $ PlayerListing#idletime. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.midcxx . . $ QString#mid(44b7563da18aea72).(63,3);
3720 aPlayer->seconds_idlecxx . . $ PlayerListing#seconds_idle. = idleTimeToSecondscxx . . $ IGSConnection#idleTimeToSeconds(9d92bb507a34628c).(aPlayercxx . . $ QString#QString(132dd6869045752b).->idletimecxx . . $ PlayerListing#idletime.);
3721 //aPlayer->nmatch = false;
3722 if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).70] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
3723 {
3724 if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).73] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
3725 aPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.midcxx . . $ QString#mid(44b7563da18aea72).(71,2);
3726 else
3727 aPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.midcxx . . $ QString#mid(44b7563da18aea72).(71,3);
3728 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(aPlayer->rankcxx . . $ PlayerListing#rank.));
3729 aPlayer->rank_scorecxx . . $ PlayerListing#rank_score. = rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(aPlayercxx . . $ QString#QString(132dd6869045752b).->rankcxx . . $ PlayerListing#rank.);
3730 }
3731 else
3732 {
3733 if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).73] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
3734 aPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.midcxx . . $ QString#mid(44b7563da18aea72).(70,3);
3735 else
3736 aPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.midcxx . . $ QString#mid(44b7563da18aea72).(70,4);
3737 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(aPlayer->rankcxx . . $ PlayerListing#rank.));
3738 aPlayer->rank_scorecxx . . $ PlayerListing#rank_score. = rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(aPlayercxx . . $ QString#QString(132dd6869045752b).->rankcxx . . $ PlayerListing#rank.);
3739 }
3740
3741 // true -> cmd "players" preceded
3742 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! playerListingReceivedcxx . . $ NetworkConnection#playerListingReceived(122195e397f39e1b).(aPlayer);
3743 }
3744 #ifdef FIXME
3745 else
3746 qDebug("player27 dropped (2): %s" + line.toLatin1());
3747 #endif //FIXME
3748 }
3749
3750 void IGSConnectioncxx . . $ IGSConnection#::handle_undocxx . . $ IGSConnection#handle_undo(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3751 // 28 guest17 undid the last (J16).
3752 // 15 Game 7 I: frosla (0 5363 -1) vs guest17 (0 5393 -1)
3753 // 15 2(B): F17
3754 // IGS:
3755 // 28 Undo in game 64: MyMaster vs MyMaster: N15
3756 //case 28:
3757 {
3758 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch;
3759 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("*** %s", line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3760 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
3761 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("undid the last "cxx . . $ QString#QString(85c52e162fed56f9).))
3762 {
3763 // now: just look in qgo_interface if _nr has decreased...
3764 // but send undo-signal anyway: in case of undo while scoring it's necessary
3765 MoveRecordcxx . . $ MoveRecord# * aMove = new MoveRecordcxx . . $ MoveRecord#();
3766 aMove->flagscxx . . $ MoveRecord#flags. = MoveRecordcxx . . $ MoveRecord#::UNDOcxx . . $ MoveRecord#UNDO.;
3767 QStringcxx . . $ QString# player = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3768 QStringcxx . . $ QString# point = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, "("cxx . . $ QString#QString(85c52e162fed56f9)., ")"cxx . . $ QString#QString(85c52e162fed56f9).);
3769
3770 aMove->xcxx . . $ MoveRecord#x. = (int)(point.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().atcxx . . $ QByteArray#at(ed855a77b1899856).(0));
3771 aMove->xcxx . . $ MoveRecord#x. -= 'A';
3772 if(aMove->xcxx . . $ MoveRecord#x. < 9) //no I on IGS
3773 aMove->xcxx . . $ MoveRecord#x.++;
3774 point.removecxx . . $ QString#remove(6483560ce2afa901).(0,1);
3775 aMove->ycxx . . $ MoveRecord#y. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(point, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3776 /* Do we need the board size here???*/
3777 aMove->ycxx . . $ MoveRecord#y. = 20 - aMove->ycxx . . $ MoveRecord#y.;
3778
3779 boarddispatch = getBoardFromOurOpponentcxx . . $ IGSConnection#getBoardFromOurOpponent(e34a72c20d4e159d).(playercxx . . $ QString#QString(132dd6869045752b).);
3780 boarddispatch->recvMovecxx . . $ BoardDispatch#recvMove(d174a3d9cfb0dd75).(aMove);
3781 delete aMove;
3782 }
3783 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Undo in game"cxx . . $ QString#QString(85c52e162fed56f9).))
3784 {
3785 MoveRecordcxx . . $ MoveRecord# * aMove = new MoveRecordcxx . . $ MoveRecord#();
3786 aMove->flagscxx . . $ MoveRecord#flags. = MoveRecordcxx . . $ MoveRecord#::UNDOcxx . . $ MoveRecord#UNDO.;
3787 QStringcxx . . $ QString# nr = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3788 nr.truncatecxx . . $ QString#truncate(d4f767463ce0a6b3).(nr.lengthcxx . . $ QString#length(455f465bc33b4cdf).() - 1);
3789 QStringcxx . . $ QString# point = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 7, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3790 aMove->xcxx . . $ MoveRecord#x. = (int)(point.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().atcxx . . $ QByteArray#at(ed855a77b1899856).(0));
3791 aMove->xcxx . . $ MoveRecord#x. -= 'A';
3792 if(aMove->xcxx . . $ MoveRecord#x. < 9) //no I on IGS
3793 aMove->xcxx . . $ MoveRecord#x.++;
3794 point.removecxx . . $ QString#remove(6483560ce2afa901).(0,1);
3795 aMove->ycxx . . $ MoveRecord#y. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(point, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3796 /* Do we need the board size here???*/
3797 aMove->ycxx . . $ MoveRecord#y. = 20 - aMove->ycxx . . $ MoveRecord#y.;
3798 boarddispatch = getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(nr.toIntcxx . . $ QString#toInt(d7972accae11ee1f).());
3799 boarddispatch->recvMovecxx . . $ BoardDispatch#recvMove(d174a3d9cfb0dd75).(aMove);
3800 delete aMove;
3801 }
3802
3803 // message anyway
3804 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3805 }
3806
3807 void IGSConnectioncxx . . $ IGSConnection#::handle_yellcxx . . $ IGSConnection#handle_yell(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3808 // different from shout??!?!?
3809 // IGS
3810 // --> ; \20
3811 // 32 Changing into channel 20.
3812 // 32 Welcome to cyberspace.
3813 //
3814 // 32 49:qgodev: Title is now: (qgodev) qGo development
3815 // 32 20:qGoDev: Person joining channel
3816 // 32 20:frosla: hi
3817 // 32 20:qGoDev: Person leaving channel
3818
3819 //
3820 // 1 5
3821 // --> channels
3822 // 9 #1 Title: Professional Channel -- Open
3823 //
3824 // 9 #20 Title: Untitled -- Open
3825 // 9 #20 frosla
3826 // #> 23 till: hello all <-- this is what the members in channel 23 see:
3827 // (channel number and who sent the message)
3828 //
3829 // NNGS:
3830 // channel talk: "49:xxxx: hi"
3831 //case 32:
3832 {
3833 /* As far as I can tell, the channel info stuff was
3834 * never hooked up to anything. The talk should be
3835 * hooked up to something, but this is a FIXME*/
3836 QStringcxx . . $ QString# e1cxx . . $ QString#QString(ced63f7c635d850d).,e2cxx . . $ QString#QString(ced63f7c635d850d).;
3837 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("%s\n", line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3838 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
3839 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Changing into channel"cxx . . $ QString#QString(85c52e162fed56f9).))
3840 {
3841 #ifdef FIXME
3842 e1 = element(line, 2, " ",".");
3843 int nr = e1.toInt();//element(line, 3, " ").toInt();
3844 emit signal_channelinfo(nr, QString("*on*"));
3845 // //emit signal_talk(e1, "", false);
3846 ////emit signal_message(line);
3847 #endif //FIXME
3848 return;
3849 }
3850 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Welcome to cyberspace"cxx . . $ QString#QString(85c52e162fed56f9).))
3851 {
3852 ////emit signal_message(line);
3853 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3854 return;
3855 }
3856 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Person joining channel"cxx . . $ QString#QString(85c52e162fed56f9).))
3857 {
3858 #ifdef FIXME
3859 int nr = element(line, 0, ":").toInt();
3860 emit signal_channelinfo(nr, QString("*on*"));
3861 #endif //FIXME
3862 return;
3863 }
3864 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("Person leaving channel"cxx . . $ QString#QString(85c52e162fed56f9).))
3865 {
3866 #ifdef FIXME
3867 int nr = element(line, 0, ":").toInt();
3868 emit signal_channelinfo(nr, QString("*on*"));
3869 #endif //FIXME
3870 return;
3871 }
3872
3873 // //emit (channel number, player + message , false =channel )
3874 /*switch (gsName)
3875 {
3876 case IGS:*/
3877 e1=cxx . . $ QString#`operator=`(4f35bf974e7f8568).elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, ":"cxx . . $ QString#QString(85c52e162fed56f9).);
3878 e2=cxx . . $ QString#`operator=`(b79fde0b0ce9b948)."> " +cxx . . $ operator+(c75c3ae4eb9af1a8). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, ":"cxx . . $ QString#QString(85c52e162fed56f9)., "EOL"cxx . . $ QString#QString(85c52e162fed56f9).).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
3879 e1 +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). e2;
3880 getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).()->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(e1.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3881 /* break;
3882
3883 default:
3884 e1=element(line, 0, ":");
3885 e2="> " + element(line, 0, ":", "EOL").trimmed();
3886 e1 += e2;
3887 break;
3888 } FIXME */
3889
3890 // //emit signal_talk(e1, e2, false);
3891 }
3892
3893 /* 36
3894 36 terra1 wants a match with you:
3895 36 terra1 wants 19x19 in 1 minutes with 10 byo-yomi and 25 byo-stones
3896 36 To accept match type 'automatch terra1'
3897 */
3898 void IGSConnectioncxx . . $ IGSConnection#::handle_automatchcxx . . $ IGSConnection#handle_automatch(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3899 {
3900 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
3901 if(line.containscxx . . $ QString#contains(8cce4688c16f48f3).("minutes"cxx . . $ QString#QString(85c52e162fed56f9).))
3902 {
3903 Roomcxx . . $ Room# * room = getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).();
3904 MatchRequestcxx . . $ MatchRequest# * aMatch = new MatchRequestcxx . . $ MatchRequest#();
3905 aMatch->opponentcxx . . $ MatchRequest#opponent. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3906
3907 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Receieved automatch request from %s", aMatch->opponentcxx . . $ MatchRequest#opponent..toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3908 QStringcxx . . $ QString# bs = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).);
3909 if(bs ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "19x19")
3910 aMatch->board_sizecxx . . $ MatchRequest#board_size. = 19;
3911 else if(bs ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "13x13")
3912 aMatch->board_sizecxx . . $ MatchRequest#board_size. = 13;
3913 else if(bs ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "9x9")
3914 aMatch->board_sizecxx . . $ MatchRequest#board_size. = 9;
3915 else
3916 {
3917 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Match offered board size: %s", bs.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
3918 delete aMatch;
3919 return;
3920 }
3921 aMatch->maintimecxx . . $ MatchRequest#maintime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3922 aMatch->periodtimecxx . . $ MatchRequest#periodtime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 7, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3923 aMatch->stones_periodscxx . . $ MatchRequest#stones_periods. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 10, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
3924 PlayerListingcxx . . $ PlayerListing# * p = getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(aMatch->opponentcxx . . $ MatchRequest#opponent.);
3925 PlayerListingcxx . . $ PlayerListing# * us = room->getPlayerListingcxx . . $ Room#getPlayerListing(d3f53ac2de9f0b45).(getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).());
3926 aMatch->our_namecxx . . $ MatchRequest#our_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). us->namecxx . . $ PlayerListing#name.;
3927 aMatch->our_rankcxx . . $ MatchRequest#our_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). us->rankcxx . . $ PlayerListing#rank.;
3928
3929 aMatch->their_rankcxx . . $ MatchRequest#their_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). p->rankcxx . . $ PlayerListing#rank.;
3930 /* Maybe we have to do automatch, rather than accept/decline,
3931 * FIXME */
3932 //protocol_save_string = "automatch";
3933 GameDialogcxx . . $ GameDialog# * gameDialog = getGameDialogcxx . . $ NetworkConnection#getGameDialog(3dcc94127826259).(p);
3934 gameDialog->recvRequestcxx . . $ GameDialog#recvRequest(461bc273ee812ab9).(aMatch);
3935
3936 delete aMatch;
3937 }
3938 }
3939
3940 void IGSConnectioncxx . . $ IGSConnection#::handle_serverinfocxx . . $ IGSConnection#handle_serverinfo(7df51288a9ebd664).(QStringcxx . . $ QString#)
3941 {}
3942
3943 // Setting your . to xxxx
3944 //case 40:
3945 void IGSConnectioncxx . . $ IGSConnection#::handle_dotcxx . . $ IGSConnection#handle_dot(7df51288a9ebd664).(QStringcxx . . $ QString#)
3946 {}
3947 // long user report equal to 7
3948 // 7 [255] YK [ 7d*] vs. SOJ [ 7d*] ( 56 19 0 5.5 4 I) ( 18)
3949 // 42 [88] AQ [ 2d*] vs. lang [ 2d*] (177 19 0 5.5 6 I) ( 1)
3950
3951 // IGS: cmd 'user'
3952 // 42 Name Info Country Rank Won/Lost Obs Pl Idle Flags Language
3953 // 0 3 15 31 40 45 48 54 59 62 67 72
3954 // 42 guest15 -- NR 0/ 0 - - 10s Q- default
3955 // 42 guest13 -- NR 0/ 0 - - 24s Q- default
3956 // 42 zz You may be rec France NR 0/ 0 - - 0s -X default
3957 // 42 zz0002 <none> Japan NR 0/ 0 - - 1m QX default
3958 // 42 zz0003 <none> () Japan NR 0/ 0 - - 1m SX default
3959 // 42 anko Taiwan 2k* 168/ 97 - - 1s -- default
3960 // 42 MUKO12 1/12 〜 1/15 Japan 4k* 666/ 372 17 - 1m -X default
3961 // 42 mof [Igc2000 1.1] Sweden 2k* 509/ 463 124 - 0s -X default
3962 // 42 obiyan <None> Japan 3k* 1018/ 850 - 50 11s -- default
3963 // 42 uzumaki COM 1k 0/ 0 - - 1s -X default
3964 // 42 HansWerner [Igc2000 1.2] Germany 1k 11/ 3 111 - 1m QX default
3965 // 42 genesis Germany 1k* 592/ 409 - 136 14s -- default
3966 // 42 hamburg Germany 3k* 279/ 259 - 334 13s -- default
3967 // 42 Sie Germany 1k* 6/ 7 - 68 39s -- default
3968 // 42 borkum Germany 4k* 163/ 228 - 100 7s -- default
3969 // 42 casumy 45-3 Germany 1d 0/ 0 - 133 2s Q- default
3970 // 42 stoni Germany 2k* 482/ 524 - 166 7s -- default
3971 // 42 Beholder <None> Germany NR 0/ 0 263 - 5s QX default
3972 // 42 xiejun 1/10-15 Germany 3d* 485/ 414 179 - 49s -X default
3973 // 9 ******** 1120 Players 247 Total Games ********
3974
3975 // IGS: new cmd 'userlist' for nmatch information
3976 // 10 20 30 40 50 60 70 80 80 90 100 110 120
3977 // 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
3978 // 42 Name Info Country Rank Won/Lost Obs Pl Idle Flags Language
3979 // 42 ----- <none> Japan 15k+ 2108/2455 - - 1m Q- default T BWN 0-9 19-19 600-600 1200-1200 25-25 0-0 0-0 0-0
3980 // 42 ----- Japan 3d 11/ 13 - 222 46s Q- default T BWN 0-9 19-19 60-60 600-600 25-25 0-0 0-0 0-0
3981 // 42 Neil <None> USA 12k 136/ 86 - - 0s -X default T BWN 0-9 19-19 60-60 60-3600 25-25 0-0 0-0 0-0
3982 //case 42:
3983
3984
3985 //42 koumas* - 11k 0000/0000 - 4 11m 9a E?E----
3986
3987 // 42 koumas* - 11k 0000/0000 - 4 11m 9a E?E----
3988 // No match
3989
3990
3991
3992 // 42 spaman* - 11k* 0000/0000 - 4 11m 9a E?E----
3993
3994 // 42 spaman* - 11k* 0000/0000 - 4 11m 9a E?E----
3995 // No match
3996
3997 void IGSConnectioncxx . . $ IGSConnection#::handle_userlistcxx . . $ IGSConnection#handle_userlist(7df51288a9ebd664).(QStringcxx . . $ QString# line)
3998 {
3999 //line = line.remove(0, 2).trimmed();
4000 PlayerListingcxx . . $ PlayerListing# * aPlayer = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
4001 Roomcxx . . $ Room# * room = getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).();
4002 if (line[cxx . . $ QString#`operator[]`(57436120916eb52c).40] ==cxx . . $ `operator==`(a468b2f18a3afe8). 'R'cxx . . $ QChar#QChar(f349c77f591a7878).) //this was line ???
4003 {
4004 // skip
4005 return;
4006 }
4007 // 1
4008 // Name
4009 QRegExpcxx . . $ QRegExp# re1 = QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("42 ([A-Za-z0-9 ]{,10}) "cxx . . $ QString#QString(85c52e162fed56f9).);
4010 // 2
4011 // Info
4012 QRegExpcxx . . $ QRegExp# re2 = QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("(.{1,14}) "cxx . . $ QString#QString(85c52e162fed56f9).);
4013 // 3
4014 // Country
4015 QRegExpcxx . . $ QRegExp# re3 = QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("([a-zA-Z][a-zA-Z. /&#92;']{,6}|-- ) "cxx . . $ QString#QString(85c52e162fed56f9).
4016 // 4
4017 // Rank
4018 "([0-9 ][0-9][kdp].?| +BC| +NR) +"
4019 // 5 6
4020 // Won Lost
4021 "([0-9 ]+[0-9]+)/([0-9 ]+[0-9]+) +"
4022 // 7 8
4023 // Obs Pl
4024 "([0-9]+|-) +([0-9]+|-) +"
4025 // 9 10 11 12
4026 // Idle Flags
4027 "([A-Za-z0-9]+) +([^ ]{,2})");// +default");
4028 QRegExpcxx . . $ QRegExp# re4 = QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).(" ([TF]) (.*)"cxx . . $ QString#QString(85c52e162fed56f9).);
4029 if(re1.indexIncxx . . $ QRegExp#indexIn(46f502bdfc4aeb33).(line) < 0 || re3.indexIncxx . . $ QRegExp#indexIn(46f502bdfc4aeb33).(line) < 0)
4030 {
4031 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("\n%s", line.toUtf8cxx . . $ QString#toUtf8(ef52b713090bc85a).().datacxx . . $ QByteArray#data(41208ce6ca65dd58).());
4032 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("No match\n");
4033 return;
4034 }
4035
4036 // 42 Neil <None> USA 12k 136/ 86 - - 0s -X default T BWN 0-9 19-19 60-60 60-3600 25-25 0-0 0-0 0-0
4037
4038 QStringcxx . . $ QString# name = re1.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(1).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
4039 aPlayer = room->getPlayerListingcxx . . $ Room#getPlayerListing(d3f53ac2de9f0b45).(name);
4040
4041 if(re2.indexIncxx . . $ QRegExp#indexIn(46f502bdfc4aeb33).(line) >= 0)
4042 {
4043 aPlayer->extInfocxx . . $ PlayerListing#extInfo. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). re2.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(1).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
4044 }
4045 else
4046 aPlayer->extInfocxx . . $ PlayerListing#extInfo. =cxx . . $ QString#`operator=`(d02845eef0c33901). "<None>";
4047 if(aPlayer->extInfocxx . . $ PlayerListing#extInfo. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "")
4048 aPlayer->extInfocxx . . $ PlayerListing#extInfo. =cxx . . $ QString#`operator=`(d02845eef0c33901). "<None>";
4049
4050 aPlayer->countrycxx . . $ PlayerListing#country. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). re3.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(1).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
4051 if(aPlayer->countrycxx . . $ PlayerListing#country. ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "--")
4052 aPlayer->countrycxx . . $ PlayerListing#country. =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
4053 aPlayer->rankcxx . . $ PlayerListing#rank. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). re3.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(2).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
4054 fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(&(aPlayer->rankcxx . . $ PlayerListing#rank.));
4055 aPlayer->rank_scorecxx . . $ PlayerListing#rank_score. = rankToScorecxx . . $ IGSConnection#rankToScore(9d92bb507a34628c).(aPlayercxx . . $ QString#QString(132dd6869045752b).->rankcxx . . $ PlayerListing#rank.);
4056 aPlayer->winscxx . . $ PlayerListing#wins. = re3.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(3).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4057 aPlayer->lossescxx . . $ PlayerListing#losses. = re3.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(4).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4058 aPlayer->observingcxx . . $ PlayerListing#observing. = re3.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(5).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4059 aPlayer->playingcxx . . $ PlayerListing#playing. = re3.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(6).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).().toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4060 aPlayer->idletimecxx . . $ PlayerListing#idletime. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). re3.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(7).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
4061 aPlayer->seconds_idlecxx . . $ PlayerListing#seconds_idle. = idleTimeToSecondscxx . . $ IGSConnection#idleTimeToSeconds(9d92bb507a34628c).(aPlayercxx . . $ QString#QString(132dd6869045752b).->idletimecxx . . $ PlayerListing#idletime.);
4062 aPlayer->infocxx . . $ PlayerListing#info. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). re3.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(8).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
4063
4064 if(re4.indexIncxx . . $ QRegExp#indexIn(46f502bdfc4aeb33).(line) < 0)
4065 aPlayer->nmatchcxx . . $ PlayerListing#nmatch. = 0;
4066 else
4067 aPlayer->nmatchcxx . . $ PlayerListing#nmatch. = re4.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(1) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "T";
4068 aPlayer->nmatch_settingscxx . . $ PlayerListing#nmatch_settings. =cxx . . $ QString#`operator=`(d02845eef0c33901). "";
4069 QStringcxx . . $ QString# nmatchString = ""cxx . . $ QString#QString(85c52e162fed56f9).;
4070 // we want to format the nmatch settings to a readable string
4071 if (aPlayer->nmatchcxx . . $ PlayerListing#nmatch.)
4072 {
4073 // BWN 0-9 19-19 60-60 600-600 25-25 0-0 0-0 0-0
4074 nmatchString =cxx . . $ QString#`operator=`(4f35bf974e7f8568). re4.capcxx . . $ QRegExp#cap(ce915ed341d4a7f0).(2).trimmedcxx . . $ QString#trimmed(30b3b70527b1c61a).();
4075 if ( ! nmatchString.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
4076 {
4077
4078 aPlayer->nmatch_blackcxx . . $ PlayerListing#nmatch_black. = (nmatchString.containscxx . . $ QString#contains(8cce4688c16f48f3).("B"cxx . . $ QString#QString(85c52e162fed56f9).));
4079 aPlayer->nmatch_whitecxx . . $ PlayerListing#nmatch_white. = (nmatchString.containscxx . . $ QString#contains(8cce4688c16f48f3).("W"cxx . . $ QString#QString(85c52e162fed56f9).));
4080 aPlayer->nmatch_nigiricxx . . $ PlayerListing#nmatch_nigiri. = (nmatchString.containscxx . . $ QString#contains(8cce4688c16f48f3).("N"cxx . . $ QString#QString(85c52e162fed56f9).));
4081
4082
4083 aPlayer->nmatch_timeMincxx . . $ PlayerListing#nmatch_timeMin. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(nmatchString, 2, " "cxx . . $ QString#QString(85c52e162fed56f9)., "-"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4084 aPlayer->nmatch_timeMaxcxx . . $ PlayerListing#nmatch_timeMax. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(nmatchString, 2, "-"cxx . . $ QString#QString(85c52e162fed56f9)., " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4085 QStringcxx . . $ QString# t1min = QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(aPlayer->nmatch_timeMincxx . . $ PlayerListing#nmatch_timeMin. / 60);
4086 QStringcxx . . $ QString# t1max = QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(aPlayer->nmatch_timeMaxcxx . . $ PlayerListing#nmatch_timeMax. / 60);
4087 if (t1min !=cxx . . $ `operator!=`(5bc2975d2d751687). t1max)
4088 t1min.appendcxx . . $ QString#append(d02845eef0c33901).(" to ").appendcxx . . $ QString#append(6a89d0b7f4d2681c).(t1max) ;
4089
4090 QStringcxx . . $ QString# t2min = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(nmatchString, 3, " "cxx . . $ QString#QString(85c52e162fed56f9)., "-"cxx . . $ QString#QString(85c52e162fed56f9).);
4091 QStringcxx . . $ QString# t2max = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(nmatchString, 3, "-"cxx . . $ QString#QString(85c52e162fed56f9)., " "cxx . . $ QString#QString(85c52e162fed56f9).);
4092 aPlayer->nmatch_BYMincxx . . $ PlayerListing#nmatch_BYMin. = t2min.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4093 aPlayer->nmatch_BYMaxcxx . . $ PlayerListing#nmatch_BYMax. = t2max.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4094
4095 QStringcxx . . $ QString# t3min = QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(t2min.toIntcxx . . $ QString#toInt(d7972accae11ee1f).() / 60);
4096 QStringcxx . . $ QString# t3max = QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(t2max.toIntcxx . . $ QString#toInt(d7972accae11ee1f).() / 60);
4097
4098 if (t2min !=cxx . . $ `operator!=`(5bc2975d2d751687). t2max)
4099 t2min.appendcxx . . $ QString#append(d02845eef0c33901).(" to ").appendcxx . . $ QString#append(6a89d0b7f4d2681c).(t2max) ;
4100
4101 if (t3min !=cxx . . $ `operator!=`(5bc2975d2d751687). t3max)
4102 t3min.appendcxx . . $ QString#append(d02845eef0c33901).(" to ").appendcxx . . $ QString#append(6a89d0b7f4d2681c).(t3max) ;
4103
4104 QStringcxx . . $ QString# s1 = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(nmatchString, 4, " "cxx . . $ QString#QString(85c52e162fed56f9)., "-"cxx . . $ QString#QString(85c52e162fed56f9).);
4105 QStringcxx . . $ QString# s2 = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(nmatchString, 4, "-"cxx . . $ QString#QString(85c52e162fed56f9)., " "cxx . . $ QString#QString(85c52e162fed56f9).);
4106 aPlayer->nmatch_stonesMincxx . . $ PlayerListing#nmatch_stonesMin. = s1.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4107 aPlayer->nmatch_stonesMaxcxx . . $ PlayerListing#nmatch_stonesMax. = s2.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4108
4109 if (s1 !=cxx . . $ `operator!=`(5bc2975d2d751687). s2)
4110 s1.appendcxx . . $ QString#append(d02845eef0c33901).("-").appendcxx . . $ QString#append(6a89d0b7f4d2681c).(s2) ;
4111
4112 if (s1 ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "1")
4113 {
4114 aPlayer->nmatch_timeSystemcxx . . $ PlayerListing#nmatch_timeSystem. = byoyomicxx . . $ byoyomi.;
4115 aPlayer->nmatch_settingscxx . . $ PlayerListing#nmatch_settings. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). "Jap. BY : " +cxx . . $ operator+(c75c3ae4eb9af1a8).
4116 t1min +cxx . . $ operator+(3d22f08efddf8107). " min. + " +cxx . . $ operator+(fab9b4f80031f353).
4117 t2min +cxx . . $ operator+(3d22f08efddf8107). " secs./st. " ;
4118 }
4119 else
4120 {
4121 aPlayer->nmatch_timeSystemcxx . . $ PlayerListing#nmatch_timeSystem. = canadiancxx . . $ canadian.;
4122 aPlayer->nmatch_settingscxx . . $ PlayerListing#nmatch_settings. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). "Can. BY : " +cxx . . $ operator+(c75c3ae4eb9af1a8).
4123 t1min +cxx . . $ operator+(3d22f08efddf8107). " min. + " +cxx . . $ operator+(fab9b4f80031f353).
4124 t3min +cxx . . $ operator+(3d22f08efddf8107). " min. /" +cxx . . $ operator+(fab9b4f80031f353).
4125 s1 +cxx . . $ operator+(3d22f08efddf8107). " st. ";
4126 }
4127
4128 QStringcxx . . $ QString# h1 = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(nmatchString, 0, " "cxx . . $ QString#QString(85c52e162fed56f9)., "-"cxx . . $ QString#QString(85c52e162fed56f9).);
4129 QStringcxx . . $ QString# h2 = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(nmatchString, 0, "-"cxx . . $ QString#QString(85c52e162fed56f9)., " "cxx . . $ QString#QString(85c52e162fed56f9).);
4130 aPlayer->nmatch_handicapMincxx . . $ PlayerListing#nmatch_handicapMin. = h1.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4131 aPlayer->nmatch_handicapMaxcxx . . $ PlayerListing#nmatch_handicapMax. = h2.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4132 if (h1 !=cxx . . $ `operator!=`(5bc2975d2d751687). h2)
4133 h1.appendcxx . . $ QString#append(d02845eef0c33901).("-").appendcxx . . $ QString#append(6a89d0b7f4d2681c).(h2) ;
4134
4135 aPlayer->nmatch_settingscxx . . $ PlayerListing#nmatch_settings..appendcxx . . $ QString#append(6a89d0b7f4d2681c).("(h " +cxx . . $ operator+(c75c3ae4eb9af1a8). h1 +cxx . . $ operator+(3d22f08efddf8107). ")") ;
4136 }
4137 else
4138 aPlayer->nmatch_settingscxx . . $ PlayerListing#nmatch_settings. =cxx . . $ QString#`operator=`(d02845eef0c33901). "No match conditions";
4139 }
4140
4141 // indicate player to be online
4142 aPlayer->onlinecxx . . $ PlayerListing#online. = true;
4143 emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! playerListingReceivedcxx . . $ NetworkConnection#playerListingReceived(122195e397f39e1b).(aPlayer);
4144 }
4145
4146 // IGS: 49 Game 42 qGoDev is removing @ C5
4147 void IGSConnectioncxx . . $ IGSConnection#::handle_removedcxx . . $ IGSConnection#handle_removed(7df51288a9ebd664).(QStringcxx . . $ QString# line)
4148 {
4149 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
4150 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("is removing @"cxx . . $ QString#QString(85c52e162fed56f9).))
4151 {
4152 int game = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4153 QStringcxx . . $ QString# pt = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 6, " "cxx . . $ QString#QString(85c52e162fed56f9).);
4154 handleRemovingAtcxx . . $ IGSConnection#handleRemovingAt(679a3afc1f0f3212).(game, ptcxx . . $ QString#QString(132dd6869045752b).);
4155 }
4156 }
4157
4158 void IGSConnectioncxx . . $ IGSConnection#::handleRemovingAtcxx . . $ IGSConnection#handleRemovingAt(679a3afc1f0f3212).(unsigned int game, QStringcxx . . $ QString# pt)
4159 {
4160 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch = getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(game);
4161 if(!boarddispatch)
4162 {
4163 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("removing for game we don't have");
4164 return;
4165 }
4166 GameDatacxx . . $ GameData# * r = boarddispatch->getGameDatacxx . . $ BoardDispatch#getGameData(f917540193955ea7).();
4167 if(!r)
4168 {
4169 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Can't get game record");
4170 return;
4171 }
4172
4173 MoveRecordcxx . . $ MoveRecord# * aMove = new MoveRecordcxx . . $ MoveRecord#();
4174 aMove->flagscxx . . $ MoveRecord#flags. = MoveRecordcxx . . $ MoveRecord#::REMOVEcxx . . $ MoveRecord#REMOVE.;
4175 aMove->xcxx . . $ MoveRecord#x. = (int)(pt.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().atcxx . . $ QByteArray#at(ed855a77b1899856).(0));
4176 aMove->xcxx . . $ MoveRecord#x. -= 'A';
4177 if(aMove->xcxx . . $ MoveRecord#x. < 9) //no I on IGS
4178 aMove->xcxx . . $ MoveRecord#x.++;
4179 pt.removecxx . . $ QString#remove(6483560ce2afa901).(0,1);
4180 aMove->ycxx . . $ MoveRecord#y. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(pt, 0, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4181 /* Do we need the board size here???*/
4182 aMove->ycxx . . $ MoveRecord#y. = r->board_sizecxx . . $ GameData#board_size. + 1 - aMove->ycxx . . $ MoveRecord#y.;
4183 boarddispatch->recvMovecxx . . $ BoardDispatch#recvMove(d174a3d9cfb0dd75).(aMove);
4184 delete aMove;
4185 }
4186
4187 //FIXME
4188 //51 Say in game 432
4189 void IGSConnectioncxx . . $ IGSConnection#::handle_ingamesaycxx . . $ IGSConnection#handle_ingamesay(7df51288a9ebd664).(QStringcxx . . $ QString# s)
4190 {
4191 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Ingamesay: %s", s.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
4192 }
4193
4194 // 53 Game 75 adjournment is declined
4195 void IGSConnectioncxx . . $ IGSConnection#::handle_adjourndeclinedcxx . . $ IGSConnection#handle_adjourndeclined(7df51288a9ebd664).(QStringcxx . . $ QString# line)
4196 {
4197 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
4198 BoardDispatchcxx . . $ BoardDispatch# * boarddispatch;
4199 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("adjournment is declined"cxx . . $ QString#QString(85c52e162fed56f9).))
4200 {
4201 unsigned int game_nr = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4202 boarddispatch = getBoardDispatchcxx . . $ NetworkConnection#getBoardDispatch(f34f0704202202).(game_nr);
4203 if(boarddispatch)
4204 boarddispatch->recvRefuseAdjourncxx . . $ BoardDispatch#recvRefuseAdjourn(49f6e7a06ebc5aa8).();
4205 else
4206 {
4207 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Adjourn decline recv %d", game_nr);
4208 }
4209 }
4210 }
4211
4212 // IGS : seek syntax, answer to 'seek config_list' command
4213 // 63 CONFIG_LIST_START 4
4214 // 63 CONFIG_LIST 0 60 600 25 0 0
4215 // 63 CONFIG_LIST 1 60 480 25 0 0
4216 // 63 CONFIG_LIST 2 60 300 25 0 0
4217 // 63 CONFIG_LIST 3 60 900 25 0 0
4218 // 63 CONFIG_LIST_END
4219
4220 // 63 OPPONENT_FOUND
4221
4222 // 63 ENTRY_LIST_START 5
4223 // 63 ENTRY_LIST HKL 60 480 25 0 0 19 1 1 0
4224 // 63 ENTRY_LIST tgor 60 480 25 0 0 19 1 1 0
4225 // 63 ENTRY_LIST sun756 60 600 25 0 0 19 1 1 0
4226 // 63 ENTRY_LIST horse 60 600 25 0 0 19 2 2 0
4227 // 63 ENTRY_LIST masaeaki 60 300 25 0 0 19 1 1 0
4228 // 63 ENTRY_LIST_END
4229 void IGSConnectioncxx . . $ IGSConnection#::handle_seekcxx . . $ IGSConnection#handle_seek(7df51288a9ebd664).(QStringcxx . . $ QString# line)
4230 {
4231 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
4232 if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("OPPONENT_FOUND"cxx . . $ QString#QString(85c52e162fed56f9).))
4233 {
4234 QStringcxx . . $ QString# oppname = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).);
4235 ConsoleDispatchcxx . . $ ConsoleDispatch# * console = getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).();
4236 if(console)
4237 console->recvTextcxx . . $ ConsoleDispatch#recvText(7df51288a9ebd664).("Opponent found: " +cxx . . $ operator+(c75c3ae4eb9af1a8). oppname);
4238 recvSeekCancelcxx . . $ NetworkConnection#recvSeekCancel(49f6e7a06ebc5aa8).();
4239 }
4240 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("CONFIG_LIST "cxx . . $ QString#QString(85c52e162fed56f9).))
4241 {
4242 SeekConditioncxx . . $ SeekCondition# * seekCondition = new SeekConditioncxx . . $ SeekCondition#();
4243 seekCondition->numbercxx . . $ SeekCondition#number. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4244 seekCondition->maintimecxx . . $ SeekCondition#maintime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4245 seekCondition->periodtimecxx . . $ SeekCondition#periodtime. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4246 seekCondition->periodscxx . . $ SeekCondition#periods. = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4247 seekCondition->blinecxx . . $ SeekCondition#bline. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9)., "EOL"cxx . . $ QString#QString(85c52e162fed56f9).);
4248 recvSeekConditioncxx . . $ NetworkConnection#recvSeekCondition(c6d377b4419439f6).(seekCondition);
4249 }
4250 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("CONFIG_LIST_START"cxx . . $ QString#QString(85c52e162fed56f9).))
4251 {
4252 recvSeekConditioncxx . . $ NetworkConnection#recvSeekCondition(c6d377b4419439f6).(0);
4253 }
4254 else if (line.containscxx . . $ QString#contains(8cce4688c16f48f3).("ENTRY_CANCEL"cxx . . $ QString#QString(85c52e162fed56f9).))
4255 {
4256 recvSeekCancelcxx . . $ NetworkConnection#recvSeekCancel(49f6e7a06ebc5aa8).();
4257 }
4258 else if ((line.containscxx . . $ QString#contains(8cce4688c16f48f3).("ERROR"cxx . . $ QString#QString(85c52e162fed56f9).)) )
4259 {
4260 recvSeekCancelcxx . . $ NetworkConnection#recvSeekCancel(49f6e7a06ebc5aa8).();
4261 ConsoleDispatchcxx . . $ ConsoleDispatch# * console = getConsoleDispatchcxx . . $ NetworkConnection#getConsoleDispatch(5304ece8b917e47).();
4262 if(console)
4263 console->recvTextcxx . . $ ConsoleDispatch#recvText(85c52e162fed56f9).(line.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).().constDatacxx . . $ QByteArray#constData(a9f41ea0e82d88cf).());
4264 }
4265 else if ((line.containscxx . . $ QString#contains(8cce4688c16f48f3).("ENTRY_LIST_START"cxx . . $ QString#QString(85c52e162fed56f9).)) )
4266 {
4267 //emit signal_clearSeekList();
4268 recvSeekPlayercxx . . $ NetworkConnection#recvSeekPlayer(3458fe3960d5051).(""cxx . . $ QString#QString(85c52e162fed56f9)., ""cxx . . $ QString#QString(85c52e162fed56f9).);
4269 }
4270 else if ((line.containscxx . . $ QString#contains(8cce4688c16f48f3).("ENTRY_LIST "cxx . . $ QString#QString(85c52e162fed56f9).)) )
4271 {
4272 //FIXME what does this do??? what does it mean? who am I?
4273 QStringcxx . . $ QString# player = elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 1, " "cxx . . $ QString#QString(85c52e162fed56f9).);
4274 QStringcxx . . $ QString# condition =
4275 elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 7, " "cxx . . $ QString#QString(85c52e162fed56f9).)+cxx . . $ operator+(3d22f08efddf8107)."x"+cxx . . $ operator+(fab9b4f80031f353).elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 7, " "cxx . . $ QString#QString(85c52e162fed56f9).)+cxx . . $ operator+(3d22f08efddf8107)." - " +cxx . . $ operator+(fab9b4f80031f353).
4276 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(int(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 2, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).()/60))+cxx . . $ operator+(3d22f08efddf8107).
4277 " +" +cxx . . $ operator+(fab9b4f80031f353).
4278 QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(int(elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 3, " "cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QString#toInt(d7972accae11ee1f).()/60)).rightJustifiedcxx . . $ QString#rightJustified(63a88914f7cad4ec).(3) +cxx . . $ operator+(3d22f08efddf8107).
4279 "' (" +cxx . . $ operator+(fab9b4f80031f353).
4280 elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 4, " "cxx . . $ QString#QString(85c52e162fed56f9).)+cxx . . $ operator+(3d22f08efddf8107).
4281 ") H -"+cxx . . $ operator+(fab9b4f80031f353).
4282 elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 8, " "cxx . . $ QString#QString(85c52e162fed56f9).) +cxx . . $ operator+(3d22f08efddf8107).
4283 " +" +cxx . . $ operator+(fab9b4f80031f353).
4284 elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(line, 9, " "cxx . . $ QString#QString(85c52e162fed56f9).);
4285
4286 recvSeekPlayercxx . . $ NetworkConnection#recvSeekPlayer(3458fe3960d5051).(playercxx . . $ QString#QString(132dd6869045752b)., conditioncxx . . $ QString#QString(132dd6869045752b).);
4287 }
4288 }
4289
4290 // IGS review protocol
4291 // 56 CREATE 107
4292 // 56 DATA 107
4293 // 56 OWNER 107 eb5 3k
4294 // 56 BOARDSIZE 107 19
4295 // 56 OPEN 107 1
4296 // 56 KIBITZ 107 1
4297 // 56 KOMI 107 0.50
4298 // 56 TITLE 107 yfh22-eb5(B) IGS
4299 // 56 SGFNAME 107 yfh22-eb5-09-03-24
4300 // 56 WHITENAME 107 yfh22
4301 // 56 WHITERANK 107 1d?
4302 // 56 BLACKNAME 107 eb5
4303 // 56 BLACKRANK 107 3k
4304 // 56 GAMERESULT 107 B+Resign
4305 // 56 NODE 107 1 0 0 0
4306 // 56 NODE 107 2 1 16 4
4307 // 56 NODE 107 3 2 16 16
4308 // 56 NODE 107 4 1 4 4
4309 // 56 NODE 107 5 2 4 16
4310 // 56 NODE 107 1 0 0 0
4311 // 56 CONTROL 107 eb5
4312 // 56 DATAEND 107
4313 // 56 ERROR That user's client does not support review.
4314 // 56 INVITED_PLAY 58 yfh2test
4315 void IGSConnectioncxx . . $ IGSConnection#::handle_reviewcxx . . $ IGSConnection#handle_review(7df51288a9ebd664).(QStringcxx . . $ QString# line)
4316 {
4317 line =cxx . . $ QString#`operator=`(4f35bf974e7f8568). line.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2).trimmedcxx . . $ QString#trimmed(dca2c5857e9adf82).();
4318 #ifdef FIXME
4319 if (line.contains("CREATE"))
4320 aGame->number = element(line, 1, " ").toInt();
4321 if (line.contains("OWNER"))
4322 aGame->player = element(line, 2, " ");
4323 if (line.contains("BOARDSIZE"))
4324 {
4325 aGame->board_size = element(line, 2, " ").toInt();
4326 memory = aGame->board_size;
4327 }
4328 if (line.contains("KOMI"))
4329 aGame->K = element(line, 2, " ");
4330 if (line.contains("WHITENAME"))
4331 aGame->wname = element(line, 2, " ");
4332 if (line.contains("WHITERANK"))
4333 {
4334 aGame->white_rank = element(line, 2, " ");
4335 fixRankString(&(aGame->white_rank));
4336 aGame->white_rank_score = rankToScore(aGame->white_rank);
4337 }
4338 if (line.contains("BLACKNAME"))
4339 aGame->black_name = element(line, 2, " ");
4340 if (line.contains("BLACKRANK"))
4341 {
4342 aGame->black_rank = element(line, 2, " ");
4343 fixRankString(&(aGame->black_rank));
4344 aGame->black_rank_score = rankToScore(aGame->black_rank);
4345 }
4346 if (line.contains("GAMERESULT"))
4347 {
4348 aGame->res = element(line, 2, " ");
4349 emit signal_gameReview(aGame);
4350 break;
4351 }
4352
4353 if (line.contains("INVITED_PLAY"))
4354 {
4355 emit signal_reviewInvite(element(line, 1, " "), element(line, 2, " "));
4356 break ;
4357 }
4358
4359 if (line.contains("NODE"))
4360 {
4361
4362 StoneColor sc = stoneNone;
4363 int c = element(line, 3, " ").toInt();
4364
4365 if (c==1)
4366 sc = stoneBlack;
4367 else if(c==2)
4368 sc=stoneWhite;
4369
4370
4371 emit signal_reviewNode(element(line, 1, " ").toInt(), element(line, 2, " ").toInt(), sc, element(line, 4, " ", "EOL").toInt() ,element(line, 3, " ").toInt() );
4372 break ;
4373 }
4374 #endif //FIXME
4375 }
4376
4377 QStringcxx . . $ QString# IGSConnectioncxx . . $ IGSConnection#::elementcxx . . $ IGSConnection#element(b18f0c69f8da8728).(const QStringcxx . . $ QString# &line, int index, const QStringcxx . . $ QString# &del1, const QStringcxx . . $ QString# &del2, bool killblanks)
4378 {
4379 int len = line.lengthcxx . . $ QString#length(455f465bc33b4cdf).();
4380 int idx = index;
4381 int i;
4382 QStringcxx . . $ QString# subcxx . . $ QString#QString(ced63f7c635d850d).;
4383
4384 // kill trailing white spaces
4385 while (/*(int)*/ len > 0)
4386 {
4387 if (line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).len-1] <cxx . . $ `operator<`(a468b2f18a3afe8). 33cxx . . $ QChar#QChar(f349c77f591a7878).)
4388 len--;
4389 else
4390 break;
4391 }
4392
4393 // right delimiter given?
4394 if (del2.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).())
4395 {
4396 // ... no right delimiter
4397 // element("a b c", 0, " ") -> "a"
4398 // element(" a b c", 0, " ") -> "a" spaces at the beginning are skipped
4399 // element("a b c", 1, " ") -> "b"
4400 // element(" a b c", 1, " ") -> "b", though two spaces between "a" and "b"
4401
4402 // skip (delimiters) spaces at the beginning
4403 i = 0;
4404 // while (i < len && line[i] == del1)
4405 while (i < len && line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).i] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
4406 i++;
4407
4408 for (; idx != -1 && i < len; i++)
4409 {
4410 // skip multiple (delimiters) spaces before wanted sequence starts
4411 // while (idx > 0 && line[i] == del1 && i < len-1 && line[i+1] == del1)
4412 while (idx > 0 && line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).i] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878). && i < len-1 && line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).i+1] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
4413 i++;
4414
4415 // look for delimiters, maybe more in series
4416 if (line.midcxx . . $ QString#mid(44b7563da18aea72).(i,del1.lengthcxx . . $ QString#length(455f465bc33b4cdf).()) ==cxx . . $ `operator==`(5bc2975d2d751687). del1)
4417 idx--;
4418 else if (idx == 0)
4419 sub +=cxx . . $ QString#`operator+=`(3a2ffbdf8ecc25e2). line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).i];
4420 }
4421 }
4422 else
4423 {
4424 // ... with right delimiter
4425 // element("a b c", 0, " ", " ") -> "b"
4426 // element("(a) (b c)", 0, "(", ")") -> "a"
4427 // element("(a) (b c)", 1, "(", ")") -> "b c"
4428 // element("(a) (b c)", 0, " ", ")") -> "(b c"
4429 // element("(a) (b c)", 1, " ", ")") -> "c"
4430 // element("(a) (b c)", 1, "(", "EOL") -> "b c)"
4431
4432 // skip spaces at the beginning
4433 i = 0;
4434 while (i < len && line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).i] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
4435 i++;
4436
4437 // seek left delimiter
4438 idx++;
4439
4440 for (; idx != -1 && i < len; i++)
4441 {
4442 // skip multiple (delimiters) spaces before wanted sequence starts
4443 // while (idx > 0 && line[i] == del1 && i < len-1 && line[i+1] == del1)
4444 while (idx > 0 && line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).i] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878). && i < len-1 && line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).i+1] ==cxx . . $ `operator==`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
4445 i++;
4446
4447 if ((idx != 0 && line.midcxx . . $ QString#mid(44b7563da18aea72).(i,del1.lengthcxx . . $ QString#length(455f465bc33b4cdf).()) ==cxx . . $ `operator==`(5bc2975d2d751687). del1) ||
4448 (idx == 0 && line.midcxx . . $ QString#mid(44b7563da18aea72).(i,del2.lengthcxx . . $ QString#length(455f465bc33b4cdf).()) ==cxx . . $ `operator==`(5bc2975d2d751687). del2))
4449 {
4450 idx--;
4451 }
4452 else if (idx == 0)
4453 {
4454 // EOL (End Of Line)?
4455 if (del2 ==cxx . . $ `operator==`(5bc2975d2d751687). QStringcxx . . $ QString#QString(85c52e162fed56f9).("EOL"))
4456 {
4457 // copy until end of line
4458 for (int j = i; j < len; j++)
4459 if (!killblanks || line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).j] !=cxx . . $ `operator!=`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
4460 sub +=cxx . . $ QString#`operator+=`(3a2ffbdf8ecc25e2). line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).j];
4461
4462 // leave loop
4463 idx--;
4464 }
4465 else if (!killblanks || line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).i] !=cxx . . $ `operator!=`(a468b2f18a3afe8). ' 'cxx . . $ QChar#QChar(f349c77f591a7878).)
4466 sub +=cxx . . $ QString#`operator+=`(3a2ffbdf8ecc25e2). line[cxx . . $ QString#`operator[]`(13af7ae5a875439e).i];
4467 }
4468 }
4469 }
4470
4471 return subcxx . . $ QString#QString(28715ad661ad3cec).;
4472 }
4473
4474 unsigned int IGSConnectioncxx . . $ IGSConnection#::idleTimeToSecondscxx . . $ IGSConnection#idleTimeToSeconds(9d92bb507a34628c).(QStringcxx . . $ QString# time)
4475 {
4476 QStringcxx . . $ QString# i = timecxx . . $ QString#QString(132dd6869045752b).;
4477 /* I guess its either minutes or seconds here, not both */
4478 if(time.containscxx . . $ QString#contains(8cce4688c16f48f3).("m"cxx . . $ QString#QString(85c52e162fed56f9).))
4479 {
4480 i.replacecxx . . $ QString#replace(612862c8abff0ba5).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("[m*]"cxx . . $ QString#QString(85c52e162fed56f9).), ""cxx . . $ QString#QString(85c52e162fed56f9).);
4481 return (60 * i.toIntcxx . . $ QString#toInt(d7972accae11ee1f).());
4482 }
4483 else
4484 {
4485 i.replacecxx . . $ QString#replace(612862c8abff0ba5).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("s"cxx . . $ QString#QString(85c52e162fed56f9).), ""cxx . . $ QString#QString(85c52e162fed56f9).);
4486 return i.toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
4487 }
4488 /*m1 = time1; m2 = time2;
4489 s1 = time1; s2 = time2;
4490 m1.replace(QRegExp("[m*]"), "");
4491 m2.replace(QRegExp("[m*]"), "");
4492 s1.replace(QRegExp("[*m]"), "");
4493 s1.replace(QRegExp("s"), "");
4494 s2.replace(QRegExp("[*m]"), "");
4495 s2.replace(QRegExp("s"), "");
4496 int seconds1 = (m1.toInt() * 60) + s1.toInt();
4497 int seconds2 = (m2.toInt() * 60) + s2.toInt();*/
4498 }
4499
4500 void IGSConnectioncxx . . $ IGSConnection#::fixRankStringcxx . . $ IGSConnection#fixRankString(ee39f32778c92bb9).(QStringcxx . . $ QString# * rank)
4501 {
4502 if(rank->atcxx . . $ QString#at(13af7ae5a875439e).(rank->lengthcxx . . $ QString#length(455f465bc33b4cdf).() - 1) ==cxx . . $ `operator==`(a468b2f18a3afe8). '*'cxx . . $ QChar#QChar(f349c77f591a7878).)
4503 rank->truncatecxx . . $ QString#truncate(d4f767463ce0a6b3).(rank->lengthcxx . . $ QString#length(455f465bc33b4cdf).() - 1);
4504 else if(*rank ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "NR") {}
4505 #ifdef IGS_OLDRATING //doublecheck WING/LGS FIXME
4506 else
4507 *rank += "?";
4508 #endif //IGS_OLDRATING
4509 }
4510
4511 PlayerListingcxx . . $ PlayerListing# * IGSConnectioncxx . . $ IGSConnection#::getPlayerListingNeverFailcxx . . $ IGSConnection#getPlayerListingNeverFail(38be696f4c5aa948).(QStringcxx . . $ QString# & name)
4512 {
4513 return getDefaultRoomcxx . . $ NetworkConnection#getDefaultRoom(93e93f117be81b18).()->getPlayerListingcxx . . $ Room#getPlayerListing(d3f53ac2de9f0b45).(name);
4514 }