Skip to content

JRakNet v2.12.3

Latest
Compare
Choose a tag to compare
@whirvis whirvis released this 29 Nov 22:38
· 21 commits to master since this release
13b2874

The final version of JRakNet version 2. This version does little except mark the end of this major version and remove a constant that has been unused since its implementation in the ConnectionType class. For more information please refer to this commit. All previous versions except this one will have their tag deleted and will no longer be hosted for download.

However, this major version will still be supported. This means that if a bug is found in this version, it will be fixed and a new version will be released. However, no new features will be added. Instead, I plan to begin work on JRakNet version 3 which will overhaul the API to make it better in areas where I feel it is mediocre and could use improvements. If you wish to propose a change for JRakNet version 3, please create an issue in the repository with the tag "v3.0 proposal". I greatly appreciate any and all feedback!

Click here to see the changelogs for each release beforehand.

JRakNet v2.11.8 (April 1st, 2019)

This version of JRakNet completely overhauls the documentation, cleans up code, improves performance, and also adds some new features!

  • Revamped documentation. So much was redocumented that I will not bother to list it all here.
    • Removed the now unnecessary "doc" folder as the JavaDocs are now hosted on CodeMC.
  • Added many throws to methods for the sake of making sure methods are not incorrectly called. Once again, this was done to so many methods that I will not bother to list them all here.
  • Reworked many internals. I will not bother to mention all the changes with these either as they either simply clean up code or improve performance.
  • Update logging to make use of trace where needed to prevent debug spam.
  • Removed example classes and moved all contents from the com.whirvis.jraknet.example package to the com.whirivs.jraknet package.
    • Fixed some bugginess in both the chat server and chat client.
  • Listeners
    • Added ThreadedListener. This allows for listener event methods to be called on their own dedicated thread. In order to use this, all one has to do is annotate their listener class with it.
    • All client listener methods now take the calling client as the first parameter.
    • All server listener methods now take the calling server as the first parameter.
  • Client
    • Clients can now specify an address to bind to when connecting to servers via the constructor.
    • Renamed SessionPreparation to PeerFactory and reworked PeerFactory internals.
    • Moved exceptions relating to connection failure from the com.whirivs.jraknet.client package to the com.whirvis.jraknet.client.peer package.
    • Removed connectThreaded() method as the client will now always use its own thread.
    • Removed shutdown() method. Clients can now also disconnect from a server and then connect to another one.
  • Discovery
    • Decoupled discovery system from the client. Anything relating to discovery will now be found in the Discovery class or in com.whirvis.jraknet.discovery package.
    • Added DiscoveryListener. Like RakNetServerListener and RakNetClientListener, this listener class also supports the ThreadedListener annotation.
  • Peer
    • Sessions are now referred to as peers.
    • Added ability to set timeout for peers.
  • Server
    • Servers can now specify an address to bind to during startup via the constructor.
    • Servers can now automatically forward the port they are running on through UPnP via the forwardPort() method! Likewise, they can then have these ports closed via the closePort() method.
    • Renamed methods that ended with "client" by simply removing the "client" suffix. For example, disconnectClient() is now simply disconnect().
    • Removed startThread() method as the server will now always use its own thread.
    • Servers can now startup after they have already been shutdown.
  • Streams
    • PacketDataInputStream now supports readLine() and readUTF().
    • PacketDataOutputStream now supports writeLine() and writeUTF().
  • Added many new utility methods to the RakNet class such as the forwardPort() and closePort(). method.
  • Removed NoListenerException.
  • Removed MessageIdentifier, all of its' fields and methods can now be found in RakNetPacket.
  • Moved InvalidChannelException to the com.whirvis.jraknet package.
  • Removed all uses of streams for performance purposes.
  • Most likely more changes I cannot remember.
  • Fixed #105
  • Fixed #106
  • Fixed #107
  • Fixed #109
  • Fixed #110
  • Fixed #112
  • Fixed #113
  • Fixed #114
  • Fixed #117
  • Fixed #118
  • Fixed #119
  • Fixed #120
  • Fixed #121
  • Fixed #122
  • Fixed #123
  • Fixed #124

JRakNet v2.10.7 (August 3rd, 2018)

This release adds the ability to manage loopback exemptions using the UniversalWindowsProgram class that will now come pre-packaged with JRakNet. I decided to add this so server developers working on server softwares for games like Minecraft which run on the Universal Windows Program framework can have the server automatically enable loopback exemption itself so server owners can connect to their server even if it's running on the same machine as they are playing on.

  • Changed logging system from SLF4J to Log4J2
  • Moved all methods and fields from ArrayUtils and RakNetUtils to RakNet.
  • Renamed com.whirvis.jraknet.utils.map package to com.whirvis.jraknet.map.
  • Client
    • Loosened maximum transfer unit restrictions and handling during login as to prevent login from failing with third party servers with their own version of RakNet implemented.
  • Protocol
    • Bumped protocol version for both server and client from 8 to 9.
    • Improved MTU negotiation methods for both server and client.
  • Windows
    • Added UniversalWindowsProgram.
    • Added PowerShellCommand.
    • Added PowerShellAdministrativeClient.
  • Exceptions
    • Added PowerShellException.
  • Fixed #95
  • Fixed #97
  • Fixed #98
  • Fixed #99
  • Fixed #100

JRakNet v2.9.8 (February 17th, 2018)

This release is mainly an update that updates the root package and maven project settings to conform with my new domain, however there are some new features and bug fixes.

  • Updated project structure
  • Changed root package to com.whirvis.jraknet.
  • Made major changes to POM to allow for Jenkins builds on the CodeMC servers.
  • Client
    • Added removeExternalServer(DiscoveredServer).
    • Added getLocalServers().
  • Protocol
    • Rewrote the connection type system to be more flexible.
  • Fixed #71
  • Fixed #72
  • Fixed #74
  • Fixed #77
  • Fixed #78
  • Fixed #79
  • Fixed #82
  • Fixed #86
  • Fixed #93
  • Fixed #94

JRakNet v2.8.4 (November 23rd, 2017)

This release adds manual logging to using SLF4J thanks to CausticCoder along with fixing a few bugs and optimizations.

  • Replaced manual logging with SLF4J logging.
  • Server
    • The server now uses 97% less CPU (Determined on a machine using an Intel i7-6700K @4.0Ghz with 8 cores).
    • Servers can now have multiple listeners! Use addListener() to add a listener to the server and removeListener to remove a listener from the server.
    • Servers are now allowed to start without any registered listeners.
    • Setting the maximum connection count to -1 will now allow for an unlimited amount of players to connect to the server.
  • Client
    • The client now uses 99% less CPU (Determined on a machine using an Intel i7-6700K @4.0Ghz with 8 cores).
    • Clients can now have multiple listeners! Use addListener() to add a listener to the client and removeListener() to remove a listener from the client.
    • Clients are now allowed to attempt to connect to servers without any registered listeners.
    • Maximum transfer unit determination is now more consistent with the official RakNet specifications.
    • Removed addMaximumTranferUnit() and removeMaximumTransferUnit() methods, they have been replaced with setMaximumTransferUnits().
  • Protocol
    • Added JungleTree connection type.
    • Renamed getMaximumTransferUnit() method to getSize() in MaximumTransferUnit.
    • Renamed MCPEIdentifier to MinecraftIdentifier due to the 1.2 better together update redefining the the definition of Minecraft from the Java version to what was previously known as Pocket Edition or its C++ counterpart.
  • Utilities
    • Added ConcurrentByteMap.
    • Added ConcurrentShortMap.
    • Added ConcurrentIntMap.
    • Added ConcurrentLongMap.
  • Fixed #61
  • Fixed #63
  • Fixed #64
  • Fixed #69
  • Fixed #70

JRakNet v2.7.6 (August 8th, 2017)

  • Server
    • The server now makes use of the new logger system.
    • It is now possible to to get the protocol implementation of a client when a ping is received (E.G.: JRakNet, RakLib, JRakLib+, etc.)
    • Added handleUnknownMessage() to RakNetServerListener which can be used to implement RakNet protocol functionality that is not present in JRakNet.
  • Client
    • The client now makes use of the new logger system.
    • The client now uses the RELIABLE_ORDERED_WITH_ACK_RECEIPT reliability for it's NewIncomingConnectionPacket and waits until it is acknowledged before calling the onConnect() method.
    • It is now possible to to get the protocol implementation of a discovered server (E.G.: JRakNet, RakLib, JRakLib+, etc.)
    • Added handleUnknownMessage() to RakNetClientListener which can be used to implement RakNet protocol functionality that is not present in JRakNet.
  • Session
    • It is now possible to get the protocol implementation of a session (E.G.: JRakNet, RakLib, JRakLib+, etc.)
    • All sendMessage() methods now return a copy of the generated encapsuated packet, which can be used to detect when a packet has been sent or lost in the now functioning and undeprecated onAcknowledge() and onNotAcknowledge() methods.
  • Protocol
    • Fixed broken reliability IDs.
    • MessageIdentifier packet name's and ID's are now cached once instead of cycling through them every time a packet name or ID is requested with getName() or getId().
    • RakNetState has been converted from an enum to a regular class.
    • RakNetState equals() method will now return true if the state given to it has an order ID greater than or equal to it.
    • Changed all readU and writeU function prefixes to readUnsigned and writeUnsigned in the Packet
      class.
    • Added writeUnsignedLong() and readUnsignedLong() functions.
  • Utilities
    • Added toHexStringId() method which can be used to easily get ID's according to the "0xXX" format.
    • Added RakNetLogger, which can be used to debug and is enabled through the RakNet class.
      equal to it.
  • Tests
    • All tests now make use of the new logging feature.
    • ChatServer
      • Added "help" command.
      • All commands now have descriptions, which are used by the "help" command.
  • Fixed #41
  • Fixed #43
  • Fixed #44
  • Fixed #45
  • Fixed #47
  • Fixed #48
  • Fixed #49
  • Fixed #50
  • Fixed #51
  • Fixed #52
  • Fixed #53
  • Fixed #54
  • Fixed #55
  • Fixed #59

JRakNet v2.6.6 (February 21st, 2017)

  • Server
    • Added handleNettyMessage() to allow implementation of modified protocols that do not interface with the main server protocol.
    • The onAddressBlocked() method now has an argument for the reason as to why the address was blocked.
    • Renamed sendRawMessage() to sendNettyMessage().
    • Renamed handlePacket() to handleMessage().
    • Publicized sendNettyMessage().
    • Deprecated onAcknowledge().
    • Deprecated onNotAcknowledge().
  • Client
    • Added handleNettyMessage() to allow implementation of modified protocols that do not interface with the main client protocol.
    • Renamed sendRawMessage() to sendNettyMessage().
    • Renamed handlePacket() to handleMessage().
    • Publicized sendNettyMessage().
    • Deprecated onAcknowledge().
    • Deprecated onNotAcknowledge().
    • Removed UseSecurityException.
    • Removed EncryptionEnabledException.
  • Bundles
    • All server and client bundles must set the listener to themselves before starting from now on. This is what helped fix bug #38 and will also prevent confusion for newcomers in the future. An easy way to do is to call setListenerSelf() before calling start(), you can even do setListenerSelf().start() to make it fit all into one line!
  • Utilities
    • Added documentation to the ByteMap, ShortMap, IntMap, LongMap, and DynamicKey classes.
  • Examples
    • Fixed broken server ID in RakNetServerExample that would cause an infinite amount of the server to appear in the MCPE server list.
    • Fixed client example so that it uses the shutdown() method instead of System.exit() when it disconnects from the server.
  • Fixed #29
  • Fixed #30
  • Fixed #31
  • Fixed #32
  • Fixed #34
  • Fixed #35
  • Fixed #36
  • Fixed #38
  • Fixed #39
  • Fixed #40

JRakNet v2.5.1 (December 27th, 2016)

  • Exceptions
    • Updated exception messages.
    • Updated exception packages.
  • Server
    • If a client attempts to rejoin the server while it is logged in, the connection is reset and the existing session is removed with the reason "Client reinstantiated connection".
    • Finalized all server methods that do not need to be overridden by the API.
    • The startThreaded() method now catches all Throwables instead of just Exceptions.
    • The causeAddress for handler exceptions is now cleared after the packet has been successfully handled with no errors.
    • Added ability to listen for exceptions thrown by session using the onSessionException() method.
    • Renamed stop() method to shutdown().
  • Client
    • Finalized all client methods that do not need to be overridden by the API.
    • The startThreaded() method now catches all Throwables instead of just Exceptions.
    • The causeAddress for handler exceptions is now cleared after the packet has been successfully handled with no errors..
    • Added ability to add and remove maximum transfer unit's for more flexible login.
    • Added sort() method to the MaximumTransferUnit class.
    • RakNetClientTest now waits until it recieves an ACK or NACK packet before disconnecting and shutting down
  • Packet
    • Added flip() method.
    • Added setBuffer() method in Packet and RakNetPacket.
  • Fixed #21
  • Fixed #22
  • Fixed #23
  • Fixed #24
  • Fixed #26
  • Fixed #27
  • Fixed #28

JRakNet v2.4.2 (December 17th, 2016)

