diff --git a/.gitignore b/.gitignore index e042209..ebf852e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,65 @@ pids.json share/locale/english/quest/object share/locale/english/quest/pre_qc + +# ======================================================= +# FULLY CASE-INSENSITIVE BACKUP EXCLUSIONS +# Matches all files and folders ending in: +# _BK, _BAK, .BK, .BAK (and all case permutations) +# ======================================================= + +# ------------------------------------------------------- +# 1. EXCLUSIONS ENDING IN .BK / _BK +# ------------------------------------------------------- + +# Files/Folders ending in _BK (e.g., File_Bk, Folder_bK) +*_BK +*_Bk +*_bK +*_bk + +# Files ending in .BK (e.g., File.BK, File.bK) +*.BK +*.Bk +*.bK +*.bk + +# Files ending in "double extension" .X.BK (e.g., File.txt.Bk) +*.*.BK +*.*.Bk +*.*.bK +*.*.bk + +# ------------------------------------------------------- +# 2. EXCLUSIONS ENDING IN .BAK / _BAK +# ------------------------------------------------------- + +# Files/Folders ending in _BAK (e.g., File_BAK, Folder_bak) +*_BAK +*_BAk +*_BaK +*_Bak +*_bAK +*_bAk +*_baK +*_bak + +# Files ending in .BAK (e.g., File.BAK, File.bak) +*.BAK +*.BAk +*.BaK +*.Bak +*.bAK +*.bAk +*.baK +*.bak + +# Files ending in "double extension" .X.BAK (e.g., File.txt.Bak) +*.*.BAK +*.*.BAk +*.*.BaK +*.*.Bak +*.*.bAK +*.*.bAk +*.*.baK +*.*.bak diff --git a/README.md b/README.md index 0eeaaaf..3d48bba 100644 --- a/README.md +++ b/README.md @@ -4,27 +4,16 @@ This repository contains the core server files and configurations. It includes f --- -## ✨ Key Updates and Fixes +## Changelog 📋 -The following changes have been implemented to improve stability, performance, and development workflow: +### 🐛 Bug Fixes & Stability +* **Configuration:** Fixed a syntax typo found in `perms.py`, ensuring correct configuration parsing. +* **SQL:** Corrected a syntax error discovered in `sql/account.sql`, improving database initialization reliability. -### ⚙️ Initial Setup & Build Process - -* **NEW Script: `clear.py`:** Added an up-to-date script for comprehensive cleanup of log, PID, and temporary files across channels and the database. -* **NEW Script: `perms.py`:** Added a script to automatically assign necessary permissions to all compiled binaries (`game`, `db` and `qc`). - * ⚠️ **Action Required:** The `perms.py` script uses `os.getcwd()` to determine the root path. **You must run this script from your game's root directory (e.g., `/usr/home/game`) for it to function correctly.** -* **Fix: `install.py`:** Corrected the script to properly create the `data/package` folder and ensure it is symbolically linked across all channels. -* **Configuration: `conf/game.txt`:** Changed the maximum character level supported in the server configuration to **120**. - -### 🐍 Core Logic & Quest Engine - -* **Fix: `make.py` (Quest Compilation):** Fixed a critical logic bug (missing `else` assignment) in `share/locale/[xxx]/quest/make.py` that was causing compiled quests and dialogs to be unresponsive in-game. -* **Fix: `pre_qc.py` (Quest Pre-processing):** Resolved a syntax error in `share/locale/[xxx]/quest/pre_qc.py` by specifying the correct encoding option when reading files. - -### 💾 Database Performance & Integrity - -* **Performance:** Replaced the default database engine on most tables with either **Aria** (for high-read tables like `item_proto`, `mob_proto`) or **InnoDB** (for high-write tables like `item`, `affect`). - * *Note: Most `log` tables retain the default **MyISAM** engine due to compatibility requirements.* -* **Integrity Fix:** Corrected a syntax error in the `item_proto` section of `sql/player.sql` where a single quote (`'`) was missing from the "Bambi Seal" item insert query. -* **Bug fix:** A fix was applied to the `MOV_SPEED` value for skill 19 in the `skill_proto` table to prevent characters from becoming immobile during the effect. -* **Updates:** All `.sql` files (`account.sql`, `common.sql`, `log.sql`, `player.sql`) are updated with the new engine and functioning query settings. \ No newline at end of file +### ⬆️ Feature & System Improvements +* **Database Structure:** Updated the data type for `hp` and `sp` fields in the `player.player` table from `smallint(4)` to the more robust `int(11)` for compatibility with the source code (`common/tables.h`). **(Note: Existing projects are highly recommended to update their table structure manually.)** +* **Deployment Scripts:** The `start.py` script logic has been updated to guarantee that **channel 99** is activated, regardless of the total number of channels specified for the start-up sequence. +* **Channel Support:** Increased the maximum supported channel count to **4** channels in `channels.py`. Run `install.py` to apply. +* **Localization (`locale_strings`):** Added full support for new chat messages from the **Messenger System** updates from the source code. (English and Greek locales only) +* **Charset compatibility:** In `special_item_group.txt`, the Korean string "경험치" has been converted to "exp" for better compatibility with the warning fixes in the source code (compatible with older source versions, the Korean string is no longer supported after the latest source updates). +* **.gitignore file**: Ignoring all files and directories ending in `_BAK` or `.BAK` (case-insensitive) \ No newline at end of file diff --git a/channels.py b/channels.py index e12215a..cc65fac 100644 --- a/channels.py +++ b/channels.py @@ -13,5 +13,7 @@ MAP_ALLOW_SPECIAL = { CHANNEL_MAP = { 1: MAP_ALLOW_NORMAL, 2: MAP_ALLOW_NORMAL, + 3: MAP_ALLOW_NORMAL, + 4: MAP_ALLOW_NORMAL, 99: MAP_ALLOW_SPECIAL, } \ No newline at end of file diff --git a/perms.py b/perms.py index 2869f1e..0632d4e 100644 --- a/perms.py +++ b/perms.py @@ -31,8 +31,8 @@ def main(): if os.name == "nt": print(f"Skipped setting Unix permissions on Windows for: {os.path.basename(path)}.") else: - # 777 in octal - permission_code = 0o777 + # 777 in octal + permission_code = 0o777 # --- Section 1: Set permissions for files inside /var/db/mysql subdirectories --- print(f"Setting permissions on files within subdirectories of '{DB_ROOT_DIR}'...") diff --git a/share/locale/english/locale_string.txt b/share/locale/english/locale_string.txt index ec623b6..2276eb6 100644 --- a/share/locale/english/locale_string.txt +++ b/share/locale/english/locale_string.txt @@ -2283,3 +2283,15 @@ "문제 입니다."; "OX-Question: "; + +"[Friends] You cannot add yourself as a friend."; +"[Friends] You cannot add yourself as a friend."; + +"[Friends] You are already friends with %s."; +"[Friends] You are already friends with %s."; + +"[Friends] You already sent a friend request to %s."; +"[Friends] You already sent a friend request to %s."; + +"[Friends] %s has already sent you a friend request."; +"[Friends] %s has already sent you a friend request."; diff --git a/share/locale/english/locale_string_gr.txt b/share/locale/english/locale_string_gr.txt index 0078b30..5e0cc8b 100644 --- a/share/locale/english/locale_string_gr.txt +++ b/share/locale/english/locale_string_gr.txt @@ -2283,3 +2283,15 @@ " Դϴ."; "OX-Question: "; + +"[Friends] You cannot add yourself as a friend."; +"[] ."; + +"[Friends] You are already friends with %s."; +"[] %s."; + +"[Friends] You already sent a friend request to %s."; +"[] %s."; + +"[Friends] %s has already sent you a friend request."; +"[] %s ."; diff --git a/share/locale/english/ori_to_new_table.txt_bakcup b/share/locale/english/ori_to_new_table.txt_bakcup deleted file mode 100644 index c9ef833..0000000 --- a/share/locale/english/ori_to_new_table.txt_bakcup +++ /dev/null @@ -1,88 +0,0 @@ -25041 39001 -70005 39002 -70020 39003 -70024 39004 -70035 39005 -70038 39006 -70039 39007 -71001 39008 -71003 39009 -71014 39010 -71018 39011 -71019 39012 -71020 39013 -71021 39014 -71025 39015 -71026 39016 -71027 39017 -71028 39018 -71029 39019 -71030 39020 -71031 39021 -71032 39022 -71035 39023 -71044 39024 -71045 39025 -71050 39026 -71083 39027 -71084 39028 -71085 39029 -71094 39030 -71101 39031 -71107 39032 -71109 39033 -71110 39034 -71113 39035 -72701 39036 -72723 39037 -72724 39038 -72725 39039 -72727 39040 -72728 39041 -72729 39042 -22010 39043 -30320 39044 -25040 72301 -70003 72302 -70005 72303 -70024 72304 -70026 72305 -70027 72306 -70028 72307 -70035 72308 -70039 72309 -71001 72310 -71020 72311 -71028 72312 -71030 72313 -71032 72314 -27051 27001 -27052 27004 -27053 27100 -27054 27103 -76000 70020 -76001 71002 -76003 71101 -76004 72727 -76005 72727 -76006 27989 -76007 27989 -76008 71004 -76009 71032 -76010 30190 -76011 70003 -76012 71050 -76013 71085 -76014 71084 -76015 70024 -76016 25040 -76017 71014 -76018 71034 -76019 71095 -76020 71035 -76021 72723 -76022 72723 -76023 71151 -76024 71152 -71151 71084 -71152 71085 diff --git a/share/locale/english/quest/reset_scroll.quest b/share/locale/english/quest/reset_scroll.quest index 2d8ef29..7f12d1f 100644 --- a/share/locale/english/quest/reset_scroll.quest +++ b/share/locale/english/quest/reset_scroll.quest @@ -1,6 +1,6 @@ quest reset_scroll begin state start begin - when 71002.use or 76001.use begin + when 71002.use or 76001.use begin say_title(gameforge.reset_scroll._10_sayTitle) say(gameforge.reset_scroll._20_say) @@ -18,7 +18,7 @@ quest reset_scroll begin end char_log(0, "RESET_ALL", "USE_ITEM(71002 or 76001)") - + item.remove() char_log(0, "RESET_ALL", "RESET_STAT_POINTS") @@ -26,13 +26,16 @@ quest reset_scroll begin char_log(0, "RESET_ALL", "RESET_SKILL_POINTS") pc.clear_skill() pc.set_skill_group(0) + horse.set_level(horse_level) char_log(0, "RESET_ALL", "RESET_END") + set_quest_state("skill_group", "run") + end when 71003.use begin say_title(gameforge.reset_scroll._50_sayTitle) - say(gameforge.reset_scroll._60_sayReward) - wait() + say(gameforge.reset_scroll._60_sayReward) + wait() local result = BuildSkillList(pc.get_job(), pc.get_skill_group()) diff --git a/share/locale/english/special_item_group.txt b/share/locale/english/special_item_group.txt index c4f508b..4cb2617 100644 --- a/share/locale/english/special_item_group.txt +++ b/share/locale/english/special_item_group.txt @@ -200,11 +200,11 @@ Group 8 70049 1 10 9 70050 1 10 10 70051 1 10 - 11 ġ 10000 30 - 12 ġ 20000 30 - 13 ġ 30000 30 - 14 ġ 40000 30 - 15 ġ 50000 30 + 11 exp 10000 30 + 12 exp 20000 30 + 13 exp 30000 30 + 14 exp 40000 30 + 15 exp 50000 30 16 ٷ 60000 15 17 ٷ 70000 15 18 ٷ 80000 15 @@ -257,10 +257,10 @@ Group 4 27004 50 43 5 27005 30 43 6 27006 20 43 - 7 ġ 5000 75 - 8 ġ 10000 75 - 9 ġ 15000 75 - 10 ġ 20000 75 + 7 exp 5000 75 + 8 exp 10000 75 + 9 exp 15000 75 + 10 exp 20000 75 11 ٷ 10000 40 12 ٷ 15000 40 13 ٷ 20000 40 @@ -471,11 +471,11 @@ Group Group ˼» { Vnum 50033 - 1 ġ 10000 80 - 2 ġ 20000 70 - 3 ġ 30000 60 - 4 ġ 40000 50 - 5 ġ 50000 40 + 1 exp 10000 80 + 2 exp 20000 70 + 3 exp 30000 60 + 4 exp 40000 50 + 5 exp 50000 40 6 ٷ 10000 80 7 ٷ 20000 70 8 ٷ 30000 65 @@ -499,10 +499,10 @@ Group Group ̳_3 { Vnum 50035 - 1 ġ 30000 100 - 2 ġ 50000 120 - 3 ġ 70000 100 - 4 ġ 100000 80 + 1 exp 30000 100 + 2 exp 50000 120 + 3 exp 70000 100 + 4 exp 100000 80 5 ٷ 30000 160 6 ٷ 50000 140 7 80004 1 60 @@ -542,10 +542,10 @@ Group Group ̳_5 { Vnum 50036 - 1 ġ 30000 30 - 2 ġ 50000 60 - 3 ġ 70000 50 - 4 ġ 100000 60 + 1 exp 30000 30 + 2 exp 50000 60 + 3 exp 70000 50 + 4 exp 100000 60 5 ٷ 30000 50 6 ٷ 50000 70 7 80004 1 70 @@ -592,10 +592,10 @@ Group 4 27004 100 75 5 27005 50 55 6 27006 10 35 - 7 ġ 30000 70 - 8 ġ 50000 40 - 9 ġ 70000 20 - 10 ġ 100000 10 + 7 exp 30000 70 + 8 exp 50000 40 + 9 exp 70000 20 + 10 exp 100000 10 11 70048 1 20 12 70102 1 9 13 70051 1 20 @@ -692,7 +692,7 @@ Group 42 ٷ 100000 70 43 ٷ 200000 9 44 27112 10 30 - 45 ġ 100000 10 + 45 exp 100000 10 } Group бǻ { @@ -743,8 +743,8 @@ Group 44 ٷ 50000 30 45 ٷ 100000 10 46 ٷ 200000 20 - 47 ġ 150000 7 - 48 ġ 200000 8 + 47 exp 150000 7 + 48 exp 200000 8 49 27112 15 25 } Group հŹǻ @@ -793,8 +793,8 @@ Group 41 ٷ 100000 30 42 ٷ 150000 40 43 ٷ 200000 30 - 44 ġ 150000 10 - 45 ġ 200000 20 + 44 exp 150000 10 + 45 exp 200000 20 46 27112 15 20 } Group հŹǻ @@ -845,9 +845,9 @@ Group 43 ٷ 200000 30 44 ٷ 250000 20 45 27112 20 20 - 46 ġ 150000 30 - 47 ġ 200000 30 - 48 ġ 250000 20 + 46 exp 150000 30 + 47 exp 200000 30 + 48 exp 250000 20 } Group Ŵ縷źǻ { @@ -891,10 +891,10 @@ Group 37 70014 1 30 38 70043 1 20 39 70005 1 20 - 40 ġ 100000 10 - 41 ġ 150000 20 - 42 ġ 200000 25 - 43 ġ 250000 30 + 40 exp 100000 10 + 41 exp 150000 20 + 42 exp 200000 25 + 43 exp 250000 30 44 ٷ 100000 10 45 ٷ 150000 20 46 ٷ 200000 25 @@ -943,9 +943,9 @@ Group 37 70014 1 30 38 70043 1 25 39 70005 1 25 - 40 ġ 150000 20 - 41 ġ 200000 30 - 42 ġ 250000 20 + 40 exp 150000 20 + 41 exp 200000 30 + 42 exp 250000 20 43 ٷ 150000 20 44 ٷ 200000 30 45 ٷ 250000 20 @@ -997,9 +997,9 @@ Group 41 70014 1 25 42 70043 1 20 43 70005 1 20 - 44 ġ 200000 20 - 45 ġ 250000 30 - 46 ġ 300000 20 + 44 exp 200000 20 + 45 exp 250000 30 + 46 exp 300000 20 47 ٷ 200000 20 48 ٷ 250000 30 49 ٷ 300000 20 @@ -1058,10 +1058,10 @@ Group ȭ 48 70014 1 25 49 70043 1 20 50 70005 1 20 - 51 ġ 150000 5 - 52 ġ 200000 10 - 53 ġ 250000 10 - 54 ġ 300000 15 + 51 exp 150000 5 + 52 exp 200000 10 + 53 exp 250000 10 + 54 exp 300000 15 55 ٷ 150000 20 56 ٷ 200000 25 57 ٷ 250000 30 @@ -1114,9 +1114,9 @@ Group 41 70014 1 25 42 70043 1 20 43 70005 1 20 - 44 ġ 200000 20 - 45 ġ 250000 30 - 46 ġ 300000 20 + 44 exp 200000 20 + 45 exp 250000 30 + 46 exp 300000 20 47 ٷ 200000 20 48 ٷ 250000 30 49 ٷ 300000 20 @@ -1199,9 +1199,9 @@ Group 21 14204 1 60 20 22 14205 1 40 20 23 14206 1 20 20 - 24 ġ 500000 100 - 25 ġ 700000 60 - 26 ġ 1000000 20 + 24 exp 500000 100 + 25 exp 700000 60 + 26 exp 1000000 20 27 ٷ 300000 100 28 ٷ 500000 60 29 ٷ 1000000 20 @@ -1853,10 +1853,10 @@ Group 2012 4 27004 100 75 5 27005 50 55 6 27006 10 35 - 7 ġ 30000 70 - 8 ġ 50000 40 - 9 ġ 70000 20 - 10 ġ 100000 10 + 7 exp 30000 70 + 8 exp 50000 40 + 9 exp 70000 20 + 10 exp 100000 10 11 70048 1 20 12 70102 1 9 13 70051 1 20 @@ -2318,12 +2318,12 @@ Group w20 86 17520 1 3 87 17540 1 3 88 17560 1 3 - 89 ġ 50000 70 - 90 ġ 100000 60 - 91 ġ 200000 50 - 92 ġ 300000 40 - 93 ġ 400000 30 - 94 ġ 500000 20 + 89 exp 50000 70 + 90 exp 100000 60 + 91 exp 200000 50 + 92 exp 300000 40 + 93 exp 400000 30 + 94 exp 500000 20 95 ٷ 500000 40 96 27002 200 100 97 27003 100 100 diff --git a/sql/account.sql b/sql/account.sql index cab4431..60fb9ca 100644 --- a/sql/account.sql +++ b/sql/account.sql @@ -61,7 +61,7 @@ CREATE TABLE `account` ( LOCK TABLES `account` WRITE; /*!40000 ALTER TABLE `account` DISABLE KEYS */; -INSERT INTO `account` VALUES (1,'admin','*CC67043C7BCFF5EEA5566BD9B1F3C74FD9A5CF5D','1234567','','0000-00-00 00:00:00',0,'OK',0,0,0,'0000-00-00 00:00:00',0,1650,'0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00',0,0,'',NULL,'2021-11-21 20:10:46'),(2,'test','*CC67043C7BCFF5EEA5566BD9B1F3C74FD9A5CF5D','1234567','','0000-00-00 00:00:00',0,'OK','',0,0,0,'0000-00-00 00:00:00',0,0,'0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00',0,0,'',NULL,'2021-08-06 11:42:12'); +INSERT INTO `account` VALUES (1,'admin','*CC67043C7BCFF5EEA5566BD9B1F3C74FD9A5CF5D','1234567','','0000-00-00 00:00:00',0,'OK',0,0,0,'0000-00-00 00:00:00',0,1650,'0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00',0,0,'',NULL,'2021-11-21 20:10:46'),(2,'test','*CC67043C7BCFF5EEA5566BD9B1F3C74FD9A5CF5D','1234567','','0000-00-00 00:00:00',0,'OK',0,0,0,'0000-00-00 00:00:00',0,0,'0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00',0,0,'',NULL,'2021-08-06 11:42:12'); /*!40000 ALTER TABLE `account` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/player.sql b/sql/player.sql index 9f2ebc2..33ac4ec 100644 --- a/sql/player.sql +++ b/sql/player.sql @@ -990,8 +990,8 @@ CREATE TABLE `player` ( `exit_x` int(11) NOT NULL DEFAULT 0, `exit_y` int(11) NOT NULL DEFAULT 0, `exit_map_index` int(11) NOT NULL DEFAULT 0, - `hp` smallint(4) NOT NULL DEFAULT 0, - `mp` smallint(4) NOT NULL DEFAULT 0, + `hp` int(11) NOT NULL DEFAULT 0, + `mp` int(11) NOT NULL DEFAULT 0, `stamina` smallint(6) NOT NULL DEFAULT 0, `random_hp` smallint(5) unsigned NOT NULL DEFAULT 0, `random_sp` smallint(5) unsigned NOT NULL DEFAULT 0, diff --git a/start.py b/start.py index 06b5a55..82fed8f 100644 --- a/start.py +++ b/start.py @@ -78,7 +78,32 @@ def main(): time.sleep(1) # Start Channel cores - for channel_id, cores in channels.CHANNEL_MAP.items(): + # 1. Create a dictionary of channel IDs guaranteed to be integers. + # This ensures that string keys (e.g., '99') are correctly treated as numbers. + int_channel_map = {int(k): v for k, v in channels.CHANNEL_MAP.items()} + + # 2. Determine which channels to start based on user input + channels_to_start = set() + for channel_id in int_channel_map.keys(): + + # Add any channel that is within the user's limit (e.g., if user_input is 2, add 1 and 2) + if user_input and channel_id <= user_input: + channels_to_start.add(channel_id) + + # If there is no user input limit, start ALL channels + elif not user_input: + channels_to_start.add(channel_id) + + # 3. GUARANTEE Channel 99 is included, regardless of the input limit + if 99 in int_channel_map: + channels_to_start.add(99) + + # 4. Sort the list to ensure correct startup order (1, 2, ..., 99) + final_start_order = sorted(list(channels_to_start)) + + # 5. Iterate through the final, clean list + for channel_id in final_start_order: + cores = int_channel_map[channel_id] # Retrieve cores using the integer ID print_green(f"> Starting CH{channel_id}:") for core_id, maps in cores.items(): name = f"channel{channel_id}_core{core_id}" @@ -93,9 +118,6 @@ def main(): time.sleep(1) print() - if user_input and channel_id == user_input: - break - print_green("> The server is running!") except Exception as e: diff --git a/stop.py b/stop.py index 6185506..ccc2bda 100644 --- a/stop.py +++ b/stop.py @@ -18,7 +18,7 @@ def stop_pid(pid, name): subprocess.call(["taskkill", "/F", "/PID", str(pid)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) else: - os.kill(pid, signal.SIGHUP) + os.kill(pid, signal.SIGTERM) except ProcessLookupError: print(f"> Process {pid} ({name}) not found, skipping.") except Exception as e: