https://github.com/raggaer/tfs_item_attributes_reader
Unserializes / Serializes TFS database item attributes
https://github.com/raggaer/tfs_item_attributes_reader
forgottenserver item serialization unserialize
Last synced: 5 months ago
JSON representation
Unserializes / Serializes TFS database item attributes
- Host: GitHub
- URL: https://github.com/raggaer/tfs_item_attributes_reader
- Owner: Raggaer
- License: mit
- Created: 2020-10-31T02:54:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-18T18:37:44.000Z (over 5 years ago)
- Last Synced: 2024-06-20T05:13:23.496Z (almost 2 years ago)
- Topics: forgottenserver, item, serialization, unserialize
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# tfs_item_attributes_reader
Unserializes/Serializes TFS database stored items.
You can directly load data as `[]byte`, load from hex string or load from a file.
## Example
```go
item, err := UnserializeHexString("18190073616D7572616920736F756C2072756E652028543129202B3822010000000000000005006C6576656C020800000000000000")
if err != nil {
// Handle
return
}
log.Println(item.Name)
...
```
The unserialized item will look like this:
```json
{
"Name": "Super Secret Rune",
"CustomAttributes": {
"level": {
"Key": "level",
"Value": 8,
}
}
}
```
You can also serialize it back:
```go
s, err := item.SerializeAsHexString()
if err != nil {
// Handle
return
}
log.Println(s)
```
```txt
18190073616D7572616920736F756C2072756E652028543129202B3822010000000000000005006C6576656C020800000000000000
```