tripleS-Dev
commited on
Commit
โข
b3c2dfa
1
Parent(s):
3dcfbab
for linux
Browse files
main.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import subprocess
|
2 |
import socket
|
3 |
import requests
|
|
|
|
|
4 |
|
5 |
# ๋ด๋ถ IP ํ์ธ
|
6 |
hostname = socket.gethostname()
|
@@ -18,6 +20,9 @@ except requests.exceptions.RequestException as e:
|
|
18 |
# Java ์คํ ํ์ผ ๊ฒฝ๋ก
|
19 |
java_executable = "./jdk-22.0.1/bin/java" # ์์ถ ํผ ์๋ฐ ํ์ผ์ ๊ฒฝ๋ก
|
20 |
|
|
|
|
|
|
|
21 |
# Minecraft ์๋ฒ JAR ํ์ผ ๊ฒฝ๋ก
|
22 |
minecraft_server_jar = "./paper-1.20.6-140.jar"
|
23 |
|
@@ -28,6 +33,7 @@ command = [
|
|
28 |
"-Xms10240M", # ์ด๊ธฐ ํ ๋ฉ๋ชจ๋ฆฌ ์ค์ (์: 10240MB)
|
29 |
"-jar",
|
30 |
minecraft_server_jar,
|
|
|
31 |
]
|
32 |
|
33 |
# ์๋ฒ ์์
|
|
|
1 |
import subprocess
|
2 |
import socket
|
3 |
import requests
|
4 |
+
import os
|
5 |
+
import stat
|
6 |
|
7 |
# ๋ด๋ถ IP ํ์ธ
|
8 |
hostname = socket.gethostname()
|
|
|
20 |
# Java ์คํ ํ์ผ ๊ฒฝ๋ก
|
21 |
java_executable = "./jdk-22.0.1/bin/java" # ์์ถ ํผ ์๋ฐ ํ์ผ์ ๊ฒฝ๋ก
|
22 |
|
23 |
+
# ํ์ผ์ ์คํ ๊ถํ ๋ถ์ฌ
|
24 |
+
os.chmod(java_executable, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
25 |
+
|
26 |
# Minecraft ์๋ฒ JAR ํ์ผ ๊ฒฝ๋ก
|
27 |
minecraft_server_jar = "./paper-1.20.6-140.jar"
|
28 |
|
|
|
33 |
"-Xms10240M", # ์ด๊ธฐ ํ ๋ฉ๋ชจ๋ฆฌ ์ค์ (์: 10240MB)
|
34 |
"-jar",
|
35 |
minecraft_server_jar,
|
36 |
+
"nogui"
|
37 |
]
|
38 |
|
39 |
# ์๋ฒ ์์
|