rcong

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 6 Imported by: 0

README

GRCON

RCON Protocol implementation for Go

Why again?

I recently started playing PalWorld, and I've searched through all the RCON Go libraries, but none of them offer good support for the ShowPlayers command. That's why I created this library.

Install

go get github.com/FlyingRadish/rcong

Useage

package main

import (
	"fmt"
	"log"

	"github.com/FlyingRadish/rcong"
)

func main() {
	conn := rcong.NewRCONConnection("127.0.0.1", 25575, "password", 3, 10)
	conn.Connect()
	defer conn.Close()

	response, err := conn.ExecCommand("ShowPlayers")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(response)	
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RCONConnection

type RCONConnection struct {
	// contains filtered or unexported fields
}

func NewRCONConnection

func NewRCONConnection(ip string, port int, password string, retryCount int, retryDelay int) *RCONConnection

func (*RCONConnection) Close

func (c *RCONConnection) Close()

func (*RCONConnection) Connect

func (c *RCONConnection) Connect() error

func (*RCONConnection) ExecCommand

func (c *RCONConnection) ExecCommand(command string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL