MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / eventPacketReceived

Method eventPacketReceived

Engine/source/sim/netEvent.cpp:136–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void NetConnection::eventPacketReceived(PacketNotify *notify)
137{
138 NetEventNote *walk = notify->eventList;
139 NetEventNote **noteList = &mNotifyEventList;
140
141 while(walk)
142 {
143 NetEventNote *next = walk->mNextEvent;
144 if(walk->mEvent->mGuaranteeType != NetEvent::GuaranteedOrdered)
145 {
146 walk->mEvent->notifyDelivered(this, true);
147 walk->mEvent->decRef();
148 mEventNoteChunker.free(walk);
149 walk = next;
150 }
151 else
152 {
153 while(*noteList && (*noteList)->mSeqCount < walk->mSeqCount)
154 noteList = &((*noteList)->mNextEvent);
155
156 walk->mNextEvent = *noteList;
157 *noteList = walk;
158 noteList = &walk->mNextEvent;
159 walk = next;
160 }
161 }
162 while(mNotifyEventList && mNotifyEventList->mSeqCount == mLastAckedEventSeq + 1)
163 {
164 mLastAckedEventSeq++;
165 NetEventNote *next = mNotifyEventList->mNextEvent;
166 //Con::printf("EVT %d: ACK - %d", getId(), mNotifyEventList->mSeqCount);
167 mNotifyEventList->mEvent->notifyDelivered(this, true);
168 mNotifyEventList->mEvent->decRef();
169 mEventNoteChunker.free(mNotifyEventList);
170 mNotifyEventList = next;
171 }
172}
173
174void NetConnection::eventWritePacket(BitStream *bstream, PacketNotify *notify)
175{

Callers

nothing calls this directly

Calls 3

notifyDeliveredMethod · 0.45
decRefMethod · 0.45
freeMethod · 0.45

Tested by

no test coverage detected