Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ enum checksumMode_t
CHECKSUM_SEQUENCE
};

static constexpr int32_t CONNECTION_WRITE_TIMEOUT = 30;
static constexpr int32_t CONNECTION_READ_TIMEOUT = 30;
inline constexpr int32_t CONNECTION_WRITE_TIMEOUT = 30;
inline constexpr int32_t CONNECTION_READ_TIMEOUT = 30;

class Protocol;
using Protocol_ptr = std::shared_ptr<Protocol>;
Expand Down
16 changes: 8 additions & 8 deletions src/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#ifndef FS_CONST_H
#define FS_CONST_H

static constexpr int32_t NETWORKMESSAGE_MAXSIZE = 24590;
static constexpr int32_t MIN_MARKET_FEE = 20;
static constexpr int32_t MAX_MARKET_FEE = 100000;
inline constexpr int32_t NETWORKMESSAGE_MAXSIZE = 24590;
inline constexpr int32_t MIN_MARKET_FEE = 20;
inline constexpr int32_t MAX_MARKET_FEE = 100000;

enum MagicEffectsType_t : uint8_t
{
Expand Down Expand Up @@ -723,14 +723,14 @@ enum CreatureIcon_t : uint8_t
CREATURE_ICON_LAST = CREATURE_ICON_CROSS_RED
};

static constexpr int32_t CHANNEL_GUILD = 0x00;
static constexpr int32_t CHANNEL_PARTY = 0x01;
static constexpr int32_t CHANNEL_PRIVATE = 0xFFFF;
inline constexpr int32_t CHANNEL_GUILD = 0x00;
inline constexpr int32_t CHANNEL_PARTY = 0x01;
inline constexpr int32_t CHANNEL_PRIVATE = 0xFFFF;

// Reserved player storage key ranges;
//[10000000 - 20000000];
static constexpr int32_t PSTRG_RESERVED_RANGE_START = 10000000;
static constexpr int32_t PSTRG_RESERVED_RANGE_SIZE = 10000000;
inline constexpr int32_t PSTRG_RESERVED_RANGE_START = 10000000;
inline constexpr int32_t PSTRG_RESERVED_RANGE_SIZE = 10000000;

#define IS_IN_KEYRANGE(key, range) \
(key >= PSTRG_##range##_START && ((key - PSTRG_##range##_START) <= PSTRG_##range##_SIZE))
Expand Down
10 changes: 5 additions & 5 deletions src/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ struct FindPathParams
int32_t maxTargetDist = -1;
};

static constexpr int32_t EVENT_CREATURECOUNT = 10;
static constexpr int32_t EVENT_CREATURE_THINK_INTERVAL = 1000;
static constexpr int32_t EVENT_CHECK_CREATURE_INTERVAL = (EVENT_CREATURE_THINK_INTERVAL / EVENT_CREATURECOUNT);
inline constexpr int32_t EVENT_CREATURECOUNT = 10;
inline constexpr int32_t EVENT_CREATURE_THINK_INTERVAL = 1000;
inline constexpr int32_t EVENT_CHECK_CREATURE_INTERVAL = (EVENT_CREATURE_THINK_INTERVAL / EVENT_CREATURECOUNT);

static constexpr uint32_t CREATURE_ID_MIN = 0x10000000;
static constexpr uint32_t CREATURE_ID_MAX = std::numeric_limits<uint32_t>::max();
inline constexpr uint32_t CREATURE_ID_MIN = 0x10000000;
inline constexpr uint32_t CREATURE_ID_MAX = std::numeric_limits<uint32_t>::max();

class FrozenPathingConditionCall
{
Expand Down
16 changes: 8 additions & 8 deletions src/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
#ifndef FS_DEFINITIONS_H
#define FS_DEFINITIONS_H

static constexpr auto STATUS_SERVER_NAME = "The Forgotten Server";
inline constexpr auto STATUS_SERVER_NAME = "The Forgotten Server";

static constexpr auto STATUS_SERVER_VERSION = "1.7";
static constexpr auto STATUS_SERVER_DEVELOPERS = "The Forgotten Server Team";
static constexpr auto CLIENT_VERSION_MIN = 1310;
static constexpr auto CLIENT_VERSION_MAX = 1311;
static constexpr auto CLIENT_VERSION_STR = "13.10";
inline constexpr auto STATUS_SERVER_VERSION = "1.7";
inline constexpr auto STATUS_SERVER_DEVELOPERS = "The Forgotten Server Team";
inline constexpr auto CLIENT_VERSION_MIN = 1310;
inline constexpr auto CLIENT_VERSION_MAX = 1311;
inline constexpr auto CLIENT_VERSION_STR = "13.10";

static constexpr auto AUTHENTICATOR_DIGITS = 6U;
static constexpr auto AUTHENTICATOR_PERIOD = 30U;
inline constexpr auto AUTHENTICATOR_DIGITS = 6U;
inline constexpr auto AUTHENTICATOR_PERIOD = 30U;

#define BOOST_ASIO_NO_DEPRECATED
#define OPENSSL_NO_DEPRECATED
Expand Down
30 changes: 15 additions & 15 deletions src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ enum GameState_t
GAME_STATE_MAINTAIN,
};

static constexpr int32_t PLAYER_NAME_LENGTH = 25;
inline constexpr int32_t PLAYER_NAME_LENGTH = 25;

static constexpr int32_t EVENT_DECAYINTERVAL = 250;
static constexpr int32_t EVENT_DECAY_BUCKETS = 4;
inline constexpr int32_t EVENT_DECAYINTERVAL = 250;
inline constexpr int32_t EVENT_DECAY_BUCKETS = 4;

static constexpr int32_t MOVE_CREATURE_INTERVAL = 1000;
static constexpr int32_t RANGE_MOVE_CREATURE_INTERVAL = 1500;
static constexpr int32_t RANGE_MOVE_ITEM_INTERVAL = 400;
static constexpr int32_t RANGE_USE_ITEM_INTERVAL = 400;
static constexpr int32_t RANGE_USE_ITEM_EX_INTERVAL = 400;
static constexpr int32_t RANGE_USE_WITH_CREATURE_INTERVAL = 400;
static constexpr int32_t RANGE_ROTATE_ITEM_INTERVAL = 400;
static constexpr int32_t RANGE_BROWSE_FIELD_INTERVAL = 400;
static constexpr int32_t RANGE_WRAP_ITEM_INTERVAL = 400;
static constexpr int32_t RANGE_REQUEST_TRADE_INTERVAL = 400;
inline constexpr int32_t MOVE_CREATURE_INTERVAL = 1000;
inline constexpr int32_t RANGE_MOVE_CREATURE_INTERVAL = 1500;
inline constexpr int32_t RANGE_MOVE_ITEM_INTERVAL = 400;
inline constexpr int32_t RANGE_USE_ITEM_INTERVAL = 400;
inline constexpr int32_t RANGE_USE_ITEM_EX_INTERVAL = 400;
inline constexpr int32_t RANGE_USE_WITH_CREATURE_INTERVAL = 400;
inline constexpr int32_t RANGE_ROTATE_ITEM_INTERVAL = 400;
inline constexpr int32_t RANGE_BROWSE_FIELD_INTERVAL = 400;
inline constexpr int32_t RANGE_WRAP_ITEM_INTERVAL = 400;
inline constexpr int32_t RANGE_REQUEST_TRADE_INTERVAL = 400;

static constexpr int32_t MAX_STACKPOS = 10;
inline constexpr int32_t MAX_STACKPOS = 10;

static constexpr uint8_t ITEM_STACK_SIZE = 100;
inline constexpr uint8_t ITEM_STACK_SIZE = 100;

/**
* Main Game class.
Expand Down
12 changes: 6 additions & 6 deletions src/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

class Creature;

static constexpr int32_t MAP_MAX_LAYERS = 16;
inline constexpr int32_t MAP_MAX_LAYERS = 16;

static constexpr uint16_t MAP_NORMALWALKCOST = 10;
static constexpr uint16_t MAP_DIAGONALWALKCOST = 25;
inline constexpr uint16_t MAP_NORMALWALKCOST = 10;
inline constexpr uint16_t MAP_DIAGONALWALKCOST = 25;

struct FindPathParams;
struct AStarNode
Expand Down Expand Up @@ -57,9 +57,9 @@ class AStarNodes

using SpectatorCache = std::map<Position, SpectatorVec>;

static constexpr int32_t FLOOR_BITS = 3;
static constexpr int32_t FLOOR_SIZE = (1 << FLOOR_BITS);
static constexpr int32_t FLOOR_MASK = (FLOOR_SIZE - 1);
inline constexpr int32_t FLOOR_BITS = 3;
inline constexpr int32_t FLOOR_SIZE = (1 << FLOOR_BITS);
inline constexpr int32_t FLOOR_MASK = (FLOOR_SIZE - 1);

struct Floor
{
Expand Down
4 changes: 2 additions & 2 deletions src/monsters.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class LuaScriptInterface;

const uint32_t MAX_LOOTCHANCE = 100000;

static constexpr int32_t BESTIARY_MAX_DIFFICULTY = 5;
static constexpr int32_t BESTIARY_MAX_OCCURRENCE = 4;
inline constexpr int32_t BESTIARY_MAX_DIFFICULTY = 5;
inline constexpr int32_t BESTIARY_MAX_OCCURRENCE = 4;

struct LootBlock
{
Expand Down
4 changes: 2 additions & 2 deletions src/party.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class Player;

using PlayerVector = std::vector<Player*>;

static constexpr int32_t EXPERIENCE_SHARE_RANGE = 30;
static constexpr int32_t EXPERIENCE_SHARE_FLOORS = 1;
inline constexpr int32_t EXPERIENCE_SHARE_RANGE = 30;
inline constexpr int32_t EXPERIENCE_SHARE_FLOORS = 1;

enum SharedExpStatus_t : uint8_t
{
Expand Down
8 changes: 4 additions & 4 deletions src/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct OpenContainer
uint16_t index;
};

static constexpr int16_t MINIMUM_SKILL_LEVEL = 10;
inline constexpr int16_t MINIMUM_SKILL_LEVEL = 10;

struct Skill
{
Expand All @@ -83,10 +83,10 @@ struct Skill

using MuteCountMap = std::map<uint32_t, uint32_t>;

static constexpr int32_t PLAYER_MAX_SPEED = 1500;
static constexpr int32_t PLAYER_MIN_SPEED = 10;
inline constexpr int32_t PLAYER_MAX_SPEED = 1500;
inline constexpr int32_t PLAYER_MIN_SPEED = 10;

static constexpr int32_t NOTIFY_DEPOT_BOX_RANGE = 1;
inline constexpr int32_t NOTIFY_DEPOT_BOX_RANGE = 1;

class Player final : public Creature
{
Expand Down
2 changes: 1 addition & 1 deletion src/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "tasks.h"
#include "thread_holder_base.h"

static constexpr int32_t SCHEDULER_MINTICKS = 50;
inline constexpr int32_t SCHEDULER_MINTICKS = 50;

class SchedulerTask : public Task
{
Expand Down