rheehot / palworld-rcon

Golang Palworld RCON Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Palworld RCON

Palworld Icon

Install

go get github.com/juunini/palworld-rcon

Usage

package main

import (
    "fmt"

    palworldrcon "github.com/juunini/palworld-rcon"
)

func main() {
    client := palworldrcon.Client{
        Host: "127.0.0.1",
        Port: 25575,
        AdminPassword: "your admin password",
    }

    if err := client.Connect(); err != nil {
        panic(err)
    }

    defer client.Disconnect()

    response, err := client.Info()
    if err != nil {
        panic(err)
    }

    fmt.Println(response) // "Welcome to Pal Server[v0.1.4.1] Default Palworld Server"
}

Client Methods

see: https://tech.palworldgame.com/settings-and-operation/commands

Method name Properties Description
Connect Connect to RCON Server
Disconnect Close Connection
Shutdown seconds, message Shutdown the server. If <seconds> is specified, the server will shut down after the specified time has elapsed. The server participant will be notified of what you have entered in <message>.
DoExit Force stop the server.
Broadcast message Send message to all player in the server.
KickPlayer steamID Kick player by <steamID> from the server.
BanPlayer steamID Ban player by <steamID> from the server.
ShowPlayers Show information on all connected players.
Info Show server information.
Save Save the world data.

License

MIT License

About

Golang Palworld RCON Client

License:MIT License


Languages

Language:Go 100.0%