bogstandard / rl-weather

Weather plugin for RuneLite
BSD 2-Clause "Simplified" License
9 stars 3 forks source link

Use Runelite okhttp client #10

Closed thyme4soup closed 2 years ago

thyme4soup commented 2 years ago

Per https://github.com/runelite/plugin-hub/pull/2257 use an injected http client instead of making our own.

Can't figure out what the USER_AGENT thing is about though...

thyme4soup commented 2 years ago

used this as a reference https://github.com/while-loop/runelite-plugins/commit/ce95da33ada020e9b8ac507aebef90b395f607ee, didn't see USER_AGENT in that repo either

hawkins commented 2 years ago

Apologies for sticking my nose where it doesn't belong, but I thiiink this is the value you're looking for? Just found your PRs when I was wishing rl weather had the local weather feature. Hope this helps...

https://github.com/runelite/runelite/blob/0a501429e6cb72e9873eba94c6060fac26bbe484/runelite-client/src/main/java/net/runelite/client/ws/WSClient.java#L109

import net.runelite.client.RuneLite;
RuneLite.USER_AGENT;
thyme4soup commented 2 years ago

@hawkins cheers! Always grateful for help and this looks to be exactly what I was missing. I've gone ahead and added the appropriate header

@bogstandard I think this now addresses all feedback from Nightfirecat@ on the PR to runelite:master

bogstandard commented 2 years ago

Hi @thyme4soup sorry for sleeping on this issue! Life has been quite a rollercoaster lately.

I've merged this now and will look into it in the coming days to see if the maintainers will let us pass! Big thanks to both of you for this.

(I've another mod in the works, separate to this, so keep an eye out!)