Skip to content

Major Version 2.0

Compare
Choose a tag to compare
@SSS-Says-Snek SSS-Says-Snek released this 07 Apr 02:46
· 62 commits to main since this release
fb67244

Full Changelog: 1.2...2.0

After over two months, we have finally finished the biggest HiSock version since v0.0.1: Version 2.0! This release is huge, with 174 commits, 52 changed files, 5,464 added lines, and 3,331 deleted lines. A HUGE shoutout to @sheepy0125, as this release wouldn't have been possible without his contributions.

Now, without further ado, let's get into the changelog!

NOTE: As this release is major, there are some major API-breaking changes, which are marked with a bold asterisk. Please refer to the newly-updated documentation if you have any questions.

MAJOR BREAKING CHANGES

  • ( @sheepy0125 )* ThreadedHiSockClient and ThreadedHiSockServer's start_client() and start_server() have been renamed to start().
  • ( @sheepy0125 )* Both of the threaded client's and server's stop_client() and stop_server() have been renamed to stop().
  • ( @sheepy0125 )* Both of the threaded client's and server's receive methods have been replaced by recv(), also with a new API. Check the documentation and the examples for how to use the new method.

NEW

  • ( @SSS-Says-Snek ) A new reserved command *! This command would be sent whenever a command not handled by a client's functions is detected.
  • ( @SSS-Says-Snek )* start() for HiSockClient and HiSockServer! Instead of having to program a while loop themselves that calls update() or run() (which has now been privatized), all you have to do is to call client.start() or server.start().
  • ( @SSS-Says-Snek ) A keepalive for HiSockServer has been added! Every minute, the server sends a request to all clients to check whether they are active. If they aren't, they will be disconnected from the server. This functionality can be disabled via a parameter to the constructor.
  • ( @sheepy0125 ) on() has a new parameter override. If the event has the same name as a reserved event and this is True, it'd behave like a regular event listener.
  • ( @sheepy0125 ) The client and server now have a callback and error handling system! If a function is passed to the callback parameter in start(), the function will get called every time the client/server gets "updated" (_run() or _update() finish). Similarly, if a function is passed to the error_handler parameter in start(), the function will get called if the client/server ever encounters an exception.
  • ( @sheepy0125 ) Event listeners now have "dynamic arguments". Check the documentation and the examples for how to use this new feature.

IMPROVED

  • ( @sheepy0125 ) The entire codebase of HiSock has been refactored! Now, it is much cleaner and easier to understand than the previous release's codebase. Huge shoutout to @sheepy0125 again for spending his time on refactoring HiSock.
  • ( @sheepy0125, @SSS-Says-Snek ) Documentation of HiSock has also been massively improved!
  • ( @SSS-Says-Snek ) Improved cache by switching from dictionaries to instances of MessageCacheMember. Now, you can use the dot notation (e.g. cache.header) to access a cache member's contents.
  • ( @SSS-Says-Snek ) Changed client data parameter in functions from dictionaries to instances of ClientInfo. Now, you can use dot notation to access a client's info. You can also directly pass this to .send() and other related commands, instead of passing the IP attribute.
  • ( @SSS-Says-Snek ) Not passing any name in change_name() and change_group() resets the client to its original name.
  • ( @SSS-Says-Snek, For Contributors) Improved setup.py yet again, with new commands, more colors, and more debug information.
  • ( @sheepy0125, @SSS-Says-Snek, For Contributors) Refactored and added tests.

BUG FIXES

That's all for this release; it's been a while since we released the latest version, but we hope that HiSock improved with this version. Bye!