Pol  Revision:4b29d2b
packets.cpp
Go to the documentation of this file.
1 
11 #include "packets.h"
12 
13 #include "../../clib/rawtypes.h"
14 #include "../../clib/spinlock.h"
15 #include "../pktboth.h"
16 #include "../pktbothid.h"
17 #include "packethelper.h"
18 #include "packetinterface.h"
19 
20 namespace Pol
21 {
22 namespace Network
23 {
24 using namespace PktHelper;
25 using namespace PacketWriterDefs;
26 
35 {
36  using namespace Core;
37  // insert packet queues at first creation
38  packets.insert( PacketQueuePair( ENCRYPTEDPKTBUFFER, new PacketQueueSingle() ) );
39 
40  packets.insert( PacketQueuePair( PKTOUT_0B_ID, new PacketQueueSingle() ) );
41  packets.insert( PacketQueuePair( PKTOUT_11_ID, new PacketQueueSingle() ) );
42  packets.insert( PacketQueuePair( PKTOUT_17_ID, new PacketQueueSingle() ) );
43  packets.insert( PacketQueuePair( PKTOUT_1A_ID, new PacketQueueSingle() ) );
44  packets.insert( PacketQueuePair( PKTOUT_1B_ID, new PacketQueueSingle() ) );
45  packets.insert( PacketQueuePair( PKTOUT_1C_ID, new PacketQueueSingle() ) );
46  packets.insert( PacketQueuePair( PKTOUT_1D_ID, new PacketQueueSingle() ) );
47  packets.insert( PacketQueuePair( PKTOUT_20_ID, new PacketQueueSingle() ) );
48  packets.insert( PacketQueuePair( PKTOUT_21_ID, new PacketQueueSingle() ) );
49  packets.insert( PacketQueuePair( PKTBI_22_APPROVED_ID, new PacketQueueSingle() ) );
50  packets.insert( PacketQueuePair( PKTOUT_24_ID, new PacketQueueSingle() ) );
51  packets.insert( PacketQueuePair( PKTOUT_25_ID, new PacketQueueSingle() ) );
52  packets.insert( PacketQueuePair( PKTOUT_27_ID, new PacketQueueSingle() ) );
53  packets.insert( PacketQueuePair( PKTOUT_29_ID, new PacketQueueSingle() ) );
54  packets.insert( PacketQueuePair( PKTBI_2C_ID, new PacketQueueSingle() ) );
55  packets.insert( PacketQueuePair( PKTOUT_2D_ID, new PacketQueueSingle() ) );
56  packets.insert( PacketQueuePair( PKTOUT_2E_ID, new PacketQueueSingle() ) );
57  packets.insert( PacketQueuePair( PKTOUT_2F_ID, new PacketQueueSingle() ) );
58  packets.insert( PacketQueuePair( PKTBI_3A_ID, new PacketQueueSingle() ) );
59  packets.insert( PacketQueuePair( PKTBI_3B_ID, new PacketQueueSingle() ) );
60  packets.insert( PacketQueuePair( PKTOUT_3C_ID, new PacketQueueSingle() ) );
61  packets.insert( PacketQueuePair( PKTOUT_4F_ID, new PacketQueueSingle() ) );
62  packets.insert( PacketQueuePair( PKTOUT_53_ID, new PacketQueueSingle() ) );
63  packets.insert( PacketQueuePair( PKTOUT_54_ID, new PacketQueueSingle() ) );
64  packets.insert( PacketQueuePair( PKTOUT_55_ID, new PacketQueueSingle() ) );
65  packets.insert( PacketQueuePair( PKTBI_56_ID, new PacketQueueSingle() ) );
66  packets.insert( PacketQueuePair( PKTOUT_65_ID, new PacketQueueSingle() ) );
67  packets.insert( PacketQueuePair( PKTBI_66_ID, new PacketQueueSingle() ) );
68  packets.insert( PacketQueuePair( PKTBI_6C_ID, new PacketQueueSingle() ) );
69  packets.insert( PacketQueuePair( PKTOUT_6D_ID, new PacketQueueSingle() ) );
70  packets.insert( PacketQueuePair( PKTOUT_6E_ID, new PacketQueueSingle() ) );
71  packets.insert( PacketQueuePair( PKTBI_6F_ID, new PacketQueueSingle() ) );
72  packets.insert( PacketQueuePair( PKTOUT_70_ID, new PacketQueueSingle() ) );
73  packets.insert( PacketQueuePair( PKTBI_72_ID, new PacketQueueSingle() ) );
74  packets.insert( PacketQueuePair( PKTOUT_74_ID, new PacketQueueSingle() ) );
75  packets.insert( PacketQueuePair( PKTOUT_76_ID, new PacketQueueSingle() ) );
76  packets.insert( PacketQueuePair( PKTOUT_77_ID, new PacketQueueSingle() ) );
77  packets.insert( PacketQueuePair( PKTOUT_78_ID, new PacketQueueSingle() ) );
78  packets.insert( PacketQueuePair( PKTOUT_7C_ID, new PacketQueueSingle() ) );
79  packets.insert( PacketQueuePair( PKTOUT_82_ID, new PacketQueueSingle() ) );
80  packets.insert( PacketQueuePair( PKTOUT_88_ID, new PacketQueueSingle() ) );
81  packets.insert( PacketQueuePair( PKTOUT_89_ID, new PacketQueueSingle() ) );
82  packets.insert( PacketQueuePair( PKTOUT_8C_ID, new PacketQueueSingle() ) );
83  packets.insert( PacketQueuePair( PKTOUT_90_ID, new PacketQueueSingle() ) );
84  packets.insert( PacketQueuePair( PKTBI_93_ID, new PacketQueueSingle() ) );
85  packets.insert( PacketQueuePair( PKTBI_95_ID, new PacketQueueSingle() ) );
86  packets.insert( PacketQueuePair( PKTBI_98_OUT_ID, new PacketQueueSingle() ) );
87  packets.insert( PacketQueuePair( PKTBI_99_ID, new PacketQueueSingle() ) );
88  packets.insert( PacketQueuePair( PKTBI_9A_ID, new PacketQueueSingle() ) );
89  packets.insert( PacketQueuePair( PKTOUT_9E_ID, new PacketQueueSingle() ) );
90  packets.insert( PacketQueuePair( PKTOUT_A1_ID, new PacketQueueSingle() ) );
91  packets.insert( PacketQueuePair( PKTOUT_A2_ID, new PacketQueueSingle() ) );
92  packets.insert( PacketQueuePair( PKTOUT_A3_ID, new PacketQueueSingle() ) );
93  packets.insert( PacketQueuePair( PKTOUT_A5_ID, new PacketQueueSingle() ) );
94  packets.insert( PacketQueuePair( PKTOUT_A6_ID, new PacketQueueSingle() ) );
95  packets.insert( PacketQueuePair( PKTOUT_A8_ID, new PacketQueueSingle() ) );
96  packets.insert( PacketQueuePair( PKTOUT_A9_ID, new PacketQueueSingle() ) );
97  packets.insert( PacketQueuePair( PKTOUT_AA_ID, new PacketQueueSingle() ) );
98  packets.insert( PacketQueuePair( PKTOUT_AB_ID, new PacketQueueSingle() ) );
99  packets.insert( PacketQueuePair( PKTOUT_AE_ID, new PacketQueueSingle() ) );
100  packets.insert( PacketQueuePair( PKTOUT_AF_ID, new PacketQueueSingle() ) );
101  packets.insert( PacketQueuePair( PKTOUT_B0_ID, new PacketQueueSingle() ) );
102  packets.insert( PacketQueuePair( PKTOUT_B7_ID, new PacketQueueSingle() ) );
103  packets.insert( PacketQueuePair( PKTBI_B8_OUT_ID, new PacketQueueSingle() ) );
104  packets.insert( PacketQueuePair( PKTOUT_B9_ID, new PacketQueueSingle() ) );
105  packets.insert( PacketQueuePair( PKTOUT_BA_ID, new PacketQueueSingle() ) );
106  packets.insert( PacketQueuePair( PKTOUT_BC_ID, new PacketQueueSingle() ) );
107 
108  packets.insert( PacketQueuePair( PKTBI_BF_ID, new PacketQueueSubs() ) );
109 
110  packets.insert( PacketQueuePair( PKTOUT_C1_ID, new PacketQueueSingle() ) );
111  packets.insert( PacketQueuePair( PKTBI_C2_ID, new PacketQueueSingle() ) );
112  packets.insert( PacketQueuePair( PKTOUT_C7_ID, new PacketQueueSingle() ) );
113  packets.insert( PacketQueuePair( PKTOUT_CC_ID, new PacketQueueSingle() ) );
114  packets.insert( PacketQueuePair( PKTBI_D6_OUT_ID, new PacketQueueSingle() ) );
115  packets.insert( PacketQueuePair( PKTOUT_DC_ID, new PacketQueueSingle() ) );
116  packets.insert( PacketQueuePair( PKTOUT_DD_ID, new PacketQueueSingle() ) );
117  packets.insert( PacketQueuePair( PKTOUT_DF_ID, new PacketQueueSingle() ) );
118  packets.insert( PacketQueuePair( PKTOUT_E2_ID, new PacketQueueSingle() ) );
119  packets.insert( PacketQueuePair( PKTOUT_E3_ID, new PacketQueueSingle() ) );
120  packets.insert( PacketQueuePair( PKTOUT_F3_ID, new PacketQueueSingle() ) );
121  packets.insert( PacketQueuePair( PKTOUT_F5_ID, new PacketQueueSingle() ) );
122  packets.insert( PacketQueuePair( PKTOUT_F6_ID, new PacketQueueSingle() ) );
123  packets.insert( PacketQueuePair( PKTOUT_F7_ID, new PacketQueueSingle() ) );
124 }
125 
127 {
128  for ( auto& pkts : packets )
129  {
130  delete pkts.second;
131  }
132  packets.clear();
133 }
134 
136 {
137  PacketQueueMap::iterator itr = packets.find( id );
138  if ( itr != packets.end() )
139  return itr->second->GetNext( id, sub );
140  throw std::runtime_error( "Request of undefined Packet: " + Clib::hexint( id ) + "-" +
141  Clib::hexint( sub ) );
142 }
143 
145 {
146  PacketQueueMap::iterator itr = packets.find( pkt->getID() );
147  if ( itr != packets.end() )
148  itr->second->Add( pkt );
149  else
150  delete pkt;
151 }
152 
154 {
155  size_t size = sizeof( PacketsSingleton );
156  for ( const auto& pkts : packets )
157  {
158  size += sizeof( pkts.first ) + ( sizeof( void* ) * 3 + 1 ) / 2;
159  size += pkts.second->estimateSize();
160  }
161  return size;
162 }
163 
164 PacketQueueSingle::PacketQueueSingle() : _packets(), _lock() {}
166 {
167  // critical start
168  Clib::SpinLockGuard lock( _lock );
169  PacketInterface* pkt;
170  if ( !_packets.empty() )
171  {
172  pkt = _packets.front(); // get next one
173  _packets.pop(); // and remove it from queue
174  pkt->ReSetBuffer();
175  }
176  else
177  pkt = GetPacket( id );
178  return pkt;
179  // critical end
180 }
181 
183 {
184  Clib::SpinLockGuard lock( _lock );
185  while ( !_packets.empty() )
186  {
187  PacketInterface* pkt = _packets.front();
188  _packets.pop();
189  delete pkt;
190  }
191 }
192 
194 {
195  Clib::SpinLockGuard lock( _lock );
196  if ( _packets.size() > MAX_PACKETS_INSTANCES ) // enough?
197  delete pkt;
198  else
199  {
200  _packets.push( pkt ); // readd it
201  }
202 }
203 
205 {
206  Clib::SpinLockGuard lock( _lock );
207  size_t size = sizeof( PacketQueueSingle );
208  if ( !_packets.empty() )
209  size += _packets.front()->estimateSize() * _packets.size();
210  return size;
211 }
212 
215 {
216  Clib::SpinLockGuard lock( _lock );
217  for ( auto& pkts : _packets )
218  {
219  while ( !pkts.second.empty() )
220  {
221  PacketInterface* pkt = pkts.second.front();
222  pkts.second.pop();
223  delete pkt;
224  }
225  }
226  _packets.clear();
227 }
228 
230 {
231  // critical start
232  Clib::SpinLockGuard lock( _lock );
233  PacketInterface* pkt;
234  if ( !_packets.empty() )
235  {
236  PacketInterfaceQueueMap::iterator itr = _packets.find( sub );
237  if ( itr != _packets.end() )
238  {
239  if ( !itr->second.empty() )
240  {
241  pkt = itr->second.front(); // get next one
242  itr->second.pop(); // and remove it from queue
243  pkt->ReSetBuffer();
244  return pkt;
245  }
246  }
247  }
248  pkt = GetPacket( id, sub );
249  return pkt;
250  // critical end
251 }
252 
254 {
255  u16 sub = pkt->getSubID();
256  // critical start
257  Clib::SpinLockGuard lock( _lock );
258  PacketInterfaceQueueMap::iterator itr = _packets.find( sub );
259  if ( itr != _packets.end() )
260  {
261  if ( itr->second.size() > MAX_PACKETS_INSTANCES ) // enough?
262  delete pkt;
263  else
264  itr->second.push( pkt ); // readd it
265  }
266  else // new sub
267  {
269  qu.push( pkt );
270  _packets.insert( PacketInterfaceQueuePair( sub, qu ) );
271  }
272  // critical end
273 }
274 
276 {
277  Clib::SpinLockGuard lock( _lock );
278  size_t count = 0;
279  for ( const auto& pkts : _packets )
280  {
281  count += pkts.second.size();
282  }
283  return count;
284 }
285 
287 {
288  Clib::SpinLockGuard lock( _lock );
289  size_t size = sizeof( PacketQueueSubs );
290  for ( const auto& pkts : _packets )
291  {
292  size += sizeof( pkts.first ) + ( sizeof( void* ) * 3 + 1 ) / 2;
293  if ( pkts.second.size() )
294  size += pkts.second.front()->estimateSize() * pkts.second.size();
295  }
296  return size;
297 }
298 
299 namespace PktHelper
300 {
301 // creates new packets
303 {
304  using namespace Core;
305  switch ( id )
306  {
307  case ENCRYPTEDPKTBUFFER:
308  return new EncryptedPktBuffer();
309  case PKTOUT_0B_ID:
310  return new PktOut_0B();
311  case PKTOUT_11_ID:
312  return new PktOut_11();
313  case PKTOUT_17_ID:
314  return new PktOut_17();
315  case PKTOUT_1A_ID:
316  return new PktOut_1A();
317  case PKTOUT_1B_ID:
318  return new PktOut_1B();
319  case PKTOUT_1C_ID:
320  return new PktOut_1C();
321  case PKTOUT_1D_ID:
322  return new PktOut_1D();
323  case PKTOUT_20_ID:
324  return new PktOut_20();
325  case PKTOUT_21_ID:
326  return new PktOut_21();
328  return new PktOut_22();
329  case PKTOUT_24_ID:
330  return new PktOut_24();
331  case PKTOUT_25_ID:
332  return new PktOut_25();
333  case PKTOUT_27_ID:
334  return new PktOut_27();
335  case PKTOUT_29_ID:
336  return new PktOut_29();
337  case PKTBI_2C_ID:
338  return new PktOut_2C();
339  case PKTOUT_2D_ID:
340  return new PktOut_2D();
341  case PKTOUT_2E_ID:
342  return new PktOut_2E();
343  case PKTOUT_2F_ID:
344  return new PktOut_2F();
345  case PKTBI_3A_ID:
346  return new PktOut_3A();
347  case PKTBI_3B_ID:
348  return new PktOut_3B();
349  case PKTOUT_3C_ID:
350  return new PktOut_3C();
351  case PKTOUT_4F_ID:
352  return new PktOut_4F();
353  case PKTOUT_53_ID:
354  return new PktOut_53();
355  case PKTOUT_54_ID:
356  return new PktOut_54();
357  case PKTOUT_55_ID:
358  return new PktOut_55();
359  case PKTBI_56_ID:
360  return new PktOut_56();
361  case PKTOUT_65_ID:
362  return new PktOut_65();
363  case PKTBI_66_ID:
364  return new PktOut_66();
365  case PKTBI_6C_ID:
366  return new PktOut_6C();
367  case PKTOUT_6D_ID:
368  return new PktOut_6D();
369  case PKTOUT_6E_ID:
370  return new PktOut_6E();
371  case PKTBI_6F_ID:
372  return new PktOut_6F();
373  case PKTOUT_70_ID:
374  return new PktOut_70();
375  case PKTBI_72_ID:
376  return new PktOut_72();
377  case PKTOUT_74_ID:
378  return new PktOut_74();
379  case PKTOUT_76_ID:
380  return new PktOut_76();
381  case PKTOUT_77_ID:
382  return new PktOut_77();
383  case PKTOUT_78_ID:
384  return new PktOut_78();
385  case PKTOUT_7C_ID:
386  return new PktOut_7C();
387  case PKTOUT_82_ID:
388  return new PktOut_82();
389  case PKTOUT_88_ID:
390  return new PktOut_88();
391  case PKTOUT_89_ID:
392  return new PktOut_89();
393  case PKTOUT_8C_ID:
394  return new PktOut_8C();
395  case PKTOUT_90_ID:
396  return new PktOut_90();
397  case PKTBI_93_ID:
398  return new PktOut_93();
399  case PKTBI_95_ID:
400  return new PktOut_95();
401  case PKTBI_98_OUT_ID:
402  return new PktOut_98();
403  case PKTBI_99_ID:
404  return new PktOut_99();
405  case PKTBI_9A_ID:
406  return new PktOut_9A();
407  case PKTOUT_9E_ID:
408  return new PktOut_9E();
409  case PKTOUT_A1_ID:
410  return new PktOut_A1();
411  case PKTOUT_A2_ID:
412  return new PktOut_A2();
413  case PKTOUT_A3_ID:
414  return new PktOut_A3();
415  case PKTOUT_A5_ID:
416  return new PktOut_A5();
417  case PKTOUT_A6_ID:
418  return new PktOut_A6();
419  case PKTOUT_A8_ID:
420  return new PktOut_A8();
421  case PKTOUT_A9_ID:
422  return new PktOut_A9();
423  case PKTOUT_AA_ID:
424  return new PktOut_AA();
425  case PKTOUT_AB_ID:
426  return new PktOut_AB();
427  case PKTOUT_AE_ID:
428  return new PktOut_AE();
429  case PKTOUT_AF_ID:
430  return new PktOut_AF();
431  case PKTOUT_B0_ID:
432  return new PktOut_B0();
433  case PKTOUT_B7_ID:
434  return new PktOut_B7();
435  case PKTBI_B8_OUT_ID:
436  return new PktOut_B8();
437  case PKTOUT_B9_ID:
438  return new PktOut_B9();
439  case PKTOUT_BA_ID:
440  return new PktOut_BA();
441  case PKTOUT_BC_ID:
442  return new PktOut_BC();
443 
444  case PKTBI_BF_ID:
445  {
446  switch ( sub )
447  {
449  return new PktOut_BF_Sub4();
451  return new PktOut_BF_Sub6();
453  return new PktOut_BF_Sub8();
455  return new PktOut_BF_Sub10();
457  return new PktOut_BF_Sub14();
459  return new PktOut_BF_Sub16();
461  return new PktOut_BF_Sub18();
463  return new PktOut_BF_Sub19();
465  return new PktOut_BF_Sub1B();
467  return new PktOut_BF_Sub1D();
469  return new PktOut_BF_Sub20();
471  return new PktOut_BF_Sub22();
473  return new PktOut_BF_Sub2A();
474  default:
475  throw std::runtime_error( "Request of undefined Packet: " + Clib::hexint( id ) + "-" +
476  Clib::hexint( sub ) );
477  }
478  }
479  case PKTOUT_C1_ID:
480  return new PktOut_C1();
481  case PKTBI_C2_ID:
482  return new PktOut_C2();
483  case PKTOUT_C7_ID:
484  return new PktOut_C7();
485  case PKTOUT_CC_ID:
486  return new PktOut_CC();
487  case PKTBI_D6_OUT_ID:
488  return new PktOut_D6();
489  case PKTOUT_DC_ID:
490  return new PktOut_DC();
491  case PKTOUT_DD_ID:
492  return new PktOut_DD();
493  case PKTOUT_DF_ID:
494  return new PktOut_DF();
495  case PKTOUT_E2_ID:
496  return new PktOut_E2();
497  case PKTOUT_E3_ID:
498  return new PktOut_E3();
499  case PKTOUT_F3_ID:
500  return new PktOut_F3();
501  case PKTOUT_F5_ID:
502  return new PktOut_F5();
503  case PKTOUT_F6_ID:
504  return new PktOut_F6();
505  case PKTOUT_F7_ID:
506  return new PktOut_F7();
507  default:
508  throw std::runtime_error( "Request of undefined Packet: " + Clib::hexint( id ) + "-" +
509  Clib::hexint( sub ) );
510  }
511 }
512 }
513 }
514 }
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_CLOSE_GUMP, 5+8 > PktOut_BF_Sub4
Definition: packets.h:433
unsigned char u8
Definition: rawtypes.h:25
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_EXTENDED_STATS_OUT, 5+7 > PktOut_BF_Sub19
Definition: packets.h:454
std::queue< PacketInterface * > PacketInterfaceQueue
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_ACTIVATE_CUSTOM_HOUSE_TOOL, 5+12 > PktOut_BF_Sub20
Definition: packets.h:463
PacketWriterDefs::PacketTemplate< Core::PKTOUT_82_ID, 2 > PktOut_82
Definition: packets.h:396
PacketWriterDefs::PacketTemplate< Core::PKTOUT_1B_ID, 37 > PktOut_1B
Definition: packets.h:358
PacketWriterDefs::PacketTemplate< Core::PKTOUT_A5_ID, URL_MAX_LEN+4 > PktOut_A5
Definition: packets.h:413
PacketWriterDefs::PacketTemplate< Core::PKTOUT_74_ID, 0xFFFF > PktOut_74
Definition: packets.h:390
PacketWriterDefs::PacketTemplate< Core::PKTOUT_55_ID, 1 > PktOut_55
Definition: packets.h:380
PacketWriterDefs::PacketTemplate< Core::PKTBI_56_ID, 11 > PktOut_56
Definition: packets.h:381
PacketWriterDefs::PacketTemplate< Core::PKTOUT_11_ID, 121 > PktOut_11
Definition: packets.h:355
PacketWriterDefs::PacketTemplate< Core::PKTOUT_1A_ID, 20 > PktOut_1A
Definition: packets.h:357
PacketWriterDefs::PacketTemplate< Core::PKTOUT_E2_ID, 10 > PktOut_E2
Definition: packets.h:482
PacketWriterDefs::PacketTemplate< Core::PKTOUT_1C_ID, 44+SPEECH_MAX_LEN+1 > PktOut_1C
Definition: packets.h:359
PacketWriterDefs::PacketTemplate< Core::PKTOUT_AB_ID, 531 > PktOut_AB
Definition: packets.h:418
PacketWriterDefs::PacketTemplate< Core::PKTBI_93_ID, 99 > PktOut_93
Definition: packets.h:403
PacketWriterDefs::PacketTemplate< Core::PKTOUT_AF_ID, 13 > PktOut_AF
Definition: packets.h:421
PacketWriterDefs::PacketTemplate< Core::PKTBI_99_ID, 30 > PktOut_99
Definition: packets.h:407
PacketWriterDefs::PacketTemplate< Core::PKTOUT_A2_ID, 9 > PktOut_A2
Definition: packets.h:411
PacketWriterDefs::PacketTemplate< Core::PKTOUT_21_ID, 8 > PktOut_21
Definition: packets.h:362
virtual PacketInterface * GetNext(u8 id, u16 sub=0) POL_OVERRIDE
Definition: packets.cpp:229
#define MAX_PACKETS_INSTANCES
Definition: packets.h:40
PacketWriterDefs::PacketTemplate< Core::PKTOUT_E3_ID, 77 > PktOut_E3
Definition: packets.h:483
PacketWriterDefs::PacketTemplate< Core::PKTOUT_BC_ID, 3 > PktOut_BC
Definition: packets.h:429
PacketWriterDefs::PacketTemplate< Core::PKTBI_B8_OUT_ID, 7+5 *(SPEECH_MAX_LEN+1)> PktOut_B8
Definition: packets.h:425
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_CHARACTER_RACE_CHANGER, 5+2 > PktOut_BF_Sub2A
Definition: packets.h:469
PacketWriterDefs::PacketTemplate< Core::PKTBI_98_OUT_ID, 37 > PktOut_98
Definition: packets.h:405
PacketWriterDefs::PacketTemplate< Core::PKTBI_66_ID, 0xFFFF > PktOut_66
Definition: packets.h:383
PacketInterface * getPacket(u8 id, u16 sub=0)
Definition: packets.cpp:135
virtual size_t estimateSize() const POL_OVERRIDE
Definition: packets.cpp:204
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_CURSOR_HUE, 5+1 > PktOut_BF_Sub8
Definition: packets.h:439
PacketWriterDefs::PacketTemplate< Core::PKTBI_3B_ID, 8 > PktOut_3B
Definition: packets.h:374
PacketWriterDefs::PacketTemplate< Core::PKTOUT_1D_ID, 5 > PktOut_1D
Definition: packets.h:360
PacketWriterDefs::PacketTemplate< Core::PKTBI_2C_ID, 2 > PktOut_2C
Definition: packets.h:369
PacketWriterDefs::PacketTemplate< Core::PKTOUT_DF_ID, 0xFFFF > PktOut_DF
Definition: packets.h:481
PacketWriterDefs::PacketTemplate< Core::PKTOUT_DD_ID, 0xFFFF > PktOut_DD
Definition: packets.h:480
PacketWriterDefs::PacketTemplate< Core::PKTOUT_6D_ID, 3 > PktOut_6D
Definition: packets.h:385
PacketWriterDefs::PacketTemplate< Core::PKTOUT_29_ID, 1 > PktOut_29
Definition: packets.h:368
virtual size_t estimateSize() const POL_OVERRIDE
Definition: packets.cpp:286
virtual void Add(PacketInterface *pkt) POL_OVERRIDE
Definition: packets.cpp:193
PacketWriterDefs::PacketTemplate< Core::PKTOUT_78_ID, 19+(9 *Core::HIGHEST_LAYER)+4 > PktOut_78
Definition: packets.h:394
PacketWriterDefs::PacketTemplate< Core::PKTBI_D6_OUT_ID, 0xFFFF > PktOut_D6
Definition: packets.h:478
virtual void Add(PacketInterface *pkt) POL_OVERRIDE
Definition: packets.cpp:253
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_CLOSE_WINDOW, 5+8 > PktOut_BF_Sub16
Definition: packets.h:448
PacketWriterDefs::PacketTemplate< Core::PKTOUT_BA_ID, 10 > PktOut_BA
Definition: packets.h:428
PacketWriterDefs::PacketTemplate< Core::PKTOUT_A9_ID, 10000 > PktOut_A9
Definition: packets.h:416
std::string hexint(unsigned short v)
Definition: strutil.cpp:23
unsigned short u16
Definition: rawtypes.h:26
PacketWriterDefs::PacketTemplate< Core::PKTOUT_89_ID, 7+(5 *(Core::NUM_LAYERS+1))+1 > PktOut_89
Definition: packets.h:400
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_OBJECT_CACHE, 5+8 > PktOut_BF_Sub10
Definition: packets.h:442
PacketWriterDefs::PacketTemplate< Core::PKTBI_6C_ID, 19 > PktOut_6C
Definition: packets.h:384
PacketWriterDefs::PacketTemplate< Core::PKTOUT_88_ID, 66 > PktOut_88
Definition: packets.h:397
PacketWriterDefs::PacketTemplate< Core::PKTOUT_AA_ID, 5 > PktOut_AA
Definition: packets.h:417
PacketWriterDefs::PacketTemplate< Core::PKTOUT_8C_ID, 11 > PktOut_8C
Definition: packets.h:401
PacketWriterDefs::PacketTemplate< Core::PKTOUT_2E_ID, 15 > PktOut_2E
Definition: packets.h:371
PacketWriterDefs::PacketTemplate< Core::PKTOUT_2D_ID, 17 > PktOut_2D
Definition: packets.h:370
virtual size_t Count() const POL_OVERRIDE
Definition: packets.cpp:275
PacketWriterDefs::PacketTemplate< Core::PKTOUT_25_ID, 21 > PktOut_25
Definition: packets.h:366
PacketWriterDefs::PacketTemplate< Core::PKTOUT_77_ID, 17 > PktOut_77
Definition: packets.h:392
PacketWriterDefs::PacketTemplate< Core::PKTOUT_9E_ID, 0xFFFF > PktOut_9E
Definition: packets.h:409
PacketWriterDefs::PacketTemplate< Core::PKTBI_C2_ID, 21 > PktOut_C2
Definition: packets.h:473
std::pair< u16, PacketInterfaceQueue > PacketInterfaceQueuePair
PacketWriterDefs::PacketTemplate< Core::PKTBI_3A_ID, 6+100 *9 > PktOut_3A
Definition: packets.h:373
virtual u16 getSubID() const
PacketWriterDefs::PacketTemplate< Core::PKTBI_72_ID, 5 > PktOut_72
Definition: packets.h:389
PacketWriterDefs::PacketTemplate< Core::PKTOUT_53_ID, 2 > PktOut_53
Definition: packets.h:378
PacketWriterDefs::PacketTemplate< Core::PKTOUT_2F_ID, 10 > PktOut_2F
Definition: packets.h:372
PacketWriterDefs::PacketTemplate< Core::PKTOUT_F6_ID, 0xFFFF > PktOut_F6
Definition: packets.h:487
PacketWriterDefs::PacketTemplate< Core::PKTOUT_B0_ID, 0xFFFF > PktOut_B0
Definition: packets.h:422
PacketWriterDefs::PacketTemplate< Core::PKTOUT_C1_ID, 48+(SPEECH_MAX_LEN+1)+2 > PktOut_C1
Definition: packets.h:472
PacketWriterDefs::PacketTemplate< Core::PKTOUT_6E_ID, 14 > PktOut_6E
Definition: packets.h:386
PacketWriterDefs::PacketTemplate< Core::PKTOUT_70_ID, 28 > PktOut_70
Definition: packets.h:388
PacketWriterDefs::PacketTemplate< Core::PKTOUT_AE_ID,(SPEECH_MAX_LEN+1)*2+48 > PktOut_AE
Definition: packets.h:420
PacketWriterDefs::PacketTemplate< Core::PKTOUT_3C_ID, 5+MAX_CONTAINER_ITEMS *20 > PktOut_3C
Definition: packets.h:376
PacketWriterDefs::EmptyBufferTemplate< ENCRYPTEDPKTBUFFER, 0xFFFF > EncryptedPktBuffer
Definition: packets.h:352
PacketWriterDefs::PacketTemplate< Core::PKTOUT_C7_ID, 49 > PktOut_C7
Definition: packets.h:474
PacketWriterDefs::PacketTemplate< Core::PKTBI_95_ID, 9 > PktOut_95
Definition: packets.h:404
size_t estimateSize() const
Definition: packets.cpp:153
PacketWriterDefs::PacketTemplate< Core::PKTOUT_20_ID, 19 > PktOut_20
Definition: packets.h:361
PacketWriterDefs::PacketTemplate< Core::PKTOUT_F3_ID, 26 > PktOut_F3
Definition: packets.h:485
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_DAMAGE, 5+6 > PktOut_BF_Sub22
Definition: packets.h:466
PacketWriterDefs::PacketTemplate< Core::PKTOUT_65_ID, 4 > PktOut_65
Definition: packets.h:382
PacketWriterDefs::PacketTemplate< Core::PKTBI_6F_ID, 47 > PktOut_6F
Definition: packets.h:387
PacketWriterDefs::PacketTemplate< Core::PKTOUT_7C_ID, 2000 > PktOut_7C
Definition: packets.h:395
PacketWriterDefs::PacketTemplate< Core::PKTOUT_A8_ID, 2000 > PktOut_A8
Definition: packets.h:415
PacketWriterDefs::PacketTemplate< Core::PKTOUT_DC_ID, 9 > PktOut_DC
Definition: packets.h:479
PacketWriterDefs::PacketTemplate< Core::PKTOUT_A6_ID, 10010 > PktOut_A6
Definition: packets.h:414
PacketWriterDefs::PacketTemplate< Core::PKTOUT_54_ID, 12 > PktOut_54
Definition: packets.h:379
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_PARTY_SYSTEM, 0xFFFF > PktOut_BF_Sub6
Definition: packets.h:436
PacketWriterDefs::PacketTemplate< Core::PKTOUT_0B_ID, 7 > PktOut_0B
Definition: packets.h:354
PacketWriterDefs::PacketTemplate< Core::PKTOUT_90_ID, 19 > PktOut_90
Definition: packets.h:402
PacketWriterDefs::PacketTemplate< Core::PKTOUT_A3_ID, 9 > PktOut_A3
Definition: packets.h:412
#define ENCRYPTEDPKTBUFFER
Definition: packets.h:349
PacketWriterDefs::PacketTemplate< Core::PKTOUT_4F_ID, 2 > PktOut_4F
Definition: packets.h:377
PacketWriterDefs::PacketTemplate< Core::PKTOUT_CC_ID, 49+(SPEECH_MAX_LEN+1)*2+SPEECH_MAX_LEN+1 > PktOut_CC
Definition: packets.h:477
PacketWriterDefs::PacketTemplate< Core::PKTBI_9A_ID, 16 > PktOut_9A
Definition: packets.h:408
virtual PacketInterface * GetNext(u8 id, u16 sub=0) POL_OVERRIDE
Definition: packets.cpp:165
PacketWriterDefs::PacketTemplate< Core::PKTOUT_B7_ID, 521 > PktOut_B7
Definition: packets.h:423
PacketWriterDefs::PacketTemplate< Core::PKTOUT_76_ID, 16 > PktOut_76
Definition: packets.h:391
PacketWriterDefs::PacketTemplate< Core::PKTOUT_A1_ID, 9 > PktOut_A1
Definition: packets.h:410
PacketWriterDefs::PacketTemplate< Core::PKTBI_22_APPROVED_ID, 3 > PktOut_22
Definition: packets.h:363
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_ENABLE_MAP_DIFFS, 5+4+MAX_NUMER_REALMS *8 > PktOut_BF_Sub18
Definition: packets.h:451
std::pair< u8, PacketQueue * > PacketQueuePair
PacketInterface * GetPacket(u8 id, u16 sub=0)
Definition: packets.cpp:302
PacketWriterDefs::PacketTemplate< Core::PKTOUT_27_ID, 2 > PktOut_27
Definition: packets.h:367
std::lock_guard< SpinLock > SpinLockGuard
Definition: spinlock.h:33
PacketWriterDefs::PacketTemplate< Core::PKTOUT_F7_ID, 0xFFFF > PktOut_F7
Definition: packets.h:488
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_NEW_SPELLBOOK, 5+18 > PktOut_BF_Sub1B
Definition: packets.h:457
PacketWriterDefs::PacketTemplate< Core::PKTOUT_B9_ID, 5 > PktOut_B9
Definition: packets.h:426
PacketWriterDefs::PacketTemplate< Core::PKTOUT_17_ID, 12 > PktOut_17
Definition: packets.h:356
Definition: berror.cpp:12
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_CUSTOM_HOUSE_SHORT, 5+8 > PktOut_BF_Sub1D
Definition: packets.h:460
PacketWriterDefs::PacketTemplate< Core::PKTOUT_F5_ID, 21 > PktOut_F5
Definition: packets.h:486
PacketWriterDefs::PacketTemplateSub< Core::PKTBI_BF_ID, 3, Core::PKTBI_BF::TYPE_DISPLAY_POPUP_MENU, 0xFFFF > PktOut_BF_Sub14
Definition: packets.h:445
PacketWriterDefs::PacketTemplate< Core::PKTOUT_24_ID, 9 > PktOut_24
Definition: packets.h:365
void ReAddPacket(PacketInterface *pkt)
Definition: packets.cpp:144