📄 changes
字号:
4) Typing notification no longer requires an AWT component ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~To support clients which do not use AWT, it is now possible to specify 'null'as the AWT key event source when registering a typing notifier. A new method,keyTyped(), is used to manually inform the session when a key has been pressed.(Actually, this method will also work even if you register an AWT component,as a way of sending bogus key presses. You shouldn't have any need to useit, however, if a genuine key event source is already registered.) 5) Session.getCookies() and NetworkConstants.COOKIE_x ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This new method returns an array of sessions cookies, as set at login time.There are three constants in the NetworkConstants interface, which correspondto the positions in the array of the Y, T and C cookies.6) Invisible login fixed ~~~~~~~~~~~~~~~~~~~~~The bug which transmitted "Is Back" regardless of what status you'd setbefore login (available or hidden) has finally been fixed. It now sends"Is Away" if hidden.7) Exception chaining ~~~~~~~~~~~~~~~~~~YMSG9BadFormatException now chains the execption which caused it.8) logoffReceived() renamed connectionClosed() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~There has been a number of changes to the way this API reports closed/broken/lost connections. logoffReceived() in the SessionListener has hada name change to reflect its broader use. The connectionClosed() methodwill now be called:(a) Shortly after logout() is called, to signal the actual close of the connection.(b) Sometime before or after login() returns, after a failed login attempt.(c) If the network connection is broken unexpectedly.(d) If Yahoo has logged us out (ie. because we logged in with the same account elsewhere).9) Various bugs fixed ~~~~~~~~~~~~~~~~~~A handful of problems fixed, keeping up with the 'bugs' section of the Project page.************************************************************************* ** Version 0.31 ** *************************************************************************------------------------------------------------------------------------Major changes------------------------------------------------------------------------1) V10 Challenge/Response fixed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~New AUTH packed encoding now fixed. You can now log in once more.2) Swing Test Client ~~~~~~~~~~~~~~~~~Alternative test client using Swing. Log into a chat room to see ademo of how styled text and smiley's can be displayed using the support API.3) Chatroom bug ~~~~~~~~~~~~A bug where user details didn't match their usernames has been fixed(maybe!). It was while I was testing this that I realised Yahoo hadchanged the AUTH packet (see 1 above). I've had no time to test thechanges - I wanted to get a working API back out ASAP.4) Anti-Spam class ~~~~~~~~~~~~~~~It's new and had minimal testing. As yet this class is 'unofficial' -I won't bother to Javadocs it just yet, as I hope it will change and expand in time for the next release. However - if you want to play with it, see the source code for details. (At the moment all it does is stop repeat messages, ie. in chat rooms...!)************************************************************************* ** Version 0.3 ** *************************************************************************------------------------------------------------------------------------Introduction------------------------------------------------------------------------Because of the deadline of Sept 24th (see below) I've had to rush this release out a little early. There are one or two minor bugs I know of,one involving receiving an unknown packet during login (seems to be a consequence of moving the protocol field in the header from 9 to 10) and there is still an outstanding issue regarding logging in with a hidden status.*** HOWEVER *** This release has had some fairly important internalchanges which, because of the deadline, I've only been able to giveminimal testing to. IT IS THEREFORE ADVISED THAT BEFORE MOVING ANEXISITNG PROJECT TO V0.3, YOU TAKE A COPY OF YOUR CURRENT SOURCETREE SO YOU CAN REVERT BACK TO V0.2 SHOULD V0.3 PROVE TOO BUG FILLED OR UNSTABLE.I will try and get an update (0.31) out with any remaining issues sorted ASAP.Btw: For those of you who asked, jYMSG is under the GPL license.Also, I've decided that the 'offical' short name of the API is "jYMSG" (with a lowercase 'j', to be trendy!). As the API is no longer limited to version 9 of the protocol, I've dropped the '9' reference. I'll try and undate the docs and web site as and when... :-)ps. If you want your project linked to on the web site, contact me via the usual channels.------------------------------------------------------------------------Major changes------------------------------------------------------------------------1) Test client ~~~~~~~~~~~A new test client has been created, easier to use and extend.2) Identifiers ~~~~~~~~~~~The use of plain String's to identify high-level data objects has been replaced with the objects themselves. So, for example, where once a Yahoo user would be represented by a String object containing their id, they are now represented by a YahooUser object itself (the getId() method can be used to determine the user's id). Likewise, where once stringswere used to refer to conferences, now the full-blown YahooConferenceobject is used instead.The reasoning behind this is simple: some parts of the API *have* toaccept and/or return high-level objects by their very nature, while some still return String's and expect you to look up the high-level object yourself from the id string. To standardise method parameters and returns, the use of high level objects has been adopted throughout.There are only a handful of exceptions, the most important being 'from' and 'to' fields in SessionEvent have remained as String's. Some othermethods to do with groups have retained their use of String too (fornow!)3) Chatrooms ~~~~~~~~~Chat support has been added, with the introduction of several new methods to the Session class, and a handful of event, exception and data objects specific to chat.4) Public constructors ~~~~~~~~~~~~~~~~~~~Exceptions and other data objects (YahooUser, YahooChatRoom, etc) nolonger have public constructors. Only the API itself should be able tocreate instances of these classes, and why the constructors were madepublic in the first place is beyond me (probably oversight on my part!) as no client should be required to create its own data orexception objects.5) Conversion to HTML etc. ~~~~~~~~~~~~~~~~~~~~~~~The convertion method which used to live in SessionEvent has been deleted (as forewarned!) and replaced with a much more flexible new scheme housed in its own package "ymsg.support" which hopefully will grow to support translation of Yahoo data to and from different formats, and also handle smiley strings.It is early days for this new package, but already it offers greater and more flexible functionality than what it replaced.6) September 24th ~~~~~~~~~~~~~~Yahoo has recently started urging users to upgrade to the latest version of their messenger software, pending a withdrawal of their server forolder protocol versions. To the best of my knowledge the API should besafe in all but one regard - it shows the old version '9' as part of its packet headers. With 0.3 the API has been updated to display 10 as its version in packet headers.(To update previous versions of the API, simply change the first byte ofVERSION and HTTP_VERSION in NetworkConstants.java to be 0x0a, instead of0x09. Or... take the NetworkConstants.class file from the 0.3 Jar andinsert it into the 0.2 Jar - it should still work!)7) Groups and user lists ~~~~~~~~~~~~~~~~~~~~~Objects which contain lists of users now use a standard getMembers()method to access a clone of the list. The getUserAt() method of YahooGrouphas been removed - it was not thread safe as the list could be updated during an iteration over the groups list of users. The prefered route nowis to use getMembers() to create a snapshot of the membership, and then iterate over that cloned list instead.8) Session.getUsers() ~~~~~~~~~~~~~~~~~~Used to return a hash of users who were on the friends list. Now the hashcontains *all* users which the API knows about. This includes contacts,chatroom users (past and present, throughout the lifetime of the session),etc, etc.A new method compliments getUsers() ... simply called getUser(), it returnsthe YahooUser object for the requested id (or null, if unknown). YahooUser yu = session.getUser(friend); if(yu!=null && yu.isFriend()) // Do somethingNote: YahooUser has a new method isFriend(), which returns true if thatuser is currently in one or more groups of the friends list.9) FailedFileTransferException renamed to FileTransferFailedException ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Reads much better. ;-)10) Jar files ~~~~~~~~~There are now three Jar files. One for the ymsg.network.* packages,one for ymsg.support package (which requires a version of Java withSwing) and finally the test client now has its own Jar file.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -