1. CommonDefines.h veya service.h içerisine ekle
  2. #define FLUSH_AT_SHUTDOWN
  3. cmd_general.cpp içerisinde
  4. struct SendDisconnectFunc
  5. //Arat
  6. struct SendDisconnectFunc
  7. {
  8. void operator () (LPDESC d)
  9. {
  10. if (d->GetCharacter())
  11. {
  12. #ifdef FLUSH_AT_SHUTDOWN
  13. d->GetCharacter()->SaveReal();
  14. DWORD pid = d->GetCharacter()->GetPlayerID();
  15. db_clientdesc->DBPacketHeader(HEADER_GD_FLUSH_CACHE, 0, sizeof(DWORD));
  16. db_clientdesc->Packet(&pid, sizeof(DWORD));
  17. #endif
  18. if (d->GetCharacter()->GetGMLevel() == GM_PLAYER)
  19. d->GetCharacter()->ChatPacket(CHAT_TYPE_COMMAND, "quit Shutdown(SendDisconnectFunc)");
  20. }
  21. }
  22. };
  23. //Fonksiyonu bu şekilde değiştiriniz.
  24. cmd_gm.cpp içerisinde
  25. ACMD(do_flush)
  26. {
  27. //Aratınız
  28. ACMD(do_flush)
  29. {
  30. char arg1[256];
  31. one_argument(argument, arg1, sizeof(arg1));
  32. #ifdef FLUSH_AT_SHUTDOWN
  33. DWORD pid = 0;
  34. if(0 == arg1[0])
  35. pid = ch->GetPlayerID();
  36. else
  37. pid = (DWORD)strtoul(arg1, NULL, 10);
  38. if (pid != 0)
  39. {
  40. ch->SaveReal();
  41. db_clientdesc->DBPacketHeader(HEADER_GD_FLUSH_CACHE, 0, sizeof(DWORD));
  42. db_clientdesc->Packet(&pid, sizeof(DWORD));
  43. }
  44. #else
  45. if (0 == arg1[0])
  46. {
  47. ch->ChatPacket(CHAT_TYPE_INFO, "usage : /flush player_id");
  48. return;
  49. }
  50. DWORD pid = (DWORD)strtoul(arg1, NULL, 10);
  51. db_clientdesc->DBPacketHeader(HEADER_GD_FLUSH_CACHE, 0, sizeof(DWORD));
  52. db_clientdesc->Packet(&pid, sizeof(DWORD));
  53. #endif
  54. }
  55. //Fonksiyonu bu şekilde değiştiriniz.
Comments powered by Disqus