Ejemplo n.º 1
0
def build_client():
    os.chdir("../client")
    exec("tsc", True)
    exec("cd ui && ng build", True)
    shutil.copytree("./build", "../mp/client_packages", dirs_exist_ok=True)
    shutil.copytree("./ui/dist", "../mp/client_packages/ui",
                    dirs_exist_ok=True)
    print("Client was successfully built!")
Ejemplo n.º 2
0
def build_client():
    os.chdir(f"{root_dir}/client")
    exec("tsc", True)
    shutil.copytree("./build",
                    "../mp/resources/wrp/client",
                    dirs_exist_ok=True)
    shutil.copytree("./other",
                    "../mp/resources/wrp/client/other",
                    dirs_exist_ok=True)
    print("Client was successfully built!")
Ejemplo n.º 3
0
def build_server():
    cp_cmd = "cp -r"
    if platform.system() == "Windows":
        cp_cmd = "copy"
    os.chdir("../server")
    exec("dotnet restore", True)
    exec("dotnet build", True)
    shutil.copytree("./compiled", "../mp/dotnet/resources/",
                    dirs_exist_ok=True)
    shutil.copy("./Config/meta.xml",
                "../mp/dotnet/resources/netcoreapp3.1/meta.xml")
    shutil.copy("./Config/settings.xml", "../mp/dotnet/settings.xml")
    shutil.copy("./Config/conf.json", "../mp/conf.json")
    if not os.path.exists("../mp/s_config.toml"):
        shutil.copy("./Config/s_config.sample.toml", "../mp/s_config.toml")
    print("Server was successfully built!")
Ejemplo n.º 4
0
def build_server():
    cp_cmd = "cp -r"
    if platform.system() == "Windows":
        cp_cmd = "copy"
    os.chdir(f"{root_dir}/server")
    exec("dotnet restore", True)
    exec("dotnet build", True)
    shutil.copytree("./compiled/netcoreapp3.1",
                    "../mp/resources/wrp-server",
                    dirs_exist_ok=True)
    shutil.copy("./Config/client_resource.cfg",
                "../mp/resources/wrp/resource.cfg")
    shutil.copy("./Config/server_resource.cfg",
                "../mp/resources/wrp-server/resource.cfg")
    shutil.copy("./Config/server.cfg", "../mp/server.cfg")
    if not os.path.exists("../mp/s_config.toml"):
        shutil.copy("./Config/s_config.sample.toml", "../mp/s_config.toml")
    print("Server was successfully built!")
Ejemplo n.º 5
0
blobsVersion = "v1.1"
mpLinuxURL = f"https://github.com/WaylandProject/ragemp-blobs/releases/download/{blobsVersion}/rage-server-linux.tar.gz"
mpWindowsURL = f"https://github.com/WaylandProject/ragemp-blobs/releases/download/{blobsVersion}/rage-server-windows.zip"
doneFile = ".init"

if os.path.exists(doneFile):
    exit(0)

os.mkdir("../temp")

if platform.system() == "Linux":
    urllib.request.urlretrieve(mpLinuxURL, "../temp/mp.zip")
elif platform.system() == "Windows":
    urllib.request.urlretrieve(mpWindowsURL, "../temp/mp.zip")

print('Server blobs downloaded!')

with ZipFile("../temp/mp.zip", 'r') as zip:
    # extracting all the files
    zip.extractall("../mp")
    print('Server blobs extracted!')

shutil.rmtree("../temp")
with open(".init", "w") as f:
    f.write("")
    f.close()

# Download NPM dependencies for clientside
exec("cd ../client && npm i", True)
exec("cd ../client/ui && npm i", True)
Ejemplo n.º 6
0
def start_ui_dev():
    os.chdir("../client/ui")
    exec("ng serve", True)
Ejemplo n.º 7
0
def start_server():
    os.chdir("../mp")
    exec_name = "ragemp-server"
    if platform.system() == "Windows":
        exec_name + ".exe"
    exec(f"{exec_name}", True)
Ejemplo n.º 8
0
def start_ui_dev():
    os.chdir(f"{root_dir}/client/ui")
    exec("ng serve", True)
Ejemplo n.º 9
0
def start_server():
    os.chdir(f"{root_dir}/mp")
    exec_name = "altv-server"
    if platform.system() == "Windows":
        exec_name + ".exe"
    exec(f"{exec_name}", True)
Ejemplo n.º 10
0
def build_ui():
    os.chdir(f"{root_dir}/client/ui")
    exec("ng build", True)
    shutil.copytree("./dist", "../../mp/resources/wrp/ui", dirs_exist_ok=True)
    print("UI was successfully built!")