| 465 | }; |
| 466 | |
| 467 | bool CGameWindow::OnUserMessages(const UserEvent &ev) |
| 468 | { |
| 469 | switch (ev.code) |
| 470 | { |
| 471 | case UOMSG_RECV: |
| 472 | { |
| 473 | AutoFree p(ev.data1); |
| 474 | |
| 475 | g_PacketManager.SavePluginReceivePacket( |
| 476 | (uint8_t *)ev.data1, checked_cast<int>(ev.data2)); |
| 477 | return true; |
| 478 | } |
| 479 | break; |
| 480 | |
| 481 | case UOMSG_SEND: |
| 482 | { |
| 483 | AutoFree p(ev.data1); |
| 484 | |
| 485 | uint32_t ticks = g_Ticks; |
| 486 | uint8_t *buf = (uint8_t *)ev.data1; |
| 487 | int size = checked_cast<int>(ev.data2); |
| 488 | |
| 489 | g_TotalSendSize += size; |
| 490 | |
| 491 | CPacketInfo &type = g_PacketManager.GetInfo(*buf); |
| 492 | (void)type; |
| 493 | |
| 494 | DEBUG( |
| 495 | Plugin, |
| 496 | "--- ^(%d) s(+%d => %d) Plugin->Server:: %s", |
| 497 | ticks - g_LastPacketTime, |
| 498 | size, |
| 499 | g_TotalSendSize, |
| 500 | type.Name); |
| 501 | |
| 502 | g_LastPacketTime = ticks; |
| 503 | g_LastSendTime = ticks; |
| 504 | |
| 505 | if (*buf == 0x80 || *buf == 0x91) |
| 506 | { |
| 507 | DEBUG_DUMP(Plugin, "SEND:", buf, 1); |
| 508 | SAFE_DEBUG_DUMP(Plugin, "SEND:", buf, size); |
| 509 | DEBUG(Plugin, "**** ACCOUNT AND PASSWORD CENSORED ****"); |
| 510 | } |
| 511 | else |
| 512 | { |
| 513 | DEBUG_DUMP(Plugin, "SEND:", buf, size); |
| 514 | } |
| 515 | g_ConnectionManager.Send((uint8_t *)ev.data1, checked_cast<int>(ev.data2)); |
| 516 | return true; |
| 517 | } |
| 518 | break; |
| 519 | |
| 520 | case UOMSG_PATHFINDING: |
| 521 | { |
| 522 | const auto xy = checked_cast<uint32_t>(ev.data1); |
| 523 | const auto zd = checked_cast<uint32_t>(ev.data2); |
| 524 | return !g_PathFinder.WalkTo( |
nothing calls this directly
no test coverage detected