Jump to content

Szakalaka

Members
  • Posts

    1,339
  • Credits

  • Joined

  • Last visited

  • Days Won

    3
  • Feedback

    0%

Posts posted by Szakalaka

  1. But on a serious note, why do you use OpenProcess, VirtualProtectEx and all the HANDLE based operation when its a dll so its in the same process as the server itself?

    I briefly looked throught the code :) Want to give opinion.

     

    extern HANDLE server; // externs in such scenario are bad, do you even need the handle if dll is indide?

     

    CUserSocket::IgnorePacket::IgnorePacket(const wchar_t *format, ...)
    : std::exception() // this is redundant, default constructor

     

    Disassemble(packet, "dd", &skillId, &skillLevel); // runtime format is very error prone. Imagine you write s instead of d in some rare packet. Disaster!

     

    Many things should be specified as const. For example, shouldnt "wchar_t* CUser::GetName()" be actually const whar_t* ? (Not saying about raw pointer risk)

     

    Singleton should definitely return a reference. With "static CSkillEnchantDB* GetInstance();" you can switch the pointed object, you can even delete it and do many other bad stuff u avoid using refernce. And btw, its possible to accidentaly copy thsi singleton xD (mark copy operator as deleted)

     

    Logger should be wrapped for safe usage. Again, if you pass an int and type "s" you are dead. With usage of tempaltes you can make compiler generate typesafe code and automatically (and properly) create format for you :)

     

    Generally there are too many static stuffs

     

    But thats only my humble opinion, just want to help ;)

     

    And to guy above, i wont even comment. Pretty sure you know jack shit about this language

×
×
  • Create New...