name_server заменил на list_config
This commit is contained in:
parent
d7174a7b57
commit
8589fb0964
1
.idea/.name
Normal file
1
.idea/.name
Normal file
@ -0,0 +1 @@
|
|||||||
|
hlna.py
|
7
.idea/hln-a.iml
Normal file
7
.idea/hln-a.iml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="PyDocumentationSettings">
|
||||||
|
<option name="format" value="PLAIN" />
|
||||||
|
<option name="myDocStringFormat" value="Plain" />
|
||||||
|
</component>
|
||||||
|
</module>
|
6
.idea/inspectionProfiles/profiles_settings.xml
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
4
.idea/misc.xml
Normal file
4
.idea/misc.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11" project-jdk-type="Python SDK" />
|
||||||
|
</project>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
18
hlna.py
18
hlna.py
@ -5,12 +5,12 @@ import threading
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
from rcon.source import Client
|
|
||||||
import click
|
import click
|
||||||
import colorama
|
import colorama
|
||||||
import click_completion
|
import click_completion
|
||||||
|
from rcon.source import Client
|
||||||
|
|
||||||
home_dir = Path.home()
|
home_dir = Path.home()
|
||||||
dir_server = f"{home_dir}/ARK_Servers/"
|
dir_server = f"{home_dir}/ARK_Servers/"
|
||||||
@ -139,7 +139,6 @@ def config(list_config=list_config):
|
|||||||
rcon_p.append(data['RCONPort'])
|
rcon_p.append(data['RCONPort'])
|
||||||
query_p.append(data['QueryPort'])
|
query_p.append(data['QueryPort'])
|
||||||
|
|
||||||
|
|
||||||
if amount_map == 1:
|
if amount_map == 1:
|
||||||
map_s = "TheIsland"
|
map_s = "TheIsland"
|
||||||
elif amount_map == 2:
|
elif amount_map == 2:
|
||||||
@ -168,7 +167,6 @@ def config(list_config=list_config):
|
|||||||
# Если вдруг каким-то боком проверка не отработает и не будет нужной цифры
|
# Если вдруг каким-то боком проверка не отработает и не будет нужной цифры
|
||||||
map_s = 'TheIsland'
|
map_s = 'TheIsland'
|
||||||
|
|
||||||
|
|
||||||
def ports(ports_arr):
|
def ports(ports_arr):
|
||||||
while True:
|
while True:
|
||||||
port = check_int("")
|
port = check_int("")
|
||||||
@ -186,12 +184,12 @@ def config(list_config=list_config):
|
|||||||
|
|
||||||
if list_config:
|
if list_config:
|
||||||
data = read_yaml(list_config[-1])
|
data = read_yaml(list_config[-1])
|
||||||
name_server.append(input("Укажите название Сервера: \n"))
|
list_config.append(input("Укажите название Сервера: \n"))
|
||||||
if name_server[-1] == '':
|
if list_config[-1] == '':
|
||||||
if map_s in name_server:
|
if map_s in list_config:
|
||||||
name_server.pop(); name_server.append(map_s + str(name_server.count(map_s)))
|
list_config.pop(); list_config.append(map_s + str(list_config.count(map_s)))
|
||||||
else:
|
else:
|
||||||
name_server.pop(); name_server.append(map_s) # если enter, то ставим последним элементом карту
|
list_config.pop(); list_config.append(map_s) # если enter, то ставим последним элементом карту
|
||||||
|
|
||||||
port_server = ports(port_s)
|
port_server = ports(port_s)
|
||||||
query_port = ports(query_p)
|
query_port = ports(query_p)
|
||||||
@ -239,7 +237,7 @@ def config(list_config=list_config):
|
|||||||
if max_players == 0:
|
if max_players == 0:
|
||||||
max_players = 70
|
max_players = 70
|
||||||
|
|
||||||
yaml_create(cluster_server, map_s, name_server[-1], port_server, query_port, rcon_enabled, rcon_port, adminpassword_server, password_server, max_players, cluster_id, cluster_dir_override)
|
yaml_create(cluster_server, map_s, list_config[-1], port_server, query_port, rcon_enabled, rcon_port, adminpassword_server, password_server, max_players, cluster_id, cluster_dir_override)
|
||||||
|
|
||||||
|
|
||||||
def yaml_create(cluster_server, map_s, name_server, port_server, query_port, rcon_enabled, rcon_port, adminpassword_server, password_server, max_players, cluster_id, cluster_dir_override):
|
def yaml_create(cluster_server, map_s, name_server, port_server, query_port, rcon_enabled, rcon_port, adminpassword_server, password_server, max_players, cluster_id, cluster_dir_override):
|
||||||
|
Loading…
Reference in New Issue
Block a user