mirvpgl

package module
v0.0.0-...-3613802 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: MIT Imports: 11 Imported by: 0

README

HLAE-Server-GO

HLAE Server with Go implemention

About

HLAE mirv_pgl command server implemention with Go.
This package helps you to handle mirv_pgl command and their datas.

mirv_pgl

mirv_pgl supports to remote-control CS:GO client by using WebSocket.
you can handle client's camera information(position,rotation,fov,time) and game-events, and you can send commands like RCON.

Official NodeJS code : https://github.com/advancedfx/advancedfx/blob/master/misc/mirv_pgl_test/server.js

Usage

see examples.

  • 1,Launch HLAE Server by go run main.go.
  • 2,Launch CSGO with HLAE.
  • 3,type following commands below:
mirv_pgl url "ws://localhost:65535/mirv";
mirv_pgl start;
mirv_pgl datastart;

once CS:GO client succeed to connect HLAE Server, you can send commands by typing window.

Documentation

Index

Constants

View Source
const (
	KEYTYPE_STRING int32
	KEYTYPE_FLOAT32
	KEYTYPE_INT32
	KEYTYPE_INT16
	KEYTYPE_INT8
	KEYTYPE_BOOLEAN
	KEYTYPE_BIGUINT64
	KEYTYPE_UNKNOWN
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CamData

type CamData struct {
	Time float32
	XPos float32
	YPos float32
	ZPos float32
	XRot float32
	YRot float32
	Zrot float32
	Fov  float32
}

CamData Camera datas

type Cordinates

type Cordinates struct {
	X float32
	Y float32
	Z float32
}

Cordinates include float32 X/Y/Z Pos cordinates.

type Enrichment

type Enrichment interface {
	Unserialize(r io.Reader) error
	GetMap() map[string]interface{}
	SetEnrichment([]string)
	GetEnrichment() []string
}

type Enrichments

type Enrichments map[string]map[string]Enrichment

type EntityNumEnrichment

type EntityNumEnrichment struct {
	Origin   Cordinates
	Angles   Cordinates
	KeyValue string
	// contains filtered or unexported fields
}

EntityNumEnrichment containns Entity's Origin/Angles.

func (*EntityNumEnrichment) GetEnrichment

func (e *EntityNumEnrichment) GetEnrichment() []string

func (*EntityNumEnrichment) GetMap

func (e *EntityNumEnrichment) GetMap() map[string]interface{}

GetMap EntityNum Enrichment

func (*EntityNumEnrichment) SetEnrichment

func (e *EntityNumEnrichment) SetEnrichment(en []string)

func (*EntityNumEnrichment) Unserialize

func (e *EntityNumEnrichment) Unserialize(r io.Reader) error

GetMap EntityNum Enrichment

type EventKey

type EventKey struct {
	Name string
	Type int32
}

EventKey key-value struct with dynamic typing

type GameEventData

type GameEventData struct {
	Name       string
	ClientTime float32
	Keys       map[string]string // Even value is float32 or int etc. convert to string
}

GameEventData Game event keys and time

type GameEventDescription

type GameEventDescription struct {
	EventID   int32
	EventName string
	Keys      []EventKey // KeyName->Key type
	// contains filtered or unexported fields
}

GameEventDescription include Event ID,Name, Keys etc.

func (*GameEventDescription) Unserialize

func (e *GameEventDescription) Unserialize(r io.Reader) (*GameEventData, error)

Unserialize parse EventDescription

type HLAEServer

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

HLAEServer Main struct

func New

func New(host, path string) (*HLAEServer, error)

New Get new instance of HLAEServer

func (*HLAEServer) BroadcastRCON

func (h *HLAEServer) BroadcastRCON(cmd string) error

BroadcastRCON broadcast command

func (*HLAEServer) RegisterCamHandler

func (h *HLAEServer) RegisterCamHandler(handler func(*CamData))

RegisterCamHandler to handle each requests

func (*HLAEServer) RegisterEventHandler

func (h *HLAEServer) RegisterEventHandler(handler func(*GameEventData))

RegisterEventHandler to handle each requests

func (*HLAEServer) RegisterHandler

func (h *HLAEServer) RegisterHandler(handler func(string))

RegisterHandler to handle each requests

func (*HLAEServer) SendRCON

func (h *HLAEServer) SendRCON(k int, cmd string) error

SendRCON Send RCON to specific client

func (*HLAEServer) Start

func (h *HLAEServer) Start() error

Start listening

func (*HLAEServer) TransBegin

func (h *HLAEServer) TransBegin() error

TransBegin Start transaction

func (*HLAEServer) TransEnd

func (h *HLAEServer) TransEnd() error

TransEnd End transaction

type UserIDEnrichment

type UserIDEnrichment struct {
	XUID      *big.Int
	EyeOrigin Cordinates
	EyeAngles Cordinates
	KeyValue  string
	// contains filtered or unexported fields
}

UserIDEnrichment contains User informations with XUID/Eyeorigins(Cordinates)/EyeAngles(Cordinates)

func (*UserIDEnrichment) GetEnrichment

func (u *UserIDEnrichment) GetEnrichment() []string

func (*UserIDEnrichment) GetMap

func (u *UserIDEnrichment) GetMap() map[string]interface{}

GetMap UserID Enrichment to map

func (*UserIDEnrichment) SetEnrichment

func (u *UserIDEnrichment) SetEnrichment(en []string)

func (*UserIDEnrichment) Unserialize

func (u *UserIDEnrichment) Unserialize(r io.Reader) error

Unserialize Unserialize into u

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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