forked from mirror/openmw-tes3mp
[Server] Place getters and setters in consistent order
This commit is contained in:
parent
947b3f76be
commit
010a80ceca
3 changed files with 68 additions and 70 deletions
|
@ -15,10 +15,10 @@ void Object::Init(LuaState &lua)
|
|||
"refId", sol::property(&BaseObject::getRefId, &BaseObject::setRefId),
|
||||
"refNum", sol::property(&BaseObject::getRefNum, &BaseObject::setRefNum),
|
||||
"mpNum", sol::property(&BaseObject::getMpNum, &BaseObject::setMpNum),
|
||||
"setPosition", &Object::setPosition,
|
||||
"getPosition", &Object::getPosition,
|
||||
"setRotation", &Object::setRotation,
|
||||
"setPosition", &Object::setPosition,
|
||||
"getRotation", &Object::getRotation,
|
||||
"setRotation", &Object::setRotation,
|
||||
"count", sol::property(&Object::getCount, &Object::setCount),
|
||||
"goldValue", sol::property(&Object::getGoldValue, &Object::setGoldValue),
|
||||
"scale", sol::property(&Object::getScale, &Object::setScale),
|
||||
|
|
|
@ -28,7 +28,6 @@ void Player::Init(LuaState &lua)
|
|||
"getCell", &NetActor::getCell,
|
||||
"getInventory", &NetActor::getInventory,
|
||||
|
||||
|
||||
"getPreviousCellPos", &Player::getPreviousCellPos,
|
||||
|
||||
"kick", &Player::kick,
|
||||
|
@ -219,19 +218,14 @@ void Player::setId(unsigned short id)
|
|||
this->id = id;
|
||||
}
|
||||
|
||||
void Player::setHandshake()
|
||||
{
|
||||
handshakeState = true;
|
||||
}
|
||||
|
||||
bool Player::isHandshaked()
|
||||
{
|
||||
return handshakeState;
|
||||
}
|
||||
|
||||
void Player::setLoadState(int state)
|
||||
void Player::setHandshake()
|
||||
{
|
||||
loadState = state;
|
||||
handshakeState = true;
|
||||
}
|
||||
|
||||
int Player::getLoadState()
|
||||
|
@ -239,30 +233,16 @@ int Player::getLoadState()
|
|||
return loadState;
|
||||
}
|
||||
|
||||
void Player::setLoadState(int state)
|
||||
{
|
||||
loadState = state;
|
||||
}
|
||||
|
||||
CellController::TContainer *Player::getCells()
|
||||
{
|
||||
return &cells;
|
||||
}
|
||||
|
||||
void Player::sendToLoaded(mwmp::PlayerPacket *myPacket)
|
||||
{
|
||||
std::list <Player*> plList;
|
||||
|
||||
for (auto cell : cells)
|
||||
for (auto pl : *cell)
|
||||
plList.push_back(pl);
|
||||
|
||||
plList.sort();
|
||||
plList.unique();
|
||||
|
||||
for (auto pl : plList)
|
||||
{
|
||||
if (pl == this) continue;
|
||||
myPacket->setPlayer(this);
|
||||
myPacket->Send(pl->guid);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::forEachLoaded(std::function<void(Player *pl, Player *other)> func)
|
||||
{
|
||||
std::list <Player*> plList;
|
||||
|
@ -286,6 +266,25 @@ void Player::forEachLoaded(std::function<void(Player *pl, Player *other)> func)
|
|||
}
|
||||
}
|
||||
|
||||
void Player::sendToLoaded(mwmp::PlayerPacket *myPacket)
|
||||
{
|
||||
std::list <Player*> plList;
|
||||
|
||||
for (auto cell : cells)
|
||||
for (auto pl : *cell)
|
||||
plList.push_back(pl);
|
||||
|
||||
plList.sort();
|
||||
plList.unique();
|
||||
|
||||
for (auto pl : plList)
|
||||
{
|
||||
if (pl == this) continue;
|
||||
myPacket->setPlayer(this);
|
||||
myPacket->Send(pl->guid);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::kick() const
|
||||
{
|
||||
mwmp::Networking::getPtr()->kickPlayer(guid);
|
||||
|
@ -318,17 +317,17 @@ int Player::getAvgPing()
|
|||
return mwmp::Networking::get().getAvgPing(guid);
|
||||
}
|
||||
|
||||
std::string Player::getName()
|
||||
{
|
||||
return npc.mName;
|
||||
}
|
||||
|
||||
void Player::setName(const std::string &name)
|
||||
{
|
||||
npc.mName = name;
|
||||
baseInfoChanged = true;
|
||||
}
|
||||
|
||||
std::string Player::getName()
|
||||
{
|
||||
return npc.mName;
|
||||
}
|
||||
|
||||
void Player::setCharGenStages(int currentStage, int endStage)
|
||||
{
|
||||
charGenState.currentStage = currentStage;
|
||||
|
@ -352,15 +351,20 @@ void Player::message(const std::string &message, bool toAll)
|
|||
packet->Send(true);
|
||||
}
|
||||
|
||||
int Player::getLevel() const
|
||||
{
|
||||
return creatureStats.mLevel;
|
||||
}
|
||||
|
||||
void Player::setLevel(int level)
|
||||
{
|
||||
creatureStats.mLevel = level;
|
||||
levelChanged = true;
|
||||
}
|
||||
|
||||
int Player::getLevel() const
|
||||
int Player::getGender() const
|
||||
{
|
||||
return creatureStats.mLevel;
|
||||
return npc.isMale();
|
||||
}
|
||||
|
||||
void Player::setGender(int gender)
|
||||
|
@ -369,9 +373,9 @@ void Player::setGender(int gender)
|
|||
baseInfoChanged = true;
|
||||
}
|
||||
|
||||
int Player::getGender() const
|
||||
std::string Player::getRace() const
|
||||
{
|
||||
return npc.isMale();
|
||||
return npc.mRace;
|
||||
}
|
||||
|
||||
void Player::setRace(const std::string &race)
|
||||
|
@ -382,9 +386,9 @@ void Player::setRace(const std::string &race)
|
|||
baseInfoChanged = true;
|
||||
}
|
||||
|
||||
std::string Player::getRace() const
|
||||
std::string Player::getHead() const
|
||||
{
|
||||
return npc.mRace;
|
||||
return npc.mHead;
|
||||
}
|
||||
|
||||
void Player::setHead(const std::string &head)
|
||||
|
@ -393,9 +397,9 @@ void Player::setHead(const std::string &head)
|
|||
baseInfoChanged = true;
|
||||
}
|
||||
|
||||
std::string Player::getHead() const
|
||||
std::string Player::getHair() const
|
||||
{
|
||||
return npc.mHead;
|
||||
return npc.mHair;
|
||||
}
|
||||
|
||||
void Player::setHair(const std::string &hair)
|
||||
|
@ -404,11 +408,6 @@ void Player::setHair(const std::string &hair)
|
|||
baseInfoChanged = true;
|
||||
}
|
||||
|
||||
std::string Player::getHair() const
|
||||
{
|
||||
return npc.mHair;
|
||||
}
|
||||
|
||||
std::string Player::getBirthsign() const
|
||||
{
|
||||
return birthsign;
|
||||
|
@ -434,15 +433,20 @@ void Player::setBounty(int bounty)
|
|||
packet->Send(true);
|
||||
}
|
||||
|
||||
int Player::getLevelProgress() const
|
||||
{
|
||||
return npcStats.mLevelProgress;
|
||||
}
|
||||
|
||||
void Player::setLevelProgress(int progress)
|
||||
{
|
||||
npcStats.mLevelProgress = progress;
|
||||
skillsChanged = true;
|
||||
}
|
||||
|
||||
int Player::getLevelProgress() const
|
||||
std::string Player::getCreatureModel() const
|
||||
{
|
||||
return npcStats.mLevelProgress;
|
||||
return creatureModel;
|
||||
}
|
||||
|
||||
void Player::setCreatureModel(const std::string &model)
|
||||
|
@ -451,11 +455,6 @@ void Player::setCreatureModel(const std::string &model)
|
|||
baseInfoChanged = true;
|
||||
}
|
||||
|
||||
std::string Player::getCreatureModel() const
|
||||
{
|
||||
return creatureModel;
|
||||
}
|
||||
|
||||
void Player::creatureName(bool useName)
|
||||
{
|
||||
useCreatureName = useName;
|
||||
|
@ -591,6 +590,11 @@ void Player::jail(int jailDays, bool ignoreJailTeleportation, bool ignoreJailSki
|
|||
packet->Send(false);
|
||||
}
|
||||
|
||||
bool Player::getWerewolfState() const
|
||||
{
|
||||
return isWerewolf;
|
||||
}
|
||||
|
||||
void Player::setWerewolfState(bool state)
|
||||
{
|
||||
isWerewolf = state;
|
||||
|
@ -601,11 +605,6 @@ void Player::setWerewolfState(bool state)
|
|||
packet->Send(true);
|
||||
}
|
||||
|
||||
bool Player::getWerewolfState() const
|
||||
{
|
||||
return isWerewolf;
|
||||
}
|
||||
|
||||
size_t Player::cellStateSize() const
|
||||
{
|
||||
return cellStateChanges.cellStates.size();
|
||||
|
|
|
@ -59,8 +59,8 @@ public:
|
|||
bool isHandshaked();
|
||||
void setHandshake();
|
||||
|
||||
void setLoadState(int state);
|
||||
int getLoadState();
|
||||
void setLoadState(int state);
|
||||
|
||||
virtual ~Player();
|
||||
|
||||
|
@ -78,27 +78,27 @@ public:
|
|||
|
||||
int getAvgPing();
|
||||
|
||||
void setName(const std::string &name);
|
||||
std::string getName();
|
||||
void setName(const std::string &name);
|
||||
void setCharGenStages(int currentStage, int endStage);
|
||||
void message(const std::string &message, bool toAll = false);
|
||||
void setGender(int gender);
|
||||
int getGender() const;
|
||||
void setRace(const std::string &race);
|
||||
void setGender(int gender);
|
||||
std::string getRace() const;
|
||||
void setHead(const std::string &head);
|
||||
void setRace(const std::string &race);
|
||||
std::string getHead() const;
|
||||
void setHair(const std::string &hair);
|
||||
void setHead(const std::string &head);
|
||||
std::string getHair() const;
|
||||
void setHair(const std::string &hair);
|
||||
std::string getBirthsign() const;
|
||||
void setBirthsign(const std::string &sign);
|
||||
|
||||
int getBounty() const;
|
||||
void setBounty(int bounty);
|
||||
void setLevel(int level);
|
||||
int getLevel() const;
|
||||
void setLevelProgress(int progress);
|
||||
void setLevel(int level);
|
||||
int getLevelProgress() const;
|
||||
void setLevelProgress(int progress);
|
||||
|
||||
/**
|
||||
* \brief Send a PlayerResurrect packet about a player.
|
||||
|
@ -130,12 +130,11 @@ public:
|
|||
void jail(int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases,
|
||||
const std::string &jailProgressText, const std::string &jailEndText);
|
||||
|
||||
void setWerewolfState(bool state);
|
||||
bool getWerewolfState() const;
|
||||
void setWerewolfState(bool state);
|
||||
|
||||
|
||||
void setCreatureModel(const std::string &model);
|
||||
std::string getCreatureModel() const;
|
||||
void setCreatureModel(const std::string &model);
|
||||
void creatureName(bool useName);
|
||||
bool isCreatureName() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue