filter duplicates in game list
This commit is contained in:
parent
c0cb4b636a
commit
31010c09dc
|
@ -288,10 +288,19 @@ void processPacket(struct packet *p)
|
||||||
void processAnnounce(struct announce *a)
|
void processAnnounce(struct announce *a)
|
||||||
{
|
{
|
||||||
if( gamecount < sizeof(games)/sizeof(games[0]) ){
|
if( gamecount < sizeof(games)/sizeof(games[0]) ){
|
||||||
|
int repeat=0;
|
||||||
|
int i;
|
||||||
|
for (i=0; i<gamecount; i++){
|
||||||
|
if (a->gameId == games[i].gameId){
|
||||||
|
repeat=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (repeat!=1){
|
||||||
games[gamecount] = *a;
|
games[gamecount] = *a;
|
||||||
gamecount++;
|
gamecount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//increment ctr and send button state, id and ctr
|
//increment ctr and send button state, id and ctr
|
||||||
void sendButton(uint8_t button)
|
void sendButton(uint8_t button)
|
||||||
|
|
Loading…
Reference in New Issue