Releases: MrBean355/dota2-gsi
Releases · MrBean355/dota2-gsi
2.4.0
2.3.0
✨ New Features
- Behavior change: the library now uses more lenient JSON deserialization by default:
- This means that when Dota adds more fields to game state objects, exceptions won't be thrown.
- To revert back to the old behavior, call
enableStrictDeserialization()
when creating theGameStateServer
.
- Added the
events
property toPlayingGameState
andSpectatingGameState
:- The type is
List<DotaEvent>
. - It represents a list of generic events that have recently happened in the game.
- For example, killing Roshan or players tipping each other.
- Check out the API docs for more info.
- The type is
🧹 Housekeeping
- Removed
@ExperimentalGameState
markers from all APIs relating to:Building
Draft
TalentTree
- Wearables
2.2.2
2.2.1
2.2.0
✨ New Features
- Added new
Hero
game object property:attributesLevel
; integer
- Added new
Item
game object property:level
; integer, optional
- Added new
Player
game object properties:accountId
; stringplayerSlot
; integerteamSlot
; integer
- Added new
SpectatedPlayer
game object properties:heroHealing
; integertowerDamage
; integer
🧹 Housekeeping
- Kotlin:
1.7.10
->1.8.20
- KotlinX Serialization:
1.3.3
->1.5.0
- Ktor:
2.0.3
->2.3.0
2.1.0
2.0.0
🌱 Major Rework
This is essentially a rewrite of the whole library; there will be many breaking changes.
Many of the classes were moved to new packages. More importantly, the library now distinguishes between "playing" and "spectating" game states. This is because the structure of the data is significantly different, so it makes sense for it to be represented by separate objects.
GameStateServer(44444)
.setPlayingListener { gameState: PlayingGameState ->
// Only called when you are playing a match.
}
.setSpectatingListener { gameState: SpectatingGameState ->
// Only called when you are spectating a match.
}
.setIdleListener { gameState: IdleGameState ->
// Only called when you not in a match (e.g. on main menu).
}
.setGenericListener { gameState: GameState ->
// Called for all game states, in addition to the above listeners.
}
.start() // or startAsync()
Explore the API reference to see what functionality is available.
✨ New Features
GameStateServer
- Different listeners can be registered to receive different types of game state updates:
setPlayingListener()
: called when the client is playing in a match. It will receive aPlayingGameState
object.setSpectatingListener()
: called when the client is spectating a match. It will receive aSpectatingGameState
object.setIdleListener()
: called when the client is not in a match (e.g. on the menu). It will receive anIdleGameState
object.setGenericListener()
: called for any game state, in addition to the above listeners. It will receive aGameState
object.
- Added the
setErrorHandler()
function, allowing you to handle exceptions that are thrown while processing the game state data. - Added the
requireAuthentication()
function, allowing you to authenticate data coming to your application. The parameters must correspond to theauth
configuration in the GSI config file. - Separated the
start(Boolean)
function into two functions:start()
: blocks the current thread until the server is stopped.startAsync()
: does not block the current thread.
Game State Objects
- Added support for extra game state properties:
buildings
draft
wearables
- Added new
Ability
properties:charges
; nullable integermaxCharges
; nullable integerchargeCooldown
; nullable integer
- Reworked the
talents
property ofHero
into an object:TalentTree
. - Added a new
Item
property:bottledRune
; nullableBottledRune
enum
- Changed the
killList
property ofPlayer
to beMap<String, Int>
; representing the victim ID to the number of times they were killed by the player. - Introduced a
Team
enum, which replaces theString
types:winningTeam
inDotaMap
team
inPlayer
- Changed most
Long
types toInt
, as it seemed unnecessary.
1.2.0
1.1.0
✨ New Features
- Added new properties to
Hero
:xp: Long
aghanimsScepter: Boolean
aghanimsShard: Boolean
- Added support for TP and neutral item slots:
HeroItems#teleport
HeroItems#neutral
⚙️ API Changes
- Breaking: reworked the
Hero#talentX
properties into a list:Hero#talents
. GameStateServer#start()
now returnsthis
, for chaining function calls.
🧹 Housekeeping
- Upgraded Kotlin:
1.4.21
->1.5.31
- Upgraded Ktor:
1.4.3
->1.6.4