LostQuasar / rzap

A rust library for connecting to an openshock server
https://crates.io/crates/rzap
GNU General Public License v3.0
1 stars 1 forks source link

add user-agent header and set application name #2

Closed 999eagle closed 1 month ago

999eagle commented 2 months ago

this pr first adds a builder pattern to OpenShockAPI so OpenShockAPI::new doesn't need to have more optional arguments added and becomes unwieldy. the second commit then adds an option to configure the application name/version in the builder. this information is used in the user agent (if configured) similarly to what the official C# API bindings do. the application name is also passed as custom_name in post_control so the correct application name shows up the the logs on the OpenShock dashboard.

the introduction of this builder pattern might be a bit too much? feel free to give feedback!

LostQuasar commented 2 months ago

Not sure how i feel about this build Ill test out the changes on my personal project i use this for and get back to you about this PR

LostQuasar commented 2 months ago

Looks great to me I'll run some tests and figure out the changes and merge/release a new version