Guest User

Untitled

a guest
Sep 11th, 2026
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.07 KB | None | 0 0
  1. #ifndef __INC_METIN_II_COMMON_SERVERCONFIG_H__
  2. #define __INC_METIN_II_COMMON_SERVERCONFIG_H__
  3.  
  4. #include "service.h"
  5.  
  6. // Central place for server custom settings, requires recompilation of both game + db
  7.  
  8.  
  9.  
  10. enum eServerConfig
  11. {
  12. MAP_ALLOW_LIMIT = 64, //@@; max maps a single game core may host (alMaps[] size). Raise as needed (tested up to 128).
  13. MAX_CLIENT_OUTPUT_BUFFER = 4194304, //@@; bytes of unsent data a client socket may pile up before it is dropped (a client that stops reading otherwise grows this without limit). 0 = no cap. P2P/DB links are exempt
  14. MAX_CONNECTION_PER_IP = 20, //@@; concurrent connections allowed from one IP. 0 = unlimited
  15. MAX_ACCEPT_PER_IP_PER_SEC = 10, //@@; new connections one IP may open per second. 0 = unlimited
  16. MAX_ACCEPT_PER_SEC = 200, //@@; new connections the core accepts per second in total. 0 = unlimited
  17. CHANNEL_STATUS_CACHE_MS = 1000, //@@; anti-flood: replay the last channel-status reply instead of re-querying the DB if a new request arrives within this window. 0 = always query
  18.  
  19. #ifdef ENABLE_SERVERSIDE_SECURITY
  20. HIT_LIMITER_WARRIOR_MS = 250, //@@; min delay between two hits on the SAME target, warrior. 0 = no limit
  21. HIT_LIMITER_ASSASSIN_MS = 200, //@@; same, assassin
  22. HIT_LIMITER_SURA_MS = 250, //@@; same, sura
  23. HIT_LIMITER_SHAMAN_MS = 250, //@@; same, shaman
  24. HIT_LIMITER_BOW_MS = 550, //@@; same, while a bow is equipped (overrides the job value) - anti BowHack
  25. HIT_LIMITER_POLY_MS = 450, //@@; same, while polymorphed (overrides the job value, bow still wins)
  26. HIT_LIMITER_MAX_DISTANCE_DIFF = 60, //@@; max distance a player may have travelled since their last hit before the next one is refused as teleport/WH. 0 = distance check off
  27. HIT_LIMITER_TELEPORT_WINDOW_MS = 100, //@@; how long after a hit that distance check stays armed (bow uses HIT_LIMITER_BOW_MS instead)
  28. HIT_LIMITER_VID_MEMORY_MS = 1000, //@@; how long a hit target is remembered. MUST be >= the largest of the limits above
  29. HIT_LIMITER_MIN_BLOCKED_TO_LOG = 3500, //@@; blocked hits in one session before the player is written to hack_log on logout. 0 = never log
  30. #endif
  31.  
  32. #ifdef ENABLE_MAINTENANCE_SYSTEM
  33. SERVER_JOIN_LIMIT = 1, //@@; maintenance login gate: 0 = players may log in for the whole countdown (refused only once maintenance actually starts), 1 = also refused during the last SERVER_JOIN_LIMIT_MINUTES minutes
  34. SERVER_JOIN_LIMIT_MINUTES = 5, //@@; only used when SERVER_JOIN_LIMIT = 1 --- time in minutes before ment. when player can't join anymore
  35. #endif
  36.  
  37. #ifdef ENABLE_MULTI_FARMBLOCK
  38. FARMBLOCK_MAX_ACCOUNTS = 2, //@@; how many characters from one machine may collect loot at the same time. 0 = nobody
  39. FARMBLOCK_WARN_COOLDOWN_MS = 30000, //@@; min delay between two "your drop is disabled" popups. Fishing and mining always warn ; this throttles the one fired by hitting a monster. 0 = warn every time (30000 ms = 30 sec)
  40. FARMBLOCK_CMD_COOLDOWN_MS = 5000, //@@; min delay between two /multifarm toggles from one character. Each accepted toggle pushes a roster to every descriptor on the machine and broadcasts it to every core. 0 = no limit (5000 ms = 5 sec)
  41. #endif
  42.  
  43.  
  44. #ifdef ENABLE_TARGET_INFO
  45. TARGET_INFO_COOLDOWN_MS = 1000, //@@; min delay between two target-info requests from the same player. The reply walks every drop table of that mob, so this is what keeps the "?" button from being a free CPU tap. 0 = no limit
  46. #endif
  47.  
  48. #ifdef ENABLE_REGEN_RT
  49. REGEN_RT_REFRESH = 0, //@@; the scheduled time arrives and the boss is still alive: 0 = leave it (never yanks a boss out of a fight, never two at once), 1 = despawn it and respawn at full HP
  50. REGEN_RT_SPAWN_AT_BOOT = 1, //@@; 1 = spawn every entry when the core boots, so a restart does not leave a fixed hour boss missing until its next hour. 0 = wait for the schedule
  51.  
  52. #endif
  53.  
  54.  
  55. };
  56.  
  57.  
  58. // Gameplay rules: party, skills, guild founding, death and shop penalties
  59. enum eGamePlaySettings
  60. {
  61. MAX_LEVEL = 99, //@@; player level cap (default for gPlayerMaxLevel; the CONFIG token "max_level" still overrides it at runtime). Hard ceiling is 120 - exp_table/aiExpLossPercents are sized PLAYER_EXP_TABLE_MAX+1, raising past that needs new table rows
  62. MAX_STAT_POINTS = 90, //@@; max points a player may put into ONE stat (st/ht/dx/iq) via /stat
  63. STAT_POINT_MAX_LEVEL = 90, //@@; last level that still grants stat points (3 per level); levels above it give none. Total granted = STAT_POINT_MAX_LEVEL * 3
  64. BOX_USE_LIMIT_MS = 0, //@@; min delay between opening two boxes (ITEM_GIFTBOX)
  65. BUYSELL_LIMIT_MS = 0, //@@; min delay between two NPC shop buy/sell actions
  66. SKILL_RESET_COOLDOWN_ON_DEATH = 0, //@@; 1 = dying clears every skill cooldown (PvP balance change: a death hands the burst straight back). The server also tells the client, so the two never disagree
  67. #ifdef ENABLE_TASKBAR_ANTIEXP
  68. ANTI_EXP_LIMIT_MS = 8000, //@@; min delay between two /anti_exp toggles. Keep it below the client's own 10s cooldown so the client gate is the one players hit and this only catches a patched client. 0 = no server-side limit
  69. #endif
  70. NO_DROP_METIN_STONE = 0, //@@; 1 = mobs never roll a metin stone drop
  71. NO_MOUNT_AT_GUILD_WAR = 1, //@@; 1 = cannot mount on a guild-war map, and entering one dismounts you
  72. AURA_REQUIRES_WEAPON = 1, //@@; 1 = Sword Aura / Blade end when no weapon is worn (stock), 0 = they stay active with the weapon off
  73. KEEP_SKILL_AT_WARP = 1, //@@; requires AURA_REQUIRES_WEAPON = 1. 0 = stock, any weapon-slot clear ends the aura (SetWear). 1 = only a manual unequip ends it (CanUnequipNow); systemic weapon changes (e.g. a warp) leave it running
  74. PARTY_MAX_MEMBER_COUNT = 8, //@@; players allowed in one party. The party exp bonus table still caps at 8 members, extra members give no further bonus
  75. PARTY_KILL_RENEWAL = 1, //@@; 1 = a mob kill fires the quest party_kill event on every NEARBY party member in their own context. 0 = stock, only the party leader gets it. Changes what existing party-kill quest counters do
  76. INFINITE_ARROWS = 0, //@@; 1 = arrows are never consumed (one equipped arrow lasts forever)
  77. SKILL_MASTER_AT_17 = 1, //@@; 1 = a normal skill turns master (M1) the moment it reaches 17, 0 = stock random roll between 17 and 20. Does not touch the master->grand master (30) or grand master->perfect (40) rolls
  78. SKILL_BOOK_EXP_COST = 20000, //@@; exp a skill book needs to be read (and spends on the grand master path). 0 = books are free, no exp needed and none taken. DEFUALT 20k
  79. RESTART_HP_FULL = 1, //@@; 1 = respawning ("Restart here" / "Restart in town") gives full HP, 0 = stock 50 HP. Does not touch SP; the guild-war and threeway-war respawn paths already restore both
  80. DEAD_AUTO_REVIVE_SEC = 180, //@@; seconds a dead player waits before the server revives them in town by itself (dead_event). Also the base the two waits below are measured from
  81. RESTART_HERE_WAIT_SEC = 10, //@@; seconds before "Restart here" is accepted. Not applied on a test server or on a non-flag guild war map (respawn is instant there)
  82. RESTART_TOWN_WAIT_SEC = 7, //@@; seconds before "Restart in town" is accepted
  83. #ifdef ENABLE_RESTART_DIALOG_TIMER
  84. RESTART_DIALOG_TIMER = 1, //@@; 1 = send the three waits to the client so the restart dialog can grey the buttons and count down. 0 = send zeros, the dialog behaves like stock. Turning it off needs no client rebuild, the packet size is the same either way
  85. #endif
  86. WEAPON_DAMAGE_FIXED = 0, //@@; removes the random roll between a weapon's min and max damage. 0 = stock random, 1 = always min (Value 3), 2 = always max (Value 4), 3 = always the average. Applies to melee, bow and skill damage (magic weapons use Value 1/2 for skills). Everything else (attack rating, crit, defense) still varies
  87. METIN_SOCKET_SUCCESS_PCT = 30, //@@; chance a metin stone attaches instead of breaking. 100 = never breaks
  88. GUILD_CREATE_PRICE = 200000, //@@; yang taken when a guild is founded (also the amount checked before founding)
  89. GUILD_CREATE_MIN_LEVEL = 40, //@@; min level to found a guild. 0 = no level requirement
  90. GUILD_WAR_AUTO_JOIN_MASTER = 1, //@@; 1 = the guild master is warped straight into a guild war instead of being sent the guild_war_join letter. Ordinary members still get the letter
  91. DISPEL_KEEPS_SPEED_BUFFS = 1, //@@; 1 = the dispel skill (Risipa) no longer strips movement/attack-speed potion buffs. Only that skill is affected - arena entry, GM duels and quests still strip everything
  92. IGNORE_LOWER_BUFFS = 1, //@@; 1 = casting one of the Sura self-buffs (Hosin/Reflect/Gicheon/Jeongeop/Kwaesok/Jeungryeok) is refused while a stronger one of the same skill is already active, so it can no longer be downgraded by a weaker recast. 0 = stock, always overwrites
  93. EMPIRE_SHOP_PRICE_PENALTY = 1, //@@; 1 = other-empire NPC shops charge x3 (stock), 0 = same price for everyone
  94. EMPIRE_DAMAGE_PENALTY = 1, //@@; 1 = stock, a PC deals 10% less damage (7-9% on some maps/locales) while fighting on another empire map. 0 = no penalty, damage is the same everywhere
  95. MAX_ALIGN_POINTS = 200000, //@@; INTERNAL alignment clamp. The client is sent value/10, so 200000 here = the 20000 you see in game. Death-drop tiers are internal too (120000 = 12000 shown)
  96. NO_EXP_LOSS_ON_DEATH = 1, //@@; 1 = players never lose experience on death (the Blessing of the Dragon God affect is also left unconsumed), 0 = stock death penalty
  97. ALLOW_BUFF_REMOVE = 1, //@@; 1 = /remove_buff works, letting a player drop one of their own buff skills. Only skills that produce a buff icon are accepted; poison/stun/slow, chat blocks and premium/mall affects can never be removed. 0 = the command does nothing. Pairs with constinfo.ENABLE_AFFECT_BUFF_REMOVE, which controls the click + tooltip hint client-side
  98. ALLOW_POLYMORPH_REMOVE = 1, //@@; 1 = /remove_polymorph works, cancelling the player's own polymorph early -- must be same value as constinfo.py
  99. STOP_RIDING_WHEN_DIE = 1, //@@; 1 = dying dismounts you (stock: StopRiding / clears mount affect+bonus), 0 = keep the horse/mount after death
  100. NO_DSS_QUALIFICATION = 1, //@@; 1 = every player is treated as Dragon Soul qualified (bypasses the AFFECT_DRAGON_SOUL_QUALIFIED requirement), 0 = stock qualification check
  101. AUTO_POTION_USE_NEXT = 1, //@@; 1 = when an auto-potion runs out the next one of the same kind (HP or SP) is activated automatically. 0 = stock, the affect just ends
  102. REFINE_PICKAXE_KEEP_ON_FAIL = 1, //@@; 1 = a failed pickaxe refine keeps the pickaxe and only takes REFINE_TOOL_FAIL_EXP_PENALTY_PCT off its stored exp. 0 = stock, it is replaced by its fail vnum (Value 4)
  103. REFINE_FISHINGROD_KEEP_ON_FAIL = 1, //@@; same as REFINE_PICKAXE_KEEP_ON_FAIL, for fishing rods
  104. REFINE_TOOL_FAIL_EXP_PENALTY_PCT = 10, //@@; percent of stored exp a failed refine takes off, used by the two settings above. A refine needs full exp again, so this is what you re-grind
  105. MAX_STACK_SIZE = 20000, //@@; max items in one stack. MAX 65535
  106. REMOVE_GOLD_LIMIT = 1, //@@; 1 = raised gold cap (uses constexpr MAX_GOLD below), 0 = classic 2000000000
  107. };
  108. constexpr long long MAX_GOLD = REMOVE_GOLD_LIMIT ? 9000000000000LL : 2000000000LL;
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115. // Ground items: how long a drop lives, who may take it, how far you may reach
  116. enum eItemDrop
  117. {
  118. ITEM_DROP_FLOOR_TIME_USER = 30, //@@; how long an item a player dropped by hand stays on the ground
  119. ITEM_DROP_FLOOR_TIME_MOB = 60, //@@; how long an item/gold dropped by a mob or metin stays on the ground
  120. ITEM_DROP_OWNERSHIP_TIME = 40, //@@; how long a mob drop stays reserved to its killer's name
  121. PICKUP_RANGE_MAX = 300, //@@; pickup rangeon foot
  122. PICKUP_RANGE_MOUNT_MAX = 500, //@@; pick up range while riding
  123. PICKUP_RANGE_TOLERANCE = 150, //@@; slack added to both, covers client/server position drift
  124. ALIGN_DROP_PENALTY = 1, //@@; 1 = dying drops items per the alignment table (stock), 0 = never drop items on death
  125. ITEM_DROP_LIMIT_MS = 0, //@@; min delay between dropping two items on the ground
  126. };
  127.  
  128.  
  129. // OX event settings. The map indexes they act on are still hardcoded at the call
  130. // sites: OX = 113, wedding = 81, guild war = 110/111
  131. enum eOxSettings
  132. {
  133. OX_BLOCK_CHAT = 1, //@@; 1 = players cannot use normal chat on the OX map (GMs unaffected)
  134. OX_BLOCK_WHISPER = 1, //@@; 1 = players cannot send whispers on the OX map (GMs unaffected)
  135. OX_BLOCK_ITEM_DROP = 1, //@@; 1 = players cannot drop items on the OX map (GMs unaffected)
  136. OX_BLOCK_PET = 1, //@@; 1 = pets are not summoned on the OX and wedding maps
  137. OX_BLOCK_HORSE = 1, //@@; 1 = horses cannot be summoned on the OX and wedding maps
  138. OX_BLOCK_MOUNT = 1, //@@; 1 = mounts are dismissed on the OX, wedding and guild-war maps
  139. OX_HIDE_PLAYERS = 1, //@@; 1 = players do not see each other on the OX map (GMs still see everyone)
  140. OX_BLOCK_SKILL = 1, //@@; 1 = skills cannot be used on the OX map
  141. OX_MAX_ACCOUNTS_PER_IP = 1, //@@; how many players from one IP may join the OX event. 0 = unlimited, 1 = one account per IP, 2 = two, etc
  142. };
  143.  
  144.  
  145. #ifdef ENABLE_OPTION_UNSTUCK
  146. enum eUnstuck
  147. {
  148. UNSTUCK_COOLDOWN_SEC = 60, //@@; wait between two successful unstucks. Being told "you are not stuck" costs nothing. GMs bypass it
  149. UNSTUCK_RANGE = 300, //@@; how far the free tile may be, in cm (300 = 3m). 0 = anywhere on the map. No free tile found = warp to the empire town
  150. UNSTUCK_COMBAT_BLOCK_MS = 10000, //@@; refuse this long after the player last ATTACKED (that is what GetLastAttackTime measures - not being hit). 0 = no combat check
  151. UNSTUCK_BLOCK_IN_DUNGEON = 1, //@@; 1 = refuse on private maps (index >= 10000). Set 0 and unstuck there warps to town, since dungeons have no map region to pick a tile from
  152. };
  153. #endif
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161. #endif /* __INC_METIN_II_COMMON_SERVERCONFIG_H__ */
  162.  
Advertisement
Add Comment
Please, Sign In to add comment