Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't load mods into the server for T6ZM #3

Open
xMonologue opened this issue Nov 14, 2024 · 4 comments
Open

can't load mods into the server for T6ZM #3

xMonologue opened this issue Nov 14, 2024 · 4 comments

Comments

@xMonologue
Copy link

So basically I tried adding those variables in the script and for some reasons I can't load the mod in question for my server so fast dl does not work

+set mod "$SERVER_MOD" # Set a mod to the server readonly SERVER_MOD="mods/zm_weapons"

any ideas how to fix it and add support for mods?

@xMonologue
Copy link
Author

Okay so I fixed it by adding this in script ```

wine .\bin\plutonium-bootstrapper-win32.exe "$GAME_MODE" "$GAME_PATH" -dedicated +start_map_rotate +set key "$SERVER_KEY" +set fs_game $MOD +set net_port "$SERVER_PORT" +set sv_config "$CONFIG_FILE" 2>/dev/null

and

MOD="mods/zm_weapons"```

full config:

```#!/bin/bash

# T6Server.sh - Plutonium Call of Duty: Black Ops II Server Script
# Version: 2.1.0
# Author: Sterbweise
# Last Updated: 21/08/2024

# Description:
# This script is designed to run and manage a dedicated server for Call of Duty: Black Ops II
# using the Plutonium client. It supports both Multiplayer and Zombie modes, and includes
# functionality for server updates and automatic restarts.

# Usage:
# 1. Configure the variables below according to your server setup
# 2. Run the script with: bash T6Server.sh

# Note: This script requires Wine to be installed on your system to run the Windows executable.

# Configuration variables
# These variables define the basic settings for your server. Modify them as needed.

# Full path to this script
readonly SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
# Directory containing this script
readonly SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
# Name of your server as it will appear in the server browser
readonly SERVER_NAME="EFG 2.0 CLOSED ALPHA"

# Game path configuration
# This is the path to your game files. Choose the appropriate path based on your game mode.
# For Multiplayer mode, use: "/opt/T6Server/Server/Multiplayer"
# For Zombie mode, use:     "/opt/T6Server/Server/Zombie"
readonly GAME_PATH="/opt/T6Server/Server/Zombie"

# Your unique server key provided by Plutonium (https://platform.plutonium.pw/serverkeys)
readonly SERVER_KEY=""

# Config file selection
# This is the configuration file for your server. Choose based on your game mode.
# For Multiplayer mode, use: "dedicated.cfg"
# For Zombie mode, use:     "dedicated_zm.cfg"
readonly CONFIG_FILE="dedicated_zm.cfg"

# The UDP port your server will listen on
readonly SERVER_PORT=4976

# Game mode selection
# This determines which game mode your server will run.
# For Multiplayer mode, use: "t6mp"
# For Zombie mode, use:     "t6zm"
readonly GAME_MODE="t6zm"

# Installation directory of Plutonium
readonly INSTALL_DIR="/opt/T6Server/Plutonium"

# Mod name (default "", (eg. "mods/nazi_zombie_ragnarok"))
MOD=""

# Note: To switch to Zombie mode, make the following changes:
# 1. Set GAME_PATH to "/opt/T6Server/Server/Zombie"
# 2. Set CONFIG_FILE to "dedicated_zm.cfg"
# 3. Set GAME_MODE to "t6zm"

# Function to update server files
# This function uses the Plutonium updater to ensure your server is running the latest version
update_server() {
    ./plutonium-updater -d "$INSTALL_DIR"
}

# Function to start and maintain the server
# This function starts the server and automatically restarts it if it crashes
start_server() {
    local timestamp
    printf -v timestamp '%(%F_%H:%M:%S)T' -1
    
    # Set the terminal title
    echo -e '\033]2;Plutonium - '"$SERVER_NAME"' - Server restart\007'
    
    # Display server information
    echo "Visit plutonium.pw | Join the Discord (plutonium) for NEWS and Updates!"
    echo "Server $SERVER_NAME will load $CONFIG_FILE and listen on port $SERVER_PORT UDP!"
    echo "To shut down the server close this window first!"
    echo "$timestamp $SERVER_NAME server started."

    # Main server loop
    while true; do
        # Start the server using Wine
        wine .\\bin\\plutonium-bootstrapper-win32.exe "$GAME_MODE" "$GAME_PATH" -dedicated +start_map_rotate +set key "$SERVER_KEY" +set fs_game $MOD +set net_port "$SERVER_PORT" +set sv_config "$CONFIG_FILE" 2>/dev/null
        
        # If the server stops, log the event and restart
        printf -v timestamp '%(%F_%H:%M:%S)T' -1
        echo "$timestamp WARNING: $SERVER_NAME server closed or dropped... server restarting."
        sleep 1
    done
}

# Main execution
# First update the server, then start it
update_server
start_server

you might want to add this @Sterbweise

@Sterbweise
Copy link
Owner

Hi @xMonologue, I wasn't aware we could load mods that way. I thought they just needed to be placed in the mods folder. If your modifications work well, feel free to submit a pull request. I can then integrate these changes into the project. Thanks for your contribution!

@xMonologue
Copy link
Author

im gonna do it glady! 1 sec

@xMonologue
Copy link
Author

just added the pull request @Sterbweise but make sure to test it first with a mod like this per exemple. It works fine on my end but its always good to double check!

https://forum.plutonium.pw/topic/37621/release-zm-mod-zm_weapons-adding-all-weapons-to-maps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants