Levi Schuck b52025ae72 Fix negative total XP calculation when skill starts
Closes #1734

Summary:
If you start a skill like fishing lobster after logging in,
you will have the xpGained value as `90`.
But, since you just started the skill, it will divide by `0`.
This results in the max integer value of `2147483647`.

If you did fletching before fishing, and had a XP per hour of `40000`.
Then when you add the fishing XP per hour of `2147483647`, the
result overflows and you get a negative number as the total XP per hour.

Solution:
Don't divide by zero, instead suppose that the skill has been active
for **at least** 60 seconds. This will result in a fair estimate that
improves as the skill continues to be used, rather than the ridiculous
estimate of 2 Billion one second and 200K the next second.

60 seconds is chosen over 1 or 5 or 10 seconds as the result is more
conservative and closer matches my hourly XP experiences.
2018-05-02 17:42:46 -05:00
2017-07-19 20:55:57 -04:00
2018-01-25 17:03:09 -05:00
2018-03-20 17:42:55 -04:00
2018-04-08 13:30:26 -04:00
2017-06-29 17:27:28 -04:00
2018-04-07 00:25:38 -04:00

runelite Travis Discord

runelite is a RuneScape 2 client and reverse engineering project

If you have any questions, please join our IRC channel on irc.rizon.net #runelite or alternatively our Discord server.

Project Layout

  • cache - Libraries used for reading/writing cache files, as well as the data in it
  • deobfuscator - Contains bytecode deobfuscator, mapper for handling updates, and the injector
  • http-api - API for api.runelite.net
  • http-service - Service for api.runelite.net
  • model-viewer - RS Model, NPC/Object, and terrain viewer
  • runelite-api - RuneLite API, interfaces for accessing the client
  • runelite-mixins - Mixins which are injected into the injected client's classes
  • runescape-api - Mappings correspond to these interfaces, runelite-api is a subset of this
  • runelite-client - Game client with plugins
  • runescape-client-injector - Builds the injected client from the vanilla client and the mappings
  • runescape-client - Decompiled RuneScape client, contains mappings

Usage

Open the project in your IDE as a Maven project, build the root module and then run the RuneLite class in runelite-client.
For more information visit the RuneLite Wiki.

License

Most of RuneLite is licensed under the BSD 2-clause license. See the license header in the respective file to be sure. Some of the code, like everything in runescape-client, is automatically generated and is not licensed.

Contribute and Develop

We've set up a separate document for our contribution guidelines.

Description
No description provided
Readme BSD-2-Clause 107 MiB
Languages
Java 98.9%
GLSL 0.7%
C 0.3%