mirror of
https://github.com/drmext/MonkeyBusiness.git
synced 2024-11-27 17:00:59 +01:00
ANSI escape sequences
This commit is contained in:
parent
7d1245d474
commit
21872c04f9
@ -140,7 +140,8 @@ async def core_process_request(request):
|
||||
request.is_binxml = KBinXML.is_binary_xml(xml_dec)
|
||||
|
||||
if config.verbose_log:
|
||||
print("Request:")
|
||||
print()
|
||||
print("\033[94mREQUEST\033[0m:")
|
||||
print(xml_text)
|
||||
|
||||
model_parts = (root.attrib["model"], *root.attrib["model"].split(":"))
|
||||
@ -173,7 +174,7 @@ async def core_prepare_response(request, xml):
|
||||
xml_binary = binxml.to_text().encode("utf-8") # TODO: Proper encoding
|
||||
|
||||
if config.verbose_log:
|
||||
print("Response:")
|
||||
print("\033[91mRESPONSE\033[0m:")
|
||||
print(binxml.to_text())
|
||||
|
||||
response_headers = {"User-Agent": "EAMUSE.Httpac/1.0"}
|
||||
|
40
pyeamu.py
40
pyeamu.py
@ -3,7 +3,7 @@ from urllib.parse import urlunparse, urlencode
|
||||
import uvicorn
|
||||
|
||||
import ujson as json
|
||||
from os import path
|
||||
from os import name, path
|
||||
|
||||
from fastapi import FastAPI, Request, Response
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
@ -65,28 +65,34 @@ else:
|
||||
return RedirectResponse(url="/config")
|
||||
|
||||
|
||||
# Enable ANSI escape sequences
|
||||
if name == "nt":
|
||||
import ctypes
|
||||
|
||||
kernel32 = ctypes.windll.kernel32
|
||||
kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(" __ __ _ ")
|
||||
print("| \/ | ___ _ __ | | _____ _ _ ")
|
||||
print("| |\/| |/ _ \| '_ \| |/ / _ \ | | |")
|
||||
print("| | | | (_) | | | | < __/ |_| |")
|
||||
print("|_| |_|\___/|_| |_|_|\_\___|\__, |")
|
||||
print(" |___/ ")
|
||||
print(" ____ _ ")
|
||||
print("| __ ) _ _ ___(_)_ __ ___ ___ ___ ")
|
||||
print("| _ \| | | / __| | '_ \ / _ \/ __/ __|")
|
||||
print("| |_) | |_| \__ \ | | | | __/\__ \__ \\")
|
||||
print("|____/ \__,_|___/_|_| |_|\___||___/___/")
|
||||
print(
|
||||
"""
|
||||
█▄ ▄█ █▀█ █▄ █ █▄▀ ▀██ ▀▄▀
|
||||
█ ▀ █ █▄█ █ ▀█ █ █ ▄▄█ █
|
||||
|
||||
██▄ █ █ ▄▀▀ ▄█ █▄ █ ▀██ ▀█▀
|
||||
█▄█ ▀▄█ ▄██ █ █ ▀█ ▄▄█ █▄▄
|
||||
"""
|
||||
)
|
||||
print()
|
||||
print("Game Config:")
|
||||
print(f"<services>{server_services_url}</services>")
|
||||
print('<url_slash __type="bool">1</url_slash>')
|
||||
print("\033[1mGame Config\033[0m:")
|
||||
print(f"<services>\033[92m{server_services_url}\033[0m</services>")
|
||||
print('<url_slash __type="bool">\033[92m1\033[0m</url_slash>')
|
||||
print()
|
||||
if webui:
|
||||
print("Web Interface:")
|
||||
print("\033[1mWeb Interface\033[0m:")
|
||||
print(f"http://{server_address}/webui/")
|
||||
print()
|
||||
print("Source Repository:")
|
||||
print("\033[1mSource Repository\033[0m:")
|
||||
print("https://github.com/drmext/MonkeyBusiness")
|
||||
print()
|
||||
uvicorn.run("pyeamu:app", host=config.ip, port=config.port, reload=True)
|
||||
|
Loading…
Reference in New Issue
Block a user