charxml

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Rudimentary charxml implementation

TODO:

  • Flags
  • Active missions
  • Inventory
  • Zone stats
  • Pets
  • Rocket parts (lrid, lcbp)
  • Point struct instead of including individual fields
  • Marshalling
  • Add and move structs into a components package?

Index

Constants

View Source
const (
	GMCivilian = GMLevel(iota)
	GMForumModerator
	GMJuniorModerator
	GMModerator
	GMSeniorModerator
	GMLeadModerator
	GMJuniorDeveloper
	GMInactiveDeveloper
	GMDeveloper
	GMOperator
)
View Source
const (
	MissionUnknown              = MissionState(-1)
	MissionRewarding            = MissionState(0)
	MissionAvailable            = MissionState(1)
	MissionActive               = MissionState(2)
	MissionReadyToComplete      = MissionState(4)
	MissionComplete             = MissionState(8)
	MissionAvailableAgain       = MissionState(9)
	MissionActiveAgain          = MissionState(10)
	MissionReadyToCompleteAgain = MissionState(12)
)

Taken from https://github.com/DarkflameUniverse/DarkflameServer/blob/main/dCommon/dEnums/eMissionState.h

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	AccountId        uint64  `xml:"acct,attr"`
	Currency         uint64  `xml:"cc,attr"`
	MaxCurrency      uint64  `xml:"cm,attr"`
	ClaimCode        uint64  `xml:"co,attr"`
	FreeToPlay       bool    `xml:"ft,attr"`
	GMLevel          uint32  `xml:"gm,attr"`
	LastLogin        int64   `xml:"llog,attr"`
	LastRespawnPosX  float32 `xml:"lrx,attr"`
	LastRespawnPosY  float32 `xml:"lry,attr"`
	LastRespawnPosZ  float32 `xml:"lrz,attr"`
	LastRespawnRotW  float32 `xml:"lrrw,attr"`
	LastRespawnRotX  float32 `xml:"lrrx,attr"`
	LastRespawnRotY  float32 `xml:"lrry,attr"`
	LastRespawnRotZ  float32 `xml:"lrrz,attr"`
	UniverseScore    uint64  `xml:"ls,attr"`
	LastZoneChecksum uint32  `xml:"lzcs,attr"`
	LastZoneId       uint64  `xml:"lzid,attr"`
	LastZoneRotW     float32 `xml:"lzrw,attr"`
	LastZoneRotX     float32 `xml:"lzrx,attr"`
	LastZoneRotY     float32 `xml:"lzry,attr"`
	LastZoneRotZ     float32 `xml:"lzrz,attr"`
	LastZonePosX     float32 `xml:"lzx,attr"`
	LastZonePosY     float32 `xml:"lzy,attr"`
	LastZonePosZ     float32 `xml:"lzz,attr"`
	LastPropModTime  int64   `xml:"mldt,attr"`
	LastWorldId      uint32  `xml:"lwid,attr"`
	Stats            *Stats  `xml:"stt,attr"`
	TotalPlayTime    uint64  `xml:"time,attr"`
	Reputation       int64   `xml:"rpt,attr"`
	Emotes           Emotes  `xml:"ue"`
}

type CompletedMission

type CompletedMission struct {
	Id             uint32
	TimesCompleted uint32
	CompletionTime time.Time
}

func (*CompletedMission) UnmarshalXML

func (mission *CompletedMission) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type CompletedMissions

type CompletedMissions map[uint32]CompletedMission

func (*CompletedMissions) UnmarshalXML

func (missions *CompletedMissions) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Emote

type Emote int32

func (*Emote) UnmarshalXML

func (emote *Emote) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Emotes

type Emotes []Emote

func (*Emotes) UnmarshalXML

func (emotes *Emotes) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type GMLevel

type GMLevel uint32

func (GMLevel) String

func (gmLevel GMLevel) String() string

type Level

type Level struct {
	Level     uint32 `xml:"l,attr"`
	SpeedBase uint32 `xml:"sb,attr"`
}

type MissionState

type MissionState int

type Obj

type Obj struct {
	XMLName   xml.Name  `xml:"obj"`
	Character Character `xml:"char"`
	Level     Level     `xml:"lvl"`
	Missions  struct {
		Done CompletedMissions `xml:"done"`
	} `xml:"mis"`
}

type Stats

type Stats struct {
	CurrencyCollected                  uint64
	BricksCollected                    int64
	SmashablesSmashed                  uint64
	QuickBuildsCompleted               uint64
	EnemiesSmashed                     uint64
	RocketsUsed                        uint64
	MissionsCompleted                  uint64
	PetsTamed                          uint64
	ImaginationPowerUpsCollected       uint64
	LifePowerUpsCollected              uint64
	ArmorPowerUpsCollected             uint64
	MetersTraveled                     uint64
	TimesSmashed                       uint64
	TotalDamageTaken                   uint64
	TotalDamageHealed                  uint64
	TotalArmorRepaired                 uint64
	TotalImaginationRestored           uint64
	TotalImaginationUsed               uint64
	DistanceDriven                     uint64
	TimeAirborneInCar                  uint64
	RacingImaginationPowerUpsCollected uint64
	RacingImaginationCratesSmashed     uint64
	RacingCarBootsActivated            uint64
	RacingTimesWrecked                 uint64
	RacingSmashablesSmashed            uint64
	RacesFinished                      uint64
	FirstPlaceRaceFinishes             uint64
}

func (*Stats) UnmarshalXMLAttr

func (stats *Stats) UnmarshalXMLAttr(attr xml.Attr) error

Need to benchmark using reflection vs. hardcoding parsing

Jump to

Keyboard shortcuts

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