Add: GMCP authenticate spec implementation#7152
Conversation
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
… into add-gmcp-authenticate
|
Please update this so it will produce a fresh Mac build, thanks! |
|
/refresh links |
|
@mpconley there you go. |
|
It's updated, could you force reload the page? Mediawiki caching is a bit weird. I used Mermaid to put it together - see https://mermaid.live. Always been a plantuml fan, it's Java rendering engine doesn't make it suited for the web - and that's where mermaid steps in. Even GitHub can render mermaid diagrams native in markdown files. |
Co-authored-by: Marco Fontani <mf@marcofontani.it>
demonnic
left a comment
There was a problem hiding this comment.
Nothing in the code stands out as a bad idea, though you may want to wait for at least one review from a more practiced C++ coder than myself. Mudlet's and my own tests pass though so I'm giving it my thumbs up. 👍🏻
SlySven
left a comment
There was a problem hiding this comment.
I've only looked through the code on a C++ basis - whether it works or not is not something I can judge. I am not offering anything in regards to UI or Infrastructure "approval"...
src/GMCPAuthenticator.h
Outdated
| * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | ||
| ***************************************************************************/ | ||
|
|
||
| #pragma once |
There was a problem hiding this comment.
That may be the way of things nowadays but since we have not adopted it elsewhere, why not stick with the existing include-guards methodology?
src/GMCPAuthenticator.h
Outdated
| #include "post_guard.h" | ||
|
|
||
|
|
||
| class GMCPAuthenticator : public QObject |
There was a problem hiding this comment.
🤔 Is this class doing anything that requires it to be derived from the QObject class?
There was a problem hiding this comment.
Well, in that case you should use Q_DECLARE_TR_FUNCTIONS(GMCPAuthenticator) (see Q_DECLARE_TR_FUNCTIONS) at the top of the class declaration in the header file instead of the Q_OBJECT macro. For example - as used in the TRoom class.
There was a problem hiding this comment.
The alternative I gave is a "lighter-weight" one - which we(I) have used elsewhere in the project.
There was a problem hiding this comment.
This is premature optimisation for a class that's instantiated one per host... https://users.ece.utexas.edu/~adnan/pike.html. I don't think this is something we should be spending energy on.
src/Host.cpp
Outdated
| #include "TLabel.h" | ||
| #include "TMap.h" | ||
| #include "TMedia.h" | ||
| #include "GMCPAuthenticator.h" |
There was a problem hiding this comment.
Sorted into the right place? Maybe not!
Co-authored-by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Stephen Lyons <slysven@virginmedia.com>
|
Mudlet 4.17.2-testing-pr7152-476efbbc seems to be working out just fine with GMCP Authentication. Its the fastest I've ever seen Mudlet log into anything. Very nice work! However... I had originally set my game server to send a Char.Login.Result { "success": false, "message": "Bad GMCP Login Credentials." } message, and then "hang up" the connection, in the event of a good account name and bad password combination. I had the "automatically reconnect" flag set in the profile... and Mudlet proceeded to repeatedly and rapidly reconnect and fail over and over again, at a rate of about seven attempts per second. I think it would be a very good idea to have Mudlet break the "automatically reconnect" loop upon receipt of a Char.Login.Result failure message. |
|
We will consider such speed in Mudlets behalf to be good :) I have adjusted it not to reconnect upon authentication failure. |
Indeed! I had the same problem, and had about 8.4 reconnections/s (on localhost) on password failure without this patch... but to test it I had to explicity tick the reconnection tickbox, which doesn't seem to be the default - phew!
Sounds very good, thanks! |
| FontManager.cpp | ||
| GifTracker.cpp | ||
| TrailingWhitespaceMarker.cpp | ||
| GMCPAuthenticator.cpp |
There was a problem hiding this comment.
Are we doing away with the convention of putting a 'T' in front of our classes? Does it have a meaning?
There was a problem hiding this comment.
For the meaning I am not sure but the T prefix could stand for a "template" (but not a C++ template) for a class that isn't associated with a dialogue (those begin with dlg instead!) Incidentally when describing a container or method for an arbitrary class T on it's own is often used as the identifier of the class. E.g. (bool) QListIterator<T>::hasNext() to test to see whether an iterator into a QList<T> has a value it can get. So maybe appending things to that seemed logical, QListIterator<TMapLabel>::hasNext() when iterating though a QList<TMapLabel>?
There was a problem hiding this comment.
I don't see a reason continue tbh. I don't see a meaning behind it other than a Template which we don't use often.
SlySven
left a comment
There was a problem hiding this comment.
Well the changes I've suggested have pretty much been applied - apart from the one about the (better IMHO) alternative to the QOBJECT macro... once that has been done I am happy to approve it from a C++ POV. @demonnic seems to be happy with it. I dunno whether @Kebap has anything to say but I think this is getting close to being ready to
...
|
Thank you for the workaround for the booleans. This is working out as expected now. |
|
Good to merge now? Let's do this? :) -Tamarindo |
|
Done ✅ |
Extended the functions disabled by the login timeout to include the `sendCharacterName()` function - and allow the timer that provides that timeout to be stopped by the GMCP authenticator that Mudlet#7152 introduced. Such a stop also immediately disables those functions so that it will neutralise any scripts or triggers that would be using them. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Brief overview of PR changes/additions
Add the GMCP authenticate spec and client credentials: https://wiki.mudlet.org/w/Standards:GMCP_Authentication
Motivation for adding to Mudlet
To solve the issues we have in trying to login to games - not every game accepts "character\npassword" kind of login - while not getting into a security quagmire that comes with exposing passwords to the Lua subsystem.
Other info (issues closed, discussion etc)