MCPcopy Create free account
hub / github.com/crossuo/crossuo / OnUserMessages

Method OnUserMessages

src/GameWindow.cpp:467–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465};
466
467bool 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(

Callers

nothing calls this directly

Calls 11

CPacketMenuResponseClass · 0.85
memcpyFunction · 0.85
WalkToMethod · 0.80
WalkMethod · 0.80
RemoveGumpMethod · 0.80
GetGumpMethod · 0.80
GetServerMethod · 0.80
SendMethod · 0.45
UpdateContentMethod · 0.45

Tested by

no test coverage detected