Forums WoW Modding Support Archives TrinityCore Discord Archives [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

[DiscordArchive] this looks nice and clean. Do you know how could I extract the World::InitServerAutoRestartTime() in

Pages (2): Previous 1 2
rektbyfaith
Administrator
0
05-03-2024, 03:11 PM
#11
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.
rektbyfaith
05-03-2024, 03:11 PM #11

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.

rektbyfaith
Administrator
0
05-03-2024, 03:12 PM
#12
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:Confusedtring 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:TonguerintMessage(ChatHandler* handler, Player* player, std:Confusedtring 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 )
rektbyfaith
05-03-2024, 03:12 PM #12

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:Confusedtring 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:TonguerintMessage(ChatHandler* handler, Player* player, std:Confusedtring 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 )

rektbyfaith
Administrator
0
05-03-2024, 03:13 PM
#13
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:Confusedtring test);
TC_GAME_API std:Confusedtring 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:Confusedtring test;
};
```

guess it says what it does from the method names.
rektbyfaith
05-03-2024, 03:13 PM #13

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:Confusedtring test);
TC_GAME_API std:Confusedtring 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:Confusedtring test;
};
```

guess it says what it does from the method names.

rektbyfaith
Administrator
0
05-03-2024, 03:13 PM
#14
Archived author: Vel • Posted: 2024-05-03T15:13:33.142000+00:00
Original source

(ofc ignore the test methods )
rektbyfaith
05-03-2024, 03:13 PM #14

Archived author: Vel • Posted: 2024-05-03T15:13:33.142000+00:00
Original source

(ofc ignore the test methods )

rektbyfaith
Administrator
0
05-03-2024, 03:24 PM
#15
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
rektbyfaith
05-03-2024, 03:24 PM #15

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

rektbyfaith
Administrator
0
05-03-2024, 03:25 PM
#16
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
rektbyfaith
05-03-2024, 03:25 PM #16

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

Pages (2): Previous 1 2
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)