MCPcopy Create free account
hub / github.com/diasurgical/devilution / dthread_send_delta

Function dthread_send_delta

Source/dthread.cpp:27–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void dthread_send_delta(int pnum, char cmd, void *pbSrc, int dwLen)
28{
29 TMegaPkt *pkt;
30 TMegaPkt *p;
31
32 if (gbMaxPlayers == 1) {
33 return;
34 }
35
36 pkt = (TMegaPkt *)DiabloAllocPtr(dwLen + 20);
37 pkt->pNext = NULL;
38 pkt->dwSpaceLeft = pnum;
39 pkt->data[0] = cmd;
40 *(DWORD *)&pkt->data[4] = dwLen;
41 memcpy(&pkt->data[8], pbSrc, dwLen);
42 sgMemCrit.Enter();
43 p = (TMegaPkt *)&sgpInfoHead;
44 while (p->pNext) {
45 p = p->pNext;
46 }
47 p->pNext = pkt;
48
49 SetEvent(sghWorkToDoEvent);
50 sgMemCrit.Leave();
51}
52
53void dthread_start()
54{

Callers 2

DeltaExportDataFunction · 0.85
multi_send_pinfoFunction · 0.85

Calls 4

DiabloAllocPtrFunction · 0.85
SetEventFunction · 0.85
EnterMethod · 0.80
LeaveMethod · 0.80

Tested by

no test coverage detected