| 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 | |
| 23 | #include <QtCore> |
| 24 | #include "matchnegotiationstate.h"cxx . . $ `<file>/src/network/matchnegotiationstate.h`/ |
| 25 | #include "messages.h"cxx . . $ `<file>/src/network/messages.h`/ |
| 26 | #include "gamedata.h"cxx . . $ `<file>/src/gamedata.h`/ |
| 27 | |
| 28 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::newMatchAllowedcxx . . $ MatchNegotiationState#newMatchAllowed(c9857a73d68e59ba).(void) |
| 29 | { |
| 30 | if(statecxx . . $ MatchNegotiationState#state. == MSNONEcxx . . $ MatchNegotiationState#MSNONE.) |
| 31 | return true; |
| 32 | return false; |
| 33 | } |
| 34 | |
| 35 | //adjourned rematch |
| 36 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::setupRematchAdjournedcxx . . $ MatchNegotiationState#setupRematchAdjourned(6f89333d9b9322ae).(unsigned short id, QStringcxx . . $ QString# opponent_name) |
| 37 | { |
| 38 | game_numbercxx . . $ MatchNegotiationState#game_number. = id; |
| 39 | opponentcxx . . $ MatchNegotiationState#opponent. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). opponent_name; |
| 40 | statecxx . . $ MatchNegotiationState#state. = MSREMATCHADJOURNEDcxx . . $ MatchNegotiationState#MSREMATCHADJOURNED.; |
| 41 | } |
| 42 | |
| 43 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::canEnterRematchAdjournedcxx . . $ MatchNegotiationState#canEnterRematchAdjourned(c9857a73d68e59ba).(void) |
| 44 | { |
| 45 | if(statecxx . . $ MatchNegotiationState#state. == MSREMATCHADJOURNEDcxx . . $ MatchNegotiationState#MSREMATCHADJOURNED.) |
| 46 | return true; |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::inGamecxx . . $ MatchNegotiationState#inGame(c9857a73d68e59ba).(void) |
| 51 | { |
| 52 | if(statecxx . . $ MatchNegotiationState#state. == MSSTARTMATCHcxx . . $ MatchNegotiationState#MSSTARTMATCH. || statecxx . . $ MatchNegotiationState#state. == MSONGOINGMATCHcxx . . $ MatchNegotiationState#MSONGOINGMATCH.) |
| 53 | return true; |
| 54 | return false; |
| 55 | } |
| 56 | |
| 57 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::isOurGamecxx . . $ MatchNegotiationState#isOurGame(3c978dac0e5ee2ad).(unsigned short id) |
| 58 | { |
| 59 | if(id == 0) |
| 60 | return false; |
| 61 | if(id == game_numbercxx . . $ MatchNegotiationState#game_number.) |
| 62 | return true; |
| 63 | return false; |
| 64 | } |
| 65 | |
| 66 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::sentMatchInvitecxx . . $ MatchNegotiationState#sentMatchInvite(c9857a73d68e59ba).(void) |
| 67 | { |
| 68 | if(statecxx . . $ MatchNegotiationState#state. == MSINVITEcxx . . $ MatchNegotiationState#MSINVITE.) |
| 69 | return true; |
| 70 | return false; |
| 71 | } |
| 72 | |
| 73 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::sentMatchOfferPendingcxx . . $ MatchNegotiationState#sentMatchOfferPending(c9857a73d68e59ba).(void) |
| 74 | { |
| 75 | if(statecxx . . $ MatchNegotiationState#state. == MSMATCHOFFERPENDINGcxx . . $ MatchNegotiationState#MSMATCHOFFERPENDING.) |
| 76 | return true; |
| 77 | return false; |
| 78 | } |
| 79 | |
| 80 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::justCreatedRoomcxx . . $ MatchNegotiationState#justCreatedRoom(c9857a73d68e59ba).(void) |
| 81 | { |
| 82 | if(statecxx . . $ MatchNegotiationState#state. == MSCREATEDROOMcxx . . $ MatchNegotiationState#MSCREATEDROOM.) |
| 83 | return true; |
| 84 | return false; |
| 85 | } |
| 86 | |
| 87 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::waitingForRoomNumbercxx . . $ MatchNegotiationState#waitingForRoomNumber(c9857a73d68e59ba).(void) |
| 88 | { |
| 89 | if(statecxx . . $ MatchNegotiationState#state. == MSACCEPTINVITEcxx . . $ MatchNegotiationState#MSACCEPTINVITE.) |
| 90 | return true; |
| 91 | return false; |
| 92 | } |
| 93 | |
| 94 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::waitingForMatchOffercxx . . $ MatchNegotiationState#waitingForMatchOffer(c9857a73d68e59ba).(void) |
| 95 | { |
| 96 | if(statecxx . . $ MatchNegotiationState#state. == MSJOINEDROOMcxx . . $ MatchNegotiationState#MSJOINEDROOM.) |
| 97 | return true; |
| 98 | return false; |
| 99 | } |
| 100 | |
| 101 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::sentMatchOffercxx . . $ MatchNegotiationState#sentMatchOffer(c9857a73d68e59ba).(void) |
| 102 | { |
| 103 | if(statecxx . . $ MatchNegotiationState#state.== MSMATCHOFFERcxx . . $ MatchNegotiationState#MSMATCHOFFER. || statecxx . . $ MatchNegotiationState#state. == MSMATCHMODIFYcxx . . $ MatchNegotiationState#MSMATCHMODIFY.) //doublecheck MODIFY fixme |
| 104 | return true; |
| 105 | return false; |
| 106 | } |
| 107 | |
| 108 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::startMatchAcceptablecxx . . $ MatchNegotiationState#startMatchAcceptable(c9857a73d68e59ba).(void) |
| 109 | { |
| 110 | if(statecxx . . $ MatchNegotiationState#state. == MSMATCHACCEPTcxx . . $ MatchNegotiationState#MSMATCHACCEPT. || statecxx . . $ MatchNegotiationState#state. == MSMATCHFINISHEDcxx . . $ MatchNegotiationState#MSMATCHFINISHED. || statecxx . . $ MatchNegotiationState#state. == MSSENTADJOURNRESUMEcxx . . $ MatchNegotiationState#MSSENTADJOURNRESUME.) |
| 111 | return true; |
| 112 | return false; |
| 113 | } |
| 114 | |
| 115 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::isOngoingMatchcxx . . $ MatchNegotiationState#isOngoingMatch(3c978dac0e5ee2ad).(unsigned short id) |
| 116 | { |
| 117 | if(!isOurGamecxx . . $ MatchNegotiationState#isOurGame(3c978dac0e5ee2ad).(id)) |
| 118 | return false; |
| 119 | if(statecxx . . $ MatchNegotiationState#state. != MSONGOINGMATCHcxx . . $ MatchNegotiationState#MSONGOINGMATCH.) |
| 120 | return false; |
| 121 | return true; |
| 122 | } |
| 123 | |
| 124 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::isOngoingMatchcxx . . $ MatchNegotiationState#isOngoingMatch(c9857a73d68e59ba).(void) |
| 125 | { |
| 126 | if(statecxx . . $ MatchNegotiationState#state. == MSONGOINGMATCHcxx . . $ MatchNegotiationState#MSONGOINGMATCH.) |
| 127 | return true; |
| 128 | return false; |
| 129 | } |
| 130 | |
| 131 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::sentCreateRoomcxx . . $ MatchNegotiationState#sentCreateRoom(c9857a73d68e59ba).(void) |
| 132 | { |
| 133 | if(statecxx . . $ MatchNegotiationState#state. == MSSENTCREATEROOMcxx . . $ MatchNegotiationState#MSSENTCREATEROOM.) |
| 134 | return true; |
| 135 | return false; |
| 136 | } |
| 137 | |
| 138 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::twoPassescxx . . $ MatchNegotiationState#twoPasses(c9857a73d68e59ba).(void) |
| 139 | { |
| 140 | if(statecxx . . $ MatchNegotiationState#state. == MSTWOPASScxx . . $ MatchNegotiationState#MSTWOPASS.) |
| 141 | return true; |
| 142 | return false; |
| 143 | } |
| 144 | |
| 145 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::sentDoneCountingcxx . . $ MatchNegotiationState#sentDoneCounting(c9857a73d68e59ba).(void) |
| 146 | { |
| 147 | if(statecxx . . $ MatchNegotiationState#state. == MSSENTDONECOUNTINGcxx . . $ MatchNegotiationState#MSSENTDONECOUNTING.) |
| 148 | return true; |
| 149 | return false; |
| 150 | } |
| 151 | |
| 152 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::receivedDoneCountingcxx . . $ MatchNegotiationState#receivedDoneCounting(c9857a73d68e59ba).(void) |
| 153 | { |
| 154 | if(statecxx . . $ MatchNegotiationState#state. == MSRECEIVEDDONECOUNTINGcxx . . $ MatchNegotiationState#MSRECEIVEDDONECOUNTING.) |
| 155 | return true; |
| 156 | return false; |
| 157 | } |
| 158 | |
| 159 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::countingcxx . . $ MatchNegotiationState#counting(c9857a73d68e59ba).(void) |
| 160 | { |
| 161 | if(statecxx . . $ MatchNegotiationState#state. == MSCOUNTINGcxx . . $ MatchNegotiationState#MSCOUNTING.) |
| 162 | return true; |
| 163 | return false; |
| 164 | } |
| 165 | |
| 166 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::doneCountingcxx . . $ MatchNegotiationState#doneCounting(c9857a73d68e59ba).(void) |
| 167 | { |
| 168 | if(statecxx . . $ MatchNegotiationState#state. == MSDONECOUNTINGcxx . . $ MatchNegotiationState#MSDONECOUNTING.) |
| 169 | return true; |
| 170 | return false; |
| 171 | } |
| 172 | |
| 173 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::sentRematchcxx . . $ MatchNegotiationState#sentRematch(c9857a73d68e59ba).(void) |
| 174 | { |
| 175 | if(statecxx . . $ MatchNegotiationState#state. == MSSENTREMATCHcxx . . $ MatchNegotiationState#MSSENTREMATCH.) |
| 176 | return true; |
| 177 | return false; |
| 178 | } |
| 179 | |
| 180 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::sentRematchAcceptcxx . . $ MatchNegotiationState#sentRematchAccept(c9857a73d68e59ba).(void) |
| 181 | { |
| 182 | if(statecxx . . $ MatchNegotiationState#state. == MSSENTREMATCHACCEPTcxx . . $ MatchNegotiationState#MSSENTREMATCHACCEPT.) |
| 183 | return true; |
| 184 | return false; |
| 185 | } |
| 186 | |
| 187 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::sentAdjournResumecxx . . $ MatchNegotiationState#sentAdjournResume(c9857a73d68e59ba).(void) |
| 188 | { |
| 189 | if(statecxx . . $ MatchNegotiationState#state. == MSSENTADJOURNRESUMEcxx . . $ MatchNegotiationState#MSSENTADJOURNRESUME.) |
| 190 | return true; |
| 191 | return false; |
| 192 | } |
| 193 | |
| 194 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::opponentDisconnectedcxx . . $ MatchNegotiationState#opponentDisconnected(c9857a73d68e59ba).(void) |
| 195 | { |
| 196 | if(statecxx . . $ MatchNegotiationState#state. == MSOPPONENTDISCONNECTcxx . . $ MatchNegotiationState#MSOPPONENTDISCONNECT.) |
| 197 | return true; |
| 198 | return false; |
| 199 | } |
| 200 | |
| 201 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::opponentRejoiningcxx . . $ MatchNegotiationState#opponentRejoining(c9857a73d68e59ba).(void) |
| 202 | { |
| 203 | if(statecxx . . $ MatchNegotiationState#state. == MSOPPONENTREJOININGcxx . . $ MatchNegotiationState#MSOPPONENTREJOINING.) |
| 204 | return true; |
| 205 | return false; |
| 206 | } |
| 207 | |
| 208 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::resetcxx . . $ MatchNegotiationState#reset(49f6e7a06ebc5aa8).(void) |
| 209 | { |
| 210 | playercxx . . $ MatchNegotiationState#player. = 0; |
| 211 | game_numbercxx . . $ MatchNegotiationState#game_number. = 0; |
| 212 | opponentcxx . . $ MatchNegotiationState#opponent. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(ced63f7c635d850d).(); |
| 213 | statecxx . . $ MatchNegotiationState#state. = MSNONEcxx . . $ MatchNegotiationState#MSNONE.; |
| 214 | } |
| 215 | |
| 216 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::sendMatchInvitecxx . . $ MatchNegotiationState#sendMatchInvite(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# * p) |
| 217 | { |
| 218 | playercxx . . $ MatchNegotiationState#player. = p; |
| 219 | statecxx . . $ MatchNegotiationState#state. = MSINVITEcxx . . $ MatchNegotiationState#MSINVITE.; |
| 220 | } |
| 221 | |
| 222 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::sendMatchAcceptcxx . . $ MatchNegotiationState#sendMatchAccept(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# * p) |
| 223 | { |
| 224 | playercxx . . $ MatchNegotiationState#player. = p; |
| 225 | statecxx . . $ MatchNegotiationState#state. = MSACCEPTINVITEcxx . . $ MatchNegotiationState#MSACCEPTINVITE.; |
| 226 | } |
| 227 | |
| 228 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::sendMatchOfferPendingcxx . . $ MatchNegotiationState#sendMatchOfferPending(49f6e7a06ebc5aa8).(void) |
| 229 | { |
| 230 | statecxx . . $ MatchNegotiationState#state. = MSMATCHOFFERPENDINGcxx . . $ MatchNegotiationState#MSMATCHOFFERPENDING.; |
| 231 | } |
| 232 | |
| 233 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::sendCreateRoomcxx . . $ MatchNegotiationState#sendCreateRoom(49f6e7a06ebc5aa8).(void) |
| 234 | { |
| 235 | statecxx . . $ MatchNegotiationState#state. = MSSENTCREATEROOMcxx . . $ MatchNegotiationState#MSSENTCREATEROOM.; |
| 236 | } |
| 237 | |
| 238 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::createdRoomcxx . . $ MatchNegotiationState#createdRoom(ed53e3bbd3fa2f69).(unsigned short id) |
| 239 | { |
| 240 | game_numbercxx . . $ MatchNegotiationState#game_number. = id; |
| 241 | statecxx . . $ MatchNegotiationState#state. = MSCREATEDROOMcxx . . $ MatchNegotiationState#MSCREATEDROOM.; |
| 242 | } |
| 243 | |
| 244 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::sendJoinRoomcxx . . $ MatchNegotiationState#sendJoinRoom(ed53e3bbd3fa2f69).(unsigned short id) |
| 245 | { |
| 246 | game_numbercxx . . $ MatchNegotiationState#game_number. = id; |
| 247 | statecxx . . $ MatchNegotiationState#state. = MSJOINEDROOMcxx . . $ MatchNegotiationState#MSJOINEDROOM.; |
| 248 | } |
| 249 | |
| 250 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::offerMatchTermscxx . . $ MatchNegotiationState#offerMatchTerms(969a5d62d7a1bd6e).(MatchRequestcxx . . $ MatchRequest# * mr) |
| 251 | { |
| 252 | statecxx . . $ MatchNegotiationState#state. = MSMATCHOFFERcxx . . $ MatchNegotiationState#MSMATCHOFFER.; |
| 253 | match_requestcxx . . $ MatchNegotiationState#match_request. = new MatchRequestcxx . . $ MatchRequest#(*mr); |
| 254 | } |
| 255 | |
| 256 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::modifyMatchTermscxx . . $ MatchNegotiationState#modifyMatchTerms(969a5d62d7a1bd6e).(MatchRequestcxx . . $ MatchRequest# * mr) |
| 257 | { |
| 258 | statecxx . . $ MatchNegotiationState#state. = MSMATCHMODIFYcxx . . $ MatchNegotiationState#MSMATCHMODIFY.; |
| 259 | match_requestcxx . . $ MatchNegotiationState#match_request. = new MatchRequestcxx . . $ MatchRequest#(*mr); |
| 260 | } |
| 261 | |
| 262 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::acceptMatchTermscxx . . $ MatchNegotiationState#acceptMatchTerms(969a5d62d7a1bd6e).(MatchRequestcxx . . $ MatchRequest# * mr) |
| 263 | { |
| 264 | statecxx . . $ MatchNegotiationState#state. = MSMATCHACCEPTcxx . . $ MatchNegotiationState#MSMATCHACCEPT.; |
| 265 | match_requestcxx . . $ MatchNegotiationState#match_request. = new MatchRequestcxx . . $ MatchRequest#(*mr); |
| 266 | } |
| 267 | |
| 268 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::startMatchcxx . . $ MatchNegotiationState#startMatch(49f6e7a06ebc5aa8).(void) |
| 269 | { |
| 270 | statecxx . . $ MatchNegotiationState#state. = MSONGOINGMATCHcxx . . $ MatchNegotiationState#MSONGOINGMATCH.; |
| 271 | } |
| 272 | |
| 273 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::incrementPassescxx . . $ MatchNegotiationState#incrementPasses(49f6e7a06ebc5aa8).(void) |
| 274 | { |
| 275 | if(statecxx . . $ MatchNegotiationState#state. == MSONGOINGMATCHcxx . . $ MatchNegotiationState#MSONGOINGMATCH.) |
| 276 | statecxx . . $ MatchNegotiationState#state. = MSONEPASScxx . . $ MatchNegotiationState#MSONEPASS.; |
| 277 | else if(statecxx . . $ MatchNegotiationState#state. == MSONEPASScxx . . $ MatchNegotiationState#MSONEPASS.) |
| 278 | statecxx . . $ MatchNegotiationState#state. = MSTWOPASScxx . . $ MatchNegotiationState#MSTWOPASS.; |
| 279 | else if(statecxx . . $ MatchNegotiationState#state. == MSTWOPASScxx . . $ MatchNegotiationState#MSTWOPASS.) |
| 280 | statecxx . . $ MatchNegotiationState#state. = MSTHREEPASScxx . . $ MatchNegotiationState#MSTHREEPASS.; |
| 281 | //error |
| 282 | } |
| 283 | |
| 284 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::enterScoreModecxx . . $ MatchNegotiationState#enterScoreMode(49f6e7a06ebc5aa8).(void) |
| 285 | { |
| 286 | statecxx . . $ MatchNegotiationState#state. = MSCOUNTINGcxx . . $ MatchNegotiationState#MSCOUNTING.; |
| 287 | } |
| 288 | |
| 289 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::sendDoneCountingcxx . . $ MatchNegotiationState#sendDoneCounting(49f6e7a06ebc5aa8).(void) |
| 290 | { |
| 291 | statecxx . . $ MatchNegotiationState#state. = MSSENTDONECOUNTINGcxx . . $ MatchNegotiationState#MSSENTDONECOUNTING.; |
| 292 | } |
| 293 | |
| 294 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::receiveDoneCountingcxx . . $ MatchNegotiationState#receiveDoneCounting(49f6e7a06ebc5aa8).(void) |
| 295 | { |
| 296 | statecxx . . $ MatchNegotiationState#state. = MSRECEIVEDDONECOUNTINGcxx . . $ MatchNegotiationState#MSRECEIVEDDONECOUNTING.; |
| 297 | } |
| 298 | |
| 299 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::setDoneCountingcxx . . $ MatchNegotiationState#setDoneCounting(49f6e7a06ebc5aa8).(void) |
| 300 | { |
| 301 | statecxx . . $ MatchNegotiationState#state. = MSDONECOUNTINGcxx . . $ MatchNegotiationState#MSDONECOUNTING.; |
| 302 | } |
| 303 | |
| 304 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::sendMatchModeRequestcxx . . $ MatchNegotiationState#sendMatchModeRequest(49f6e7a06ebc5aa8).(void) |
| 305 | { |
| 306 | statecxx . . $ MatchNegotiationState#state. = MSMATCHMODEREQUESTcxx . . $ MatchNegotiationState#MSMATCHMODEREQUEST.; |
| 307 | } |
| 308 | |
| 309 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::sendRematchcxx . . $ MatchNegotiationState#sendRematch(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# * p) |
| 310 | { |
| 311 | statecxx . . $ MatchNegotiationState#state. = MSSENTREMATCHcxx . . $ MatchNegotiationState#MSSENTREMATCH.; |
| 312 | playercxx . . $ MatchNegotiationState#player. = p; |
| 313 | } |
| 314 | |
| 315 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::sendRematchAcceptcxx . . $ MatchNegotiationState#sendRematchAccept(49f6e7a06ebc5aa8).(void) |
| 316 | { |
| 317 | statecxx . . $ MatchNegotiationState#state. = MSSENTREMATCHACCEPTcxx . . $ MatchNegotiationState#MSSENTREMATCHACCEPT.; |
| 318 | } |
| 319 | |
| 320 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::opponentDisconnectcxx . . $ MatchNegotiationState#opponentDisconnect(49f6e7a06ebc5aa8).(void) |
| 321 | { |
| 322 | statecxx . . $ MatchNegotiationState#state. = MSOPPONENTDISCONNECTcxx . . $ MatchNegotiationState#MSOPPONENTDISCONNECT.; |
| 323 | } |
| 324 | |
| 325 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::sendAdjournResumecxx . . $ MatchNegotiationState#sendAdjournResume(49f6e7a06ebc5aa8).(void) |
| 326 | { |
| 327 | statecxx . . $ MatchNegotiationState#state. = MSSENTADJOURNRESUMEcxx . . $ MatchNegotiationState#MSSENTADJOURNRESUME.; |
| 328 | } |
| 329 | |
| 330 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::opponentRejoinscxx . . $ MatchNegotiationState#opponentRejoins(49f6e7a06ebc5aa8).(void) |
| 331 | { |
| 332 | statecxx . . $ MatchNegotiationState#state. = MSOPPONENTREJOININGcxx . . $ MatchNegotiationState#MSOPPONENTREJOINING.; |
| 333 | } |
| 334 | |
| 335 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::opponentReconnectcxx . . $ MatchNegotiationState#opponentReconnect(49f6e7a06ebc5aa8).(void) |
| 336 | { |
| 337 | statecxx . . $ MatchNegotiationState#state. = MSONGOINGMATCHcxx . . $ MatchNegotiationState#MSONGOINGMATCH.; //FIXME |
| 338 | } |
| 339 | |
| 340 | void MatchNegotiationStatecxx . . $ MatchNegotiationState#::swapColorscxx . . $ MatchNegotiationState#swapColors(49f6e7a06ebc5aa8).(void) |
| 341 | { |
| 342 | if(match_requestcxx . . $ MatchNegotiationState#match_request.->color_requestcxx . . $ MatchRequest#color_request. == MatchRequestcxx . . $ MatchRequest#::WHITEcxx . . $ MatchRequest#WHITE.) |
| 343 | match_requestcxx . . $ MatchNegotiationState#match_request.->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::BLACKcxx . . $ MatchRequest#BLACK.; |
| 344 | else if(match_requestcxx . . $ MatchNegotiationState#match_request.->color_requestcxx . . $ MatchRequest#color_request. == MatchRequestcxx . . $ MatchRequest#::BLACKcxx . . $ MatchRequest#BLACK.) |
| 345 | match_requestcxx . . $ MatchNegotiationState#match_request.->color_requestcxx . . $ MatchRequest#color_request. = MatchRequestcxx . . $ MatchRequest#::WHITEcxx . . $ MatchRequest#WHITE.; |
| 346 | } |
| 347 | |
| 348 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::verifyPlayercxx . . $ MatchNegotiationState#verifyPlayer(20057ff4c3da74fc).(PlayerListingcxx . . $ PlayerListing# * p) |
| 349 | { |
| 350 | if(p == playercxx . . $ MatchNegotiationState#player.) |
| 351 | return true; |
| 352 | return false; |
| 353 | } |
| 354 | |
| 355 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::verifyMatchRequestcxx . . $ MatchNegotiationState#verifyMatchRequest(4332f687ff4e837).(MatchRequestcxx . . $ MatchRequest# & mr) |
| 356 | { |
| 357 | if(!match_requestcxx . . $ MatchNegotiationState#match_request.) |
| 358 | return false; //shouldn't be called here |
| 359 | if(match_requestcxx . . $ MatchNegotiationState#match_request.->stones_periodscxx . . $ MatchRequest#stones_periods. != mr.stones_periodscxx . . $ MatchRequest#stones_periods. || |
| 360 | match_requestcxx . . $ MatchNegotiationState#match_request.->periodtimecxx . . $ MatchRequest#periodtime. != mr.periodtimecxx . . $ MatchRequest#periodtime. || |
| 361 | match_requestcxx . . $ MatchNegotiationState#match_request.->maintimecxx . . $ MatchRequest#maintime. != mr.maintimecxx . . $ MatchRequest#maintime. || |
| 362 | match_requestcxx . . $ MatchNegotiationState#match_request.->komicxx . . $ MatchRequest#komi. != mr.komicxx . . $ MatchRequest#komi. || |
| 363 | match_requestcxx . . $ MatchNegotiationState#match_request.->timeSystemcxx . . $ MatchRequest#timeSystem. != mr.timeSystemcxx . . $ MatchRequest#timeSystem. || |
| 364 | match_requestcxx . . $ MatchNegotiationState#match_request.->handicapcxx . . $ MatchRequest#handicap. != mr.handicapcxx . . $ MatchRequest#handicap. || |
| 365 | match_requestcxx . . $ MatchNegotiationState#match_request.->color_requestcxx . . $ MatchRequest#color_request. != mr.color_requestcxx . . $ MatchRequest#color_request.) |
| 366 | return false; |
| 367 | return true; |
| 368 | } |
| 369 | |
| 370 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::verifyGameDatacxx . . $ MatchNegotiationState#verifyGameData(14f5f86f6c435b5).(GameDatacxx . . $ GameData# & g) |
| 371 | { |
| 372 | if(!match_requestcxx . . $ MatchNegotiationState#match_request.) |
| 373 | return false; //shouldn't be called here |
| 374 | if(match_requestcxx . . $ MatchNegotiationState#match_request.->stones_periodscxx . . $ MatchRequest#stones_periods. != g.stones_periodscxx . . $ GameData#stones_periods. || |
| 375 | match_requestcxx . . $ MatchNegotiationState#match_request.->periodtimecxx . . $ MatchRequest#periodtime. != g.periodtimecxx . . $ GameData#periodtime. || |
| 376 | match_requestcxx . . $ MatchNegotiationState#match_request.->maintimecxx . . $ MatchRequest#maintime. != g.maintimecxx . . $ GameData#maintime. || |
| 377 | match_requestcxx . . $ MatchNegotiationState#match_request.->komicxx . . $ MatchRequest#komi. != g.komicxx . . $ GameData#komi. || |
| 378 | match_requestcxx . . $ MatchNegotiationState#match_request.->timeSystemcxx . . $ MatchRequest#timeSystem. != g.timeSystemcxx . . $ GameData#timeSystem. || |
| 379 | (match_requestcxx . . $ MatchNegotiationState#match_request.->handicapcxx . . $ MatchRequest#handicap. != g.handicapcxx . . $ GameData#handicap. && (match_requestcxx . . $ MatchNegotiationState#match_request.->handicapcxx . . $ MatchRequest#handicap. != 1 || (g.handicapcxx . . $ GameData#handicap. != 0 && g.handicapcxx . . $ GameData#handicap. != 1))))/* || |
| 380 | match_request->color_request != g.color_request)*/ //FIXME |
| 381 | return false; |
| 382 | return true; |
| 383 | } |
| 384 | |
| 385 | bool MatchNegotiationStatecxx . . $ MatchNegotiationState#::verifyCountDoneMessagecxx . . $ MatchNegotiationState#verifyCountDoneMessage(3c978dac0e5ee2ad).(unsigned short v) |
| 386 | { |
| 387 | if(v == counting_verificationcxx . . $ MatchNegotiationState#counting_verification.) |
| 388 | return true; |
| 389 | return false; |
| 390 | } |