[DiscordArchive] this looks nice and clean. Do you know how could I extract the World::InitServerAutoRestartTime() in
[DiscordArchive] this looks nice and clean. Do you know how could I extract the World::InitServerAutoRestartTime() in
Archived author: Vel • Posted: 2024-05-03T15:11:01.147000+00:00
Original source
Yeah, I know. But I have more than 10+ years of professional experience as a PHP developer. So it's not that bad. And I was actually successfull now building what I described before.
tring message);
rintMessage(ChatHandler* handler, Player* player, std:
tring message)Archived author: Vel • Posted: 2024-05-03T15:12:28.322000+00:00
Original source
VelHelper.h
```
#include "Define.h"
#include "Player.h"
#include "Chat.h"
#include <string>
namespace VelHelper
{
TC_GAME_API void PrintMessage(ChatHandler* handler, Player* player, std:
tring message);
}
class VelHelperClass
{
public:
VelHelperClass() noexcept;
};```
VelHelper.cpp
```
#include "VelHelper.h"
#include "Common.h"
#include "ScriptMgr.h"
#include "Util.h"
#include "Player.h"
#include "Chat.h"
#include <iterator>
#include <sstream>
namespace VelHelper {
extern VelHelperClass g_VelHelperInstance;
}
VelHelperClass::VelHelperClass() noexcept
{
}
VelHelperClass VelHelper::g_VelHelperInstance;
// Define namespace functions
void VelHelper:
rintMessage(ChatHandler* handler, Player* player, std:
tring message)
{
if( player == handler->GetPlayer() ) {
handler->PSendSysMessage("|cffFFFFFF[|cffFFFF00Vel's|cffFFFFFF]|cffFFFFFF[|cfffcc203CORE|cffFFFFFF]: |cffFFFFFF%s|r", message);
} else {
ChatHandler(player->GetSession()).PSendSysMessage("|cffFFFFFF[|cffFFFF00Vel's|cffFFFFFF]|cffFFFFFF[|cfffcc203CORE|cffFFFFFF]: |cffFFFFFF%s|r", message);
}
}
```
One of the side-classes I created. Is it alright from best-practice view? (codewise it works fine )
tring test);
tring GetTest();
tring test;Archived author: Vel • Posted: 2024-05-03T15:13:22.426000+00:00
Original source
The main class is:
```c++
#include "Define.h"
#include "Player.h"
#include <string>
namespace VelRpStats
{
TC_GAME_API void SetTest(std:
tring test);
TC_GAME_API std:
tring GetTest();
TC_GAME_API std::array<int32, 4> Load(Player* target);
TC_GAME_API void Save(Player* target, int32 hp, int32 maxHp, int32 energy, int32 maxEnergy);
TC_GAME_API void RefreshAll();
TC_GAME_API void ActivateCreature(Creature* creature, int32 hp, int32 energy);
TC_GAME_API void DeactivateCreature(Creature* creature);
TC_GAME_API int32 _getClassMaxHp(Player* player);
TC_GAME_API int32 _getClassMaxEnergy(Player* player);
}
class VelRpStatsClass
{
public:
VelRpStatsClass() noexcept;
std:
tring test;
};
```
guess it says what it does from the method names.
Archived author: Vel • Posted: 2024-05-03T15:13:33.142000+00:00
Original source
(ofc ignore the test methods )
Archived author: Foe • Posted: 2024-05-03T15:24:22.577000+00:00
Original source
Sure, but the majority of people using it as a crutch doesn't know that so it just ends up being a really bad feedback loop
Archived author: Foe • Posted: 2024-05-03T15:25:13.500000+00:00
Original source
The white paper from github about copilot and the quality of its code is interesting