mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
863a54bfe1
To prevent deleted games' ghost invitations from remaining as persisted on a topic and so being received over and over, have recipient of invitation send an empty message on the same topic to remove them. Any message sent once the game start would have replaced the invitation, but sometimes if the sender is deleted at the right time there's none.
59 lines
2.5 KiB
C
59 lines
2.5 KiB
C
/* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */
|
|
/*
|
|
* Copyright 2020 by Eric House (xwords@eehouse.org). All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
|
|
#ifndef _DEVICE_H_
|
|
#define _DEVICE_H_
|
|
|
|
#include "dutil.h"
|
|
|
|
// void device_load( XW_DUtilCtxt dctxt );
|
|
# ifdef XWFEATURE_DEVICE
|
|
void dvc_store( XW_DUtilCtxt* dctxt, XWEnv xwe );
|
|
# else
|
|
# define dvc_store(dctxt, xwe)
|
|
# endif
|
|
|
|
typedef void (*MsgAndTopicProc)( void* closure, const XP_UCHAR* topic,
|
|
const XP_U8* msgBuf, XP_U16 msgLen );
|
|
|
|
void dvc_getMQTTDevID( XW_DUtilCtxt* dutil, XWEnv xwe, MQTTDevID* devID );
|
|
void dvc_resetMQTTDevID( XW_DUtilCtxt* dutil, XWEnv xwe );
|
|
void dvc_getMQTTSubTopics( XW_DUtilCtxt* dutil, XWEnv xwe,
|
|
XP_UCHAR* storage, XP_U16 storageLen,
|
|
XP_U16* nTopics, XP_UCHAR* topics[] );
|
|
void dvc_makeMQTTInvites( XW_DUtilCtxt* dutil, XWEnv xwe,
|
|
MsgAndTopicProc proc, void* closure,
|
|
const MQTTDevID* addressee,
|
|
const NetLaunchInfo* nli );
|
|
void dvc_makeMQTTNukeInvite( XW_DUtilCtxt* dutil, XWEnv xwe,
|
|
MsgAndTopicProc proc, void* closure,
|
|
const NetLaunchInfo* nli );
|
|
|
|
void dvc_makeMQTTMessages( XW_DUtilCtxt* dutil, XWEnv xwe,
|
|
MsgAndTopicProc proc, void* closure,
|
|
const MQTTDevID* addressee,
|
|
XP_U32 gameID, const XP_U8* buf, XP_U16 len );
|
|
void dvc_makeMQTTNoSuchGames( XW_DUtilCtxt* dutil, XWEnv xwe,
|
|
MsgAndTopicProc proc, void* closure,
|
|
const MQTTDevID* addressee,
|
|
XP_U32 gameID );
|
|
void dvc_parseMQTTPacket( XW_DUtilCtxt* dutil, XWEnv xwe, const XP_UCHAR* topic,
|
|
const XP_U8* buf, XP_U16 len );
|
|
#endif
|