| 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 <QDebug> |
| 23 | #include "room.h"cxx . . $ `<file>/src/network/room.h`/ |
| 24 | #include "listviews.h"cxx . . $ `<file>/src/listviews.h`/ |
| 25 | #include "talk.h"cxx . . $ `<file>/src/network/talk.h`/ |
| 26 | #include "gamedialog.h"cxx . . $ `<file>/src/network/gamedialog.h`/ |
| 27 | #include "defines.h"cxx . . $ `<file>/src/defines.h`/ |
| 28 | #include "connectionwidget.h"cxx . . $ `<file>/src/connectionwidget.h`/ |
| 29 | #include "playergamelistings.h"cxx . . $ `<file>/src/network/playergamelistings.h`/ |
| 30 | #include "boarddispatch.h"cxx . . $ `<file>/src/network/boarddispatch.h`/ //so we can remove observers |
| 31 | #include "networkconnection.h"cxx . . $ `<file>/src/network/networkconnection.h`/ |
| 32 | |
| 33 | #include "ui_connectionwidget.h"cxx . . $ `<file>/build/ui/ui_connectionwidget.h`/ // Contains declaration of Ui::ConnectionWidget, needed in Room::Room, FIXME |
| 34 | |
| 35 | Roomcxx . . $ Room#::Roomcxx . . $ Room#Room(bdf7e61fb2b15626).(NetworkConnectioncxx . . $ NetworkConnection# * c) |
| 36 | { |
| 37 | connectioncxx . . $ Room#connection. = c; // has to be set before the signals are connected. |
| 38 | connectionWidgetcxx . . $ connectionWidget.->roomcxx . . $ ConnectionWidget#room. = this; |
| 39 | |
| 40 | gamesListModelcxx . . $ Room#gamesListModel. = new GamesListModelcxx . . $ GamesListModel#GamesListModel(49f6e7a06ebc5aa8).(); |
| 41 | gamesViewcxx . . $ Room#gamesView. = connectionWidgetcxx . . $ connectionWidget.->uicxx . . $ ConnectionWidget#ui.->gamesViewcxx . . $ Ui_ConnectionWidget#gamesView.; |
| 42 | connectionWidgetcxx . . $ connectionWidget.->gamesListProxyModelcxx . . $ ConnectionWidget#gamesListProxyModel.->setSourceModelcxx . . $ QSortFilterProxyModel#setSourceModel(c6e1f1e42522b780).(gamesListModelcxx . . $ Room#gamesListModel.); |
| 43 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_IDcxx . . $ GC_ID., 40 ); |
| 44 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_WHITENAMEcxx . . $ GC_WHITENAME., 150 ); |
| 45 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_WHITERANKcxx . . $ GC_WHITERANK., 40 ); |
| 46 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_BLACKNAMEcxx . . $ GC_BLACKNAME., 150 ); |
| 47 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_BLACKRANKcxx . . $ GC_BLACKRANK., 40 ); |
| 48 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_MOVEScxx . . $ GC_MOVES., 40 ); |
| 49 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_SIZEcxx . . $ GC_SIZE., 40 ); |
| 50 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_HANDICAPcxx . . $ GC_HANDICAP., 40 ); |
| 51 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_KOMIcxx . . $ GC_KOMI., 40 ); |
| 52 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_BYOMIcxx . . $ GC_BYOMI., 40 ); |
| 53 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_FLAGScxx . . $ GC_FLAGS., 40 ); |
| 54 | gamesViewcxx . . $ Room#gamesView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( GC_OBSERVERScxx . . $ GC_OBSERVERS., 40 ); |
| 55 | |
| 56 | |
| 57 | playerListModelcxx . . $ Room#playerListModel. = new PlayerListModelcxx . . $ PlayerListModel#PlayerListModel(49f6e7a06ebc5aa8).(); |
| 58 | playerViewcxx . . $ Room#playerView. = connectionWidgetcxx . . $ connectionWidget.->uicxx . . $ ConnectionWidget#ui.->playerViewcxx . . $ Ui_ConnectionWidget#playerView.; |
| 59 | connectionWidgetcxx . . $ connectionWidget.->playerListProxyModelcxx . . $ ConnectionWidget#playerListProxyModel.->setSourceModelcxx . . $ QSortFilterProxyModel#setSourceModel(c6e1f1e42522b780).(playerListModelcxx . . $ Room#playerListModel.); |
| 60 | playerViewcxx . . $ Room#playerView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( PC_STATUScxx . . $ PC_STATUS., 40 ); |
| 61 | playerViewcxx . . $ Room#playerView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( PC_NAMEcxx . . $ PC_NAME., 200 ); |
| 62 | playerViewcxx . . $ Room#playerView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( PC_RANKcxx . . $ PC_RANK., 40 ); |
| 63 | playerViewcxx . . $ Room#playerView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( PC_PLAYINGcxx . . $ PC_PLAYING., 40 ); |
| 64 | playerViewcxx . . $ Room#playerView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( PC_OBSERVINGcxx . . $ PC_OBSERVING., 40); |
| 65 | playerViewcxx . . $ Room#playerView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( PC_WINScxx . . $ PC_WINS., 60 ); |
| 66 | playerViewcxx . . $ Room#playerView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( PC_LOSSEScxx . . $ PC_LOSSES., 60 ); |
| 67 | playerViewcxx . . $ Room#playerView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( PC_IDLEcxx . . $ PC_IDLE., 60 ); |
| 68 | playerViewcxx . . $ Room#playerView.->setColumnWidthcxx . . $ QTableView#setColumnWidth(3e454b8ccf442868). ( PC_COUNTRYcxx . . $ PC_COUNTRY., 100 ); |
| 69 | playerViewcxx . . $ Room#playerView.->horizontalHeadercxx . . $ QTableView#horizontalHeader(f0c0fe1a435d30ff).()->setStretchLastSectioncxx . . $ QHeaderView#setStretchLastSection(b45ddcbc8423892c).(true); |
| 70 | //playerView->setColumnWidth ( PC_MATCHPREFS, 200 ); |
| 71 | |
| 72 | connectcxx . . $ QObject#connect(835f87066c895669).(playerViewcxx . . $ Room#playerView., &QTableViewcxx . . $ QTableView#::doubleClickedcxx . . $ QAbstractItemView#doubleClicked(87a6de385263c395)., this, &Roomcxx . . $ Room#::slot_playerOpenTalkcxx . . $ Room#slot_playerOpenTalk(87a6de385263c395).); |
| 73 | connectcxx . . $ QObject#connect(835f87066c895669).(playerViewcxx . . $ Room#playerView., &QTableViewcxx . . $ QTableView#::customContextMenuRequestedcxx . . $ QWidget#customContextMenuRequested(4f9e9534be445c03)., this, &Roomcxx . . $ Room#::slot_showPopupcxx . . $ Room#slot_showPopup(4f9e9534be445c03).); |
| 74 | connectcxx . . $ QObject#connect(835f87066c895669).(gamesViewcxx . . $ Room#gamesView., &QTableViewcxx . . $ QTableView#::doubleClickedcxx . . $ QAbstractItemView#doubleClicked(87a6de385263c395)., this, &Roomcxx . . $ Room#::slot_gamesDoubleClickedcxx . . $ Room#slot_gamesDoubleClicked(87a6de385263c395).); |
| 75 | connectcxx . . $ QObject#connect(835f87066c895669).(gamesViewcxx . . $ Room#gamesView., &QTableViewcxx . . $ QTableView#::customContextMenuRequestedcxx . . $ QWidget#customContextMenuRequested(4f9e9534be445c03)., this, &Roomcxx . . $ Room#::slot_showGamesPopupcxx . . $ Room#slot_showGamesPopup(4f9e9534be445c03).); |
| 76 | connectcxx . . $ QObject#connect(835f87066c895669).(connectionWidgetcxx . . $ connectionWidget.->uicxx . . $ ConnectionWidget#ui.->refreshPlayersButtoncxx . . $ Ui_ConnectionWidget#refreshPlayersButton., &QPushButtoncxx . . $ QPushButton#::pressedcxx . . $ QAbstractButton#pressed(49f6e7a06ebc5aa8)., this, &Roomcxx . . $ Room#::slot_refreshPlayerscxx . . $ Room#slot_refreshPlayers(49f6e7a06ebc5aa8).); |
| 77 | connectcxx . . $ QObject#connect(835f87066c895669).(connectionWidgetcxx . . $ connectionWidget.->uicxx . . $ ConnectionWidget#ui.->refreshGamesButtoncxx . . $ Ui_ConnectionWidget#refreshGamesButton., &QPushButtoncxx . . $ QPushButton#::pressedcxx . . $ QAbstractButton#pressed(49f6e7a06ebc5aa8)., this, &Roomcxx . . $ Room#::slot_refreshGamescxx . . $ Room#slot_refreshGames(49f6e7a06ebc5aa8).); |
| 78 | |
| 79 | playerViewcxx . . $ Room#playerView.->blockSignalscxx . . $ QObject#blockSignals(4264aff4942d46ac).(false); |
| 80 | gamesViewcxx . . $ Room#gamesView.->blockSignalscxx . . $ QObject#blockSignals(4264aff4942d46ac).(false); |
| 81 | |
| 82 | connectcxx . . $ QObject#connect(835f87066c895669).(connectioncxx . . $ Room#connection.,&NetworkConnectioncxx . . $ NetworkConnection#::playerListingReceivedcxx . . $ NetworkConnection#playerListingReceived(122195e397f39e1b)., this, &Roomcxx . . $ Room#::recvPlayerListingcxx . . $ Room#recvPlayerListing(122195e397f39e1b).); |
| 83 | connectcxx . . $ QObject#connect(835f87066c895669).(connectioncxx . . $ Room#connection.,&NetworkConnectioncxx . . $ NetworkConnection#::gameListingReceivedcxx . . $ NetworkConnection#gameListingReceived(9a447f3b9a8a5041)., this, &Roomcxx . . $ Room#::recvGameListingcxx . . $ Room#recvGameListing(9a447f3b9a8a5041).); |
| 84 | |
| 85 | playerscxx . . $ Room#players. = 0; |
| 86 | gamescxx . . $ Room#games. = 0; |
| 87 | |
| 88 | matchActcxx . . $ Room#matchAct. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ Room#tr(75d9f1c324b4579d).("Match"), 0); |
| 89 | statsActcxx . . $ Room#statsAct. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ Room#tr(75d9f1c324b4579d).("Stats"), 0); |
| 90 | talkActcxx . . $ Room#talkAct. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ Room#tr(75d9f1c324b4579d).("Talk"), 0); |
| 91 | removeFriendActcxx . . $ Room#removeFriendAct. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ Room#tr(75d9f1c324b4579d).("Remove from Friends"), 0); |
| 92 | addFriendActcxx . . $ Room#addFriendAct. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ Room#tr(75d9f1c324b4579d).("Add to Friends"), 0); |
| 93 | removeWatchActcxx . . $ Room#removeWatchAct. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ Room#tr(75d9f1c324b4579d).("Remove from Watches"), 0); |
| 94 | addWatchActcxx . . $ Room#addWatchAct. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ Room#tr(75d9f1c324b4579d).("Add to Watches"), 0); |
| 95 | blockActcxx . . $ Room#blockAct. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ Room#tr(75d9f1c324b4579d).("Block"), 0); |
| 96 | |
| 97 | joinObserveActcxx . . $ Room#joinObserveAct. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ Room#tr(75d9f1c324b4579d).("Join and Observe"), 0); |
| 98 | observeOutsideActcxx . . $ Room#observeOutsideAct. = new QActioncxx . . $ QAction#QAction(6b24f83d17022bd9).(trcxx . . $ Room#tr(75d9f1c324b4579d).("Observe Outside"), 0); |
| 99 | } |
| 100 | |
| 101 | Roomcxx . . $ Room#::~cxx . . $ Room#`~Room`(ced63f7c635d850d).Roomcxx . . $ Room#() |
| 102 | { |
| 103 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("Room::~Room()"); |
| 104 | /* blockSignals necessary in qt 4.7 otherwise setModel(0) crashes stupidly */ |
| 105 | playerViewcxx . . $ Room#playerView.->blockSignalscxx . . $ QObject#blockSignals(4264aff4942d46ac).(true); |
| 106 | gamesViewcxx . . $ Room#gamesView.->blockSignalscxx . . $ QObject#blockSignals(4264aff4942d46ac).(true); |
| 107 | connectionWidgetcxx . . $ connectionWidget.->playerListProxyModelcxx . . $ ConnectionWidget#playerListProxyModel.->setSourceModelcxx . . $ QSortFilterProxyModel#setSourceModel(c6e1f1e42522b780).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 108 | connectionWidgetcxx . . $ connectionWidget.->gamesListProxyModelcxx . . $ ConnectionWidget#gamesListProxyModel.->setSourceModelcxx . . $ QSortFilterProxyModel#setSourceModel(c6e1f1e42522b780).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 109 | connectionWidgetcxx . . $ connectionWidget.->roomcxx . . $ ConnectionWidget#room. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 110 | while (! playerListModelcxx . . $ Room#playerListModel.->itemscxx . . $ PlayerListModel#items..isEmptycxx . . $ QList#isEmpty(3482b152b9333168).()) |
| 111 | delete playerListModelcxx . . $ Room#playerListModel.->itemscxx . . $ PlayerListModel#items..takeLastcxx . . $ QList#takeLast(5f357b03ed472e5e).(); |
| 112 | while (! gamesListModelcxx . . $ Room#gamesListModel.->itemscxx . . $ GamesListModel#items..isEmptycxx . . $ QList#isEmpty(3482b152b9333168).()) |
| 113 | delete gamesListModelcxx . . $ Room#gamesListModel.->itemscxx . . $ GamesListModel#items..takeLastcxx . . $ QList#takeLast(5f357b03ed472e5e).(); |
| 114 | delete playerListModelcxx . . $ Room#playerListModel.; |
| 115 | delete gamesListModelcxx . . $ Room#gamesListModel.; |
| 116 | talkMapcxx . . $ Room#talkMap..clearcxx . . $ QMap#clear(49f6e7a06ebc5aa8).(); |
| 117 | } |
| 118 | |
| 119 | void Roomcxx . . $ Room#::onErrorcxx . . $ Room#onError(49f6e7a06ebc5aa8).(void) |
| 120 | { |
| 121 | /* We're going to call this straight from the network dispatch |
| 122 | * until we work out any room UI issues */ |
| 123 | //mainwindow->onConnectionError(); |
| 124 | } |
| 125 | |
| 126 | void Roomcxx . . $ Room#::setConnectioncxx . . $ Room#setConnection(bdf7e61fb2b15626).(NetworkConnectioncxx . . $ NetworkConnection# * c) |
| 127 | { |
| 128 | connectioncxx . . $ Room#connection. = c; |
| 129 | playerListModelcxx . . $ Room#playerListModel.->setAccountNamecxx . . $ PlayerListModel#setAccountName(3520e46b33348bf6).(connectioncxx . . $ Room#connection.->getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).()); |
| 130 | } |
| 131 | |
| 132 | void Roomcxx . . $ Room#::slot_playerOpenTalkcxx . . $ Room#slot_playerOpenTalk(87a6de385263c395).(const QModelIndexcxx . . $ QModelIndex# & index) |
| 133 | { |
| 134 | QModelIndexcxx . . $ QModelIndex# sourceIndex = connectionWidgetcxx . . $ connectionWidget.->playerListProxyModelcxx . . $ ConnectionWidget#playerListProxyModel.->mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(index); |
| 135 | PlayerListingcxx . . $ PlayerListing# * opponent = playerListModelcxx . . $ Room#playerListModel.->playerListingFromIndexcxx . . $ PlayerListModel#playerListingFromIndex(b5acbb67a572cd68).(sourceIndex); |
| 136 | openTalkcxx . . $ Room#openTalk(122195e397f39e1b).(opponent); |
| 137 | } |
| 138 | |
| 139 | void Roomcxx . . $ Room#::slot_showPopupcxx . . $ Room#slot_showPopup(4f9e9534be445c03).(const QPointcxx . . $ QPoint# & iPoint) |
| 140 | { |
| 141 | popup_itemcxx . . $ Room#popup_item. =cxx . . $ QModelIndex#`operator=`(4665afb3441ab1ca). playerViewcxx . . $ Room#playerView.->indexAtcxx . . $ QTableView#indexAt(90c2c28d33eadf46).(iPoint); |
| 142 | if (popup_itemcxx . . $ Room#popup_item. ==cxx . . $ QModelIndex#`operator==`(c401e435e302c57b). QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).()) |
| 143 | return; |
| 144 | popup_itemcxx . . $ Room#popup_item. =cxx . . $ QModelIndex#`operator=`(4665afb3441ab1ca). connectionWidgetcxx . . $ connectionWidget.->playerListProxyModelcxx . . $ ConnectionWidget#playerListProxyModel.->mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(popup_itemcxx . . $ Room#popup_item.); |
| 145 | |
| 146 | /* If we have the listing now, we don't need to look it up |
| 147 | * again later FIXME */ |
| 148 | popup_playerlistingcxx . . $ Room#popup_playerlisting. = playerListModelcxx . . $ Room#playerListModel.->playerListingFromIndexcxx . . $ PlayerListModel#playerListingFromIndex(b5acbb67a572cd68).(popup_itemcxx . . $ Room#popup_item.); |
| 149 | if(popup_playerlistingcxx . . $ Room#popup_playerlisting.->namecxx . . $ PlayerListing#name. ==cxx . . $ `operator==`(5bc2975d2d751687). connectioncxx . . $ Room#connection.->getUsernamecxx . . $ NetworkConnection#getUsername(a2fb7a6ce195d51).()) |
| 150 | return; |
| 151 | |
| 152 | QMenucxx . . $ QMenu# * menu = new QMenucxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).(playerViewcxx . . $ Room#playerView.); |
| 153 | |
| 154 | menu->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(statsActcxx . . $ Room#statsAct.); |
| 155 | menu->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(matchActcxx . . $ Room#matchAct.); |
| 156 | menu->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(talkActcxx . . $ Room#talkAct.); |
| 157 | menu->addSeparatorcxx . . $ QMenu#addSeparator(a590eff9f1ec9a95).(); |
| 158 | matchActcxx . . $ Room#matchAct.->setEnabledcxx . . $ QAction#setEnabled(b45ddcbc8423892c).(!(popup_playerlistingcxx . . $ Room#popup_playerlisting.->infocxx . . $ PlayerListing#info..containscxx . . $ QString#contains(8cce4688c16f48f3).("X"cxx . . $ QString#QString(85c52e162fed56f9).))); |
| 159 | if(popup_playerlistingcxx . . $ Room#popup_playerlisting.->friendWatchTypecxx . . $ PlayerListing#friendWatchType. == PlayerListingcxx . . $ PlayerListing#::friendedcxx . . $ PlayerListing#friended.) |
| 160 | menu->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(removeFriendActcxx . . $ Room#removeFriendAct.); |
| 161 | else |
| 162 | menu->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(addFriendActcxx . . $ Room#addFriendAct.); |
| 163 | if(popup_playerlistingcxx . . $ Room#popup_playerlisting.->friendWatchTypecxx . . $ PlayerListing#friendWatchType. == PlayerListingcxx . . $ PlayerListing#::watchedcxx . . $ PlayerListing#watched.) |
| 164 | menu->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(removeWatchActcxx . . $ Room#removeWatchAct.); |
| 165 | else |
| 166 | menu->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(addWatchActcxx . . $ Room#addWatchAct.); |
| 167 | menu->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(blockActcxx . . $ Room#blockAct.); |
| 168 | |
| 169 | QActioncxx . . $ QAction# * result = menu->execcxx . . $ QMenu#exec(2535b15b88c544d4).(playerViewcxx . . $ Room#playerView.->mapToGlobalcxx . . $ QWidget#mapToGlobal(1aa4d425351b0c99).(iPoint)); |
| 170 | if (result == statsActcxx . . $ Room#statsAct.) |
| 171 | connectioncxx . . $ Room#connection.->sendStatsRequestcxx . . $ NetworkConnection#sendStatsRequest(cac334474c82cf3a).(popup_playerlistingcxx . . $ Room#popup_playerlisting.); |
| 172 | if (result == matchActcxx . . $ Room#matchAct.) |
| 173 | connectioncxx . . $ Room#connection.->sendMatchInvitecxx . . $ NetworkConnection#sendMatchInvite(cac334474c82cf3a).(popup_playerlistingcxx . . $ Room#popup_playerlisting.); |
| 174 | if (result == talkActcxx . . $ Room#talkAct.) |
| 175 | openTalkcxx . . $ Room#openTalk(122195e397f39e1b).(popup_playerlistingcxx . . $ Room#popup_playerlisting.); |
| 176 | if (result == removeFriendActcxx . . $ Room#removeFriendAct.) |
| 177 | connectioncxx . . $ Room#connection.->removeFriendcxx . . $ NetworkConnection#removeFriend(122195e397f39e1b).(popup_playerlistingcxx . . $ Room#popup_playerlisting.); |
| 178 | if (result == addFriendActcxx . . $ Room#addFriendAct.) |
| 179 | connectioncxx . . $ Room#connection.->addFriendcxx . . $ NetworkConnection#addFriend(122195e397f39e1b).(popup_playerlistingcxx . . $ Room#popup_playerlisting.); |
| 180 | if (result == removeWatchActcxx . . $ Room#removeWatchAct.) |
| 181 | connectioncxx . . $ Room#connection.->removeWatchcxx . . $ NetworkConnection#removeWatch(122195e397f39e1b).(popup_playerlistingcxx . . $ Room#popup_playerlisting.); |
| 182 | if (result == addWatchActcxx . . $ Room#addWatchAct.) |
| 183 | connectioncxx . . $ Room#connection.->addWatchcxx . . $ NetworkConnection#addWatch(122195e397f39e1b).(popup_playerlistingcxx . . $ Room#popup_playerlisting.); |
| 184 | if (result == blockActcxx . . $ Room#blockAct.) |
| 185 | connectioncxx . . $ Room#connection.->addBlockcxx . . $ NetworkConnection#addBlock(122195e397f39e1b).(popup_playerlistingcxx . . $ Room#popup_playerlisting.); |
| 186 | menu->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 187 | menu = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 188 | return; |
| 189 | } |
| 190 | |
| 191 | void Roomcxx . . $ Room#::slot_showGamesPopupcxx . . $ Room#slot_showGamesPopup(4f9e9534be445c03).(const QPointcxx . . $ QPoint# & iPoint) |
| 192 | { |
| 193 | if(!connectioncxx . . $ Room#connection.) |
| 194 | return; |
| 195 | popup_itemcxx . . $ Room#popup_item. =cxx . . $ QModelIndex#`operator=`(4665afb3441ab1ca). gamesViewcxx . . $ Room#gamesView.->indexAtcxx . . $ QTableView#indexAt(90c2c28d33eadf46).(iPoint); |
| 196 | if (popup_itemcxx . . $ Room#popup_item. ==cxx . . $ QModelIndex#`operator==`(c401e435e302c57b). QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).()) |
| 197 | return; |
| 198 | popup_itemcxx . . $ Room#popup_item. =cxx . . $ QModelIndex#`operator=`(4665afb3441ab1ca). connectionWidgetcxx . . $ connectionWidget.->gamesListProxyModelcxx . . $ ConnectionWidget#gamesListProxyModel.->mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(popup_itemcxx . . $ Room#popup_item.); |
| 199 | |
| 200 | popup_gamelistingcxx . . $ Room#popup_gamelisting. = gamesListModelcxx . . $ Room#gamesListModel.->gameListingFromIndexcxx . . $ GamesListModel#gameListingFromIndex(bc3c1a338b377edc).(popup_itemcxx . . $ Room#popup_item.); |
| 201 | if(popup_gamelistingcxx . . $ Room#popup_gamelisting.->isRoomOnlycxx . . $ GameListing#isRoomOnly.) |
| 202 | return; |
| 203 | QMenucxx . . $ QMenu# * menu = new QMenucxx . . $ QMenu#QMenu(108f35f7aa7f3cf9).(gamesViewcxx . . $ Room#gamesView.); |
| 204 | menu->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(joinObserveActcxx . . $ Room#joinObserveAct.); |
| 205 | if(connectioncxx . . $ Room#connection.->supportsObserveOutsidecxx . . $ NetworkConnection#supportsObserveOutside(c9857a73d68e59ba).()) |
| 206 | menu->addActioncxx . . $ QWidget#addAction(92b1e80c0a7f1406).(observeOutsideActcxx . . $ Room#observeOutsideAct.); |
| 207 | |
| 208 | QActioncxx . . $ QAction# * result = menu->execcxx . . $ QMenu#exec(2535b15b88c544d4).(gamesViewcxx . . $ Room#gamesView.->mapToGlobalcxx . . $ QWidget#mapToGlobal(1aa4d425351b0c99).(iPoint)); |
| 209 | if (result == observeOutsideActcxx . . $ Room#observeOutsideAct.) |
| 210 | connectioncxx . . $ Room#connection.->sendObserveOutsidecxx . . $ NetworkConnection#sendObserveOutside(963dc8955d49573e).(popup_gamelistingcxx . . $ Room#popup_gamelisting.); |
| 211 | if (result == joinObserveActcxx . . $ Room#joinObserveAct.) |
| 212 | connectioncxx . . $ Room#connection.->sendObservecxx . . $ NetworkConnection#sendObserve(963dc8955d49573e).(popup_gamelistingcxx . . $ Room#popup_gamelisting.); |
| 213 | menu->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 214 | menu = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 215 | return; |
| 216 | } |
| 217 | |
| 218 | void Roomcxx . . $ Room#::openTalkcxx . . $ Room#openTalk(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# *listing) |
| 219 | { |
| 220 | Talkcxx . . $ Talk# * talk = getTalkcxx . . $ Room#getTalk(e709c6e389e35213).(listing); |
| 221 | //connection->sendStatsRequest(opponent); |
| 222 | /* This is really only for ORO, and let's see if it works but... */ |
| 223 | if(talk) |
| 224 | talk->updatePlayerListingcxx . . $ Talk#updatePlayerListing(49f6e7a06ebc5aa8).(); |
| 225 | } |
| 226 | |
| 227 | //observe |
| 228 | void Roomcxx . . $ Room#::slot_gamesDoubleClickedcxx . . $ Room#slot_gamesDoubleClicked(87a6de385263c395).(const QModelIndexcxx . . $ QModelIndex# & index) |
| 229 | { |
| 230 | QModelIndexcxx . . $ QModelIndex# sourceIndex = connectionWidgetcxx . . $ connectionWidget.->gamesListProxyModelcxx . . $ ConnectionWidget#gamesListProxyModel.->mapToSourcecxx . . $ QSortFilterProxyModel#mapToSource(f800c6f2fa4cbe57).(index); |
| 231 | const GameListingcxx . . $ GameListing# * g = gamesListModelcxx . . $ Room#gamesListModel.->gameListingFromIndexcxx . . $ GamesListModel#gameListingFromIndex(bc3c1a338b377edc).(sourceIndex); |
| 232 | if(preferencescxx . . $ preferences..observe_outside_on_doubleclickcxx . . $ _preferences#observe_outside_on_doubleclick. && |
| 233 | connectioncxx . . $ Room#connection.->supportsObserveOutsidecxx . . $ NetworkConnection#supportsObserveOutside(c9857a73d68e59ba).() && !g->isRoomOnlycxx . . $ GameListing#isRoomOnly.) |
| 234 | connectioncxx . . $ Room#connection.->sendObserveOutsidecxx . . $ NetworkConnection#sendObserveOutside(963dc8955d49573e).(g); |
| 235 | else |
| 236 | connectioncxx . . $ Room#connection.->sendObservecxx . . $ NetworkConnection#sendObserve(963dc8955d49573e).(g); |
| 237 | } |
| 238 | |
| 239 | void Roomcxx . . $ Room#::slot_refreshGamescxx . . $ Room#slot_refreshGames(49f6e7a06ebc5aa8).(void) |
| 240 | { |
| 241 | connectioncxx . . $ Room#connection.->sendGamesRequestcxx . . $ NetworkConnection#sendGamesRequest(49f6e7a06ebc5aa8).(); |
| 242 | } |
| 243 | |
| 244 | void Roomcxx . . $ Room#::slot_refreshPlayerscxx . . $ Room#slot_refreshPlayers(49f6e7a06ebc5aa8).(void) |
| 245 | { |
| 246 | connectioncxx . . $ Room#connection.->sendPlayersRequestcxx . . $ NetworkConnection#sendPlayersRequest(49f6e7a06ebc5aa8).(); |
| 247 | } |
| 248 | |
| 249 | void Roomcxx . . $ Room#::recvTogglecxx . . $ Room#recvToggle(918ebd27a9ddbad3).(int type, bool val) |
| 250 | { |
| 251 | connectionWidgetcxx . . $ connectionWidget.->slot_checkboxcxx . . $ ConnectionWidget#slot_checkbox(918ebd27a9ddbad3).(type, val); |
| 252 | } |
| 253 | |
| 254 | PlayerListingcxx . . $ PlayerListing# * Roomcxx . . $ Room#::getPlayerListingcxx . . $ Room#getPlayerListing(d3f53ac2de9f0b45).(const QStringcxx . . $ QString# & name) |
| 255 | { |
| 256 | //qDebug() << "Room::getPlayerListing() called with argument " << name; |
| 257 | PlayerListingcxx . . $ PlayerListing# * result = playerListModelcxx . . $ Room#playerListModel.->getEntrycxx . . $ PlayerListModel#getEntry(d3f53ac2de9f0b45).(name); |
| 258 | if (result == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 259 | { |
| 260 | result = new PlayerListingcxx . . $ PlayerListing#PlayerListing(49f6e7a06ebc5aa8).(); |
| 261 | result->onlinecxx . . $ PlayerListing#online. = true; |
| 262 | result->namecxx . . $ PlayerListing#name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). name; |
| 263 | playerListModelcxx . . $ Room#playerListModel.->insertListingcxx . . $ PlayerListModel#insertListing(122195e397f39e1b).(result); |
| 264 | } |
| 265 | return result; |
| 266 | } |
| 267 | |
| 268 | PlayerListingcxx . . $ PlayerListing# * Roomcxx . . $ Room#::getPlayerListingcxx . . $ Room#getPlayerListing(ad2afa9294843726).(const unsigned int id) |
| 269 | { |
| 270 | PlayerListingcxx . . $ PlayerListing# * result = playerListModelcxx . . $ Room#playerListModel.->getEntrycxx . . $ PlayerListModel#getEntry(ad2afa9294843726).(id); |
| 271 | if (result == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 272 | { |
| 273 | result = new PlayerListingcxx . . $ PlayerListing#PlayerListing(49f6e7a06ebc5aa8).(); |
| 274 | result->onlinecxx . . $ PlayerListing#online. = true; |
| 275 | result->idcxx . . $ PlayerListing#id. = id; |
| 276 | playerListModelcxx . . $ Room#playerListModel.->insertListingcxx . . $ PlayerListModel#insertListing(122195e397f39e1b).(result); |
| 277 | } |
| 278 | return result; |
| 279 | } |
| 280 | |
| 281 | // The reason to have this function seems to date from performance issues around 2011. |
| 282 | /* Here's the deal with this. Tygem has a username and a nickname. |
| 283 | * the nickname is displayed and generally present, but not always. The username |
| 284 | * seems to always be present. At first glance, it makes sense to lookup by |
| 285 | * the username since that seems how the information is stored and it seems |
| 286 | * unique to username. However, if we need to display and sort by the |
| 287 | * nickname, that introduces overhead in the listviews that are slow enough |
| 288 | * already. It might be minor overhead, and it might be really ugly |
| 289 | * to search through all the listings to find a particular username like |
| 290 | * this, but I think its better since its done rarely. I may regret this |
| 291 | * and change it later. */ |
| 292 | /* FIXME don't we usually say "from" instead of "by" change this */ |
| 293 | PlayerListingcxx . . $ PlayerListing# * Roomcxx . . $ Room#::getPlayerListingByNotNicknamecxx . . $ Room#getPlayerListingByNotNickname(d3f53ac2de9f0b45).(const QStringcxx . . $ QString# & notnickname) |
| 294 | { |
| 295 | PlayerListingcxx . . $ PlayerListing# * result = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 296 | /* It is illogical to try to look up things by username first and by "notnickname" second |
| 297 | * in this function, but this apparently has some historical reason that I am unaware of. */ |
| 298 | if (result == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 299 | result = playerListModelcxx . . $ Room#playerListModel.->getEntrycxx . . $ PlayerListModel#getEntry(d3f53ac2de9f0b45).(notnickname); |
| 300 | if (result == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 301 | playerListModelcxx . . $ Room#playerListModel.->getPlayerFromNotNickNamecxx . . $ PlayerListModel#getPlayerFromNotNickName(d3f53ac2de9f0b45).(notnickname); |
| 302 | if (result == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 303 | { |
| 304 | result = new PlayerListingcxx . . $ PlayerListing#PlayerListing(49f6e7a06ebc5aa8).(); |
| 305 | result->onlinecxx . . $ PlayerListing#online. = true; |
| 306 | result->notnicknamecxx . . $ PlayerListing#notnickname. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). notnickname; |
| 307 | playerListModelcxx . . $ Room#playerListModel.->insertListingcxx . . $ PlayerListModel#insertListing(122195e397f39e1b).(result); |
| 308 | } |
| 309 | return result; |
| 310 | } |
| 311 | |
| 312 | GameListingcxx . . $ GameListing# * Roomcxx . . $ Room#::getGameListingcxx . . $ Room#getGameListing(d402167d8f57cf00).(unsigned int key) |
| 313 | { |
| 314 | GameListingcxx . . $ GameListing# * result = gamesListModelcxx . . $ Room#gamesListModel.->getEntrycxx . . $ GamesListModel#getEntry(d402167d8f57cf00).(key); |
| 315 | if (result == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 316 | { |
| 317 | result = new GameListingcxx . . $ GameListing#GameListing(49f6e7a06ebc5aa8).(); |
| 318 | result->numbercxx . . $ GameListing#number. = key; |
| 319 | gamesListModelcxx . . $ Room#gamesListModel.->insertListingcxx . . $ GamesListModel#insertListing(9a447f3b9a8a5041).(result); |
| 320 | } |
| 321 | return result; |
| 322 | } |
| 323 | |
| 324 | /* Called from getNewEntry in BoardDispatchRegistry in networkconnection.cpp */ |
| 325 | class BoardDispatchcxx . . $ BoardDispatch# * Roomcxx . . $ Room#::getNewBoardDispatchcxx . . $ Room#getNewBoardDispatch(f34f0704202202).(unsigned int key) |
| 326 | { |
| 327 | /* Oro might pass a game code rather than a number here. But |
| 328 | * the listings sometimes only have numbers. We need to |
| 329 | * look up in game stuff like moves and results by game code. |
| 330 | * we don't have the number there. But this means always |
| 331 | * passing game codes to this, but then we can't use getGameListing |
| 332 | * initially. Even if we use the number on the initial board get/create |
| 333 | * and the game code thereafter, assuming there aren't collisions in |
| 334 | * the id spaces, we still have to alter this to be aware of the |
| 335 | * ORO protocol. Its a fucking mess. I think we better just store |
| 336 | * everything by the key and have a separate lookup, code to key */ |
| 337 | GameListingcxx . . $ GameListing# * listing = getGameListingcxx . . $ Room#getGameListing(d402167d8f57cf00).(key); |
| 338 | return new BoardDispatchcxx . . $ BoardDispatch#BoardDispatch(6099f5785a5456d1).(connectioncxx . . $ Room#connection., listing); |
| 339 | } |
| 340 | |
| 341 | void Roomcxx . . $ Room#::recvPlayerListingcxx . . $ Room#recvPlayerListing(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# *player) |
| 342 | { |
| 343 | playerListModelcxx . . $ Room#playerListModel.->updateEntrycxx . . $ PlayerListModel#updateEntry(e0d5f17158edcac4).(player); |
| 344 | |
| 345 | if(!player->onlinecxx . . $ PlayerListing#online.) |
| 346 | { |
| 347 | if(player->playingcxx . . $ PlayerListing#playing.) |
| 348 | { |
| 349 | /* FIXME, something should clear this when games end */ |
| 350 | GameListingcxx . . $ GameListing# * g = getGameListingcxx . . $ Room#getGameListing(d402167d8f57cf00).(player->playingcxx . . $ PlayerListing#playing.); |
| 351 | if(g->blackcxx . . $ GameListing#black. == player) |
| 352 | { |
| 353 | g->blackcxx . . $ GameListing#black. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 354 | g->_black_namecxx . . $ GameListing#_black_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). player->namecxx . . $ PlayerListing#name.; |
| 355 | g->_black_rankcxx . . $ GameListing#_black_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). player->rankcxx . . $ PlayerListing#rank.; |
| 356 | } |
| 357 | else if(g->whitecxx . . $ GameListing#white. == player) |
| 358 | { |
| 359 | g->whitecxx . . $ GameListing#white. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 360 | g->_white_namecxx . . $ GameListing#_white_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). player->namecxx . . $ PlayerListing#name.; |
| 361 | g->_white_rankcxx . . $ GameListing#_white_rank. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). player->rankcxx . . $ PlayerListing#rank.; |
| 362 | } |
| 363 | } |
| 364 | if(player->observingcxx . . $ PlayerListing#observing.) |
| 365 | { |
| 366 | /* FIXME remove this check, room_list should be sufficient */ |
| 367 | /* FIXME, something should clear this when games end */ |
| 368 | BoardDispatchcxx . . $ BoardDispatch# * b = connectioncxx . . $ Room#connection.->getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(player->observingcxx . . $ PlayerListing#observing.); |
| 369 | if(b) |
| 370 | { |
| 371 | b->recvObservercxx . . $ BoardDispatch#recvObserver(fcd883ebbd0934ee).(player, false); |
| 372 | } |
| 373 | if(player->dialog_openedcxx . . $ PlayerListing#dialog_opened.) |
| 374 | closeTalkcxx . . $ Room#closeTalk(cac334474c82cf3a).(player); |
| 375 | } |
| 376 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<unsigned short>::iteratorcxx . . $ std/vector#iterator# room_listit = player->room_listcxx . . $ PlayerListing#room_list..begincxx . . $ std/vector#begin(55a6de06420d4903).(); |
| 377 | while(room_listit !=cxx . . $ __gnu_cxx/`operator!=`(30ee64f2df4eef8b). player->room_listcxx . . $ PlayerListing#room_list..endcxx . . $ std/vector#end(55a6de06420d4903).()) |
| 378 | { |
| 379 | BoardDispatchcxx . . $ BoardDispatch# * boarddispatch = connectioncxx . . $ Room#connection.->getIfBoardDispatchcxx . . $ NetworkConnection#getIfBoardDispatch(f34f0704202202).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(f9c37c6e427d43d6).room_listit); |
| 380 | if(boarddispatch) |
| 381 | boarddispatch->recvObservercxx . . $ BoardDispatch#recvObserver(fcd883ebbd0934ee).(player, false); |
| 382 | else |
| 383 | player->room_listcxx . . $ PlayerListing#room_list..erasecxx . . $ std/vector#erase(351407f384f345bc).(room_listitcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(459a7e7b9fbe7640).); |
| 384 | room_listit =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(f6cfb6c9d983a29e). player->room_listcxx . . $ PlayerListing#room_list..begincxx . . $ std/vector#begin(55a6de06420d4903).(); |
| 385 | } |
| 386 | if(player->friendWatchTypecxx . . $ PlayerListing#friendWatchType. != PlayerListingcxx . . $ PlayerListing#::nonecxx . . $ PlayerListing#none.) |
| 387 | connectioncxx . . $ Room#connection.->getAndSetFriendWatchTypecxx . . $ NetworkConnection#getAndSetFriendWatchType(122195e397f39e1b).(player); //removes |
| 388 | } |
| 389 | |
| 390 | if(player->onlinecxx . . $ PlayerListing#online.) |
| 391 | connectioncxx . . $ Room#connection.->getAndSetFriendWatchTypecxx . . $ NetworkConnection#getAndSetFriendWatchType(122195e397f39e1b).(player); |
| 392 | |
| 393 | if(player->onlinecxx . . $ PlayerListing#online. && player->dialog_openedcxx . . $ PlayerListing#dialog_opened.) |
| 394 | { |
| 395 | Talkcxx . . $ Talk# * t = getIfTalkcxx . . $ Room#getIfTalk(b72f705c6951e6b6).(player); |
| 396 | if(t) |
| 397 | t->updatePlayerListingcxx . . $ Talk#updatePlayerListing(49f6e7a06ebc5aa8).(); |
| 398 | else |
| 399 | qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!("dialog_opened flag set but no talk dialog"); |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | void Roomcxx . . $ Room#::recvGameListingcxx . . $ Room#recvGameListing(9a447f3b9a8a5041).(GameListingcxx . . $ GameListing# * game) |
| 404 | { |
| 405 | gamesListModelcxx . . $ Room#gamesListModel.->updateListingcxx . . $ GamesListModel#updateListing(9a447f3b9a8a5041).(game); |
| 406 | /* This WAS iffy, we WERE using the other ID registry's |
| 407 | * existence to indicate an ORO connection in order |
| 408 | * to use a different key. Ugly. Once this works, |
| 409 | * we need to find a way to hide this within the |
| 410 | * connection. It shouldn't be running around here */ |
| 411 | /* FIXME, turns out that game_number is better for listings |
| 412 | * even if we need the code for joining, etc. Its unique |
| 413 | * anyway, so who cares */ |
| 414 | //if(playerListingIDRegistry) |
| 415 | // key = game->game_code; |
| 416 | //else |
| 417 | |
| 418 | if(game->runningcxx . . $ GameListing#running.) |
| 419 | { |
| 420 | connectioncxx . . $ Room#connection.->checkGameWatchedcxx . . $ NetworkConnection#checkGameWatched(963dc8955d49573e).(game); |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | Talkcxx . . $ Talk# * Roomcxx . . $ Room#::getTalkcxx . . $ Room#getTalk(e709c6e389e35213).(PlayerListingcxx . . $ PlayerListing# * opponent) |
| 425 | { |
| 426 | Talkcxx . . $ Talk# * result = getIfTalkcxx . . $ Room#getIfTalk(b72f705c6951e6b6).(opponent); |
| 427 | if (result == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 428 | { |
| 429 | // Create if it does not exist |
| 430 | result = new Talkcxx . . $ Talk#Talk(77742c7bccc24af4).(connectioncxx . . $ Room#connection., opponent, this); |
| 431 | /* Here's how the talk stuff works for future reference. FIXME. |
| 432 | * double clicking on a name or typing a console command (maybe) opens |
| 433 | * a talk dialog through the room which also, at that time, might request |
| 434 | * stats from the network connection. We also notify |
| 435 | * the mainwindow to add the new dialog to the list of talk dialogs */ |
| 436 | connectionWidgetcxx . . $ connectionWidget.->talkOpenedcxx . . $ ConnectionWidget#talkOpened(8355d8551324cb3e).(result); |
| 437 | talkMapcxx . . $ Room#talkMap..insertcxx . . $ QMap#insert(929a1ed410fe8423).(opponent, result); |
| 438 | } |
| 439 | return result; |
| 440 | } |
| 441 | |
| 442 | Talkcxx . . $ Talk# * Roomcxx . . $ Room#::getIfTalkcxx . . $ Room#getIfTalk(b72f705c6951e6b6).(const PlayerListingcxx . . $ PlayerListing# * opponent) |
| 443 | { |
| 444 | QMapcxx . . $ QMap# <const PlayerListing *, Talk *>::const_iteratorcxx . . $ QMap#const_iterator# i = talkMapcxx . . $ QMap#const_iterator#const_iterator(fad78f9efe814c03)..findcxx . . $ QMap#find(9e2276816f28e801).(opponent); |
| 445 | if(i ==cxx . . $ QMap#const_iterator#`operator==`(afb29c289d8ce2db). talkMapcxx . . $ QMap#const_iterator#const_iterator(fad78f9efe814c03)..endcxx . . $ QMap#end(2d49d7eeb2586d1c).()) |
| 446 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 447 | else |
| 448 | return i.valuecxx . . $ QMap#const_iterator#value(bdbd05d619d62250).(); |
| 449 | } |
| 450 | |
| 451 | void Roomcxx . . $ Room#::closeTalkcxx . . $ Room#closeTalk(cac334474c82cf3a).(const PlayerListingcxx . . $ PlayerListing# * opponent) |
| 452 | { |
| 453 | QMapcxx . . $ QMap# <const PlayerListing *, Talk *>::iteratorcxx . . $ QMap#iterator# i = talkMapcxx . . $ Room#talkMap..findcxx . . $ QMap#find(9e2276816f28e801).(opponent); |
| 454 | if(i ==cxx . . $ QMap#iterator#`operator==`(8a5a4c9a0d42c534). talkMapcxx . . $ Room#talkMap..endcxx . . $ QMap#end(2d49d7eeb2586d1c).()) |
| 455 | return; |
| 456 | |
| 457 | i.valuecxx . . $ QMap#iterator#value(51f62fb05f27f6a2).()->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 458 | talkMapcxx . . $ Room#talkMap..erasecxx . . $ QMap#erase(bbdfa0de74344179).(i); |
| 459 | } |