MCPcopy Create free account
hub / github.com/ddnet/ddnet / RecordPlayerJoin

Method RecordPlayerJoin

src/game/server/teehistorian.cpp:510–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508}
509
510void CTeeHistorian::RecordPlayerJoin(int ClientId, int Protocol)
511{
512 dbg_assert(Protocol == PROTOCOL_6 || Protocol == PROTOCOL_7, "invalid version");
513 EnsureTickWritten();
514
515 {
516 CTeehistorianPacker Buffer;
517 Buffer.Reset();
518 Buffer.AddInt(ClientId);
519 if(m_Debug)
520 {
521 dbg_msg("teehistorian", "joinver%d cid=%d", Protocol == PROTOCOL_6 ? 6 : 7, ClientId);
522 }
523 CUuid Uuid = Protocol == PROTOCOL_6 ? UUID_TEEHISTORIAN_JOINVER6 : UUID_TEEHISTORIAN_JOINVER7;
524 WriteExtra(Uuid, Buffer.Data(), Buffer.Size());
525 }
526
527 CTeehistorianPacker Buffer;
528 Buffer.Reset();
529 Buffer.AddInt(-TEEHISTORIAN_JOIN);
530 Buffer.AddInt(ClientId);
531
532 if(m_Debug)
533 {
534 dbg_msg("teehistorian", "join cid=%d", ClientId);
535 }
536
537 Write(Buffer.Data(), Buffer.Size());
538}
539
540void CTeeHistorian::RecordPlayerRejoin(int ClientId)
541{

Callers 2

TEST_FFunction · 0.80

Calls 6

dbg_msgFunction · 0.85
WriteEnum · 0.85
AddIntMethod · 0.80
ResetMethod · 0.45
DataMethod · 0.45
SizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.64