Skip to content

Conversation

@tpetrychyn
Copy link

@tpetrychyn tpetrychyn commented Apr 18, 2023

Changes:

  • deathlog has been modularized and unit tested
  • GUID is now emitted with the death message
  • Added two new config options

New config

  1. verified deaths - if enabled require 3 checksums from guildmates
  2. death log size - limit the deaths LRU in hardcore.lua stored variables
    image

Next steps

This PR is intended to support a new deaths recorder API, see: https://github.com/tpetrychyn/wow-hardcore-death-recorder
Mods will copy and paste their death_log_entries table to the API so deaths can be persisted and queried later

Tests run in docker

$ docker-compose up
[+] Running 1/0
 - Container wow_hardcore-test-1  Created                                                                                                                             0.0s 
Attaching to wow_hardcore-test-1
wow_hardcore-test-1  | +++++
wow_hardcore-test-1  | 5 successes / 0 failures / 0 errors / 0 pending : 0.024148 seconds
wow_hardcore-test-1 exited with code 0

@tpetrychyn tpetrychyn changed the title wip: deathlog refactor testable Modularize deathlog, emit GUID on death, new hidden record command Apr 20, 2023
@tpetrychyn tpetrychyn changed the title Modularize deathlog, emit GUID on death, new hidden record command Modularize deathlog, unit tests, emit GUID on death, new hidden record command Apr 20, 2023
@tpetrychyn tpetrychyn changed the title Modularize deathlog, unit tests, emit GUID on death, new hidden record command Modularize deathlog, unit tests, emit GUID on death, new recorded_deaths object for internal use Apr 20, 2023
@zdeyn
Copy link
Collaborator

zdeyn commented Apr 21, 2023

Can you elaborate some more on your work here?

I've been working on an api back-end written in flask using python

I'm fairly confident we don't have any other Go users on the team, but python is a little more ubiquitous

How best can we work together?

@tpetrychyn
Copy link
Author

Hey @zdeyn, for sure,

Addon:

This PR should be ready to merge, I have been running it in game for a day or two and by default is functionally unchanged.

The spirit of this PR is two-fold:

  1. Add GUID to the death message since it is the only way we can uniquely identify players for storage
  2. Add config so mods can disable the 3 guildmate checksum verification and store a larger log
  • disabling checksum is important because without it only players in guilds would be caught
  • increasing log size allows mods to upload their log less-frequently.

I got carried away with the refactor but I think it's a great improvement to have unit tests to make future work easier and safer.

API:

If you have a python flask API in development I would be happy to contribute Python code there. The API is dead simple, just two steps:

  1. Parse a LUA table string request body in to an array object -- I used chatgpt to generate the code to do this in Go.
  2. Store that array in mysql, index on guid and player name

Currently I have a mysql table setup in Planetscale free tier we could use, or setup a new one for your organization.

@tpetrychyn
Copy link
Author

@zdeyn if you would prefer, I could split the PRs:

  • one for refactor/testing w/ no changes
  • one for adding guid and menu options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants