Skip to content

Commit

Permalink
corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
andiricum2 committed Sep 4, 2023
1 parent 514251b commit 4247312
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
piemc/lang/__pycache__/
piemc/meta/__pycache__/
piemc/__pycache__/
pieuid.dat
uid.pie
piemc_test.py
log/

Expand Down
2 changes: 1 addition & 1 deletion piemc/lang/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IP: "خادم IP"
PORT: "Port"
GAMEMODE: "نوع اللعبة"
MAX_PLAYERS: "ماكس لاعبين"
CREATED_PIEUID: "Created pieuid.dat and added server's UID"
CREATED_PIEUID: "Created uid.pie and added server's UID"
SERVER_INITIALIZED: "Server initialized"
NEW_INCOMING_CONNECTION: "Player connecting"
DISCONNECT: "Player disconnected"
Expand Down
2 changes: 1 addition & 1 deletion piemc/lang/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IP: "Server-IP"
PORT: "Serverport"
GAMEMODE: "Spielmodus"
MAX_PLAYERS: "Max Spieleranzahl"
CREATED_PIEUID: "Created pieuid.dat and added server's UID"
CREATED_PIEUID: "Created uid.pie and added server's UID"
SERVER_INITIALIZED: "Server initialized"
NEW_INCOMING_CONNECTION: "Player connecting"
DISCONNECT: "Player disconnected"
Expand Down
2 changes: 1 addition & 1 deletion piemc/lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IP: "Server IP"
PORT: "Port"
GAMEMODE: "Gamemode"
MAX_PLAYERS: "Max Players"
CREATED_PIEUID: "Created pieuid.dat and added server's UID"
CREATED_PIEUID: "Created uid.pie and added server's UID"
SERVER_INITIALIZED: "Server initialized"
NEW_INCOMING_CONNECTION: "Player connecting"
DISCONNECT: "Player disconnected"
Expand Down
2 changes: 1 addition & 1 deletion piemc/lang/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IP: "IP del Servidor"
PORT: "Puerto"
GAMEMODE: "Modo de Juego"
MAX_PLAYERS: "Límite de Jugadores"
CREATED_PIEUID: "Se ha creado el archivo pieuid.dat y se ha añadido el UID del servidor"
CREATED_PIEUID: "Se ha creado el archivo uid.pie y se ha añadido el UID del servidor"
SERVER_INITIALIZED: "Servidor iniciado"
NEW_INCOMING_CONNECTION: "Jugador uniéndose"
DISCONNECT: "Jugador desconectado"
Expand Down
2 changes: 1 addition & 1 deletion piemc/lang/eu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IP: "Zerbitzari IPa"
PORT: "Portua"
GAMEMODE: "Joko Modua"
MAX_PLAYERS: "Jokalari Muga"
CREATED_PIEUID: "pieuid.dat fitxategia sortu da eta zerbitzariaren UIDa gehitu da."
CREATED_PIEUID: "uid.pie fitxategia sortu da eta zerbitzariaren UIDa gehitu da."
SERVER_INITIALIZED: "Server initialized"
NEW_INCOMING_CONNECTION: "Player connecting"
DISCONNECT: "Player disconnected"
Expand Down
2 changes: 1 addition & 1 deletion piemc/lang/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IP: "IP du serveur"
PORT: "Port"
GAMEMODE: "Mode de jeu"
MAX_PLAYERS: "Nombre maximum de joueurs"
CREATED_PIEUID: "Fichier pieuid.dat créé et UID du serveur ajouté"
CREATED_PIEUID: "Fichier uid.pie créé et UID du serveur ajouté"
SERVER_INITIALIZED: "Serveur initialisé"
NEW_INCOMING_CONNECTION: "Joueur se connectant"
DISCONNECT: "Joueur déconnecté"
Expand Down
2 changes: 1 addition & 1 deletion piemc/lang/gr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IP: "IP διακομιστή"
PORT: "Θύρα"
GAMEMODE: "Τρόπος παιχνιδιού"
MAX_PLAYERS: "Μέγιστοι παίχτες"
CREATED_PIEUID: "Δημιουργήθηκε το pieuid.dat και προστέθηκε το UID του διακομιστή"
CREATED_PIEUID: "Δημιουργήθηκε το uid.pie και προστέθηκε το UID του διακομιστή"
SERVER_INITIALIZED: "Ο διακομιστής αρχικοποιήθηκε"
NEW_INCOMING_CONNECTION: "Ο παίχτης συνδέεται"
DISCONNECT: "Ο παίχτης αποσυνδέθηκε"
Expand Down
2 changes: 1 addition & 1 deletion piemc/lang/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IP: "IP сервера"
PORT: "Порт сервера"
GAMEMODE: "Режим игры по умолчанию"
MAX_PLAYERS: "Игроков максимум"
CREATED_PIEUID: "Создан файл pieuid.dat и добавлен UID сервера"
CREATED_PIEUID: "Создан файл uid.pie и добавлен UID сервера"
SERVER_INITIALIZED: "Сервер инициализирован"
NEW_INCOMING_CONNECTION: "Подключение игрока"
DISCONNECT: "Игрок отключен"
Expand Down
2 changes: 1 addition & 1 deletion piemc/lang/ua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IP: "IP сервера"
PORT: "Порт сервера"
GAMEMODE: "Режим гри за замовчуванням"
MAX_PLAYERS: "Гравців максимум"
CREATED_PIEUID: "Створено файл pieuid.dat і доданий UID сервера"
CREATED_PIEUID: "Створено файл uid.pie і доданий UID сервера"
SERVER_INITIALIZED: "Сервер ініціалізовано"
NEW_INCOMING_CONNECTION: "Підключення гравця"
DISCONNECT: "Програвач відключено"
Expand Down
7 changes: 3 additions & 4 deletions piemc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from piemc.handlers.command import handle_command, initialize_commands
from piemc.handlers.lang import LangHandler
from piemc.handlers.logger import create_logger
import piemc.commands
from piemc.update import check_for_updates

from piebedrock.server import BedrockServer
Expand All @@ -33,9 +32,9 @@ def __init__(self):
self.lang = LangHandler.initialize_language()
self.logger = create_logger('PieMC')
self.logger.info(self.lang['INITIALIZING'])
if not os.path.exists("pieuid.dat"):
if not os.path.exists("uid.pie"):
pieuid = random.randint(10 ** 19, (10 ** 20) - 1)
with open("pieuid.dat", "w") as uid_file:
with open("uid.pie", "w") as uid_file:
uid_file.write(str(pieuid))
self.logger.info(f"{self.lang['CREATED_PIEUID']}: {str(pieuid)}")

Expand All @@ -45,7 +44,7 @@ def __init__(self):
self.logger.info(self.lang['SERVER_INITIALIZED'])
self.running = True
self.start_time = int(time.time())
initialize_commands(piemc.handlers.command)
initialize_commands(self)

def start(self):
self.logger.info(f"{self.lang['IP']}: {config.HOST}")
Expand Down
11 changes: 7 additions & 4 deletions piemc/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# @link http://www.PieMC-Dev.github.io/

import requests

import piemc.server
from piemc.handlers.logger import create_logger

repo_url = "https://api.github.com/repos/PieMC-Dev/PieMC/releases"

Expand All @@ -36,6 +38,7 @@ def normalize(v):
return 0

def check_for_updates():
logger = create_logger('Updater')
response = requests.get(repo_url)
if response.status_code == 200:
releases = response.json()
Expand All @@ -47,10 +50,10 @@ def check_for_updates():
current_release_version = piemc.server.__version__

if compare_versions(current_release_version, latest_release_version) < 0:
print("⚠️\033[33mNew version available:\033[0m", latest_release_version)
logger.info("⚠️\033[33mNew version available:\033[0m", latest_release_version)
else:
print("The server is already up to date.")
logger.info("The server is already up to date.")
else:
print("No releases found for the repository.")
logger.info("No releases found for the repository.")
else:
print("Failed to retrieve repository information.")
logger.info("Failed to retrieve repository information.")
1 change: 0 additions & 1 deletion version.dat

This file was deleted.

0 comments on commit 4247312

Please sign in to comment.