normalize

package module
v0.0.0-...-608f34f Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: MIT Imports: 11 Imported by: 0

README

Convert lambda:

is taking the WoWCombatlog.txt format of displaying the events and normalizes it into a csv. It can handle raw .txt file, archived as .zip or compressed as gzip.

The data has to be normalized in order to be able to get loaded into a relational db, where things like overall damage is calculated.

TODO:

general:

  • check combatlog version

  • check advanced combatlog enabled

  • fix encounter start/end, ignore commons on split if it is inside ""

  • count columns per event and check against expected value

  • split up encounter start & end

  • upload uuid should be file name without the date stuff

  • add tests

  • [ ]

  • [ ]

  • add remaining unsupported events to readme

  • write tests for normalize

    • test that no code is added outside of a m+
    • test that boss fight uuid is empty after the bossfight
    • test that boss fight uuid is generated after a bossfight starts
    • combatlog uuid can't be empty
    • [ ]
    • [ ]
    • [ ]

table changes:

  • rename KeyUnkown1 to KeyChests
  • drop advanced combat logging field and column, it has to be 1
  • add column in damage event
  • [ ]
  • [ ]

events:

  • COMBAT_LOG_VERSION
  • SPELL_DAMAGE
  • CHALLENGE_MODE_END
  • CHALLENGE_MODE_START
  • ENCOUNTER_END
  • ENCOUNTER_START
  • COMBATANT_INFO
  • DAMAGE_SPLIT
  • EMOTE
  • ENVIRONMENTAL_DAMAGE
  • SPELL_CAST_SUCCESS
  • SPELL_CAST_START
  • SPELL_CAST_FAILED
  • SPELL_AURA_APPLIED
  • SPELL_AURA_REFRESH
  • SPELL_SUMMON
  • SPELL_PERIODIC_HEAL
  • SPELL_AURA_REMOVED
  • SPELL_HEAL
  • SPELL_AURA_APPLIED_DOSE
  • SPELL_CREATE
  • SPELL_AURA_REMOVED_DOSE
  • SPELL_ABSORBED
  • SPELL_DISPEL
  • SPELL_HEAL_ABSORBED
  • SPELL_INSTAKILL
  • SPELL_INTERRUPT
  • SPELL_MISSED
  • SPELL_PERIODIC_DAMAGE
  • SPELL_PERIODIC_ENERGIZE
  • SPELL_PERIODIC_MISSED
  • SPELL_RESURRECT
  • SPELL_ENERGIZE
  • SWING_DAMAGE
  • SWING_DAMAGE_LANDED
  • SWING_MISSED
  • PARTY_KILL
  • UNIT_DIED
  • ZONE_CHANGE

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Atoi32

func Atoi32(input string) (int32, error)

Atoi32 converts a string directly to a int32, baseline golang parses string always into int64 and have to be converted to int32. You can however transform a string easily to int, which is somehow the same, but the parquet package expects int32 specifically

func Atoi64

func Atoi64(input string) (int64, error)

Atoi64 is just a small wrapper around ParseInt

func Normalize

func Normalize(scanner *bufio.Scanner, uploadUUID string) (map[string]map[string][]*timestreamwrite.WriteRecordsInput, map[string][]string, error)

Normalize converts the combatlog to a slice of Event structs TODO: rename, we are not really normalizing the data anymore, because I'm not using a relational database anymore

Types

type Event

type Event struct {
	//START_BASE_PARAMS
	// UploadUUID     string
	// Unsupported    bool //DEBUGGING PARAM
	// CombatlogUUIDs  string
	// BossFightUUID  string
	MythicplusUUID string
	// ColumnUUID     string
	Timestamp int64 //6/30 21:46:57.014

	CasterID   string //Player-970-000BF9AC
	CasterName string //"Eluxbeta-Sylvanas"
	CasterType string //0x511 its always 511 for me and 512 for other grp members and other stuff for enemy trash
	SourceFlag string //0x0
	TargetID   string //Player-970-000BF9AC
	TargetName string //"Eluxbeta-Sylvanas"
	TargetType string //0x511
	DestFlag   string //0x0

	//START_BASE_SPELL_PARAMS
	SpellID   int32  //194509
	SpellName string //"Power Word: Radiance"
	SpellType string //0x2 //holy i guess

	//START_ADVANCED_COMBAT_LOGGING_PARAMS
	// AnotherPlayerID string //Player-970-000BF9AC in case of pets this is always the target player_id not the summoner
	// D0              string //0000000000000000
	// D1              int64  //89449
	// D2              int64  //93932
	// D3              int64  //5637
	// D4              int64  //998
	// D5              int64  //2599
	// D6              int64  //1
	// D7              int64  //596
	// D8              int64  //1000
	// D9              string //0
	// D10             string //-967.46 coordinates?
	// D11             string //2171.14 ^
	// D12             string //0.4005  ^
	// D13             string //313
	// DamageUnkown14  string //Added with combatlog version 9?
	//END_ADVANCED_COMBAT_LOGGING_PARAMS
	//START_HEAL_PARAMS (SPELL_HEAL, SPELL_PERIODIC_HEAL)
	//START_DAMAGE_PARAMS e.g. 3724,5319,-1,1,0,0,0,nil,nil,nil
	ActualAmount int64 //reduced by amor, 2x for crit, reduced by absorb

}

Event contains all events that are relevant for the combat itself. It does not contain things like COMBAT_LOG_VERSION

example: 6/30 21:46:57.014 SPELL_HEAL,Player-970-000BF9AC,"Eluxbeta-Sylvanas",0x511,0x0,Player-970-000BF9AC,"Eluxbeta-Sylvanas",0x511,0x0,194509,"Power Word: Radiance",0x2,Player-970-000BF9AC,0000000000000000,92811,110009,368,4868,801,0,100000,100000,0,-922.47,2149.70,3.0913,326,5101,5101,0,0,nil

Jump to

Keyboard shortcuts

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