combatlog

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DateFormat = "2006.01.02 15:04:05"

Variables

View Source
var (
	LanguageCode_name = map[int32]string{
		0: "UNKNOWN",
		1: "ENGLISH",
		2: "FRENCH",
		3: "GERMAN",
		4: "JAPANESE",
		5: "KOREAN",
		6: "RUSSIAN",
		7: "CHINESE",
		8: "SPANISH",
	}
	LanguageCode_value = map[string]int32{
		"UNKNOWN":  0,
		"ENGLISH":  1,
		"FRENCH":   2,
		"GERMAN":   3,
		"JAPANESE": 4,
		"KOREAN":   5,
		"RUSSIAN":  6,
		"CHINESE":  7,
		"SPANISH":  8,
	}
)

Enum value maps for LanguageCode.

View Source
var File_combatlog_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CombatLogFile

type CombatLogFile struct {
	Filename     string
	LanguageCode LanguageCode
}

type CombatLogRecord

type CombatLogRecord struct {
	CharacterName  string       `protobuf:"bytes,1,opt,name=character_name,json=characterName,proto3" json:"character_name,omitempty"`
	CombatLogLines []string     `protobuf:"bytes,2,rep,name=combat_log_lines,json=combatLogLines,proto3" json:"combat_log_lines,omitempty"`
	LanguageCode   LanguageCode `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CombatLogRecord) Descriptor deprecated

func (*CombatLogRecord) Descriptor() ([]byte, []int)

Deprecated: Use CombatLogRecord.ProtoReflect.Descriptor instead.

func (*CombatLogRecord) GetCharacterName

func (x *CombatLogRecord) GetCharacterName() string

func (*CombatLogRecord) GetCombatLogLines

func (x *CombatLogRecord) GetCombatLogLines() []string

func (*CombatLogRecord) GetLanguageCode

func (x *CombatLogRecord) GetLanguageCode() LanguageCode

func (*CombatLogRecord) ProtoMessage

func (*CombatLogRecord) ProtoMessage()

func (*CombatLogRecord) ProtoReflect

func (x *CombatLogRecord) ProtoReflect() protoreflect.Message

func (*CombatLogRecord) Reset

func (x *CombatLogRecord) Reset()

func (*CombatLogRecord) String

func (x *CombatLogRecord) String() string

type LanguageCode

type LanguageCode int32
const (
	LanguageCode_UNKNOWN  LanguageCode = 0
	LanguageCode_ENGLISH  LanguageCode = 1
	LanguageCode_FRENCH   LanguageCode = 2
	LanguageCode_GERMAN   LanguageCode = 3
	LanguageCode_JAPANESE LanguageCode = 4
	LanguageCode_KOREAN   LanguageCode = 5
	LanguageCode_RUSSIAN  LanguageCode = 6
	LanguageCode_CHINESE  LanguageCode = 7
	LanguageCode_SPANISH  LanguageCode = 8
)

func (LanguageCode) Descriptor

func (LanguageCode) Enum

func (x LanguageCode) Enum() *LanguageCode

func (LanguageCode) EnumDescriptor deprecated

func (LanguageCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use LanguageCode.Descriptor instead.

func (LanguageCode) Number

func (LanguageCode) String

func (x LanguageCode) String() string

func (LanguageCode) Type

type LocalizedMatcher

type LocalizedMatcher struct {
	ListenerRe     *regexp.Regexp
	SessionStartRe *regexp.Regexp
}

LocalizedMatcher holds regexps for language to detect.

type LocalizedMatchers

type LocalizedMatchers map[LanguageCode]LocalizedMatcher

LocalizedMatchers mapping between LanguageCode and LocalizedMatchers.

var LanguageMatchers LocalizedMatchers

LanguageMatchers holds default initialized regexps for all languages.

type Reader

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

func NewReader

func NewReader(path string) *Reader

func (*Reader) GetCombatLogRecords

func (r *Reader) GetCombatLogRecords(characters map[string]CombatLogFile) []*CombatLogRecord

GetCombatLogRecords reads combatlog from stored offsets and converts to CombatLogRecord struct.

func (*Reader) GetLogFiles

func (r *Reader) GetLogFiles(end time.Time, timeWindow time.Duration) ([]string, error)

GetLogFiles returns slice of filepaths that logged in in last timeWindow.

func (*Reader) MapCharactersToFiles

func (r *Reader) MapCharactersToFiles(files []string) map[string]CombatLogFile

MapCharactersToFiles maps given paths to characters, detecting combatlog language in process.

func (*Reader) MarkStartOffsets

func (r *Reader) MarkStartOffsets(characters map[string]CombatLogFile)

MarkStartOffsets stores offsets of combatlog files.

func (*Reader) SetLogFolder

func (r *Reader) SetLogFolder(folder string)

Jump to

Keyboard shortcuts

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