Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bots and statuspage fixes #178

Merged
merged 10 commits into from Apr 1, 2024
Merged

Bots and statuspage fixes #178

merged 10 commits into from Apr 1, 2024

Conversation

hbeni
Copy link
Owner

@hbeni hbeni commented Mar 6, 2024

Adds hook support for lua bots

Hopefully fixing #174
May also potentially help with #177

@hbeni hbeni linked an issue Mar 6, 2024 that may be closed by this pull request
@hbeni
Copy link
Owner Author

hbeni commented Mar 6, 2024

Deployed to test server... lets see how this goes

@hbeni hbeni self-assigned this Mar 7, 2024
@hbeni hbeni force-pushed the Issue-17 branch 22 times, most recently from eeb7cff to a03e0b7 Compare March 9, 2024 23:41
@hbeni hbeni linked an issue Mar 10, 2024 that may be closed by this pull request
@hbeni hbeni changed the title Issue 117 Issue 177+174 Mar 10, 2024
@hbeni
Copy link
Owner Author

hbeni commented Mar 15, 2024

The bot was restarted with the PRs code 2024-03-10 01:20:43 (utc+1).
Did not occur so far, but its early to say; the bug took a week or two to manifest so far.

  • 2024-03-15 12:09: Bots and statuspage fixes #178 (comment) Still looking good so far.
  • 2024-03-19 17:23: still going strong and nothing suspicios. Just had three live clients and heard them talking (but they ignored me :cry: )

👀

@hbeni hbeni linked an issue Mar 18, 2024 that may be closed by this pull request
@hbeni
Copy link
Owner Author

hbeni commented Mar 20, 2024

Restarted the statusbot with code 089688e

@hbeni hbeni force-pushed the Issue-17 branch 2 times, most recently from af40168 to 5dd99aa Compare March 20, 2024 22:23
@hbeni
Copy link
Owner Author

hbeni commented Mar 20, 2024

Restarted the statusbot with refactored code 5dd99aa

The lua shared functions lib now supports calling a hook
for when plugin data was parsed.
A bot now can hook custom code into some shared_functions library,
by implementing the functions.supplying for example: `fgcom.hooks.parsePluginData_afterParseIID = function(sid, iid) ... end`

Currently these are available:
- parsePluginData_afterParseIID(sid, iid)
  called when parsePluginData() received data for a given iid

- fgcom.hooks.parsePluginData_newClient(sid, iid)
  called when parsePluginData() detected that the client was not seen before.
  is called before any datas is parsed/added.

- fgcom.hooks.parsePluginData_updateKnownClient(sid, iid)
  called when parsePluginData() detected that the client was known.
  is called before any datas is parsed/updated.

- fgcom.hooks.parsePluginData_processedPacket(mumble_user, packtype, dataID_t)
  called after processing the packet, passing raw data

- fgcom.hooks.cleanupPluginData_entry(sid, iid)
  called when cleaning up an entry. return false to prevent the entry to be cleaned out.

-------------------------
Server/Statusbot:
Also this commit tries to prevent duplicate entries (#177).
make sure, the data structure has a type field default, and prevent nil value (#174)

fix #174
fix #177
Also the test/fgcom-fakepilot bot was ammended:
- now also has a version number
- now utilizes fgcom.log() and .dbg() for output (giving timestamps)
- checkMissingPluginData(client, askForMissingDataAfter=30) added to fgcom-sharedFunctions
  - This will check for missing metadata.
  - If client is supplied, and askForMissingDataAfter is >0, it will emit a
    ICANHAZDATAPLZ packet to the client in question
  - It will return a table containing detected missing fields.
    So calling with client=nil can be used to just check for missing data.

- The status and recorder bot will now ask for data if it misses it for too long.
@hbeni hbeni linked an issue Mar 21, 2024 that may be closed by this pull request
@hbeni
Copy link
Owner Author

hbeni commented Mar 21, 2024

2024-03-21 18:35 Restarted statusbot with the new "ask for data feature" (a42a9d8) in order to fix the "missing callsign bug" (#186)

@hbeni
Copy link
Owner Author

hbeni commented Mar 22, 2024

2024-03-21 18:35 Restarted statusbot with the new "ask for data feature" (a42a9d8) in order to fix the "missing callsign bug" (#186)

Also, since 2024-03-22 08:30 a fakepilot bot is running.

2024-03-26 18:38 still Running good.
2024-03-30 14:18 still good

- FakePilotBot:
  - randomized start position globally (not locally around 0,0 anymore).
  - added optional --lat, --lon and --alt parameters to define a fixed start location.
  - fixed lat/lon mixed data in UPD_LOC packet.
  - fixed limiting/wrapping of lat/lon; it will wrap over correctly now.
    The bot thus now follows a great-circle path over the globe.

- loadTest tool:
  - changed call options. There are now 3 mandatory options (for the script itself).
  - options after the initial 3 ones are passed to the bot call directly.
@hbeni hbeni changed the title Issue 177+174 Bots and statuspage fixes Mar 24, 2024
@hbeni
Copy link
Owner Author

hbeni commented Apr 1, 2024

This was going flawless since over two weeks now. I think we can consider it fixed

@hbeni hbeni merged commit ba3af79 into master Apr 1, 2024
5 of 9 checks passed
@hbeni hbeni deleted the Issue-17 branch April 1, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant