diff --git a/RetroChessPlugin.cpp b/RetroChessPlugin.cpp index 5bd9144..967ba79 100644 --- a/RetroChessPlugin.cpp +++ b/RetroChessPlugin.cpp @@ -32,6 +32,7 @@ #include "gui/RetroChessChatWidgetHolder.h" #include +#include #include #include @@ -90,6 +91,7 @@ RetroChessPlugin::RetroChessPlugin() void RetroChessPlugin::setInterfaces(RsPlugInInterfaces &interfaces) { mPeers = interfaces.mPeers; + mGxsTunnels = interfaces.mGxsTunnels; } /*ConfigPage *RetroChessPlugin::qt_config_page() const @@ -128,6 +130,7 @@ ChatWidgetHolder *RetroChessPlugin::qt_get_chat_widget_holder(ChatWidget *chatWi case ChatWidget::CHATTYPE_UNKNOWN: case ChatWidget::CHATTYPE_LOBBY: case ChatWidget::CHATTYPE_DISTANT: + return new RetroChessChatWidgetHolder(chatWidget, mRetroChessNotify); break; } @@ -136,15 +139,23 @@ ChatWidgetHolder *RetroChessPlugin::qt_get_chat_widget_holder(ChatWidget *chatWi p3Service *RetroChessPlugin::p3_service() const { - if(mRetroChess == NULL) - rsRetroChess = mRetroChess = new p3RetroChess(mPlugInHandler,mRetroChessNotify) ; // , 3600 * 24 * 30 * 6); // 6 Months - - return mRetroChess ; + if(mRetroChess == NULL) + { + // Create the service + rsRetroChess = mRetroChess = new p3RetroChess(mPlugInHandler, mRetroChessNotify); + + // Register it for GXS Tunnels immediately if the interface is available + if (mGxsTunnels) { + mGxsTunnels->registerClientService(RETRO_CHESS_GXS_TUNNEL_SERVICE_ID, mRetroChess); + } + } + return mRetroChess; } void RetroChessPlugin::setPlugInHandler(RsPluginHandler *pgHandler) { - mPlugInHandler = pgHandler; + mPlugInHandler = pgHandler; + // No need to register here if done in p3_service } QIcon *RetroChessPlugin::qt_icon() const diff --git a/RetroChessPlugin.h b/RetroChessPlugin.h index c2e6fee..0b0c0a1 100644 --- a/RetroChessPlugin.h +++ b/RetroChessPlugin.h @@ -26,6 +26,7 @@ /*libretroshare"*/ #include +#include #include "gui/NEMainpage.h" @@ -76,6 +77,8 @@ class RetroChessPlugin: public RsPlugin mutable QIcon *mIcon; mutable MainPage* mainpage ; + RsGxsTunnelService *mGxsTunnels; + RsGxsTunnelService::RsGxsTunnelClientService *mGxsTunnelClient; RetroChessNotify *mRetroChessNotify ; RetroChessGUIHandler *mRetroChessGUIHandler ; }; diff --git a/gui/RetroChessChatWidgetHolder.cpp b/gui/RetroChessChatWidgetHolder.cpp index 29e7b8c..cad590c 100644 --- a/gui/RetroChessChatWidgetHolder.cpp +++ b/gui/RetroChessChatWidgetHolder.cpp @@ -30,6 +30,7 @@ #include "RetroChessChatWidgetHolder.h" +#include #include #include @@ -41,7 +42,6 @@ RetroChessChatWidgetHolder::RetroChessChatWidgetHolder(ChatWidget *chatWidget, R QIcon icon ; icon.addPixmap(QPixmap(IMAGE_RetroChess)) ; - playChessButton = new QToolButton ; playChessButton->setIcon(icon) ; playChessButton->setToolTip(tr("Invite Friend to Chess")); @@ -111,29 +111,37 @@ void RetroChessChatWidgetHolder::chessnotify(RsPeerId from_peer_id) void RetroChessChatWidgetHolder::chessPressed() { - RsPeerId peer_id = mChatWidget->getChatId().toPeerId();//TODO support GXSID - if (rsRetroChess->hasInviteFrom(peer_id)) - { + ChatId chatId = mChatWidget->getChatId(); + if (chatId.isDistantChatId()) { + rsRetroChess->sendGxsInvite(RsGxsId(chatId.toDistantChatId().toStdString())); + } else { + RsPeerId peer_id = chatId.toPeerId(); + + if (rsRetroChess->hasInviteFrom(peer_id)){ + rsRetroChess->acceptedInvite(peer_id); + mRetroChessNotify->notifyChessStart(peer_id); + return; + } - rsRetroChess->acceptedInvite(peer_id); - mRetroChessNotify->notifyChessStart(peer_id); - return; + rsRetroChess->sendInvite(peer_id); - } - rsRetroChess->sendInvite(peer_id); - - QString peerName = QString::fromUtf8(rsPeers->getPeerName(peer_id).c_str()); - mChatWidget->addChatMsg(true, tr("Chess Status"), QDateTime::currentDateTime(), QDateTime::currentDateTime() + QString peerName = QString::fromUtf8(rsPeers->getPeerName(peer_id).c_str()); + mChatWidget->addChatMsg(true, tr("Chess Status"), QDateTime::currentDateTime(), QDateTime::currentDateTime() , tr("You're now inviting %1 to play Chess").arg(peerName), ChatWidget::MSGTYPE_SYSTEM); + } } void RetroChessChatWidgetHolder::chessStart() { - RsPeerId peer_id = mChatWidget->getChatId().toPeerId();//TODO support GXSID - - rsRetroChess->acceptedInvite(peer_id); - mRetroChessNotify->notifyChessStart(peer_id); + ChatId chatId = mChatWidget->getChatId(); + if (chatId.isDistantChatId()) { + rsRetroChess->acceptedInviteGxs(RsGxsId(chatId.toDistantChatId().toStdString())); + } else { + RsPeerId peer_id = chatId.toPeerId(); + rsRetroChess->acceptedInvite(peer_id); + mRetroChessNotify->notifyChessStart(peer_id); + } return; } diff --git a/gui/RetroChessNotify.cpp b/gui/RetroChessNotify.cpp index 8b2fb5a..74ed28d 100644 --- a/gui/RetroChessNotify.cpp +++ b/gui/RetroChessNotify.cpp @@ -51,3 +51,13 @@ void RetroChessNotify::notifyChessInvite(const RsPeerId &peer_id) emit chessInvited(peer_id) ; } + +void RetroChessNotify::notifyChessMoveGxs(const RsGxsId &gxs_id, int col, int row, int count) +{ + emit chessMoveGxs(gxs_id, col, row, count); +} + +void RetroChessNotify::notifyGxsTunnelReady(const RsGxsId &gxs_id) +{ + emit gxsTunnelReady(gxs_id); +} diff --git a/gui/RetroChessNotify.h b/gui/RetroChessNotify.h index 4fdd0fa..e2f70a8 100644 --- a/gui/RetroChessNotify.h +++ b/gui/RetroChessNotify.h @@ -40,6 +40,11 @@ class RetroChessNotify : public QObject void notifyReceivedMsg(const RsPeerId &peer_id, QString str) ; void notifyChessStart(const RsPeerId &peer_id) ; void notifyChessInvite(const RsPeerId &peer_id) ; + /** Notify the UI of a chess move received via a GXS tunnel */ + void notifyChessMoveGxs(const RsGxsId &gxs_id, int col, int row, int count); + + /** Notify the UI that a GXS tunnel is now ready for use */ + void notifyGxsTunnelReady(const RsGxsId &gxs_id); signals: void NeMsgArrived(const RsPeerId &peer_id, QString str) ; // emitted when the peer gets a msg @@ -47,6 +52,9 @@ class RetroChessNotify : public QObject void chessStart(const RsPeerId &peer_id) ; void chessInvited(const RsPeerId &peer_id) ; + void chessMoveGxs(const RsGxsId &gxs_id, int col, int row, int count); + void gxsTunnelReady(const RsGxsId &gxs_id); + public slots: }; diff --git a/gui/chess.cpp b/gui/chess.cpp index 68277e0..e606cba 100644 --- a/gui/chess.cpp +++ b/gui/chess.cpp @@ -26,10 +26,76 @@ #include "gui/common/AvatarDefs.h" #include "../services/p3RetroChess.h" +// NEW: Constructor for Distant GXS Identity +RetroChessWindow::RetroChessWindow(const RsGxsId &gxsId, int player, QWidget *parent) : + QWidget(parent), + m_ui(new Ui::RetroChessWindow), + mGxsId(gxsId), + mIsGxs(true) +{ + QString player_str; + if (player == 1) { + player_str = " (1)"; + } else if (player == 2) { + player_str = " (2)"; + } + + m_ui->setupUi(this); + mPeerId = gxsId.toStdString(); // Use string representation for internal tracking + + m_ui->m_player1_result->hide(); + m_ui->m_player2_result->hide(); + m_ui->m_status_bar->hide(); + + m_flag_finished = 0; // set as unfinish + + //tile = { { NULL } }; + count=0; + turn=1; // white first + max=0; + texp = new int[60]; + + setGeometry(0,0,1370,700); + + // Resolve our own primary GXS ID + std::list ownIds; + rsIdentity->getOwnIds(ownIds); + RsGxsId myGxsId = ownIds.empty() ? RsGxsId() : ownIds.front(); + + if (player) { // local player as black + // Note: For GXS we track identities rather than PeerIds + player_str = " (1)"; + m_localplayer_turn = 0; + + RsIdentityDetails d1, d2; + rsIdentity->getIdDetails(myGxsId, d1); + rsIdentity->getIdDetails(gxsId, d2); + p1name = d1.mNickname; + p2name = d2.mNickname; + } else { // local player as white + player_str = " (2)"; + m_localplayer_turn = 1; + + RsIdentityDetails d1, d2; + rsIdentity->getIdDetails(gxsId, d1); + rsIdentity->getIdDetails(myGxsId, d2); + p1name = d1.mNickname; + p2name = d2.mNickname; + } + + QString title = QString::fromUtf8(p2name.c_str()) + " Playing Chess against " + QString::fromUtf8(p1name.c_str()) + player_str; + + setWindowTitle(title); + initAccessories(); + playerTurnNotice(); + initChessBoard(); +} + RetroChessWindow::RetroChessWindow(std::string peerid, int player, QWidget *parent) : QWidget(parent), m_ui( new Ui::RetroChessWindow() ), - mPeerId(peerid) + mPeerId(peerid), + mIsGxs(false) //ui(new Ui::RetroChessWindow) { m_ui->setupUi( this ); @@ -125,7 +191,11 @@ void RetroChessWindow::initAccessories() void RetroChessWindow::closeEvent(QCloseEvent *event) { // send leave message - rsRetroChess->player_leave(this->mPeerId); + if (mIsGxs) { + rsRetroChess->player_leave_gxs(this->mGxsId); + } else { + rsRetroChess->player_leave(mPeerId); + } QWidget::closeEvent(event); } @@ -998,10 +1068,22 @@ int RetroChessWindow::resultJudge() void RetroChessWindow::showPlayerLeaveMsg() { - std::string player_name = rsPeers->getPeerName( RsPeerId(mPeerId )); - QString status_msg(player_name.c_str()); - status_msg += " has left"; - m_ui->m_status_bar->setText( status_msg ); + QString name; + if (mIsGxs) { + // Resolve GXS nickname + RsIdentityDetails details; + if (rsIdentity->getIdDetails(mGxsId, details)) { + name = QString::fromUtf8(details.mNickname.c_str()); + } else { + name = tr("Distant Friend"); + } + } else { + // Resolve Peer name + name = QString::fromStdString(rsPeers->getPeerName(RsPeerId(mPeerId))); + } + + QString status_msg = name + tr(" has left"); + m_ui->m_status_bar->setText(status_msg); m_ui->m_status_bar->setVisible(true); } diff --git a/gui/chess.h b/gui/chess.h index 6e30272..5576813 100644 --- a/gui/chess.h +++ b/gui/chess.h @@ -27,6 +27,7 @@ #include #include "retroshare/rspeers.h" +#include "retroshare/rsidentity.h" #include @@ -55,9 +56,12 @@ class RetroChessWindow : public QWidget public: std::string mPeerId; explicit RetroChessWindow(std::string peerid, int player = 0, QWidget *parent = 0); + explicit RetroChessWindow(const RsGxsId &gxsId, int player = 0, QWidget *parent = 0); ~RetroChessWindow(); int currentplayer; int myid; + RsGxsId mGxsId; // Store GXS identity if using a tunnel + bool mIsGxs; //from global diff --git a/gui/tile.cpp b/gui/tile.cpp index 681af84..dd0bd16 100644 --- a/gui/tile.cpp +++ b/gui/tile.cpp @@ -48,7 +48,11 @@ void Tile::mousePressEvent(QMouseEvent *event) if((chess_window_p)->m_localplayer_turn == (chess_window_p)->turn) { validate( ++(chess_window_p)->count ); - rsRetroChess->chess_click(peer_id, this->row,this->col,(chess_window_p)->count); + if ((chess_window_p)->mIsGxs) { + rsRetroChess->chess_click_gxs((chess_window_p)->mGxsId, this->row,this->col, (chess_window_p)->count); + } else { + rsRetroChess->chess_click((chess_window_p)->mPeerId, this->row,this->col, (chess_window_p)->count); + } } // not local player's turn } diff --git a/interface/rsRetroChess.h b/interface/rsRetroChess.h index 3e715d7..10ac9df 100644 --- a/interface/rsRetroChess.h +++ b/interface/rsRetroChess.h @@ -53,6 +53,15 @@ class RsRetroChess virtual void acceptedInvite(RsPeerId peerID) = 0; virtual void gotInvite(RsPeerId peerID) = 0; virtual void sendInvite(RsPeerId peerID) = 0; + + // New GXSID & Tunneling methods + virtual void chess_click_gxs(const RsGxsId &gxs_id, int col, int row, int count) = 0; + virtual void player_leave_gxs(const RsGxsId &gxs_id) = 0; + virtual void requestGxsTunnel(const RsGxsId &gxsId) = 0; + virtual void sendGxsInvite(const RsGxsId &gxsId) = 0; + virtual void addChessFriend(const RsGxsId &gxsId) = 0; + virtual void acceptedInviteGxs(const RsGxsId &gxsId) = 0; + }; diff --git a/services/p3RetroChess.cc b/services/p3RetroChess.cc index 912ec51..e042378 100644 --- a/services/p3RetroChess.cc +++ b/services/p3RetroChess.cc @@ -25,6 +25,7 @@ #include "pqi/p3linkmgr.h" #include #include +//#include "retroshare/rsmsgs.h" #include // for std::istringstream @@ -111,10 +112,11 @@ int p3RetroChess::tick() #ifdef DEBUG_RetroChess std::cerr << "ticking p3RetroChess" << std::endl; #endif + // Call your GXS polling logic + handleGxsTick(); - //processIncoming(); - //sendPackets(); - + // Call the base class tick if necessary, or return 0 + // Returning 0 tells the core this service is idle for this slice return 0; } @@ -245,8 +247,6 @@ void p3RetroChess::msg_all(std::string msg) // mServiceControl->getPeersConnected(getServiceInfo().mServiceType, onlineIds); rsPeers->getOnlineList(onlineIds); - double ts = getCurrentTS(); - #ifdef DEBUG_RetroChess std::cerr << "p3RetroChess::msg_all() @ts: " << ts; std::cerr << std::endl; @@ -272,9 +272,6 @@ void p3RetroChess::broadcast_paint(int x, int y) // mServiceControl->getPeersConnected(getServiceInfo().mServiceType, onlineIds); rsPeers->getOnlineList(onlineIds); - double ts = getCurrentTS(); - - std::cout << "READY TO PAINT: " << onlineIds.size() << "\n"; /* prepare packets */ std::list::iterator it; @@ -417,3 +414,154 @@ RsSerialiser *p3RetroChess::setupSerialiser() return rsSerialiser ; } + +void p3RetroChess::chess_click_gxs(const RsGxsId &gxs_id, int col, int row, int count) +{ + if (mActiveTunnels.find(gxs_id) == mActiveTunnels.end()) { + // Tunnel not ready, try to re-open + sendGxsInvite(gxs_id); + return; + } + + RsGxsTunnelId tunnel_id = mActiveTunnels[gxs_id]; + + // Create a data item for the move + RsRetroChessDataItem *item = new RsRetroChessDataItem(); + item->m_msg = QString("%1,%2,%3").arg(col).arg(row).arg(count).toStdString(); + + // Send raw data through the secured tunnel + mGxsTunnels->sendData(tunnel_id, RETRO_CHESS_GXS_TUNNEL_SERVICE_ID, (const uint8_t*)item->m_msg.c_str(), item->m_msg.size()); +} + +void p3RetroChess::requestGxsTunnel(const RsGxsId &gxsId) +{ + // Check if we already have a tunnel + if (mActiveTunnels.count(gxsId)) { + mNotify->notifyGxsTunnelReady(gxsId); + return; + } + // Otherwise, start the async tunnel request + this->sendGxsInvite(gxsId); +} + +void p3RetroChess::sendGxsInvite(const RsGxsId &to_gxs_id) +{ + RsGxsId from_gxs_id; + std::list ownIds; + rsIdentity->getOwnIds(ownIds); + if (ownIds.empty()) return; + from_gxs_id = ownIds.front(); + + RsGxsTunnelId tunnel_id; + uint32_t error_code; + + // Open a tunnel using mGxsTunnel (Async Request) + if (mGxsTunnels->requestSecuredTunnel( + to_gxs_id, from_gxs_id, tunnel_id, + RETRO_CHESS_GXS_TUNNEL_SERVICE_ID, error_code)) + { + mPendingTunnels[to_gxs_id] = tunnel_id; + std::cout << "Chess Tunnel requested. Pending ID: " << tunnel_id << std::endl; + } +} + +void p3RetroChess::handleGxsTick() +{ + auto it = mPendingTunnels.begin(); + while (it != mPendingTunnels.end()) { + RsGxsTunnelService::GxsTunnelInfo tinfo; + if (mGxsTunnels->getTunnelInfo(it->second, tinfo)) { + // Check if the tunnel is "Connected" (CAN_TALK) + if (tinfo.tunnel_status == RsGxsTunnelService::RS_GXS_TUNNEL_STATUS_CAN_TALK) { + mActiveTunnels[it->first] = it->second; + mNotify->notifyGxsTunnelReady(it->first); + it = mPendingTunnels.erase(it); + continue; + } + // Check for "Closed/Failed" status + else if (tinfo.tunnel_status == RsGxsTunnelService::RS_GXS_TUNNEL_STATUS_REMOTELY_CLOSED || + tinfo.tunnel_status == RsGxsTunnelService::RS_GXS_TUNNEL_STATUS_TUNNEL_DN) { + it = mPendingTunnels.erase(it); + continue; + } + } + ++it; + } +} + +// Update this signature to include gxs_id and am_I_client_side +void p3RetroChess::handleRawData(const RsGxsId& gxs_id, + const RsGxsTunnelId& tunnel_id, + bool am_I_client_side, + const uint8_t *data, + uint32_t data_size) +{ + // Identify who sent the data using the Tunnel ID helper + // This ensures we have a record of this tunnel in our mActiveTunnels map + RsGxsId sender_id = findGxsIdByTunnel(tunnel_id); + + // Fallback: If the map lookup fails but the API provided a valid gxs_id, use that + if (sender_id.isNull() && !gxs_id.isNull()) { + sender_id = gxs_id; + } + + if (sender_id.isNull()) { + std::cerr << "p3RetroChess::handleRawData: Received data from unknown tunnel " << tunnel_id << std::endl; + return; + } + + // Deserialize the raw bytes into the Chess Data Item + uint32_t temp_size = data_size; + RsRetroChessDataItem item((void*)data, temp_size); + + // Parse the move protocol (Format: "col,row,count") + QString qMsg = QString::fromStdString(item.m_msg); + QStringList parts = qMsg.split(","); + + if (parts.size() == 3) { + int col = parts[0].toInt(); + int row = parts[1].toInt(); + int count = parts[2].toInt(); + + // Notify the GUI with the resolved GXS Identity + mNotify->notifyChessMoveGxs(sender_id, col, row, count); + } +} + +void p3RetroChess::player_leave_gxs(const RsGxsId &gxs_id) { + // Logic to close tunnel + if(mActiveTunnels.count(gxs_id)) { + mGxsTunnels->closeExistingTunnel(mActiveTunnels[gxs_id], RETRO_CHESS_GXS_TUNNEL_SERVICE_ID); + mActiveTunnels.erase(gxs_id); + } +} + +RsGxsId p3RetroChess::findGxsIdByTunnel(const RsGxsTunnelId& tunnel_id) +{ + std::map::iterator it; + for (it = mActiveTunnels.begin(); it != mActiveTunnels.end(); ++it) { + if (it->second == tunnel_id) return it->first; + } + return RsGxsId(); +} + +// services/p3RetroChess.cc + +void p3RetroChess::notifyTunnelStatus(const RsGxsTunnelId& /*tunnel_id*/, uint32_t /*tunnel_status*/) +{ +} + +void p3RetroChess::receiveData(const RsGxsTunnelId& id, unsigned char *data, uint32_t data_size) +{ + this->handleRawData(RsGxsId(), id, false, (const uint8_t*)data, data_size); +} + +void p3RetroChess::connectToGxsTunnelService(RsGxsTunnelService *tunnel_service) +{ + mGxsTunnels = tunnel_service; +} + +bool p3RetroChess::acceptDataFromPeer(const RsGxsId& /*gxs_id*/, const RsGxsTunnelId& /*tunnel_id*/, bool /*am_I_client_side*/) +{ + return true; +} diff --git a/services/p3RetroChess.h b/services/p3RetroChess.h index 2ff1387..56dd940 100644 --- a/services/p3RetroChess.h +++ b/services/p3RetroChess.h @@ -30,12 +30,16 @@ #include "serialiser/rstlvbase.h" #include "rsitems/rsconfigitems.h" #include "plugins/rspqiservice.h" +#include "retroshare/rsidentity.h" +#include + #include class p3LinkMgr; class RetroChessNotify ; - +// Use a valid 16-bit Service ID (below 0xFFFF) +#define RETRO_CHESS_GXS_TUNNEL_SERVICE_ID 0xC4E5 //!The RS VoIP Test service. /** @@ -43,7 +47,7 @@ class RetroChessNotify ; * This is only used to test Latency for the moment. */ -class p3RetroChess: public RsPQIService, public RsRetroChess +class p3RetroChess: public RsPQIService, public RsRetroChess, public RsGxsTunnelService::RsGxsTunnelClientService // Maybe we inherit from these later - but not needed for now. //, public p3Config, public pqiMonitor { @@ -61,7 +65,7 @@ class p3RetroChess: public RsPQIService, public RsRetroChess * : notifyCustomState, notifyChatStatus, notifyPeerHasNewAvatar * @see NotifyBase */ - virtual int tick(); + virtual int tick() override;; virtual int status(); virtual bool recvItem(RsItem *item); @@ -101,13 +105,44 @@ class p3RetroChess: public RsPQIService, public RsRetroChess void gotInvite(RsPeerId peerID); void acceptedInvite(RsPeerId peerID); void sendInvite(RsPeerId peerID); -private: + void player_leave_gxs(const RsGxsId &gxs_id); + void addChessFriend(const RsGxsId &gxsId); + void sendGxsInvite(const RsGxsId &toGxsId); + void acceptedInviteGxs(const RsGxsId &gxsId); + void chess_click_gxs(const RsGxsId &gxs_id, int col, int row, int count); + virtual void requestGxsTunnel(const RsGxsId &gxsId) override; + + // Async tunnel management + void handleGxsTick(); // Called periodically by the core + + virtual uint32_t getGxsTunnelServiceId() const { + return RETRO_CHESS_GXS_TUNNEL_SERVICE_ID; + } + + // Fix handleRawData signature + void handleRawData(const RsGxsId& gxs_id, const RsGxsTunnelId& tunnel_id, bool am_I_client_side, const uint8_t *data, uint32_t data_size); + + virtual void notifyTunnelStatus(const RsGxsTunnelId& tunnel_id, uint32_t tunnel_status) override; + virtual void receiveData(const RsGxsTunnelId& id, unsigned char *data, uint32_t data_size) override; + virtual void connectToGxsTunnelService(RsGxsTunnelService *tunnel_service) override; + virtual bool acceptDataFromPeer(const RsGxsId& gxs_id, const RsGxsTunnelId& tunnel_id, bool am_I_client_side) override; + +private: + // Helper to find which friend sent the data based on the tunnel ID + RsGxsId findGxsIdByTunnel(const RsGxsTunnelId& tunnel_id); std::set invitesTo; std::set invitesFrom; + void handleData(RsRetroChessDataItem*) ; + // Tracks GXS IDs that we are currently trying to connect to + std::map mPendingTunnels; + // Tracks established tunnels ready for data + std::map mActiveTunnels; + + RsGxsTunnelService *mGxsTunnels; RsMutex mRetroChessMtx; //RsPeerId mPeerID; diff --git a/services/rsRetroChessItems.h b/services/rsRetroChessItems.h index 1e4a563..623e992 100644 --- a/services/rsRetroChessItems.h +++ b/services/rsRetroChessItems.h @@ -55,7 +55,7 @@ /**************************************************************************/ -const uint16_t RS_SERVICE_TYPE_RetroChess_PLUGIN = 0xc4e55; +const uint16_t RS_SERVICE_TYPE_RetroChess_PLUGIN = 0xc4e5; const uint8_t RS_PKT_SUBTYPE_RetroChess_DATA = 0x01; @@ -98,6 +98,7 @@ class RsRetroChessDataItem: public RsRetroChessItem uint32_t flags ; uint32_t data_size ; std::string m_msg; + RsGxsId m_gxsId; // Optional: track origin GXS ID in the item };