This update is mostly an internal rewrite of the RakNetSession class, and the results are astounding to how much faster data sends! There are also some new features, too :)

  • RakNetSession
    • Cleaner and now optimized to run much faster.
    • Added setKeepAliveState() and getKeepAliveState() which allows for the user to set when the session should start checking to make sure the client is still alive. This is useful for games that have logins that go farther than the stock RakNet connection. An important note is that latency detection will be disabled if keep alive is also disabled (Set the keep alive state to -1 to have it disabled no matter what state the session is in).
    • Added getInetAddress(), which returns the InetAddress of the session.
    • Added getInetPort(), which returns the port of the session.
    • Moved some of the variables from RakNetSession to RakNet.
    • At the moment, onPacketAcknowledge() and onPacketNotAcknowledge() are existent functions but are never called due to how finicky they can be at the moment. I have yet to decide whether or not to deprecate these or actually implement their functionality.
  • RakNetServer
    • Added onClientPreDisconnect() which allows the server to listen for login failures.
  • Protocol
    • Removed acknowledge receipt support.
    • Removed AcknowledgeReceipt class.
    • Removed AcknowledgeReceiptType class.
    • Added getSplitIndex(), getSplitCount(), getReliability(), needsSplit(), and splitPacket() methods.
  • Utilities
    • Added the DynamicKey class, which allows keys to be easily renamed in map types that support them
  • Removed many unneeded "synchronized" method modifiers.
  • Fixed #14
  • Fixed #15
  • Fixed #16
  • Fixed #17
  • Fixed #20

JRakNet v2.3 (December 3rd, 2016)

  • Client
    • Added the ability for clients to ping external servers.
    • RakNetClient is now able to return it's own protocol version.
  • Server
    • RakNetServer can now enable and disable broadcasting, it is enabled by default.
  • It is now possible to retrieve the release version, major version, and minor version of JRakNet through the RakNet interface.
  • Fixed #13

JRakNet v2.2.5 (November 27th, 2016)

This release makes some changes that I overlooked in version v2.2.4, it's not a bug fix update but more tweaks.

  • Changed root package from net.marfgamer.raknet to net.marfgamer.jraknet.
  • Added documentation to some classes and methods that previously did not have it.
  • Removed pesky main(String[] args) methods I forget to remove after testing in non-test programs.

JRakNet v2.2.4 (November 25th, 2016)

This update is just some small features and fixes like v2.2

  • Client
    • Client is now able to shutdown.
  • Session
    • Added getLastLatency() method.
    • ID_DETECT_LOST_CONNECTIONS is now used in place of CONNECTED_PING to make sure connections are not lost.
    • Latency detection is now optional for sessions (These still use CONNECTED_PING, and is enabled by default)
    • Disconnection reasons are now more consistent and cleaner.
  • Packets
    • Added clear() method, which removes all the data from the read and write buffers.
    • Added the Failable interface, which is implemented by packets critical to connection or login. If the failed() method returns true after it has been encoded or decoded something has gone wrong.
    • The writeAddress() and readAddress() now throw UnknownHostException instead of returning null when encountering such an error.
    • Removed the DisconnectionNotification packet class.
  • Tests
    • RakNetClientTest now calls disconnectAndShutdown() instead of disconnect().
  • Fixes

JRakNet v2.2 (November 23rd, 2016)

In this release, I added a few new features and fixed some nasty bugs :)
Here is the list of changes and additions to this release:

  • RakNetClient now implements RakNetClientListener, allowing classes to extend it and act as all in one bundles!
  • RakNetServer now implements RakNetServerListener, allowing classes to extend it and act as all in one bundles!
  • Packet
    • Fixed IPv6 reading/writing.
  • Identifiers
    • Fixed MCPEIdentifier, timestamp should've been server GUID.
    • Fixed identifier inconsistencies between tests and examples.
  • Examples
    • Added client bundle example.
    • Added server bundle example.

JRakNet v2.1 (November 10th, 2016)

This is a minor update that adds a few new features and fixes a bug or two :)

  • Session
    • Added onNotAcknowledge() method for RakNetClientListener and RakNetServerListener
  • Protocol
    • Fixed the ConnectionBanned (0x17) packet.
    • Added getDataInput() and getDataOutput() to the Packet class, allowing them to act as input streams or output streams.
  • Documentation
    • Removed the unnecessary -s from the @param tag definitions.

JRakNet v2.0 (November 6th, 2016)

JRakNet 2 has been finished, and over 7 weeks early too! This version contains all the features of the last, but improved! However, it is more reliable, has significant speed increases, and more!