MRMJ-1: Messenger & Skills fixes
This commit is contained in:
62
.gitignore
vendored
62
.gitignore
vendored
@@ -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
|
||||
|
||||
33
README.md
33
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.
|
||||
### ⬆️ 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)
|
||||
@@ -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,
|
||||
}
|
||||
@@ -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.";
|
||||
|
||||
@@ -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 σου έχει στείλει ήδη αίτημα φιλίας.";
|
||||
|
||||
@@ -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
|
||||
@@ -26,7 +26,10 @@ 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
30
start.py
30
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:
|
||||
|
||||
2
stop.py
2
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:
|
||||
|
||||
Reference in New Issue
Block a user