Releases: rjwut/ian
3.5.1
3.5.0
New Features and Major Changes
SystemManager
was refactored and is now calledWorld
. This new class includes a variety of useful ways to query for objects, including accepting an arbitrary predicate. A new interface calledWorldListener
allows you to be notified when objects are created or deleted or when players spawn (meaning the player's the ship index is known).- Vessel internals and system damage has been refactored so that data is stored in the same structure and can be updated in a consistent fashion. The new
Grid
class provides a common interface for this data.DefaultContext
can read and write.snt
files usingGrid
s. DAMCON team status is now represented by the stand-alone classDamconTeam
.EngGridUpdatePacket
now contains aList
ofGridNode
s and aList
ofDamconTeam
s.Vessel.getInternalDataFile()
is now calledgetSntFile()
,getInternals()
is nowgetGrid()
, andpreloadInternals()
is nowpreloadGrids()
. ArtemisNetworkInterface
now supports auto-heartbeat management. By default, heartbeat packets will be automatically sent so that code that consumes IAN need not send heartbeats itself.@Listeners
can now listen for two newConnectionEvent
subclasses related to heartbeats:HeartbeatLostEvent
andHeartbeatRegainedEvent
. As part of this update,HeartbeatPacket
is now an abstract superclass ofServerHeartbeatPacket
andClientHeartbeatPacket
.- Determining IFF between two objects is now determined by comparing their
side
properties, then falls back to usingFaction
attributes. This has caused changes toCommsRecipientType
andCommsOutgoingPacket
. VesselData
now hasgetFactions()
andgetVessels()
to getList
s of allFaction
s andVessel
s, respectively.Model
now supports transformation of any arbitrary point cloud, andGrid
can export a point cloud of its nodes. This allows system grids to be more easily overlaid on a ship model render, as is done in the stock engineering console.- All object types now have a unique class that represents them.
ArtemisGenericObject
no longer exists, having been broken intoArtemisAsteroid
,ArtemisBlackHole
, andArtemisMine
classes. - All
ArtemisObject
s now havegetScanLevel()
andgetMaxScans()
methods. CallinggetMaxScans()
on non-scannable objects returns0
. ArtemisObject
s now handleTag
s with thegetTags()
,addTag()
, andisTagged()
methods.ArtemisObject
s now report side visibility via thegetVisibility()
method.BiomechRagePacket
is supported, allowing the client to detect when the biomech tribe's stance toward the player changes.TensionPacket
is supported, which is used by the stock client to control music playback.ArtemisOrientable
now exposes theshieldsFrontMax
,shieldsRearMax
, andside
properties.ArtemisBase
now reports pitch, roll, heading, and side.ArtemisCreature
now reports scans.ArtemisNpc.isEnemy()
has been removed, as it has become clear that this property in the protocol is not what it was originally believed to be. To determine whether a ship is an enemy vessel, you should compare itsside
property with the player's.ArtemisNpc
now has anisNpcTagged()
method.- The new
SetupManager
class can be used by custom servers to track connected clients and their ship and console assignments. Console
can now report aClaimType
enum value that represents any limitations on the clients that claim it. Possible values areONE_PER_SHIP
(pertains toHELM
,WEAPONS
, andENGINEERING
),ONE_PER_GAME
(pertains toGAME_MASTER
), andNO_LIMIT
(pertains to all other consoles).TagPacket
now reports the tag with a separateTag
class.OrdnanceType.HOMING
has been changed toOrdnanceType.TORPEDO
to match the change to the in-game nomenclature.- To reflect its wider use cases, all references to "vertices" have been changed to "points."
Minor Updates and Internal Changes
EngGridUpdatePacket.isRequested()
is now more accurately titledEngGridUpdatePackage.isFullUpdate()
.ArtemisNetworkInterface.send()
is now overloaded to allow sending aCollection
of packets.- Events can now be manually dispatched to listeners via the
ArtemisNetworkInterface.dispatch()
method. ArtemisObject
now has agetNameString()
convenience method.ArtemisObject.distanceIgnoreY()
allows you to get the distance between two objects on the X-Z plane. (ArtemisObject.distance()
reports actual distance in 3D space.) Both will now throw a more specificIllegalStateException
rather than aRuntimeException
if the distance cannot be computed because one or both objects have no position.- Unknown properties can be retrieved and set by byte and bit number via
ArtemisObject.getUnknownProp()
andArtemisObject.setUnknownProp()
. BaseArtemisShielded.extractCallsign()
will intelligently determine a contact's short name if it has one.BaseArtemisShielded.getVessel()
is now null-safe.BaseArtemisShip
now has a convenience constructor which accepts an ID and aVessel
and populates all relevant properties.ArtemisOrientable
now extendsArtemisObject
, andArtemisShielded
now extendsArtemisOrientable
.Ship
now has a clone constructor.PausePacket.isPaused()
now returns aboolean
instead of aBoolState
, as the packet does not supportBoolState.UNKNOWN
.PacketReader
has improved error handling that will provide more information in the event of a parsing error. Packet parsing is more resilient: as long as IAN is confident that the packet size is correct, any subsequent parsing errors will be non-fatal.ArtemisPacketException
now has afatal
property so that you can tell whether the error caused the interface to shut down, and will dump the packet with a stack trace print.BoolState
now has atoValue()
method, which provides an equivalent to the Java ternary operator, selecting a value based on whether theBoolState
isTRUE
,FALSE
, orUNKNOWN
.Poly
now implementsIterable<String>
.- You can now retrieve the scaling factor specified by
RenderParams
with thescale()
method. AnomalyType.toString()
now returns a human-oriented label.ServerDiscoveryResponder
now uses the username as the name of the server instead of the host name. This was done to be consistent with Artemis.- Minor label changes to
Ship System
for consistency. - Added
toString()
implementations to various objects to provide more useful information while debugging. Util.joinSpaceDelimited()
now acceptsObject
s, not justString
s.- Added distribution management information for GitHub Packages.
- Documentation improvements.
Bug Fixes
ArtemisBase
now correctly reports max shields. (Previously, the max shields value was erroneously reported as rear shields.)- Fixed a bug where undocking was not always properly reported by
ArtemisPlayer.getDockingBase()
. BeamFiredPacket
was reporting the incorrectTargetingMode
. This has been fixed.Vessel
torpedo tubes were incorrectly created as instances ofBeamPort
. They are nowVesselPoint
instances.- Fixed a minor issue where unknown object packet fields were inconsistently named.
3.4.0
IAN v3.4.0 Release Notes
This release updates IAN to support Artemis v2.7.2 and later and fixes a critical bug with DisconnectEvent
not firing.
New Features and Improvements
SpecialAbility
now has theSHIELD_VAMP
,TELE_BACK
, andSHIELD_RESET
values introduced in Artemis v2.7.2.
Bug Fixes
- Fixed a bug where
DisconnectEvent
was not firing when the connection was closed. A test was added to cover this in the future.
3.3.1
3.3.0
IAN v3.3.0 Release Notes
The principal goal of IAN v3.3.0 is to provide support for Artemis v2.7.0-1. Below are the full release notes.
New Features and Improvements
- Support for beacons, probes, and tags (includes updates to
OrdnanceType
andBaseMessage
). - New packet types supported:
BayStatusPacket
,BeaconConfigPacket
,CommsButtonPacket
,IdleTextPacket
,SetSingleSeatSettingsPacket
,SingleSeatTextPacket
,TagPacket
. - New properties exposed:
ArtemisNebula.type
,ArtemisNpc.targetX
,ArtemisNpc.targetY
,ArtemisNpc.targetZ
,ArtemisNpc.tagged
,ArtemisPlayer.climbDive
,ArtemisPlayer.emergencyJumpCooldown
,ArtemisPlayer.beaconType
,ArtemisPlayer.beaconMode
,ArtemisPlayer.nebulaType
,ArtemisDrone.side
,ArtemisDrone.y
. - New enum
AnomalyType
for the different kinds of anomalies. Includes agetUpgrade()
which returns the kind ofUpgrade
you get from picking up this anomaly (if thisAnomalyType
supports that). RemovedUpgrade.fromAnomalyIndex()
andUpgrade.getAnomalyIndex()
;Upgrade.fromActivationIndex()
is now just namedfromIndex()
. - New enum
BeaconMode
for representing "attract" and "repel" modes for beacons. - New enum
CommFilter
for the different types of filters that can be applied to comm messages.CommsIncomingPacket.matches()
returnstrue
when the message matches the given filter.GameMasterMessagePacket
updated to support filters. CreatureType.CLASSIC
renamed toTYPHON
to match its new name;CreatureType.JELLY
added.GameType
enum now includesBORDER_WAR
andINFESTATION
.OrdinanceType
can now translate to and from the three-character codes that are now used invesselData.xml
.- IAN can announce and discover games on the LAN. Use
ServerDiscoveryRequester
to discover games, andServerDiscoveryResponder
to announce them. - Support for turning off parsing in
PacketReader
has been removed. (You can get access to raw bytes through theDebugger
interface). ThreadedArtemisNetworkInterface
now allows you to attach aDebugger
to be notified of low-level events.ThreadedArtemisNetworkInterface
has aproxyTo()
method to forward uncaptured events to anotherArtemisNetworkInterface
.DestroyObjectPacket
was renamed toDeleteObjectPacket
so as to not imply that it caused an explosion effect.EndGamePacket
andGameOverPacket
were refactored so thatGameOverPacket
is sent when the simulation ends (victory, player's ship is destroyed, etc.), whileEndGamePacket
is sent when theEnd Game
button is clicked on the statistics page.GameOverStatsPacket
now supports section header rows.GameMasterButtonClickPacket
has been renamed toButtonClickPacket
(since now custom buttons are available for comms, too).GameMasterMessagePacket
supports a newPresentation
enum that describes how the message is presented on the client.ExplosionPacket
now handles both packet subtypes0x00
and0x13
.SingleSeatCraft
class now available.Bay
is nowComparable
.Vessel
efficiency has been split into three separate properties:shipEfficiency
,warpEfficiency
, andjumpEfficiency
.- Carrier-type vessels now expose the number of bays they have.
- Weapon ports now expose the player damage they inflict (apparently only applies to single-seat craft).
- Removed
ArtemisBase.getIndex()
, since bases don't have indexes anymore. - Float properties are now
NaN
when unspecified, unless the documentation says otherwise. - Compiled JDK version moved to Java 7, as Java 6 has reached end-of-life and Travis CI was complaining.
Bug Fixes
- Fixed a bug with unspecified front and rear shields on
BaseArtemisShip
. - Fixed a bug where single and double scanning of NPC ships was incorrectly handled.
- Removed error that occurs if an
ArtemisPlayer
receives a nebula type other than 0 - 3 inclusive, since apparently the actual game server does send other values. Ship
no longer throws an exception when given an accent color value of1.0
and no longer incorrectly reports whether it has a name.- Fixed an error reading arguments in the
ProxyDemo
. - Fixed #10 (SenderThread does not terminate on IOException)
- Fixed #18 (Newly registered protocols are not forwarded to PacketReader)
- Fixed #19 (ServerDiscoveryRequester never terminates)
- Fixed #20 (Server.java equals() method has a bug)
Internal Changes (no direct impact on users)
ThreadedArtemisNetworkInterface
now uses a separate thread for event dispatching. This prevents the receiver thread from blocking on listeners.- Documentation improvements.
3.2.0
New Features and Improvements
- IAN no longer requires a
Context
object, except for certain very specific functionality. This means that nowThreadedArtemisNetworkInterface
does not require aContext
in its constructor, andArtemisObject.updateFrom()
no longer hasContext
as an argument. This, by extension, means that IAN now has no hard requirement to readvesselData.xml
. - The
Context
class has been extracted to an interface, with the implementation code moved to theDefaultContext
class. This allows you to implement your ownContext
that doesn't have to parse a stream to build the context data (which was particularly useful in the testing code).PathResolver
and its implementation classes have been moved to the same package as theContext
interface. - The
ConnectionType
enum
has been renamed toOrigin
, and all references to "connection type" have been renamed to "origin." This makes it more clear which direction packets are being sent, and it's shorter. - New packets:
ActivateUpgradePacket
,CloakDecloakPacket
,DockedPacket
,EngResetCoolant
,ExplosionPacket
,HeartbeatPacket
,HelmEmergencyJumpPacket
,KlaxonPacket
,
SingleSeatPilotPacket
,SingleSeatShootPacket
,SmokePacket
,TitlePacket
- Exposed new properties on various packets:
BayStatusPacket.bays
,BeamFiredPacket.origin
,BeamFiredPacket.targetId
,EngRequestGridUpdatePacket.requested
,FighterLaunchPacket.objectId
,FireBeamPacket.targetId
,FireBeamPacket.x
,FireBeamPacket.y
,FireBeamPacket.z
,FireTubePacket.tubeIndex
,GameMasterMessagePacket.recipients
,GameMasterSelectObjectPacket.targetId
,GameStartPacket.difficulty
,GameStartPacket.gameType
,HelmSetWarpPacket.warpFactor
,LoadTubePacket.ordnanceType
,LoadTubePacket.tubeIndex
,PlayerShipDamagePacket.duration
,PlayerShipDamagePacket.shipIndex
,SciScanPacket.targetId
,SciSelectPacket.targetId
,SetConsolePacket.console
,SetConsolePacket.selected
,SetBeamFreqPacket.beamFrequency
,SetShipPacket.shipNumber
,SetShipSettingsPacket.drive
,SetShipSettingsPacket.hullId
,SetShipSettingsPacket.accentColor
,SetShipSettingsPacket.name
,SetWeaponsTargetPacket.targetId
,UnloadTubePacket.tubeIndex
ArtemisNpc
andArtemisAnomaly
now expose per-side scan levels, and bothArtemisNpc
andArtemisPlayer
expose their sides.JumpStatusPacket
has been split intoJumpBeginPacket
andJumpEndPacket
.ToggleShieldsPacket
was renamed toSetShieldsPacket
and its functionality expanded to handle raising and lowering shields as well as toggling them.DifficultyPacket
was renamed toGameStartPacket
and moved to the core protocol's root package. TheMIN
andMAX
constants were renamed toMIN_DIFFICULTY
andMAX_DIFFICULTY
.ReadyPacket2
has been renamed toEngRequestGridUpdatePacket
.- Target selection packets have been renamed for consistency and clarity (e.g.
CaptainSelectPacket
->CaptainTargetPacket
). - Torpedoes now have their own object class (
ArtemisTorpedo
) instead of usingArtemisGenericObject
. - The
Upgrade
enum
now contains all known upgrade types, including those not obtainable from anomalies. - The underlying protocol has standardized on zero-based ship index values, so IAN has followed suit. All references to the one-based "ship number" have been changed to the zero-based "ship index."
- IAN now gracefully accepts custom vessel
broadType
s invesselData.xml
. To support this, theVesselAttribute
enum
has been removed. Instead, these values are represented as plain oldString
s, and there is now aVesselAttribute
class withString
constants representing the default ArtemisbroadType
s. - IAN will no longer throw an exception and close the connection when an
ArtemisPacketException
is encountered while parsing a packet's payload. Instead, the exception will be reported to the attachedDebugger
instance, and the packet will be reported as anUnknownPacket
. Note that if an exception occurs while parsing the packet's header, IAN will still close the connection and throw an exception, since it can't know how long the packet is without parsing the header. ArtemisObject.getProps()
no longer accepts aboolean
argument to indicate whether unspecified properties should be included. (They are always excluded, now.)ArtemisPlayer
now supports themissiles
property for fighters. As this uses the same property in the protocol asavailableCoolant
, there is now anavailableCoolantOrMissiles
property, from which theavailableCoolant
andmissiles
properties read. If the vessel type is unknown or the wrong type, attempting to read or writeavailableCoolant
ormissiles
will fail, but theavailableCoolantOrMissiles
property will always work regardless of vessel type.ArtemisCreature
now supports thehealth
andmaxHealth
properties.- You can now create an
ObjectUpdatePacket
and populate it. This lets you create custom proxies that can insert objects visible to clients. ObjectUpdatePacket
supports mixedObjectType
payloads, as used by some custom software. Stock Artemis clients appear to handle this fine. However, if you wish to ensure that you generate packets how the Artemis server does,ObjectUpdatePacket
now has a static method calledsegregate()
which accepts aCollection
ofArtemisObjects
and generates aList
of correspondingObjectUpdatePackets
where each has payloads with homogeneousObjectTypes
.ArtemisPlayer
has asplit()
method that will break it into several objects, with the appropriate properties set for eachObjectType
. It also has multiple update methods to only update the properties for a particularObjectType
.- The
AllShipSettingsPacket.Ship
class was extracted to its own top-level class, and is now used by theSetShipSettingsPacket
. - A new example package contains some sample client and proxy code. The example code in
README.md
was replaced with a mention of the new package. VesselInternals
objects can now be built from scratch and be exported to anOutputStream
in.snt
format.GameMasterButtonClickPacket
supports providing the label of the button to click, which will then compute the hash for you.FactionAttribute.build(String)
will now complain if certain invalid combinations of attributes are used: 1) not specifying one ofPLAYER
,FRIENDLY
, orENEMY
; 2) not specifying one ofSTANDARD
,SUPPORT
, orLONER
forENEMY
factions; 3) specifying bothWHALEHATER
andWHALELOVER
; 4) specifyingJUMPMASTER
without specifyingPLAYER
.- The
EngGridUpdatePacket
inner classes (GridDamage
andDamconStatus
) now have public constructors. FighterBayStatusPacket
now lets you add bays to it.ThreadedArtemisNetworkInterface
was updated to report time since the last heartbeat.- Most references to "fighters" were changed to "single-seat craft," since a fighter is only one kind of single-seat craft.
- The special bits properties for
ArtemisNpc
will now preserve the original data, even in the case where garbage data gives special abilities to a non-special ship. However, the special abilities properties that don't have the word "Bits" in their names will compensate for this Artemis server error, so in general you should use those instead. However, note that they will not claim to know the special abilities status if the properties in question are unspecified or if the hull ID is unspecified or does not correspond to a known vessel (due to a server/clientvesselData.xml
mismatch, for example). This was done to improve symmetrical read/write support for proxies. - All parsed
String
s are now instances of the newNullTerminatedString
class, and all API methods that may have referenced a parsed string now use theCharSequence
interface, which is implemented by bothString
andNullTerminatedString
. This was done to improve symmetrical read/write support for proxies. You can convert aString
to aNullTerminatedString
using theNullTerminatedString(String)
constructor, and convert aNullTerminatedString
to aString
using thetoString()
method.NullTerminatedString
also features static methods to convertList
s ofString
s orNullTerminatedString
s. This change will not cause problems for most code, but if you're doing anequals()
comparison between aString
and a string value that was parsed from a packet, it will fail becauseString
s andNullTerminatedString
s can't be equal. The best approach is to calltoString()
on theNullTerminatedString
and compare that against yourString
. BoolState
has been refactored to be a regular class instead of anenum
. It now stores the original representation of theboolean
value as read from the bit stream so that it can be written out exactly as it was read (again to support symmetrical read/write for proxies).ArtemisPlayer.setSystemEnergy(ShipSystem, int)
is renamedsetSystemEnergyAsPercent
to be more explicit.- Added
DEFAULT_PORT
constant to Artemis class. WelcomePacket
allows you to specify a custom message (not that that's terribly important, but whatever).- Removed setters from
FighterBayStatusPacket.Bay
so that the class is immutable. GameMasterButtonClickPacket
now displays the hash in hex instead of decimal intoString()
.- Removed
GridCoord.getUniqueId()
, as it wasn't really being used. OutputStreamDebugger
now accepts both an output and an errorOutputStream
.- Removed connection tracking for nodes in
VesselInternals
(will eventually replace with something better). ArtemisPacket
now exposes a timestamp property which contains the value ofSystem.nanoTime()
when the packet was constructed.- IAN now confirms that classes which have methods with the
@Listener
annotation are public. BeamFiredPacket.autoFired
is now calledtargetingMode
, and returns aTargetingMode
`enu...
3.1.1
This release resolves a problem which was preventing IAN from being usable on Android. The new rendering code used classes from java.awt
, which is not available on Android. The rendering code has now been removed, while the code which parses .dxs files and stores the points and polys has been retained so that rendering code can still be written for any platform. The plan is to eventually release the rendering code separately.
3.1.0
- Artemis 2.4.0 support. This includes: support for the new ships and the new Ximni faction, new
jumpmaster
faction attribute,elite
faction attribute changed tohasspecials
,playershields
attribute for fighters, support for game master custom buttons, support for ship accent colors and fighter capital ship IDs. All references to "elite" changed to "special" in the code base. - VesselData refactor. There is no longer a static instance of
VesselData
. Instead, you create aContext
object and pass it to the required classes. This was done in order to allow automated testing with differentvesselData.xml
files to exercise various scenarios. - Load Artemis resources however you want. Instead of simply giving a path to the Artemis install, you can now construct the
Context
class passing in an object that implements thePathResolver
interface. This gives you much more flexibility when it comes to loading Artemis resource files. IAN comes with twoPathResolver
implementations out of the box:FilePathResolver
(to read from disk) andClasspathResolver
(to read resources packaged inside your JAR). - Way easier proxying.
ArtemisNetworkInterface
now has aproxyTo()
method. Simply pass in a recipientArtemisNetworkInterface
object, and any packets which are not caught by your listeners are automatically passed through to the proxied connection. - Ship number/index consistency fix. The Artemis protocol isn't 100% consistent about whether Artemis is ship 1 or ship 0. This change makes your life easier by making IAN consistent (Artemis is ship 1) even though the protocol isn't.
- Determine whether a disconnection was "normal." Some
DisconnectEvents
are expected to occur when a connection is terminated intentionally. TheisNormal()
method onDisconnectEvent
will now tell you whether thisDisconnectEvent
is expected or not. README.md
updated. It now includes detailed information about how to create clients or server proxies, including updated example source code.- Added
pom.xml
. Don't know why this wasn't in there before! Anyway, this should let you build the JAR from a local copy of the repository with themvn install
command. - A bunch of documentation updates. Yay for documentation!
- More automated test coverage. We are currently at 44.1% coverage.
- A bunch of internal improvements which you probably won't care about, but which make IAN better.
Here are the things to watch for that may break your existing code upon updating to IAN 3.1.0:
VesselData.setArtemisInstallPath()
doesn't exist anymore, since we're now using the newContext
object with the more powerfulPathResolver
mechanism. Construct aContext
object and pass in an object which implementsPathResolver
. There are a few constructors and methods which now require you to pass in theContext
(most notably, constructors forThreadedArtemisNetworkInterface
).- To be consistent with the new terminology used in
vesselData.xml
, all references to the term "elite" in the code have been changed to "special." Any references you may have in your code will need to be changed accordingly. - Make sure that any code that identifies a ship by number/index is one-based and not zero-based.