MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / RecvNotificationPacket

Method RecvNotificationPacket

Source/Client/NM_Engine/ServerSocketAuth.cpp:478–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476}
477
478std::size_t CNetworkServer::RecvNotificationPacket(std::shared_ptr<CNetworkPeer> peer, const void* data, std::size_t maxlength)
479{
480 if (maxlength < TPacketNotification::size())
481 return 0;
482
483 if (maxlength != TPacketNotification::size())
484 {
485 NETWORK_LOG(LL_CRI, "Packet size mismatch it can be combined packet!");
486 return TPacketNotification::size();
487 }
488
489 auto packet = reinterpret_cast<const TPacketNotification*>(data);
490
491 NETWORK_LOG(LL_SYS, "Notification packet received! ID: %u", packet->uiNotificationID);
492
493 switch (packet->uiNotificationID)
494 {
495 case NOTIFICATION_CS_BLACKLIST_PARSE_OK:
496 {
497 peer->SendRoutinePacket();
498 } break;
499
500 default:
501 NETWORK_LOG(LL_ERR, "Unknown notificaiton id: %u", packet->uiNotificationID);
502 boost::system::error_code e;
503 peer->Disconnect(e);
504 break;
505 }
506
507 return TPacketNotification::size();
508}
509
510std::size_t CNetworkServer::RecvLargeTestMsg(std::shared_ptr<CNetworkPeer> peer, const void* data, std::size_t maxlength)
511{

Callers

nothing calls this directly

Calls 3

sizeClass · 0.85
SendRoutinePacketMethod · 0.80
DisconnectMethod · 0.45

Tested by

no test coverage detected