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

Settings can cause data overflow in extreme situations #200

Open
Kermalis opened this issue Sep 5, 2019 · 0 comments
Open

Settings can cause data overflow in extreme situations #200

Kermalis opened this issue Sep 5, 2019 · 0 comments

Comments

@Kermalis
Copy link
Owner

Kermalis commented Sep 5, 2019

TODO:

  • NatureStatBoost and CritMultiplier problems with double.Infinity and double.NegativeInfinity?
  • LightClayTurnExtension can overflow the reflect and light screen counter?
  • MaxStatChange overflow? Also should not be negative.
  • NatureStatBoost and CritMultiplier actually will cause damage to overflow.

DONE:

  • MaxPPUps can overflow the pp byte?
@Kermalis Kermalis added the Bug label Sep 5, 2019
Kermalis added a commit that referenced this issue Sep 16, 2019
Changed PBEAction struct into the PBETurnAction class
Changed the switch-ins value tuple into the PBESwitchIn class
Renamed PBEAIManager to PBEAI
Renamed PBETarget to PBETurnTarget
Removed the Teams array from PBEBattle and made the PBETeams class
Added "OpposingTeam" into PBETeam
Using IEnumerable<T> way less because it wasn't good
Changed 3-line <summary> comments into 1-line comments
Cleaned up most switch statements to throw ArgumentOutOfRangeException
Added victim to PBEMoveCritPacket
Changed pp into an int (partial #200)
Changed moves, pp, and maxpps in PBEPokemon into the PBEBattleMoveset class which also adds KnownPP
Added IDisposable to classes so they can unsubscribe from events
Added ArgumentNullException checks to public methods
Renamed PBEMovesetBuilder to PBEMoveset
Renamed PBEEffortValueCollection to PBEEffortValues
Renamed PBEIndividualValueCollection to PBEIndividualValues
For the above three, setting values is simplified to properties (no longer done with methods)
Changed PBETeam.Party into a PBEList and added a Remove() method
PBESetPartyPacket was renamed to PBETeamPacket and is now sent by the battle itself (and so the replays do not need to store the party explicitly, the packet within the replay will load the party)
Ids are now based on the team id, so that way team 2 does not know how many Pokémon team 1 has
PropertyChanged and CollectionChanged events will now only fire if they ACTUALLY changed
PBEPokemonShell can now be created publicly (but not added to a PBETeamShell yet)
Packets now are created internally with methods to make the info hidden (special packets are still public, such as sending your team)
Packets also now properly store the Buffer property when being received/read
Packet buffers are now read only collections of bytes and less overhead goes into creating them
Time was removed from the PBETurnBeganPacket because it wasn't necessary and didn't really make sense
All project files now define the entry point
Silenced the "missing xml comment" warning to allow for better focus on actual warnings and errors

[CLIENT]
BattleClient now properly responds to the PBEMatchCancelledPacket and the packet timer was removed in place of a thread that only starts once all packets are received
BattleClient also now includes the player's PBETeam for easy access
Changed public setters to private/internal ones

[ISSUES]
Closes #142
Closes #203
Fixes #208
Closes #209
Fixes #211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant