summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/actions/chat.cpp4
-rw-r--r--src/actions/commands.cpp2
-rw-r--r--src/being/being.cpp2
-rw-r--r--src/being/localplayer.cpp10
-rw-r--r--src/flooritem.cpp2
-rw-r--r--src/game.cpp2
-rw-r--r--src/gui/popups/itempopup.cpp4
-rw-r--r--src/gui/popups/popupmenu.cpp6
-rw-r--r--src/gui/windows/charcreatedialog.cpp18
-rw-r--r--src/gui/windows/registerdialog.cpp2
-rw-r--r--src/gui/windows/socialwindow.cpp2
-rw-r--r--src/gui/windows/whoisonline.cpp2
-rw-r--r--src/item.cpp2
-rw-r--r--src/net/ea/adminhandler.cpp2
-rw-r--r--src/net/ea/chathandler.cpp2
-rw-r--r--src/net/ea/gui/partytab.cpp4
-rw-r--r--src/net/eathena/inventoryhandler.cpp2
-rw-r--r--src/net/net.cpp6
-rw-r--r--src/net/net.h2
-rw-r--r--src/net/serverfeatures.h2
-rw-r--r--src/net/tmwa/beinghandler.cpp20
-rw-r--r--src/net/tmwa/buysellhandler.cpp4
-rw-r--r--src/net/tmwa/charserverhandler.cpp4
-rw-r--r--src/net/tmwa/chathandler.cpp6
-rw-r--r--src/net/tmwa/guildhandler.cpp2
-rw-r--r--src/net/tmwa/inventoryhandler.cpp12
-rw-r--r--src/net/tmwa/loginhandler.cpp2
-rw-r--r--src/net/tmwa/npchandler.cpp2
-rw-r--r--src/resources/db/itemdb.cpp4
-rw-r--r--src/shopitem.cpp6
-rw-r--r--src/utils/chatutils.cpp2
31 files changed, 69 insertions, 73 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp
index 42b9fca24..8e210a155 100644
--- a/src/actions/chat.cpp
+++ b/src/actions/chat.cpp
@@ -73,7 +73,7 @@ static void outString(const ChatTab *const tab,
{
if (guild->getServerGuild())
{
- if (!Net::getServerFeatures()->haveNativeGuilds())
+ if (!serverFeatures->haveNativeGuilds())
return;
guildHandler->chat(guild->getId(), str);
}
@@ -272,7 +272,7 @@ impHandler(createParty)
impHandler(createGuild)
{
- if (!event.tab || !Net::getServerFeatures()->haveNativeGuilds())
+ if (!event.tab || !serverFeatures->haveNativeGuilds())
return false;
if (event.args.empty())
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index cdc65f0ad..254f3868c 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -411,7 +411,7 @@ impHandler(sendMail)
impHandler(info)
{
if (!event.tab || !localPlayer
- || !Net::getServerFeatures()->haveNativeGuilds())
+ || !serverFeatures->haveNativeGuilds())
{
return false;
}
diff --git a/src/being/being.cpp b/src/being/being.cpp
index e0aa5f29c..c5e2ff716 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2456,7 +2456,7 @@ void Being::drawHpBar(Graphics *const graphics, const int maxHP, const int hp,
const int dx = static_cast<const int>(static_cast<float>(width) / p);
- if (!Net::getServerFeatures()->haveServerHp())
+ if (!serverFeatures->haveServerHp())
{ // old servers
if ((!damage && (this != localPlayer || hp == maxHP))
|| (!hp && maxHP == damage))
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 23a8063ca..30e323d7e 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -334,7 +334,7 @@ void LocalPlayer::slowLogic()
weightNoticeTime = 0;
}
- if (!Net::getServerFeatures()->havePlayerStatusUpdate()
+ if (!serverFeatures->havePlayerStatusUpdate()
&& mEnableAdvert
&& !mBlockAdvert
&& mAdvertTime < cur_time)
@@ -858,7 +858,7 @@ void LocalPlayer::pickedUp(const ItemInfo &itemInfo, const int amount,
else
{
std::string str;
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
str = itemInfo.getName(color);
else
str = itemInfo.getName();
@@ -1117,7 +1117,7 @@ void LocalPlayer::moveToTarget(int dist)
dist = settings.moveToTargetType;
if (dist != 0)
{
- const bool broken = Net::getServerFeatures()
+ const bool broken = serverFeatures
->haveBrokenPlayerAttackDistance();
switch (dist)
{
@@ -2745,7 +2745,7 @@ void LocalPlayer::attack2(Being *const target, const bool keep,
if (!dontChangeEquipment && target)
changeEquipmentBeforeAttack(target);
- const bool broken = Net::getServerFeatures()
+ const bool broken = serverFeatures
->haveBrokenPlayerAttackDistance();
// probably need cache getPathLength(target)
@@ -3226,7 +3226,7 @@ bool LocalPlayer::checAttackPermissions(const Being *const target)
void LocalPlayer::updateStatus() const
{
- if (Net::getServerFeatures()->havePlayerStatusUpdate() && mEnableAdvert)
+ if (serverFeatures->havePlayerStatusUpdate() && mEnableAdvert)
{
uint8_t status = 0;
if (mTradebot && shopWindow && !shopWindow->isShopEmpty())
diff --git a/src/flooritem.cpp b/src/flooritem.cpp
index 5c979f46a..ae88c41b8 100644
--- a/src/flooritem.cpp
+++ b/src/flooritem.cpp
@@ -103,7 +103,7 @@ const ItemInfo &FloorItem::getInfo() const
std::string FloorItem::getName() const
{
const ItemInfo &info = ItemDB::get(mItemId);
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
return info.getName(mColor);
else
return info.getName();
diff --git a/src/game.cpp b/src/game.cpp
index 44bb258bb..ca778a071 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -239,7 +239,7 @@ static void createGuiWindows()
if (config.getBoolValue("showChatHistory"))
localChatTab->loadFromLogFile("#General");
- if (Net::getServerFeatures()->haveLangTab()
+ if (serverFeatures->haveLangTab()
&& serverConfig.getValue("enableLangTab", 1))
{
const std::string lang = getLangShort();
diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp
index fb4c3a9fd..cf471ba3e 100644
--- a/src/gui/popups/itempopup.cpp
+++ b/src/gui/popups/itempopup.cpp
@@ -118,7 +118,7 @@ void ItemPopup::setItem(const Item *const item, const bool showImage)
mLastName = ii.getName();
mLastColor = item->getColor();
mLastId = item->getId();
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
mItemName->setCaption(strprintf("%s (+%u), %d",
ii.getName(item->getColor()).c_str(),
@@ -182,7 +182,7 @@ void ItemPopup::setItem(const ItemInfo &item, const unsigned char color,
mLastColor = color;
mLastId = id;
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
mItemName->setCaption(strprintf("%s, %d",
item.getName(color).c_str(), id));
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 9aa99b229..31ae42b4a 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -793,7 +793,7 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab)
}
addPlayerMisc();
addBuySellDefault();
- if (Net::getServerFeatures()->havePartyNickInvite())
+ if (serverFeatures->havePartyNickInvite())
addParty(wTab->getNick());
mBrowserBox->addRow("##3---");
}
@@ -1087,7 +1087,7 @@ void PopupMenu::handleLink(const std::string &link,
{
if (mItem)
{
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
chatWindow->addItemText(mItem->getInfo().getName(
mItem->getColor()));
@@ -1104,7 +1104,7 @@ void PopupMenu::handleLink(const std::string &link,
if (item)
{
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
chatWindow->addItemText(item->getInfo().getName(
item->getColor()));
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index 1ee09a5d8..def290047 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -187,7 +187,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
mNameField->setMaximum(24);
- if (Net::getServerFeatures()->haveRaceSelection())
+ if (serverFeatures->haveRaceSelection())
{
// TRANSLATORS: char create dialog button
mNextRaceButton = new Button(this, _(">"), "nextrace", this);
@@ -197,7 +197,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
mRaceLabel = new Label(this, _("Race:"));
mRaceNameLabel = new Label(this, "");
}
- if (Net::getServerFeatures()->haveLookSelection() && mMinLook < mMaxLook)
+ if (serverFeatures->haveLookSelection() && mMinLook < mMaxLook)
{
// TRANSLATORS: char create dialog button
mNextLookButton = new Button(this, _(">"), "nextlook", this);
@@ -253,7 +253,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
mHairStyleLabel->setPosition(labelX, y);
mHairStyleNameLabel->setPosition(nameX, y);
- if (Net::getServerFeatures()->haveLookSelection() && mMinLook < mMaxLook)
+ if (serverFeatures->haveLookSelection() && mMinLook < mMaxLook)
{
y += 24;
mPrevLookButton->setPosition(leftX, y);
@@ -262,7 +262,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
mLookLabel->setPosition(labelX, y);
mLookNameLabel->setPosition(nameX, y); // 93
}
- if (Net::getServerFeatures()->haveRaceSelection())
+ if (serverFeatures->haveRaceSelection())
{
y += 24;
mPrevRaceButton->setPosition(leftX, y);
@@ -293,7 +293,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
add(mActionButton);
add(mRotateButton);
- if (Net::getServerFeatures()->haveLookSelection() && mMinLook < mMaxLook)
+ if (serverFeatures->haveLookSelection() && mMinLook < mMaxLook)
{
add(mNextLookButton);
add(mPrevLookButton);
@@ -301,7 +301,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
add(mLookNameLabel);
}
- if (Net::getServerFeatures()->haveRaceSelection())
+ if (serverFeatures->haveRaceSelection())
{
add(mNextRaceButton);
add(mPrevRaceButton);
@@ -322,9 +322,9 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
mNameField->requestFocus();
updateHair();
- if (Net::getServerFeatures()->haveRaceSelection())
+ if (serverFeatures->haveRaceSelection())
updateRace();
- if (Net::getServerFeatures()->haveLookSelection() && mMinLook < mMaxLook)
+ if (serverFeatures->haveLookSelection() && mMinLook < mMaxLook)
updateLook();
updatePlayer();
@@ -638,7 +638,7 @@ void CharCreateDialog::updateLook()
{
const ItemInfo &item = ItemDB::get(-100 - mRace);
const int sz = item.getColorsSize();
- if (sz > 0 && Net::getServerFeatures()->haveLookSelection())
+ if (sz > 0 && serverFeatures->haveLookSelection())
{
if (mLook < 0)
mLook = sz - 1;
diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp
index 5701395a7..4c582d9f2 100644
--- a/src/gui/windows/registerdialog.cpp
+++ b/src/gui/windows/registerdialog.cpp
@@ -101,7 +101,7 @@ RegisterDialog::RegisterDialog(LoginData *const data) :
mMaleButton = new RadioButton(this, _("Male"), "sex", true);
// TRANSLATORS: register dialog. button.
mFemaleButton = new RadioButton(this, _("Female"), "sex", false);
- if (Net::getServerFeatures()->haveOtherGender())
+ if (serverFeatures->haveOtherGender())
{
// TRANSLATORS: register dialog. button.
mOtherButton = new RadioButton(this, _("Other"), "sex", false);
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index e792d0a0a..6407e8fa6 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -344,7 +344,7 @@ void SocialWindow::action(const ActionEvent &event)
}
else if (eventId == "create guild")
{
- if (!Net::getServerFeatures()->haveNativeGuilds())
+ if (!serverFeatures->haveNativeGuilds())
return;
std::string name = mGuildCreateDialog->getText();
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index a4ea81bfa..7244e4195 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -112,7 +112,7 @@ WhoIsOnline::WhoIsOnline() :
mShowLevel(false),
mUpdateOnlineList(config.getBoolValue("updateOnlineList")),
mGroupFriends(true),
- mServerSideList(Net::getServerFeatures()->haveOnlineList())
+ mServerSideList(serverFeatures->haveOnlineList())
{
mCurlError[0] = 0;
setWindowName("WhoIsOnline");
diff --git a/src/item.cpp b/src/item.cpp
index ca860eeea..b8c2194f3 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -117,7 +117,7 @@ Image *Item::getImage(const int id, const unsigned char color)
std::string Item::getName() const
{
const ItemInfo &info = ItemDB::get(mId);
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
return info.getName(mColor);
else
return info.getName();
diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp
index 550e96065..42c2eb52e 100644
--- a/src/net/ea/adminhandler.cpp
+++ b/src/net/ea/adminhandler.cpp
@@ -73,7 +73,7 @@ void AdminHandler::ipcheckName(const std::string &name) const
void AdminHandler::createItems(const int id, const int color,
const int amount) const
{
- if (!Net::getServerFeatures()->haveItemColors())
+ if (!serverFeatures->haveItemColors())
{
chatHandler->talk(strprintf("@item %d %d",
id, amount), GENERAL_CHANNEL);
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index b1c90ee17..b8f201229 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -302,7 +302,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg) const
std::string sender_name = ((pos == std::string::npos)
? "" : chatMsg.substr(0, pos));
- if (Net::getServerFeatures()->haveIncompleteChatMessages())
+ if (serverFeatures->haveIncompleteChatMessages())
{
// work around for "new" tmw server
sender_name = being->getName();
diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp
index 937245fc9..afc1c3845 100644
--- a/src/net/ea/gui/partytab.cpp
+++ b/src/net/ea/gui/partytab.cpp
@@ -197,7 +197,7 @@ bool PartyTab::handleCommand(const std::string &restrict type,
}
}
else if (type == "setleader"
- && Net::getServerFeatures()->haveChangePartyLeader())
+ && serverFeatures->haveChangePartyLeader())
{
partyHandler->changeLeader(args);
}
@@ -228,7 +228,7 @@ void PartyTab::getAutoCompleteCommands(StringVect &names) const
names.push_back("/kick ");
names.push_back("/item");
names.push_back("/exp");
- if (Net::getServerFeatures()->haveChangePartyLeader())
+ if (serverFeatures->haveChangePartyLeader())
names.push_back("/setleader ");
}
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index e2ffe196c..487b22a9f 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -378,7 +378,7 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
if (item && item->getId() == itemId)
amount += item->getQuantity();
- if (!Net::getServerFeatures()->haveItemColors() && identified > 1)
+ if (!serverFeatures->haveItemColors() && identified > 1)
identified = 1;
inventory->setItem(index, itemId, amount, refine,
diff --git a/src/net/net.cpp b/src/net/net.cpp
index 14d06bc76..268f41180 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -58,6 +58,7 @@ namespace Net
class PetHandler;
class PlayerHandler;
class QuestHandler;
+ class ServerFeatures;
}
Net::AdminHandler *adminHandler = nullptr;
@@ -94,11 +95,6 @@ Net::TradeHandler *Net::getTradeHandler()
return tradeHandler;
}
-Net::ServerFeatures *Net::getServerFeatures()
-{
- return serverFeatures;
-}
-
namespace Net
{
diff --git a/src/net/net.h b/src/net/net.h
index 7ddfd4364..a289d45df 100644
--- a/src/net/net.h
+++ b/src/net/net.h
@@ -38,11 +38,9 @@ namespace Net
class SkillHandler;
class TradeHandler;
-class ServerFeatures;
SkillHandler *getSkillHandler() A_WARN_UNUSED;
TradeHandler *getTradeHandler() A_WARN_UNUSED;
-ServerFeatures *getServerFeatures() A_WARN_UNUSED;
ServerInfo::Type getNetworkType() A_WARN_UNUSED;
diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h
index d2029d7da..5da521ea2 100644
--- a/src/net/serverfeatures.h
+++ b/src/net/serverfeatures.h
@@ -72,4 +72,6 @@ class ServerFeatures notfinal
} // namespace Net
+extern Net::ServerFeatures *serverFeatures;
+
#endif // NET_SERVERFEATURES_H
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index bea17edb6..2a9b31c0f 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -296,7 +296,7 @@ void BeingHandler::processBeingChangeLook2(Net::MessageIn &msg) const
int id2 = 0;
const int16_t id = msg.readInt16("id1");
- if (type == 2 || Net::getServerFeatures()->haveItemColors())
+ if (type == 2 || serverFeatures->haveItemColors())
{
id2 = msg.readInt16("id2");
}
@@ -569,7 +569,7 @@ void BeingHandler::processPlayerUpdate1(Net::MessageIn &msg) const
dstBeing->updateSprite(SPRITE_WEAPON, weapon, "", 1, true);
if (!mHideShield)
dstBeing->updateSprite(SPRITE_SHIELD, shield);
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
dstBeing->updateSprite(SPRITE_BOTTOMCLOTHES, headBottom,
"", colors[0]);
@@ -720,7 +720,7 @@ void BeingHandler::processPlayerUpdate2(Net::MessageIn &msg) const
dstBeing->updateSprite(SPRITE_WEAPON, weapon, "", 1, true);
if (!mHideShield)
dstBeing->updateSprite(SPRITE_SHIELD, shield);
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
dstBeing->updateSprite(SPRITE_BOTTOMCLOTHES, headBottom,
"", colors[0]);
@@ -871,7 +871,7 @@ void BeingHandler::processPlayerMove(Net::MessageIn &msg) const
dstBeing->updateSprite(SPRITE_WEAPON, weapon, "", 1, true);
if (!mHideShield)
dstBeing->updateSprite(SPRITE_SHIELD, shield);
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
dstBeing->updateSprite(SPRITE_BOTTOMCLOTHES, headBottom,
"", colors[0]);
@@ -947,7 +947,7 @@ void BeingHandler::processPlayerMove(Net::MessageIn &msg) const
void BeingHandler::processBeingMove3(Net::MessageIn &msg)
{
BLOCK_START("BeingHandler::processBeingMove3")
- if (!Net::getServerFeatures()->haveMove3())
+ if (!serverFeatures->haveMove3())
{
BLOCK_END("BeingHandler::processBeingMove3")
return;
@@ -1103,7 +1103,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg)
uint16_t gloves;
if (dstBeing->getType() == ActorType::Monster)
{
- if (Net::getServerFeatures()->haveServerHp())
+ if (serverFeatures->haveServerHp())
{
const int hp = msg.readInt32("hp");
const int maxHP = msg.readInt32("max hp");
@@ -1131,7 +1131,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg)
msg.readInt16("manner");
dstBeing->setStatusEffectBlock(32, msg.readInt16("opt3"));
- if (Net::getServerFeatures()->haveMonsterAttackRange()
+ if (serverFeatures->haveMonsterAttackRange()
&& dstBeing->getType() == ActorType::Monster)
{
const int attackRange = static_cast<int>(
@@ -1307,7 +1307,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
uint16_t gloves;
if (dstBeing->getType() == ActorType::Monster)
{
- if (Net::getServerFeatures()->haveServerHp())
+ if (serverFeatures->haveServerHp())
{
const int hp = msg.readInt32("hp");
const int maxHP = msg.readInt32("max hp");
@@ -1335,7 +1335,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
msg.readInt16("manner");
dstBeing->setStatusEffectBlock(32, msg.readInt16("opt3"));
- if (Net::getServerFeatures()->haveMonsterAttackRange()
+ if (serverFeatures->haveMonsterAttackRange()
&& dstBeing->getType() == ActorType::Monster)
{
const int attackRange = static_cast<int>(
@@ -1377,7 +1377,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
{
dstBeing->setAction(BeingAction::STAND, 0);
dstBeing->setTileCoords(srcX, srcY);
- if (!Net::getServerFeatures()->haveMove3())
+ if (!serverFeatures->haveMove3())
dstBeing->setDestination(dstX, dstY);
}
diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp
index 2b34e0a83..5de7b0556 100644
--- a/src/net/tmwa/buysellhandler.cpp
+++ b/src/net/tmwa/buysellhandler.cpp
@@ -96,7 +96,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg)
{
msg.readInt16("len");
unsigned int sz = 11;
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
sz += 1;
const unsigned int n_items = (msg.getLength() - 4U) / sz;
mBuyDialog = new BuyDialog(mNpcId);
@@ -109,7 +109,7 @@ void BuySellHandler::processNpcBuy(Net::MessageIn &msg)
msg.readUInt8("type");
const int itemId = msg.readInt16("item id");
uint8_t color = 1;
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
color = msg.readUInt8("item color");
mBuyDialog->addItem(itemId, color, 0, value);
}
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index d386206aa..a6c7ab178 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -280,11 +280,11 @@ void CharServerHandler::newCharacter(const std::string &name, const int slot,
outMsg.writeInt8(static_cast<int8_t>(hairColor), "hair color");
outMsg.writeInt8(0, "unused");
outMsg.writeInt8(static_cast<int8_t>(hairstyle), "hair style");
- if (Net::getServerFeatures()->haveLookSelection())
+ if (serverFeatures->haveLookSelection())
outMsg.writeInt8(look, "look");
else
outMsg.writeInt8(0, "unused");
- if (Net::getServerFeatures()->haveRaceSelection())
+ if (serverFeatures->haveRaceSelection())
outMsg.writeInt8(race, "class");
}
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 099649566..0d0c08d90 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -127,7 +127,7 @@ void ChatHandler::talk(const std::string &restrict text,
const std::string mes = std::string(localPlayer->getName()).append(
" : ").append(text);
- if (Net::getServerFeatures()->haveChatChannels() && channel.size() == 3)
+ if (serverFeatures->haveChatChannels() && channel.size() == 3)
{
MessageOut outMsg(CMSG_CHAT_MESSAGE2);
// Added + 1 in order to let eAthena parse admin commands correctly
@@ -236,7 +236,7 @@ void ChatHandler::processRaw(MessageOut &restrict outMsg,
void ChatHandler::ignoreAll() const
{
- if (!Net::getServerFeatures()->haveServerIgnore())
+ if (!serverFeatures->haveServerIgnore())
return;
MessageOut outMsg(CMSG_IGNORE_ALL);
outMsg.writeInt8(0, "flag");
@@ -244,7 +244,7 @@ void ChatHandler::ignoreAll() const
void ChatHandler::unIgnoreAll() const
{
- if (!Net::getServerFeatures()->haveServerIgnore())
+ if (!serverFeatures->haveServerIgnore())
return;
MessageOut outMsg(CMSG_IGNORE_ALL);
outMsg.writeInt8(1, "flag");
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index 4a7b00147..35b25364b 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -85,7 +85,7 @@ GuildHandler::~GuildHandler()
void GuildHandler::handleMessage(Net::MessageIn &msg)
{
BLOCK_START("GuildHandler::handleMessage")
- if (!Net::getServerFeatures()->haveNativeGuilds())
+ if (!serverFeatures->haveNativeGuilds())
return;
switch (msg.getId())
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index a1eb1b159..359326e31 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -267,7 +267,7 @@ void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg)
index, itemId, itemType, identified);
}
- if (!Net::getServerFeatures()->haveItemColors() && identified > 1)
+ if (!serverFeatures->haveItemColors() && identified > 1)
identified = 1;
if (inventory)
@@ -338,7 +338,7 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg)
if (item && item->getId() == itemId)
amount += item->getQuantity();
- if (!Net::getServerFeatures()->haveItemColors() && identified > 1)
+ if (!serverFeatures->haveItemColors() && identified > 1)
identified = 1;
inventory->setItem(index, itemId, amount, refine,
@@ -388,7 +388,7 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg)
cards[0], cards[1], cards[2], cards[3]);
}
- if (!Net::getServerFeatures()->haveItemColors() && identified > 1)
+ if (!serverFeatures->haveItemColors() && identified > 1)
identified = 1;
// Trick because arrows are not considered equipment
@@ -431,7 +431,7 @@ void InventoryHandler::processPlayerStorage(Net::MessageIn &msg)
cards[0], cards[1], cards[2], cards[3]);
}
- if (!Net::getServerFeatures()->haveItemColors() && identified > 1)
+ if (!serverFeatures->haveItemColors() && identified > 1)
identified = 1;
mInventoryItems.push_back(Ea::InventoryItem(index, itemId,
@@ -499,7 +499,7 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg)
static_cast<unsigned int>(refine));
}
- if (!Net::getServerFeatures()->haveItemColors() && identified > 1U)
+ if (!serverFeatures->haveItemColors() && identified > 1U)
identified = 1U;
mInventoryItems.push_back(Ea::InventoryItem(index,
@@ -530,7 +530,7 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
{
if (mStorage)
{
- if (!Net::getServerFeatures()->haveItemColors() && identified > 1)
+ if (!serverFeatures->haveItemColors() && identified > 1)
identified = 1;
mStorage->setItem(index, itemId, amount,
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 35321b1b8..bcf0e6c2b 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -267,7 +267,7 @@ void LoginHandler::processUpdateHost2(Net::MessageIn &msg) const
int LoginHandler::supportedOptionalActions() const
{
- return Net::getServerFeatures()->haveEmailOnRegister()
+ return serverFeatures->haveEmailOnRegister()
? Net::RegistrationOptions::SetEmailOnRegister
| Net::RegistrationOptions::SetGenderOnRegister
: Net::RegistrationOptions::SetGenderOnRegister;
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index 0718e9b4f..5437d6920 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -180,7 +180,7 @@ void NpcHandler::buyItem(const int beingId A_UNUSED, const int itemId,
const unsigned char color, const int amount) const
{
MessageOut outMsg(CMSG_NPC_BUY_REQUEST);
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
outMsg.writeInt16(10); // One item (length of packet)
outMsg.writeInt16(static_cast<int16_t>(amount));
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index ae64ae9c1..b50fc3944 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -673,7 +673,7 @@ static int parseDirectionName(const std::string &name)
int id = -1;
if (name == "down")
{
- if (Net::getServerFeatures()->haveEightDirections())
+ if (serverFeatures->haveEightDirections())
id = SpriteDirection::DOWN;
else
id = -2;
@@ -692,7 +692,7 @@ static int parseDirectionName(const std::string &name)
}
else if (name == "up")
{
- if (Net::getServerFeatures()->haveEightDirections())
+ if (serverFeatures->haveEightDirections())
id = SpriteDirection::UP;
else
id = -3;
diff --git a/src/shopitem.cpp b/src/shopitem.cpp
index ec79a29da..10491ef2d 100644
--- a/src/shopitem.cpp
+++ b/src/shopitem.cpp
@@ -42,7 +42,7 @@ ShopItem::ShopItem(const int inventoryIndex, const int id,
mPrice(price),
mShowQuantity(true)
{
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
mDisplayName = std::string(getInfo().getName(color)).append(" (")
.append(Units::formatCurrency(mPrice)).append(") ");
@@ -66,7 +66,7 @@ ShopItem::ShopItem(const int id, const unsigned char color, const int price) :
mPrice(price),
mShowQuantity(false)
{
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
mDisplayName = std::string(getInfo().getName(color)).append(" (")
.append(Units::formatCurrency(mPrice)).append(")");
@@ -94,7 +94,7 @@ void ShopItem::update()
{
if (mShowQuantity)
{
- if (Net::getServerFeatures()->haveItemColors())
+ if (serverFeatures->haveItemColors())
{
mDisplayName = std::string(getInfo().getName(mColor)).append(" (")
.append(Units::formatCurrency(mPrice)).append(") ");
diff --git a/src/utils/chatutils.cpp b/src/utils/chatutils.cpp
index 3c6a4912e..1bc08ad4e 100644
--- a/src/utils/chatutils.cpp
+++ b/src/utils/chatutils.cpp
@@ -66,7 +66,7 @@ void outStringNormal(ChatTab *const tab,
{
if (guild->getServerGuild())
{
- if (!Net::getServerFeatures()->haveNativeGuilds())
+ if (!serverFeatures->haveNativeGuilds())
return;
guildHandler->chat(guild->getId(), str);
}