You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IAN no longer requires a Context object, except for certain very specific functionality. This means that now ThreadedArtemisNetworkInterface does not require a Context in its constructor, and ArtemisObject.updateFrom() no longer has Context as an argument. This, by extension, means that IAN now has no hard requirement to read vesselData.xml.
The Context class has been extracted to an interface, with the implementation code moved to the DefaultContext class. This allows you to implement your own Context 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 the Context interface.
The ConnectionTypeenum has been renamed to Origin, 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.
ArtemisNpc and ArtemisAnomaly now expose per-side scan levels, and both ArtemisNpc and ArtemisPlayer expose their sides.
JumpStatusPacket has been split into JumpBeginPacket and JumpEndPacket.
ToggleShieldsPacket was renamed to SetShieldsPacket and its functionality expanded to handle raising and lowering shields as well as toggling them.
DifficultyPacket was renamed to GameStartPacket and moved to the core protocol's root package. The MIN and MAX constants were renamed to MIN_DIFFICULTY and MAX_DIFFICULTY.
ReadyPacket2 has been renamed to EngRequestGridUpdatePacket.
Target selection packets have been renamed for consistency and clarity (e.g. CaptainSelectPacket -> CaptainTargetPacket).
Torpedoes now have their own object class (ArtemisTorpedo) instead of using ArtemisGenericObject.
The Upgradeenum 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 broadTypes in vesselData.xml. To support this, the VesselAttributeenum has been removed. Instead, these values are represented as plain old Strings, and there is now a VesselAttribute class with String constants representing the default ArtemisbroadTypes.
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 attached Debugger instance, and the packet will be reported as an UnknownPacket. 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 a boolean argument to indicate whether unspecified properties should be included. (They are always excluded, now.)
ArtemisPlayer now supports the missiles property for fighters. As this uses the same property in the protocol as availableCoolant, there is now an availableCoolantOrMissiles property, from which the availableCoolant and missiles properties read. If the vessel type is unknown or the wrong type, attempting to read or write availableCoolant or missiles will fail, but the availableCoolantOrMissiles property will always work regardless of vessel type.
ArtemisCreature now supports the health and maxHealth 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 mixed ObjectType 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 called segregate() which accepts a Collection of ArtemisObjects and generates a List of corresponding ObjectUpdatePackets where each has payloads with homogeneous ObjectTypes. ArtemisPlayer has a split() method that will break it into several objects, with the appropriate properties set for each ObjectType. It also has multiple update methods to only update the properties for a particular ObjectType.
The AllShipSettingsPacket.Ship class was extracted to its own top-level class, and is now used by the SetShipSettingsPacket.
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 an OutputStream 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 of PLAYER, FRIENDLY, or ENEMY; 2) not specifying one of STANDARD, SUPPORT, or LONER for ENEMY factions; 3) specifying both WHALEHATER and WHALELOVER; 4) specifying JUMPMASTER without specifying PLAYER.
The EngGridUpdatePacket inner classes (GridDamage and DamconStatus) 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/client vesselData.xml mismatch, for example). This was done to improve symmetrical read/write support for proxies.
All parsed Strings are now instances of the new NullTerminatedString class, and all API methods that may have referenced a parsed string now use the CharSequence interface, which is implemented by both String and NullTerminatedString. This was done to improve symmetrical read/write support for proxies. You can convert a String to a NullTerminatedString using the NullTerminatedString(String) constructor, and convert a NullTerminatedString to a String using the toString() method. NullTerminatedString also features static methods to convert Lists of Strings or NullTerminatedStrings. This change will not cause problems for most code, but if you're doing an equals() comparison between a String and a string value that was parsed from a packet, it will fail because Strings and NullTerminatedStrings can't be equal. The best approach is to call toString() on the NullTerminatedString and compare that against your String.
BoolState has been refactored to be a regular class instead of an enum. It now stores the original representation of the boolean 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 renamed setSystemEnergyAsPercent 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 in toString().
Removed GridCoord.getUniqueId(), as it wasn't really being used.
OutputStreamDebugger now accepts both an output and an error OutputStream.
Removed connection tracking for nodes in VesselInternals (will eventually replace with something better).
ArtemisPacket now exposes a timestamp property which contains the value of System.nanoTime() when the packet was constructed.
IAN now confirms that classes which have methods with the @Listener annotation are public.
BeamFiredPacket.autoFired is now called targetingMode, and returns a TargetingModeenum value instead of a boolean.
SpecialAbility.fromValue() will now return a LinkedHashSet so that you can be certain that the values will always be in the same order.
BaseMessage.STAND_BY_FOR_DOCKING has been renamed to BaseMessage.STAND_BY_FOR_DOCKING_OR_CEASE_OPERATION to reflect the fact that this message may be sent to an enemy base.
The labels have been removed from the enums which implement the CommsMessage interface, since the actual text to display to the human is an implementation detail that is the responsibility of the client (and which may be internationalized anyway).
Added validation to numerous constructors and methods.
A bunch of additions and improvements to comments.
The pom.xml now specified the source and target Java version (1.6) and provides the relevant GitHub, Travis CI, and license links.
Bug Fixes
Corrected parsing/writing bugs for the following packets: AllShipSettingsPacket, ConvertTorpedoPacket, GameMasterButtonPacket, GameMasterInstructionsPacket, GameMasterMessagePacket, KeyCaptureTogglePacket, ObjectUpdatePacket: ArtemisAnomaly, ObjectUpdatePacket:, ArtemisNebula, ObjectUpdatePacket: ArtemisNpc, ObjectUpdatePacket:, ArtemisPlayer, ObjectUpdatePacket: ArtemisGenericObject, SetShipSettingsPacket.
Fixed incorrect reading of short values (which fortunately wasn't used before now).
Fixed improper JamCRC hash computations.
Fixed problems with PacketReader reporting unused bytes when reading RawPackets.
Fixed improper color handling for generic meshes and nebulae.
Fixed incorrect parsing due to the v2.4.0 valueInt subtype shuffle.
AllShipSettingsPacket now properly declares the accentColor property as a float rather than an int (since you only set a hue, not saturation or brightness).
Mines, torpedoes, black holes, and asteroids will now properly update their type in updateFrom().
Fixed PerspectivePacket, which now only toggles perspective.
ArtemisNpc.fleetNumber is now Byte.MIN_VALUE when unspecified, since -1 is a valid value meaning "no fleet".
Internal Changes (no direct impact on users)
Packet classes now have the @Packet annotation, and the packet registration mechanism has been refactored to read from it and fabricate an appropriate PacketFactory. This resulted in a net reduction of almost 1,600 lines of boilerplate code.
BitField, PacketReader and PacketWriter no longer require representing the bits in a bit field with an enum (although you still can).
PacketReader now supports mixed-origin streams. Of course, this is not useful for reading data from a real server or client, as they'll only ever serve up packets of one Origin, but it is handy for reading captured packet data files that have packets from both sides.
BitFields now correctly compute their widths when the number of bits is divisible by 8. (Artemis allocates an extra byte in that scenario.) Packets with "fake" extra properties to deal with the extra byte were updated accordingly.
PacketWriter now requires you to pass in the ObjectType of an object to ensure that the correct packet is written (since ArtemisPlayer can be of four different types).
PacketWriter now allows writing a BoolState that isn't part of an object.
ValueIntPacket no longer needs the subtype passed into the constructor when passing in a PacketReader; it will just read the subtype from the stream.
Classes which don't conform to the ValueIntPacket payload structure were refactored to no longer descend from that class.
Removed the assumed default values convenience methods on PacketReader and PacketWriter, since they were rarely used.
Removed PacketWriter.writeObjByte(), which was no longer used.
Boatloads of new unit tests. Unit testing coverage has jumped to 81.1%.
Packet type hash constants have been converted to internal name strings, and the hashes computed via the JamCRC algorithm. This presents useful names to the person reading the code instead of a meaningless integers.
Internal changes to ArtemisPlayer to store upgrade and system statuses in separate objects.
Better messaging for incorrect path to a packet test file.
Matrix now supports equals() and hashCode().
Added some validation to ByteArrayReader constructors and methods.
Util class was made uninstantiable and has new public methods: containsAny(), caratToNewline(), newlineToCarat().
AbstractPacketTester was refactored to permit more granular overriding of the test process (done principally to support testing of unparsed packets).
Corrected Upgrade.getActivatedby() to getActivatedBy().
Removed name parsing from OtherParser, as with the named objects having been split off it was no longer used.
Protocol registrations and listener method invocations via reflection now throw ReflectiveOperationException instead of several more specific kinds (not that they'd ever get thrown anyway, since we pre-validate them).
Travis CI no longer supports openjdk6 and oraclejdk7, so .travis.yml was updated to make it happy.
Removed unnecessary synchronization on the ListenerRegistry.
Test code can reuse a Debugger instead of constructing new ones all the time.
Various minor fixes suggested by SpotBugs.
Miscellaneous small changes to accomodate unit tests and general code cleanup.
Fixed issues that were prevening JavaDoc generation. You want JavaDocs? You got JavaDocs!
README.md was reorganized to simplify individual sections.
Added some names to the thank-you list.
Added CONTRIBUTING.md, ISSUE_TEMPLATE.md, and PULL_REQUEST_TEMPLATE.md.