iprobedroid / swgoh-arena-tracker

47 stars 189 forks source link

Crash on timeout, other questions #10

Closed aibeira closed 4 years ago

aibeira commented 4 years ago

First... I am really liking this. It's been very informative.

Second... I have noticed that when the game API call times out, it just stops polling. I have had to make the docker container automatically restart, but that results in a dump of all the players in the configuration everytime it restarts. I understand why that is I think, but it would be better if the timeout didn't cause a crash.

Additionally, some other questions...

I am wondering about the polling frequency of the API. Is it every one minute?

Also, if I modify the shard-bot we use to output the json like the bot wants for the URL, how often will it get retrieved?

Lastly, is the source code for the bot itself available somewhere? I think I could solve most of these questions that way. Or perhaps information on the API being called? I maintain a discord bot used by my arena shards and a few others, and I've been wondering about pairing that with this sort of tracking for quite some time.

Thanks!

iprobedroid commented 4 years ago

Could you provide the exact error logs, please? The bot should not stop polling on all of the game API errors in theory.

The bot polls the game API for each player in the list one by one (2 seconds each due to the API's rate limit) then waits 3 minutes and starts over in the infinite loop.

The bot polls the list of players from the provided URL on each cycle(approx every 5-6 minutes).

I can provide you with the base game client code, it is .net core/c#.

aibeira commented 4 years ago

Thanks for your reply...

How do you want to send me the code? I'd love to look at it, or contribute. I started out professional development in C#, so it shouldn't be completely foreign to me.

Thanks.

The most recent time the container stopped it was not a timeout, but, ... here's the entire log...

Logger type: CONSOLE GAME_CLIENT_VERSION: 99.99.99, Arena type: Fleet Provided ally codes from environment: #4 465464213,254757364,232377518,711479725 Provided discord tags: #4 aibeira,Blinkin,MaxPower, Error: The remote server returned an error: (504) Gateway Time-out. Error: The remote server returned an error: (504) Gateway Time-out. Error: The remote server returned an error: (504) Gateway Time-out. Error: The remote server returned an error: (504) Gateway Time-out. Error: The remote server returned an error: (504) Gateway Time-out.

Unhandled Exception: System.Net.WebException: Resource temporarily unavailable Resource temporarily unavailable ---> System.Net.Http.HttpRequestException: Resource temporarily unavailable ---> System.Net.Sockets.SocketException: Resource temporarily unavailable at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask1 creationTask) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at System.Net.HttpWebRequest.SendRequest() at System.Net.HttpWebRequest.GetResponse() --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetResponse() at Ipd.GameClient.GameClient.BasicPostRequest(Byte[] body) at Ipd.GameClient.GameClient.GetGuestAuth() at Ipd.Core.Services.PlayerRankService.Login() at Ipd.Core.Utils.ExecutionThrottle.ThrottleSync[T](Int32 timeLimitMs, Func1 action) at SimpleTracker.Tracker.Track() at SimpleTracker.Program.Main(String[] args)

iprobedroid commented 4 years ago

yep, that's a bug, will try to fix it this weekend. gimme your discord name, I will contact you later.

aibeira commented 4 years ago

Ok. Looking forward to hearing from you. aibeira#9160

iprobedroid commented 4 years ago

discord can't find your account

aibeira commented 4 years ago

Sorry - typo on my part. Try aibeira#9130