Use lowerCamelCase in tes3mp server script function names, part 1

coverity_scan^2
David Cernat 8 years ago
parent 25dc2b19e7
commit 0e2b589cdb

@ -10,7 +10,7 @@
using namespace std;
using namespace ESM;
void CharClassFunctions::SendClass(unsigned short pid) noexcept
void CharClassFunctions::sendClass(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -18,26 +18,26 @@ void CharClassFunctions::SendClass(unsigned short pid) noexcept
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_CHARCLASS)->Send(player, false);
}
void CharClassFunctions::SetDefaultClass(unsigned short pid, const char *id) noexcept
void CharClassFunctions::setDefaultClass(unsigned short pid, const char *id) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
player->charClass.mId = id;
}
void CharClassFunctions::SetClassName(unsigned short pid, const char *name) noexcept
void CharClassFunctions::setClassName(unsigned short pid, const char *name) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
player->charClass.mName = name;
player->charClass.mId = "";
}
void CharClassFunctions::SetClassDesc(unsigned short pid, const char *desc) noexcept
void CharClassFunctions::setClassDesc(unsigned short pid, const char *desc) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
player->charClass.mDescription = desc;
}
void CharClassFunctions::SetClassMajorAttribute(unsigned short pid, unsigned char slot, int attrId) noexcept
void CharClassFunctions::setClassMajorAttribute(unsigned short pid, unsigned char slot, int attrId) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -48,13 +48,13 @@ void CharClassFunctions::SetClassMajorAttribute(unsigned short pid, unsigned cha
player->charClass.mData.mAttribute[slot] = attrId;
}
void CharClassFunctions::SetClassSpecialization(unsigned short pid, int spec) noexcept
void CharClassFunctions::setClassSpecialization(unsigned short pid, int spec) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
player->charClass.mData.mSpecialization = spec;
}
void CharClassFunctions::SetClassMajorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept
void CharClassFunctions::setClassMajorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -62,7 +62,7 @@ void CharClassFunctions::SetClassMajorSkill(unsigned short pid, unsigned char sl
throw invalid_argument("Incorrect skill slot id");
player->charClass.mData.mSkills[slot][1] = skillId;
}
void CharClassFunctions::SetClassMinorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept
void CharClassFunctions::setClassMinorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -71,35 +71,35 @@ void CharClassFunctions::SetClassMinorSkill(unsigned short pid, unsigned char sl
player->charClass.mData.mSkills[slot][0] = skillId;
}
int CharClassFunctions::IsClassDefault(unsigned short pid) noexcept
int CharClassFunctions::isClassDefault(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,0);
return !player->charClass.mId.empty(); // true if default
}
const char *CharClassFunctions::GetDefaultClass(unsigned short pid) noexcept
const char *CharClassFunctions::getDefaultClass(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,"");
return player->charClass.mId.c_str();
}
const char *CharClassFunctions::GetClassName(unsigned short pid) noexcept
const char *CharClassFunctions::getClassName(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,"");
return player->charClass.mName.c_str();
}
const char *CharClassFunctions::GetClassDesc(unsigned short pid) noexcept
const char *CharClassFunctions::getClassDesc(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,"");
return player->charClass.mDescription.c_str();
}
int CharClassFunctions::GetClassMajorAttribute(unsigned short pid, unsigned char slot) noexcept
int CharClassFunctions::getClassMajorAttribute(unsigned short pid, unsigned char slot) noexcept
{
Player *player;
GET_PLAYER(pid, player,0);
@ -108,14 +108,14 @@ int CharClassFunctions::GetClassMajorAttribute(unsigned short pid, unsigned char
return player->charClass.mData.mAttribute[slot];
}
int CharClassFunctions::GetClassSpecialization(unsigned short pid) noexcept
int CharClassFunctions::getClassSpecialization(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,0);
return player->charClass.mData.mSpecialization;
}
int CharClassFunctions::GetClassMajorSkill(unsigned short pid, unsigned char slot) noexcept
int CharClassFunctions::getClassMajorSkill(unsigned short pid, unsigned char slot) noexcept
{
Player *player;
GET_PLAYER(pid, player,0);
@ -124,7 +124,7 @@ int CharClassFunctions::GetClassMajorSkill(unsigned short pid, unsigned char slo
return player->charClass.mData.mSkills[slot][1];
}
int CharClassFunctions::GetClassMinorSkill(unsigned short pid, unsigned char slot) noexcept
int CharClassFunctions::getClassMinorSkill(unsigned short pid, unsigned char slot) noexcept
{
Player *player;
GET_PLAYER(pid, player,0);

@ -8,75 +8,75 @@
#include "../Types.hpp"
#define CHARCLASSFUNCTIONS \
{"SetDefaultClass", CharClassFunctions::SetDefaultClass},\
{"SetClassName", CharClassFunctions::SetClassName},\
{"SetClassDesc", CharClassFunctions::SetClassDesc},\
{"SetClassMajorAttribute", CharClassFunctions::SetClassMajorAttribute},\
{"SetClassSpecialization", CharClassFunctions::SetClassSpecialization},\
{"SetClassMajorSkill", CharClassFunctions::SetClassMajorSkill},\
{"SetClassMinorSkill", CharClassFunctions::SetClassMinorSkill},\
{"GetDefaultClass", CharClassFunctions::GetDefaultClass},\
{"GetClassName", CharClassFunctions::GetClassName},\
{"GetClassDesc", CharClassFunctions::GetClassDesc},\
{"GetClassMajorAttribute", CharClassFunctions::GetClassMajorAttribute},\
{"GetClassSpecialization", CharClassFunctions::GetClassSpecialization},\
{"GetClassMajorSkill", CharClassFunctions::GetClassMajorSkill},\
{"GetClassMinorSkill", CharClassFunctions::GetClassMinorSkill},\
{"IsClassDefault", CharClassFunctions::IsClassDefault},\
{"SendClass", CharClassFunctions::SendClass}
{"setDefaultClass", CharClassFunctions::setDefaultClass},\
{"setClassName", CharClassFunctions::setClassName},\
{"setClassDesc", CharClassFunctions::setClassDesc},\
{"setClassMajorAttribute", CharClassFunctions::setClassMajorAttribute},\
{"setClassSpecialization", CharClassFunctions::setClassSpecialization},\
{"setClassMajorSkill", CharClassFunctions::setClassMajorSkill},\
{"setClassMinorSkill", CharClassFunctions::setClassMinorSkill},\
{"getDefaultClass", CharClassFunctions::getDefaultClass},\
{"getClassName", CharClassFunctions::getClassName},\
{"getClassDesc", CharClassFunctions::getClassDesc},\
{"getClassMajorAttribute", CharClassFunctions::getClassMajorAttribute},\
{"getClassSpecialization", CharClassFunctions::getClassSpecialization},\
{"getClassMajorSkill", CharClassFunctions::getClassMajorSkill},\
{"getClassMinorSkill", CharClassFunctions::getClassMinorSkill},\
{"isClassDefault", CharClassFunctions::isClassDefault},\
{"sendClass", CharClassFunctions::sendClass}
class CharClassFunctions
{
public:
CharClassFunctions() {}
static void SetDefaultClass(unsigned short pid, const char *id) noexcept;
static void SetClassName(unsigned short pid, const char *name) noexcept;
static void SetClassDesc(unsigned short pid, const char *desc) noexcept;
static void setDefaultClass(unsigned short pid, const char *id) noexcept;
static void setClassName(unsigned short pid, const char *name) noexcept;
static void setClassDesc(unsigned short pid, const char *desc) noexcept;
/**
* \param pid
* \param slot 0 = first, 1 = second
* \param attrId
*/
static void SetClassMajorAttribute(unsigned short pid, unsigned char slot, int attrId) noexcept;
static void setClassMajorAttribute(unsigned short pid, unsigned char slot, int attrId) noexcept;
/**
* \param pid
* \param spec 0 = Combat, 1 = Magic, 2 = Stealth
*/
static void SetClassSpecialization(unsigned short pid, int spec) noexcept;
static void setClassSpecialization(unsigned short pid, int spec) noexcept;
/**
* \param pid
* \param slot 0 to 4
* \param skillId
*/
static void SetClassMajorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
static void SetClassMinorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
static void setClassMajorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
static void setClassMinorSkill(unsigned short pid, unsigned char slot, int skillId) noexcept;
static const char *GetDefaultClass(unsigned short pid) noexcept;
static const char *GetClassName(unsigned short pid) noexcept;
static const char *GetClassDesc(unsigned short pid) noexcept;
static const char *getDefaultClass(unsigned short pid) noexcept;
static const char *getClassName(unsigned short pid) noexcept;
static const char *getClassDesc(unsigned short pid) noexcept;
/**
* \param pid
* \param slot 0 = first, 1 = second
* \return attrId
*/
static int GetClassMajorAttribute(unsigned short pid, unsigned char slot) noexcept;
static int getClassMajorAttribute(unsigned short pid, unsigned char slot) noexcept;
/**
* \param pid
* \return spec 0 = Combat, 1 = Magic, 2 = Stealth
*/
static int GetClassSpecialization(unsigned short pid) noexcept;
static int getClassSpecialization(unsigned short pid) noexcept;
/**
* \param pid
* \param slot 0 to 4
* \return skillId
*/
static int GetClassMajorSkill(unsigned short pid, unsigned char slot) noexcept;
static int GetClassMinorSkill(unsigned short pid, unsigned char slot) noexcept;
static int getClassMajorSkill(unsigned short pid, unsigned char slot) noexcept;
static int getClassMinorSkill(unsigned short pid, unsigned char slot) noexcept;
static int IsClassDefault(unsigned short pid) noexcept;
static int isClassDefault(unsigned short pid) noexcept;
static void SendClass(unsigned short pid) noexcept;
static void sendClass(unsigned short pid) noexcept;
};
#endif //OPENMW_CHARCLASS_HPP

@ -10,7 +10,7 @@
using namespace mwmp;
void ItemFunctions::AddItem(unsigned short pid, const char* itemName, unsigned int count, int health) noexcept
void ItemFunctions::addItem(unsigned short pid, const char* itemName, unsigned int count, int health) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -24,7 +24,7 @@ void ItemFunctions::AddItem(unsigned short pid, const char* itemName, unsigned i
player->inventorySendBuffer.action = Inventory::ADDITEM;
}
void ItemFunctions::EquipItem(unsigned short pid, unsigned short slot, const char *itemName, unsigned int count, int health) noexcept
void ItemFunctions::equipItem(unsigned short pid, unsigned short slot, const char *itemName, unsigned int count, int health) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -34,13 +34,13 @@ void ItemFunctions::EquipItem(unsigned short pid, unsigned short slot, const cha
player->EquipedItem(slot)->health = health;
}
void ItemFunctions::UnequipItem(unsigned short pid, unsigned short slot) noexcept
void ItemFunctions::unequipItem(unsigned short pid, unsigned short slot) noexcept
{
LOG_MESSAGE(Log::LOG_WARN, "%s", "stub");
//ItemFunctions::EquipItem(pid, slot, "", 0);
//ItemFunctions::equipItem(pid, slot, "", 0);
}
const char *ItemFunctions::GetItemSlot(unsigned short pid, unsigned short slot) noexcept
const char *ItemFunctions::getItemSlot(unsigned short pid, unsigned short slot) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -48,7 +48,7 @@ const char *ItemFunctions::GetItemSlot(unsigned short pid, unsigned short slot)
return player->EquipedItem(slot)->refid.c_str();
}
bool ItemFunctions::HasItemEquipped(unsigned short pid, const char* itemName)
bool ItemFunctions::hasItemEquipped(unsigned short pid, const char* itemName)
{
Player *player;
GET_PLAYER(pid, player, false);
@ -59,7 +59,7 @@ bool ItemFunctions::HasItemEquipped(unsigned short pid, const char* itemName)
return false;
}
void ItemFunctions::RemoveItem(unsigned short pid, const char* itemName, unsigned short count) noexcept
void ItemFunctions::removeItem(unsigned short pid, const char* itemName, unsigned short count) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -72,12 +72,12 @@ void ItemFunctions::RemoveItem(unsigned short pid, const char* itemName, unsigne
player->inventorySendBuffer.items.push_back(item);
player->inventorySendBuffer.action = Inventory::REMOVEITEM;
}
void ItemFunctions::GetItemCount(unsigned short pid, const char* itemName) noexcept
void ItemFunctions::getItemCount(unsigned short pid, const char* itemName) noexcept
{
LOG_MESSAGE(Log::LOG_WARN, "%s", "stub");
}
const char *ItemFunctions::GetItemName(unsigned short pid, unsigned int i) noexcept
const char *ItemFunctions::getItemName(unsigned short pid, unsigned int i) noexcept
{
Player *player;
GET_PLAYER(pid, player, "");
@ -85,7 +85,7 @@ const char *ItemFunctions::GetItemName(unsigned short pid, unsigned int i) noexc
return player->inventory.items.at(i).refid.c_str();
}
int ItemFunctions::GetItemCount2(unsigned short pid, unsigned int i) noexcept
int ItemFunctions::getItemCount2(unsigned short pid, unsigned int i) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -93,7 +93,7 @@ int ItemFunctions::GetItemCount2(unsigned short pid, unsigned int i) noexcept
return player->inventory.items.at(i).count;
}
int ItemFunctions::GetItemHealth(unsigned short pid, unsigned int i) noexcept
int ItemFunctions::getItemHealth(unsigned short pid, unsigned int i) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -101,7 +101,7 @@ int ItemFunctions::GetItemHealth(unsigned short pid, unsigned int i) noexcept
return player->inventory.items.at(i).health;
}
unsigned int ItemFunctions::GetInventorySize(unsigned short pid) noexcept
unsigned int ItemFunctions::getInventorySize(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -109,7 +109,7 @@ unsigned int ItemFunctions::GetInventorySize(unsigned short pid) noexcept
return player->inventory.count;
}
void ItemFunctions::SendEquipment(unsigned short pid) noexcept
void ItemFunctions::sendEquipment(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -118,7 +118,7 @@ void ItemFunctions::SendEquipment(unsigned short pid) noexcept
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_EQUIPMENT)->Send(player, true);
}
void ItemFunctions::SendInventory(unsigned short pid) noexcept
void ItemFunctions::sendInventory(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );

@ -6,38 +6,38 @@
#define OPENMW_ITEMS_HPP
#define ITEMAPI \
{"AddItem", ItemFunctions::AddItem},\
{"RemoveItem", ItemFunctions::RemoveItem},\
{"GetItemCount", ItemFunctions::GetItemCount2},\
{"EquipItem", ItemFunctions::EquipItem},\
{"UnequipItem", ItemFunctions::UnequipItem},\
{"GetItemSlot", ItemFunctions::GetItemSlot},\
{"HasItemEquipped", ItemFunctions::HasItemEquipped},\
{"GetItemName", ItemFunctions::GetItemName},\
{"GetItemHealth", ItemFunctions::GetItemHealth},\
{"GetInventorySize", ItemFunctions::GetInventorySize},\
{"addItem", ItemFunctions::addItem},\
{"removeItem", ItemFunctions::removeItem},\
{"getItemCount", ItemFunctions::getItemCount2},\
{"equipItem", ItemFunctions::equipItem},\
{"unequipItem", ItemFunctions::unequipItem},\
{"getItemSlot", ItemFunctions::getItemSlot},\
{"hasItemEquipped", ItemFunctions::hasItemEquipped},\
{"getItemName", ItemFunctions::getItemName},\
{"getItemHealth", ItemFunctions::getItemHealth},\
{"getInventorySize", ItemFunctions::getInventorySize},\
\
{"SendEquipment", ItemFunctions::SendEquipment},\
{"SendInventory", ItemFunctions::SendInventory}\
{"sendEquipment", ItemFunctions::sendEquipment},\
{"sendInventory", ItemFunctions::sendInventory}\
class ItemFunctions
{
public:
static void AddItem(unsigned short pid, const char* itemName, unsigned int count, int health) noexcept;
static void RemoveItem(unsigned short pid, const char* itemName, unsigned short count) noexcept;
static void GetItemCount(unsigned short pid, const char* itemName) noexcept;
static void EquipItem(unsigned short pid, unsigned short slot, const char* itemName, unsigned int count, int health) noexcept;
static void UnequipItem(unsigned short pid, unsigned short slot) noexcept;
static bool HasItemEquipped(unsigned short pid, const char* itemName);
static const char *GetItemSlot(unsigned short pid, unsigned short slot) noexcept;
static void addItem(unsigned short pid, const char* itemName, unsigned int count, int health) noexcept;
static void removeItem(unsigned short pid, const char* itemName, unsigned short count) noexcept;
static void getItemCount(unsigned short pid, const char* itemName) noexcept;
static void equipItem(unsigned short pid, unsigned short slot, const char* itemName, unsigned int count, int health) noexcept;
static void unequipItem(unsigned short pid, unsigned short slot) noexcept;
static bool hasItemEquipped(unsigned short pid, const char* itemName);
static const char *getItemSlot(unsigned short pid, unsigned short slot) noexcept;
static const char *GetItemName(unsigned short pid, unsigned int i) noexcept;
static int GetItemCount2(unsigned short pid, unsigned int i) noexcept;
static int GetItemHealth(unsigned short pid, unsigned int i) noexcept;
static unsigned int GetInventorySize(unsigned short pid) noexcept;
static const char *getItemName(unsigned short pid, unsigned int i) noexcept;
static int getItemCount2(unsigned short pid, unsigned int i) noexcept;
static int getItemHealth(unsigned short pid, unsigned int i) noexcept;
static unsigned int getInventorySize(unsigned short pid) noexcept;
static void SendEquipment(unsigned short pid) noexcept;
static void SendInventory(unsigned short pid) noexcept;
static void sendEquipment(unsigned short pid) noexcept;
static void sendInventory(unsigned short pid) noexcept;
private:
};

@ -15,7 +15,7 @@
using namespace std;
using namespace ESM;
void StatsFunctions::SetName(unsigned short pid, const char *name) noexcept
void StatsFunctions::setName(unsigned short pid, const char *name) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -26,7 +26,7 @@ void StatsFunctions::SetName(unsigned short pid, const char *name) noexcept
player->Npc()->mName = name;
}
const char *StatsFunctions::GetName(unsigned short pid) noexcept
const char *StatsFunctions::getName(unsigned short pid) noexcept
{
Player *player;
@ -35,7 +35,7 @@ const char *StatsFunctions::GetName(unsigned short pid) noexcept
return player->Npc()->mName.c_str();
}
void StatsFunctions::SetBirthsign(unsigned short pid, const char *sign) noexcept
void StatsFunctions::setBirthsign(unsigned short pid, const char *sign) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -46,7 +46,7 @@ void StatsFunctions::SetBirthsign(unsigned short pid, const char *sign) noexcept
*player->BirthSign() = sign;
}
const char *StatsFunctions::GetBirthsign(unsigned short pid) noexcept
const char *StatsFunctions::getBirthsign(unsigned short pid) noexcept
{
Player *player;
@ -56,7 +56,7 @@ const char *StatsFunctions::GetBirthsign(unsigned short pid) noexcept
return player->BirthSign()->c_str();
}
void StatsFunctions::SetRace(unsigned short pid, const char *race) noexcept
void StatsFunctions::setRace(unsigned short pid, const char *race) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -72,7 +72,7 @@ void StatsFunctions::SetRace(unsigned short pid, const char *race) noexcept
player->Npc()->mRace = race;
}
const char *StatsFunctions::GetRace(unsigned short pid) noexcept
const char *StatsFunctions::getRace(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -80,7 +80,7 @@ const char *StatsFunctions::GetRace(unsigned short pid) noexcept
return player->Npc()->mRace.c_str();
}
void StatsFunctions::SetHead(unsigned short pid, const char *head) noexcept
void StatsFunctions::setHead(unsigned short pid, const char *head) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -91,7 +91,7 @@ void StatsFunctions::SetHead(unsigned short pid, const char *head) noexcept
player->Npc()->mHead = head;
}
const char *StatsFunctions::GetHead(unsigned short pid) noexcept
const char *StatsFunctions::getHead(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -99,7 +99,7 @@ const char *StatsFunctions::GetHead(unsigned short pid) noexcept
return player->Npc()->mHead.c_str();
}
void StatsFunctions::SetHairstyle(unsigned short pid, const char *style) noexcept
void StatsFunctions::setHairstyle(unsigned short pid, const char *style) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -110,7 +110,7 @@ void StatsFunctions::SetHairstyle(unsigned short pid, const char *style) noexcep
player->Npc()->mHair = style;
}
const char *StatsFunctions::GetHairstyle(unsigned short pid) noexcept
const char *StatsFunctions::getHairstyle(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -118,7 +118,7 @@ const char *StatsFunctions::GetHairstyle(unsigned short pid) noexcept
return player->Npc()->mHair.c_str();
}
int StatsFunctions::GetIsMale(unsigned short pid) noexcept
int StatsFunctions::getIsMale(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,false);
@ -126,7 +126,7 @@ int StatsFunctions::GetIsMale(unsigned short pid) noexcept
return player->Npc()->isMale();
}
void StatsFunctions::SetIsMale(unsigned short pid, int value) noexcept
void StatsFunctions::setIsMale(unsigned short pid, int value) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -134,7 +134,7 @@ void StatsFunctions::SetIsMale(unsigned short pid, int value) noexcept
player->Npc()->setIsMale(value == true);
}
int StatsFunctions::GetLevel(unsigned short pid) noexcept
int StatsFunctions::getLevel(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -142,7 +142,7 @@ int StatsFunctions::GetLevel(unsigned short pid) noexcept
return player->CreatureStats()->mLevel;
}
void StatsFunctions::SetLevel(unsigned short pid, int value) noexcept
void StatsFunctions::setLevel(unsigned short pid, int value) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -150,7 +150,7 @@ void StatsFunctions::SetLevel(unsigned short pid, int value) noexcept
player->CreatureStats()->mLevel = value;
}
int StatsFunctions::GetLevelProgress(unsigned short pid) noexcept
int StatsFunctions::getLevelProgress(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -158,7 +158,7 @@ int StatsFunctions::GetLevelProgress(unsigned short pid) noexcept
return player->NpcStats()->mLevelProgress;
}
void StatsFunctions::SetLevelProgress(unsigned short pid, int value) noexcept
void StatsFunctions::setLevelProgress(unsigned short pid, int value) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -166,7 +166,7 @@ void StatsFunctions::SetLevelProgress(unsigned short pid, int value) noexcept
player->NpcStats()->mLevelProgress = value;
}
double StatsFunctions::GetHealthBase(unsigned short pid) noexcept
double StatsFunctions::getHealthBase(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -174,7 +174,7 @@ double StatsFunctions::GetHealthBase(unsigned short pid) noexcept
return player->CreatureStats()->mDynamic[0].mBase;
}
void StatsFunctions::SetHealthBase(unsigned short pid, double value) noexcept
void StatsFunctions::setHealthBase(unsigned short pid, double value) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -182,7 +182,7 @@ void StatsFunctions::SetHealthBase(unsigned short pid, double value) noexcept
player->CreatureStats()->mDynamic[0].mBase = value;
}
double StatsFunctions::GetHealthCurrent(unsigned short pid) noexcept
double StatsFunctions::getHealthCurrent(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -190,7 +190,7 @@ double StatsFunctions::GetHealthCurrent(unsigned short pid) noexcept
return player->CreatureStats()->mDynamic[0].mCurrent;
}
void StatsFunctions::SetHealthCurrent(unsigned short pid, double value) noexcept
void StatsFunctions::setHealthCurrent(unsigned short pid, double value) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -198,7 +198,7 @@ void StatsFunctions::SetHealthCurrent(unsigned short pid, double value) noexcept
player->CreatureStats()->mDynamic[0].mCurrent = value;
}
double StatsFunctions::GetMagickaBase(unsigned short pid) noexcept
double StatsFunctions::getMagickaBase(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -206,7 +206,7 @@ double StatsFunctions::GetMagickaBase(unsigned short pid) noexcept
return player->CreatureStats()->mDynamic[1].mBase;
}
void StatsFunctions::SetMagickaBase(unsigned short pid, double value) noexcept
void StatsFunctions::setMagickaBase(unsigned short pid, double value) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -214,7 +214,7 @@ void StatsFunctions::SetMagickaBase(unsigned short pid, double value) noexcept
player->CreatureStats()->mDynamic[1].mBase = value;
}
double StatsFunctions::GetMagickaCurrent(unsigned short pid) noexcept
double StatsFunctions::getMagickaCurrent(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -222,7 +222,7 @@ double StatsFunctions::GetMagickaCurrent(unsigned short pid) noexcept
return player->CreatureStats()->mDynamic[1].mCurrent;
}
void StatsFunctions::SetMagickaCurrent(unsigned short pid, double value) noexcept
void StatsFunctions::setMagickaCurrent(unsigned short pid, double value) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -230,7 +230,7 @@ void StatsFunctions::SetMagickaCurrent(unsigned short pid, double value) noexcep
player->CreatureStats()->mDynamic[1].mCurrent = value;
}
double StatsFunctions::GetFatigueBase(unsigned short pid) noexcept
double StatsFunctions::getFatigueBase(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -238,7 +238,7 @@ double StatsFunctions::GetFatigueBase(unsigned short pid) noexcept
return player->CreatureStats()->mDynamic[2].mBase;
}
void StatsFunctions::SetFatigueBase(unsigned short pid, double value) noexcept
void StatsFunctions::setFatigueBase(unsigned short pid, double value) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -246,7 +246,7 @@ void StatsFunctions::SetFatigueBase(unsigned short pid, double value) noexcept
player->CreatureStats()->mDynamic[2].mBase = value;
}
double StatsFunctions::GetFatigueCurrent(unsigned short pid) noexcept
double StatsFunctions::getFatigueCurrent(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -254,7 +254,7 @@ double StatsFunctions::GetFatigueCurrent(unsigned short pid) noexcept
return player->CreatureStats()->mDynamic[2].mCurrent;
}
void StatsFunctions::SetFatigueCurrent(unsigned short pid, double value) noexcept
void StatsFunctions::setFatigueCurrent(unsigned short pid, double value) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -262,17 +262,17 @@ void StatsFunctions::SetFatigueCurrent(unsigned short pid, double value) noexcep
player->CreatureStats()->mDynamic[2].mCurrent = value;
}
int StatsFunctions::GetAttributeCount() noexcept
int StatsFunctions::getAttributeCount() noexcept
{
return Attribute::Length;
}
int StatsFunctions::GetSkillCount() noexcept
int StatsFunctions::getSkillCount() noexcept
{
return Skill::Length;
}
int StatsFunctions::GetAttributeId(const char *name) noexcept
int StatsFunctions::getAttributeId(const char *name) noexcept
{
for (int x = 0; x < Attribute::Length; x++)
{
@ -285,7 +285,7 @@ int StatsFunctions::GetAttributeId(const char *name) noexcept
return -1;
}
int StatsFunctions::GetSkillId(const char *name) noexcept
int StatsFunctions::getSkillId(const char *name) noexcept
{
for (int x = 0; x < Skill::Length; x++)
{
@ -298,7 +298,7 @@ int StatsFunctions::GetSkillId(const char *name) noexcept
return -1;
}
const char *StatsFunctions::GetAttributeName(unsigned short attribute) noexcept
const char *StatsFunctions::getAttributeName(unsigned short attribute) noexcept
{
if (attribute >= Attribute::Length)
return "invalid";
@ -306,7 +306,7 @@ const char *StatsFunctions::GetAttributeName(unsigned short attribute) noexcept
return Attribute::sAttributeNames[attribute].c_str();
}
const char *StatsFunctions::GetSkillName(unsigned short skill) noexcept
const char *StatsFunctions::getSkillName(unsigned short skill) noexcept
{
if (skill >= Skill::Length)
return "invalid";
@ -314,7 +314,7 @@ const char *StatsFunctions::GetSkillName(unsigned short skill) noexcept
return Skill::sSkillNames[skill].c_str();
}
int StatsFunctions::GetAttributeBase(unsigned short pid, unsigned short attribute) noexcept
int StatsFunctions::getAttributeBase(unsigned short pid, unsigned short attribute) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -325,7 +325,7 @@ int StatsFunctions::GetAttributeBase(unsigned short pid, unsigned short attribut
return player->CreatureStats()->mAttributes[attribute].mBase;
}
void StatsFunctions::SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept
void StatsFunctions::setAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -336,7 +336,7 @@ void StatsFunctions::SetAttributeBase(unsigned short pid, unsigned short attribu
player->CreatureStats()->mAttributes[attribute].mBase = value;
}
int StatsFunctions::GetAttributeCurrent(unsigned short pid, unsigned short attribute) noexcept
int StatsFunctions::getAttributeCurrent(unsigned short pid, unsigned short attribute) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -347,7 +347,7 @@ int StatsFunctions::GetAttributeCurrent(unsigned short pid, unsigned short attri
return player->CreatureStats()->mAttributes[attribute].mCurrent;
}
void StatsFunctions::SetAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept
void StatsFunctions::setAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -358,7 +358,7 @@ void StatsFunctions::SetAttributeCurrent(unsigned short pid, unsigned short attr
player->CreatureStats()->mAttributes[attribute].mCurrent = value;
}
int StatsFunctions::GetSkillBase(unsigned short pid, unsigned short skill) noexcept
int StatsFunctions::getSkillBase(unsigned short pid, unsigned short skill) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -369,7 +369,7 @@ int StatsFunctions::GetSkillBase(unsigned short pid, unsigned short skill) noexc
return player->NpcStats()->mSkills[skill].mBase;
}
void StatsFunctions::SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
void StatsFunctions::setSkillBase(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
{
Player *player;
GET_PLAYER(pid, player,);
@ -380,7 +380,7 @@ void StatsFunctions::SetSkillBase(unsigned short pid, unsigned short skill, int
player->NpcStats()->mSkills[skill].mBase = value;
}
int StatsFunctions::GetSkillCurrent(unsigned short pid, unsigned short skill) noexcept
int StatsFunctions::getSkillCurrent(unsigned short pid, unsigned short skill) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -391,7 +391,7 @@ int StatsFunctions::GetSkillCurrent(unsigned short pid, unsigned short skill) no
return player->NpcStats()->mSkills[skill].mCurrent;
}
void StatsFunctions::SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
void StatsFunctions::setSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept //TODO: need packet for one value
{
Player *player;
GET_PLAYER(pid, player,);
@ -402,7 +402,7 @@ void StatsFunctions::SetSkillCurrent(unsigned short pid, unsigned short skill, i
player->NpcStats()->mSkills[skill].mCurrent = value;
}
double StatsFunctions::GetSkillProgress(unsigned short pid, unsigned short skill) noexcept
double StatsFunctions::getSkillProgress(unsigned short pid, unsigned short skill) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -413,7 +413,7 @@ double StatsFunctions::GetSkillProgress(unsigned short pid, unsigned short skill
return player->NpcStats()->mSkills[skill].mProgress;
}
void StatsFunctions::SetSkillProgress(unsigned short pid, unsigned short skill, double value) noexcept
void StatsFunctions::setSkillProgress(unsigned short pid, unsigned short skill, double value) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -424,7 +424,7 @@ void StatsFunctions::SetSkillProgress(unsigned short pid, unsigned short skill,
player->NpcStats()->mSkills[skill].mProgress = value;
}
int StatsFunctions::GetSkillIncrease(unsigned short pid, unsigned int attribute) noexcept
int StatsFunctions::getSkillIncrease(unsigned short pid, unsigned int attribute) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -435,7 +435,7 @@ int StatsFunctions::GetSkillIncrease(unsigned short pid, unsigned int attribute)
return player->NpcStats()->mSkillIncrease[attribute];
}
void StatsFunctions::SetSkillIncrease(unsigned short pid, unsigned int attribute, int value) noexcept // TODO: need packet for transmit it
void StatsFunctions::setSkillIncrease(unsigned short pid, unsigned int attribute, int value) noexcept // TODO: need packet for transmit it
{
Player *player;
GET_PLAYER(pid, player,);
@ -446,7 +446,7 @@ void StatsFunctions::SetSkillIncrease(unsigned short pid, unsigned int attribute
player->NpcStats()->mSkillIncrease[attribute] = value;
}
void StatsFunctions::SetCharGenStage(unsigned short pid, int start, int end) noexcept
void StatsFunctions::setCharGenStage(unsigned short pid, int start, int end) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -457,14 +457,14 @@ void StatsFunctions::SetCharGenStage(unsigned short pid, int start, int end) noe
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_CHARGEN)->Send(player, false);
}
void StatsFunctions::Resurrect(unsigned short pid)
void StatsFunctions::resurrect(unsigned short pid)
{
Player *player;
GET_PLAYER(pid, player,);
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_RESURRECT)->RequestData(player->guid);
}
void StatsFunctions::SendBaseInfo(unsigned short pid) noexcept
void StatsFunctions::sendBaseInfo(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -473,7 +473,7 @@ void StatsFunctions::SendBaseInfo(unsigned short pid) noexcept
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_BASE_INFO)->Send(player, true);
}
void StatsFunctions::SendDynamicStats(unsigned short pid) noexcept
void StatsFunctions::sendDynamicStats(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -481,7 +481,7 @@ void StatsFunctions::SendDynamicStats(unsigned short pid) noexcept
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_DYNAMICSTATS)->Send(player, true);
}
void StatsFunctions::SendAttributes(unsigned short pid) noexcept
void StatsFunctions::sendAttributes(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -490,7 +490,7 @@ void StatsFunctions::SendAttributes(unsigned short pid) noexcept
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_ATTRIBUTE)->Send(player, true);
}
void StatsFunctions::SendSkills(unsigned short pid) noexcept
void StatsFunctions::sendSkills(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -499,7 +499,7 @@ void StatsFunctions::SendSkills(unsigned short pid) noexcept
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_SKILL)->Send(player, true);
}
void StatsFunctions::SendLevel(unsigned short pid) noexcept
void StatsFunctions::sendLevel(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );

@ -6,146 +6,146 @@
#define OPENMW_STATS_HPP
#define STATSFUNCTIONS \
{"GetName", StatsFunctions::GetName},\
{"SetName", StatsFunctions::SetName},\
{"getName", StatsFunctions::getName},\
{"setName", StatsFunctions::setName},\
\
{"GetRace", StatsFunctions::GetRace},\
{"SetRace", StatsFunctions::SetRace},\
{"getRace", StatsFunctions::getRace},\
{"setRace", StatsFunctions::setRace},\
\
{"GetHead", StatsFunctions::GetHead},\
{"SetHead", StatsFunctions::SetHead},\
{"getHead", StatsFunctions::getHead},\
{"setHead", StatsFunctions::setHead},\
\
{"GetHair", StatsFunctions::GetHairstyle},\
{"SetHair", StatsFunctions::SetHairstyle},\
{"GetHair", StatsFunctions::getHairstyle},\
{"SetHair", StatsFunctions::setHairstyle},\
\
{"GetIsMale", StatsFunctions::GetIsMale},\
{"SetIsMale", StatsFunctions::SetIsMale},\
{"getIsMale", StatsFunctions::getIsMale},\
{"setIsMale", StatsFunctions::setIsMale},\
\
{"GetLevel", StatsFunctions::GetLevel},\
{"SetLevel", StatsFunctions::SetLevel},\
{"GetLevelProgress", StatsFunctions::GetLevelProgress},\
{"SetLevelProgress", StatsFunctions::SetLevelProgress},\
{"getLevel", StatsFunctions::getLevel},\
{"setLevel", StatsFunctions::setLevel},\
{"getLevelProgress", StatsFunctions::getLevelProgress},\
{"setLevelProgress", StatsFunctions::setLevelProgress},\
\
{"GetBirthsign", StatsFunctions::GetBirthsign},\
{"SetBirthsign", StatsFunctions::SetBirthsign},\
{"getBirthsign", StatsFunctions::getBirthsign},\
{"setBirthsign", StatsFunctions::setBirthsign},\
\
{"GetAttributeCount", StatsFunctions::GetAttributeCount},\
{"GetSkillCount", StatsFunctions::GetSkillCount},\
{"GetAttributeId", StatsFunctions::GetAttributeId},\
{"GetSkillId", StatsFunctions::GetSkillId},\
{"GetAttributeName", StatsFunctions::GetAttributeName},\
{"GetSkillName", StatsFunctions::GetSkillName},\
{"getAttributeCount", StatsFunctions::getAttributeCount},\
{"getSkillCount", StatsFunctions::getSkillCount},\
{"getAttributeId", StatsFunctions::getAttributeId},\
{"getSkillId", StatsFunctions::getSkillId},\
{"getAttributeName", StatsFunctions::getAttributeName},\
{"getSkillName", StatsFunctions::getSkillName},\
\
{"GetAttributeBase", StatsFunctions::GetAttributeBase},\
{"SetAttributeBase", StatsFunctions::SetAttributeBase},\
{"GetAttributeCurrent", StatsFunctions::GetAttributeCurrent},\
{"SetAttributeCurrent", StatsFunctions::SetAttributeCurrent},\
{"getAttributeBase", StatsFunctions::getAttributeBase},\
{"setAttributeBase", StatsFunctions::setAttributeBase},\
{"getAttributeCurrent", StatsFunctions::getAttributeCurrent},\
{"setAttributeCurrent", StatsFunctions::setAttributeCurrent},\
\
{"GetSkillBase", StatsFunctions::GetSkillBase},\
{"SetSkillBase", StatsFunctions::SetSkillBase},\
{"GetSkillCurrent", StatsFunctions::GetSkillCurrent},\
{"SetSkillCurrent", StatsFunctions::SetSkillCurrent},\
{"GetSkillProgress", StatsFunctions::GetSkillProgress},\
{"SetSkillProgress", StatsFunctions::SetSkillProgress},\
{"getSkillBase", StatsFunctions::getSkillBase},\
{"setSkillBase", StatsFunctions::setSkillBase},\
{"getSkillCurrent", StatsFunctions::getSkillCurrent},\
{"setSkillCurrent", StatsFunctions::setSkillCurrent},\
{"getSkillProgress", StatsFunctions::getSkillProgress},\
{"setSkillProgress", StatsFunctions::setSkillProgress},\
\
{"GetHealthBase", StatsFunctions::GetHealthBase},\
{"SetHealthBase", StatsFunctions::SetHealthBase},\
{"GetHealthCurrent", StatsFunctions::GetHealthCurrent},\
{"SetHealthCurrent", StatsFunctions::SetHealthCurrent},\
{"getHealthBase", StatsFunctions::getHealthBase},\
{"setHealthBase", StatsFunctions::setHealthBase},\
{"getHealthCurrent", StatsFunctions::getHealthCurrent},\
{"setHealthCurrent", StatsFunctions::setHealthCurrent},\
\
{"GetMagickaBase", StatsFunctions::GetMagickaBase},\
{"SetMagickaBase", StatsFunctions::SetMagickaBase},\
{"GetMagickaCurrent", StatsFunctions::GetMagickaCurrent},\
{"SetMagickaCurrent", StatsFunctions::SetMagickaCurrent},\
{"getMagickaBase", StatsFunctions::getMagickaBase},\
{"setMagickaBase", StatsFunctions::setMagickaBase},\
{"getMagickaCurrent", StatsFunctions::getMagickaCurrent},\
{"setMagickaCurrent", StatsFunctions::setMagickaCurrent},\
\
{"SetFatigueBase", StatsFunctions::SetFatigueBase},\
{"GetFatigueBase", StatsFunctions::GetFatigueBase},\
{"SetFatigueCurrent", StatsFunctions::SetFatigueCurrent},\
{"GetFatigueCurrent", StatsFunctions::GetFatigueCurrent},\
{"setFatigueBase", StatsFunctions::setFatigueBase},\
{"getFatigueBase", StatsFunctions::getFatigueBase},\
{"setFatigueCurrent", StatsFunctions::setFatigueCurrent},\
{"getFatigueCurrent", StatsFunctions::getFatigueCurrent},\
\
{"GetSkillIncrease", StatsFunctions::GetSkillIncrease},\
{"SetSkillIncrease", StatsFunctions::SetSkillIncrease},\
{"getSkillIncrease", StatsFunctions::getSkillIncrease},\
{"setSkillIncrease", StatsFunctions::setSkillIncrease},\
\
{"SetCharGenStage", StatsFunctions::SetCharGenStage},\
{"Resurrect", StatsFunctions::Resurrect},\
{"SendBaseInfo", StatsFunctions::SendBaseInfo},\
{"setCharGenStage", StatsFunctions::setCharGenStage},\
{"resurrect", StatsFunctions::resurrect},\
{"sendBaseInfo", StatsFunctions::sendBaseInfo},\
\
{"SendDynamicStats", StatsFunctions::SendDynamicStats},\
{"SendAttributes", StatsFunctions::SendAttributes},\
{"SendSkills", StatsFunctions::SendSkills},\
{"SendLevel", StatsFunctions::SendLevel}
{"sendDynamicStats", StatsFunctions::sendDynamicStats},\
{"sendAttributes", StatsFunctions::sendAttributes},\
{"sendSkills", StatsFunctions::sendSkills},\
{"sendLevel", StatsFunctions::sendLevel}
class StatsFunctions
{
public:
static void SetName(unsigned short pid, const char *name) noexcept;
static const char *GetName(unsigned short pid) noexcept;
static void SetBirthsign(unsigned short pid, const char *name) noexcept;
static const char *GetBirthsign(unsigned short pid) noexcept;
static void SetRace(unsigned short pid, const char *race) noexcept;
static const char *GetRace(unsigned short pid) noexcept;
static void SetHead(unsigned short pid, const char *head) noexcept;
static const char *GetHead(unsigned short pid) noexcept;
static void SetHairstyle(unsigned short pid, const char *style) noexcept;
static const char *GetHairstyle(unsigned short pid) noexcept;
static void SetIsMale(unsigned short pid, int male) noexcept;
static int GetIsMale(unsigned short pid) noexcept;
static int GetLevel(unsigned short pid) noexcept;
static void SetLevel(unsigned short pid, int value) noexcept;
static int GetLevelProgress(unsigned short pid) noexcept;
static void SetLevelProgress(unsigned short pid, int value) noexcept;
static double GetHealthBase(unsigned short pid) noexcept;
static void SetHealthBase(unsigned short pid, double value) noexcept;
static double GetHealthCurrent(unsigned short pid) noexcept;
static void SetHealthCurrent(unsigned short pid, double value) noexcept;
static double GetMagickaBase(unsigned short pid) noexcept;
static void SetMagickaBase(unsigned short pid, double value) noexcept;
static double GetMagickaCurrent(unsigned short pid) noexcept;
static void SetMagickaCurrent(unsigned short pid, double value) noexcept;
static double GetFatigueBase(unsigned short pid) noexcept;
static void SetFatigueBase(unsigned short pid, double value) noexcept;
static double GetFatigueCurrent(unsigned short pid) noexcept;
static void SetFatigueCurrent(unsigned short pid, double value) noexcept;
static int GetAttributeCount() noexcept;
static int GetSkillCount() noexcept;
static int GetAttributeId(const char *name) noexcept;
static int GetSkillId(const char *name) noexcept;
static const char *GetAttributeName(unsigned short attribute) noexcept;
static const char *GetSkillName(unsigned short skill) noexcept;
static int GetAttributeBase(unsigned short pid, unsigned short attribute) noexcept;
static void SetAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept;
static int GetAttributeCurrent(unsigned short pid, unsigned short attribute) noexcept;
static void SetAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept;
static int GetSkillBase(unsigned short pid, unsigned short skill) noexcept;
static void SetSkillBase(unsigned short pid, unsigned short skill, int value) noexcept;
static int GetSkillCurrent(unsigned short pid, unsigned short skill) noexcept;
static void SetSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept;
static double GetSkillProgress(unsigned short pid, unsigned short skill) noexcept;
static void SetSkillProgress(unsigned short pid, unsigned short skill, double value) noexcept;
static int GetSkillIncrease(unsigned short pid, unsigned int pos) noexcept;
static void SetSkillIncrease(unsigned short pid, unsigned int pos, int value) noexcept;
static void Resurrect(unsigned short pid);
static void SetCharGenStage(unsigned short pid, int start, int end) noexcept;
static void SendBaseInfo(unsigned short pid) noexcept;
static void SendDynamicStats(unsigned short pid) noexcept;
static void SendAttributes(unsigned short pid) noexcept;
static void SendSkills(unsigned short pid) noexcept;
static void SendLevel(unsigned short pid) noexcept;
static void setName(unsigned short pid, const char *name) noexcept;
static const char *getName(unsigned short pid) noexcept;
static void setBirthsign(unsigned short pid, const char *name) noexcept;
static const char *getBirthsign(unsigned short pid) noexcept;
static void setRace(unsigned short pid, const char *race) noexcept;
static const char *getRace(unsigned short pid) noexcept;
static void setHead(unsigned short pid, const char *head) noexcept;
static const char *getHead(unsigned short pid) noexcept;
static void setHairstyle(unsigned short pid, const char *style) noexcept;
static const char *getHairstyle(unsigned short pid) noexcept;
static void setIsMale(unsigned short pid, int male) noexcept;
static int getIsMale(unsigned short pid) noexcept;
static int getLevel(unsigned short pid) noexcept;
static void setLevel(unsigned short pid, int value) noexcept;
static int getLevelProgress(unsigned short pid) noexcept;
static void setLevelProgress(unsigned short pid, int value) noexcept;
static double getHealthBase(unsigned short pid) noexcept;
static void setHealthBase(unsigned short pid, double value) noexcept;
static double getHealthCurrent(unsigned short pid) noexcept;
static void setHealthCurrent(unsigned short pid, double value) noexcept;
static double getMagickaBase(unsigned short pid) noexcept;
static void setMagickaBase(unsigned short pid, double value) noexcept;
static double getMagickaCurrent(unsigned short pid) noexcept;
static void setMagickaCurrent(unsigned short pid, double value) noexcept;
static double getFatigueBase(unsigned short pid) noexcept;
static void setFatigueBase(unsigned short pid, double value) noexcept;
static double getFatigueCurrent(unsigned short pid) noexcept;
static void setFatigueCurrent(unsigned short pid, double value) noexcept;
static int getAttributeCount() noexcept;
static int getSkillCount() noexcept;
static int getAttributeId(const char *name) noexcept;
static int getSkillId(const char *name) noexcept;
static const char *getAttributeName(unsigned short attribute) noexcept;
static const char *getSkillName(unsigned short skill) noexcept;
static int getAttributeBase(unsigned short pid, unsigned short attribute) noexcept;
static void setAttributeBase(unsigned short pid, unsigned short attribute, int value) noexcept;
static int getAttributeCurrent(unsigned short pid, unsigned short attribute) noexcept;
static void setAttributeCurrent(unsigned short pid, unsigned short attribute, int value) noexcept;
static int getSkillBase(unsigned short pid, unsigned short skill) noexcept;
static void setSkillBase(unsigned short pid, unsigned short skill, int value) noexcept;
static int getSkillCurrent(unsigned short pid, unsigned short skill) noexcept;
static void setSkillCurrent(unsigned short pid, unsigned short skill, int value) noexcept;
static double getSkillProgress(unsigned short pid, unsigned short skill) noexcept;
static void setSkillProgress(unsigned short pid, unsigned short skill, double value) noexcept;
static int getSkillIncrease(unsigned short pid, unsigned int pos) noexcept;
static void setSkillIncrease(unsigned short pid, unsigned int pos, int value) noexcept;
static void resurrect(unsigned short pid);
static void setCharGenStage(unsigned short pid, int start, int end) noexcept;
static void sendBaseInfo(unsigned short pid) noexcept;
static void sendDynamicStats(unsigned short pid) noexcept;
static void sendAttributes(unsigned short pid) noexcept;
static void sendSkills(unsigned short pid) noexcept;
static void sendLevel(unsigned short pid) noexcept;
};
#endif //OPENMW_STATS_HPP

@ -11,7 +11,7 @@
#include <iostream>
using namespace std;
void TranslocationFunctions::GetPos(unsigned short pid, float *x, float *y, float *z) noexcept
void TranslocationFunctions::getPos(unsigned short pid, float *x, float *y, float *z) noexcept
{
*x = 0.00;
*y = 0.00;
@ -25,7 +25,7 @@ void TranslocationFunctions::GetPos(unsigned short pid, float *x, float *y, floa
*z = player->Position()->pos[2];
}
double TranslocationFunctions::GetPosX(unsigned short pid) noexcept
double TranslocationFunctions::getPosX(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -33,7 +33,7 @@ double TranslocationFunctions::GetPosX(unsigned short pid) noexcept
return player->Position()->pos[0];
}
double TranslocationFunctions::GetPosY(unsigned short pid) noexcept
double TranslocationFunctions::getPosY(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -41,7 +41,7 @@ double TranslocationFunctions::GetPosY(unsigned short pid) noexcept
return player->Position()->pos[1];
}
double TranslocationFunctions::GetPosZ(unsigned short pid) noexcept
double TranslocationFunctions::getPosZ(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -49,7 +49,7 @@ double TranslocationFunctions::GetPosZ(unsigned short pid) noexcept
return player->Position()->pos[2];
}
void TranslocationFunctions::GetAngle(unsigned short pid, float *x, float *y, float *z) noexcept
void TranslocationFunctions::getAngle(unsigned short pid, float *x, float *y, float *z) noexcept
{
*x = 0.00;
*y = 0.00;
@ -63,7 +63,7 @@ void TranslocationFunctions::GetAngle(unsigned short pid, float *x, float *y, fl
*z = player->Position()->rot[2];
}
double TranslocationFunctions::GetAngleX(unsigned short pid) noexcept
double TranslocationFunctions::getAngleX(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -71,7 +71,7 @@ double TranslocationFunctions::GetAngleX(unsigned short pid) noexcept
return player->Position()->rot[0];
}
double TranslocationFunctions::GetAngleY(unsigned short pid) noexcept
double TranslocationFunctions::getAngleY(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -79,7 +79,7 @@ double TranslocationFunctions::GetAngleY(unsigned short pid) noexcept
return player->Position()->rot[1];
}
double TranslocationFunctions::GetAngleZ(unsigned short pid) noexcept
double TranslocationFunctions::getAngleZ(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0.0f);
@ -87,7 +87,7 @@ double TranslocationFunctions::GetAngleZ(unsigned short pid) noexcept
return player->Position()->rot[2];
}
void TranslocationFunctions::SetPos(unsigned short pid, double x, double y, double z) noexcept
void TranslocationFunctions::setPos(unsigned short pid, double x, double y, double z) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -97,7 +97,7 @@ void TranslocationFunctions::SetPos(unsigned short pid, double x, double y, doub
player->Position()->pos[2] = z;
}
void TranslocationFunctions::SetAngle(unsigned short pid, double x, double y, double z) noexcept
void TranslocationFunctions::setAngle(unsigned short pid, double x, double y, double z) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -107,7 +107,7 @@ void TranslocationFunctions::SetAngle(unsigned short pid, double x, double y, do
player->Position()->rot[2] = z;
}
const char* TranslocationFunctions::GetCell(unsigned short pid) noexcept
const char* TranslocationFunctions::getCell(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, 0);
@ -115,7 +115,7 @@ const char* TranslocationFunctions::GetCell(unsigned short pid) noexcept
return player->GetCell()->mName.c_str();
}
void TranslocationFunctions::SetCell(unsigned short pid, const char *name) noexcept
void TranslocationFunctions::setCell(unsigned short pid, const char *name) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -135,7 +135,7 @@ void TranslocationFunctions::SetCell(unsigned short pid, const char *name) noexc
player->GetCell()->mName = name;
}
void TranslocationFunctions::SetExterior(unsigned short pid, int x, int y) noexcept
void TranslocationFunctions::setExterior(unsigned short pid, int x, int y) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -156,21 +156,21 @@ void TranslocationFunctions::SetExterior(unsigned short pid, int x, int y) noexc
player->GetCell()->mData.mY = y;
}
int TranslocationFunctions::GetExteriorX(unsigned short pid) noexcept
int TranslocationFunctions::getExteriorX(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,0);
return player->GetCell()->mData.mX;
}
int TranslocationFunctions::GetExteriorY(unsigned short pid) noexcept
int TranslocationFunctions::getExteriorY(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player,0);
return player->GetCell()->mData.mY;
}
bool TranslocationFunctions::IsInExterior(unsigned short pid) noexcept
bool TranslocationFunctions::isInExterior(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, false);
@ -178,7 +178,7 @@ bool TranslocationFunctions::IsInExterior(unsigned short pid) noexcept
return player->GetCell()->isExterior();
}
void TranslocationFunctions::SendPos(unsigned short pid) noexcept
void TranslocationFunctions::sendPos(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -186,7 +186,7 @@ void TranslocationFunctions::SendPos(unsigned short pid) noexcept
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_POS)->Send(player, false);
}
void TranslocationFunctions::SendCell(unsigned short pid) noexcept
void TranslocationFunctions::sendCell(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );

@ -8,55 +8,55 @@
#include "../Types.hpp"
#define TRANSLOCATIONFUNCTIONS \
{"GetPos", TranslocationFunctions::GetPos},\
{"GetPosX", TranslocationFunctions::GetPosX},\
{"GetPosY", TranslocationFunctions::GetPosY},\
{"GetPosZ", TranslocationFunctions::GetPosZ},\
{"getPos", TranslocationFunctions::getPos},\
{"getPosX", TranslocationFunctions::getPosX},\
{"getPosY", TranslocationFunctions::getPosY},\
{"getPosZ", TranslocationFunctions::getPosZ},\
\
{"GetAngle", TranslocationFunctions::GetAngle},\
{"GetAngleX", TranslocationFunctions::GetAngleX},\
{"GetAngleY", TranslocationFunctions::GetAngleY},\
{"GetAngleZ", TranslocationFunctions::GetAngleZ},\
{"getAngle", TranslocationFunctions::getAngle},\
{"getAngleX", TranslocationFunctions::getAngleX},\
{"getAngleY", TranslocationFunctions::getAngleY},\
{"getAngleZ", TranslocationFunctions::getAngleZ},\
\
{"SetPos", TranslocationFunctions::SetPos},\
{"SetAngle", TranslocationFunctions::SetAngle},\
{"setPos", TranslocationFunctions::setPos},\
{"setAngle", TranslocationFunctions::setAngle},\
\
{"GetCell", TranslocationFunctions::GetCell},\
{"SetCell", TranslocationFunctions::SetCell},\
{"SetExterior", TranslocationFunctions::SetExterior},\
{"GetExteriorX", TranslocationFunctions::GetExteriorX},\
{"GetExteriorY", TranslocationFunctions::GetExteriorY},\
{"IsInExterior", TranslocationFunctions::IsInExterior},\
{"getCell", TranslocationFunctions::getCell},\
{"setCell", TranslocationFunctions::setCell},\
{"setExterior", TranslocationFunctions::setExterior},\
{"getExteriorX", TranslocationFunctions::getExteriorX},\
{"getExteriorY", TranslocationFunctions::getExteriorY},\
{"isInExterior", TranslocationFunctions::isInExterior},\
\
{"SendPos", TranslocationFunctions::SendPos},\
{"SendCell", TranslocationFunctions::SendCell}
{"sendPos", TranslocationFunctions::sendPos},\
{"sendCell", TranslocationFunctions::sendCell}
class TranslocationFunctions
{
public:
static void GetPos(unsigned short pid, float *x, float *y, float *z) noexcept;
static double GetPosX(unsigned short pid) noexcept;
static double GetPosY(unsigned short pid) noexcept;
static double GetPosZ(unsigned short pid) noexcept;
static void GetAngle(unsigned short pid, float *x, float *y, float *z) noexcept;
static double GetAngleX(unsigned short pid) noexcept;
static double GetAngleY(unsigned short pid) noexcept;
static double GetAngleZ(unsigned short pid) noexcept;
static void SetPos(unsigned short pid, double x, double y, double z) noexcept;
static void SetAngle(unsigned short pid, double x, double y, double z) noexcept;
static const char *GetCell(unsigned short pid) noexcept;
static void SetCell(unsigned short pid, const char *name) noexcept;
static void SetExterior(unsigned short pid, int x, int y) noexcept;
static int GetExteriorX(unsigned short pid) noexcept;
static int GetExteriorY(unsigned short pid) noexcept;
static bool IsInExterior(unsigned short pid) noexcept;
static void SendPos(unsigned short pid) noexcept;
static void SendCell(unsigned short pid) noexcept;
static void getPos(unsigned short pid, float *x, float *y, float *z) noexcept;
static double getPosX(unsigned short pid) noexcept;
static double getPosY(unsigned short pid) noexcept;
static double getPosZ(unsigned short pid) noexcept;
static void getAngle(unsigned short pid, float *x, float *y, float *z) noexcept;
static double getAngleX(unsigned short pid) noexcept;
static double getAngleY(unsigned short pid) noexcept;
static double getAngleZ(unsigned short pid) noexcept;
static void setPos(unsigned short pid, double x, double y, double z) noexcept;
static void setAngle(unsigned short pid, double x, double y, double z) noexcept;
static const char *getCell(unsigned short pid) noexcept;
static void setCell(unsigned short pid, const char *name) noexcept;
static void setExterior(unsigned short pid, int x, int y) noexcept;
static int getExteriorX(unsigned short pid) noexcept;
static int getExteriorY(unsigned short pid) noexcept;
static bool isInExterior(unsigned short pid) noexcept;
static void sendPos(unsigned short pid) noexcept;
static void sendCell(unsigned short pid) noexcept;
};
#endif //OPENMW_TRANSLOCATIONS_HPP

@ -8,7 +8,7 @@
#include <components/openmw-mp/NetworkMessages.hpp>
#include "World.hpp"
void WorldFunctions::SetHour(unsigned short pid, double hour) noexcept
void WorldFunctions::setHour(unsigned short pid, double hour) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -20,7 +20,7 @@ void WorldFunctions::SetHour(unsigned short pid, double hour) noexcept
mwmp::Networking::get().getPlayerController()->GetPacket(ID_GAME_TIME)->Send(player, false);
}
void WorldFunctions::SetMonth(unsigned short pid, int month) noexcept
void WorldFunctions::setMonth(unsigned short pid, int month) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
@ -33,7 +33,7 @@ void WorldFunctions::SetMonth(unsigned short pid, int month) noexcept
}
void WorldFunctions::SetDay(unsigned short pid, int day) noexcept
void WorldFunctions::setDay(unsigned short pid, int day) noexcept
{
Player *player;
GET_PLAYER(pid, player,);

@ -6,16 +6,16 @@
#define OPENMW_WORLD_HPP
#define WORLDFUNCTIONS \
{"SetHour", WorldFunctions::SetHour},\
{"SetMonth", WorldFunctions::SetMonth},\
{"SetDay", WorldFunctions::SetDay}
{"setHour", WorldFunctions::setHour},\
{"setMonth", WorldFunctions::setMonth},\
{"setDay", WorldFunctions::setDay}
class WorldFunctions
{
public:
static void SetHour(unsigned short pid, double hour) noexcept;
static void SetMonth(unsigned short pid, int month) noexcept;
static void SetDay(unsigned short pid, int day) noexcept;
static void setHour(unsigned short pid, double hour) noexcept;
static void setMonth(unsigned short pid, int month) noexcept;
static void setDay(unsigned short pid, int day) noexcept;
};

Loading…
Cancel
Save