Commits

Friedrich Kastner-Masilko committed bf8af79

OMPClient: refactored keep-alive packet receiver to check for deletion marks

  • Participants
  • Parent commits 4999c91

Comments (0)

Files changed (1)

File Orbitersdk/samples/OMP/OMPClient/OMPClient.cpp

 												threaddata->user->timestamp-pac.contentKA.tsSent);
 											tlogging(1, line);
 										}
-										if (pac.contentKA.Global4Local)
+										if (!pac.contentKA.Global4Local) break;										
+										sprintf(line, "%d", pac.contentKA.LocalID);
+										if ((entry=(IDload *)threaddata->user->LocalsByID->get(line))==0)
 										{
-											sprintf(line, "%d", pac.contentKA.LocalID);
-											if ((entry=(IDload *)threaddata->user->LocalsByID->get(line))!=0)
-											{
-												//if (entry->GlobalID==0)
-												//{
-													sprintf(line, "%d", pac.contentKA.GlobalID);
-													if ((entry1=(IDload *)threaddata->user->GlobalsByID->get(line))==0)									
-													{											
-														entry1			=new IDload;
-														entry->GlobalID	=entry1;
-														entry1->ID		=pac.contentKA.GlobalID;
-														entry1->object	=entry->object;
-														entry1->vessel	=entry->vessel;
-														entry1->size	=entry->size;
-														entry1->linkage	=1;
-														entry1->MasterID=0;											
-														entry1->refcount=0;
-														entry1->NavInfo=0;
-														entry1->DockInfo=0;
-														entry1->AnimInfo=entry->AnimInfo;
-														entry1->Events=entry->Events;
-														entry1->lastJump=0;
-														threaddata->user->GlobalsByID->put(line, entry1);
-														sprintf(line, "%p", entry1->object);
-														if ((entry=(IDload *)threaddata->user->GlobalsByHandle->put(line, entry1))!=0)
-														{
-															entry->tsSent=pac.contentKA.tsSent;
-															entry->linkage=2;
-															sprintf(line, "[L%d]G%d => G%d", pac.contentKA.LocalID, entry->ID, pac.contentKA.GlobalID);
-															tlogging(7, line);											
-														}
-														else
-														{
-															sprintf(line, "[L%d]G%d", pac.contentKA.LocalID, pac.contentKA.GlobalID);
-															tlogging(7, line);
-														}
-													}
-												//}
-											}
+											sprintf(line, "[L%d ?]G%d", pac.contentKA.LocalID, pac.contentKA.GlobalID);
+											tlogging(7, line);
+											break;
+										}
+										if (dinfo.deletedVessels.count(pac.contentKA.GlobalID)!=0)
+										{
+											sprintf(line, "[L%d]G%d !", pac.contentKA.LocalID, pac.contentKA.GlobalID);
+											tlogging(7, line);
+											break;
+										}
+										sprintf(line, "%d", pac.contentKA.GlobalID);
+										if ((entry1=(IDload *)threaddata->user->GlobalsByID->get(line))!=0)
+										{
+											sprintf(line, "[L%d]G%d ?", pac.contentKA.LocalID, pac.contentKA.GlobalID);
+											tlogging(7, line);
+											break;
+										}
+										entry1			=new IDload;
+										entry->GlobalID	=entry1;
+										entry1->ID		=pac.contentKA.GlobalID;
+										entry1->object	=entry->object;
+										entry1->vessel	=entry->vessel;
+										entry1->size	=entry->size;
+										entry1->linkage	=1;
+										entry1->MasterID=0;											
+										entry1->refcount=0;
+										entry1->NavInfo=0;
+										entry1->DockInfo=0;
+										entry1->AnimInfo=entry->AnimInfo;
+										entry1->Events=entry->Events;
+										entry1->lastJump=0;
+										threaddata->user->GlobalsByID->put(line, entry1);
+										sprintf(line, "%p", entry1->object);
+										if ((entry=(IDload *)threaddata->user->GlobalsByHandle->put(line, entry1))!=0)
+										{
+											entry->tsSent=pac.contentKA.tsSent;
+											entry->linkage=2;
+											sprintf(line, "[L%d]G%d => G%d", pac.contentKA.LocalID, entry->ID, pac.contentKA.GlobalID);
+											tlogging(7, line);											
+										}
+										else
+										{
+											sprintf(line, "[L%d]G%d", pac.contentKA.LocalID, pac.contentKA.GlobalID);
+											tlogging(7, line);
 										}
 										break;
 									case 1: //GROUP INFO