| 476 | } |
| 477 | |
| 478 | std::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 | |
| 510 | std::size_t CNetworkServer::RecvLargeTestMsg(std::shared_ptr<CNetworkPeer> peer, const void* data, std::size_t maxlength) |
| 511 | { |
nothing calls this directly
no test coverage detected