Skip to content

Commit

Permalink
Moved player name length to a config and raised it to 25 (otland#3760)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-bernardo authored and EPuncker committed May 23, 2023
1 parent 116e7a6 commit 5023b41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ Player* Game::getPlayerByGUID(const uint32_t& guid)
ReturnValue Game::getPlayerByNameWildcard(const std::string& s, Player*& player)
{
size_t strlen = s.length();
if (strlen == 0 || strlen > 20) {
if (strlen == 0 || strlen > PLAYER_NAME_LENGTH) {
return RETURNVALUE_PLAYERWITHTHISNAMEISNOTONLINE;
}

Expand Down Expand Up @@ -3250,7 +3250,7 @@ void Game::playerSetFightModes(uint32_t playerId, fightMode_t fightMode, bool ch

void Game::playerRequestAddVip(uint32_t playerId, const std::string& name)
{
if (name.length() > 20) {
if (name.length() > PLAYER_NAME_LENGTH) {
return;
}

Expand Down
2 changes: 2 additions & 0 deletions src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ enum GameState_t {
GAME_STATE_MAINTAIN,
};

static constexpr int32_t PLAYER_NAME_LENGTH = 25;

static constexpr int32_t EVENT_LIGHTINTERVAL = 10000;
static constexpr int32_t EVENT_WORLDTIMEINTERVAL = 2500;
static constexpr int32_t EVENT_DECAYINTERVAL = 250;
Expand Down

0 comments on commit 5023b41

Please sign in to comment.