Author Topic: Include version string in IRC real name  (Read 2504 times)

ctz

  • Summoner
  • **
  • Posts: 46
  • aka cathaur, formerly lyra
    • View Profile
Include version string in IRC real name
« on: 16 September 2013, 06:52:35 »
It is not possible to easily determine the MegaGlest version of a player with the name MG_name_### in the #megaglest-lobby channel.  As a result, one may possibly ask to play a game, only to find that the versions are incompatible.

Currently, this is the result of a /whois on a MegaGlest client:
Code: [Select]
/whois MG_lyra_68
MG_lyra_68 [~MG_lyra_6@(host)]
realname : megaglest
channels : #megaglest-lobby
[...]

The current "real name" of all MegaGlest clients is "megaglest".  Adding the version string to the IRC "real name" (e.g. so that it is "megaglest 3.8.0-beta1" in the case of the current beta version) may make it easier to determine a player's MG version--just do a /whois.

It's not possible to do a /whois from within MegaGlest, but this might still be useful to people who sit around in the channel with their IRC clients.

Implementation of this should require adding the version string to the last argument of irc_connect in source/shared_lib/sources/platform/posix/ircclient.cpp lines 790 and 1001.

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Include version string in IRC real name
« Reply #1 on: 16 September 2013, 17:06:14 »
I'd like to see version numbers in the realname field, too.

FreeNode runs ircd-seven, their fork or the charybdis IRC server. According to ircd-seven's ircd_defs.h (compare to charydbis ircd_defs.h) the maximum realname length is 50 characters.

This is definitely enough to squeeze in both the game version, and most likely the compiler, too.
Code: [Select]
$ echo -n '|v12.12.12-beta12|GNUC: 40403 [64bit]|' | wc -c
38

It may even suffice to also add the build time (and date) stamp, but it may be necessary to format this as a Unix epoch to save space.

Code: [Select]
$ echo -n '|v12.12.12-beta12|GNUC: 40403 [64bit]|Jun 25 2013 22:02:29|' | wc -c
59

$ echo -n '|v12.12.12-beta12|GNUC: 40403 [64bit]|1372190549|' | wc -c
49

We need to be careful about the compiler string, though, since it can vary much, so maybe it'd be better to put this last, i.e. to have |VERSION|BUILD TIMESTAMP|COMPILER| as in
Code: [Select]
|v12.12.12-beta12|1372190549|GNUC: 40403 [64bit]|.

I have a feeling I brought this suggestion up with softcoder before, though, and that he said this would require patching the 3rd party library we depend on for the IRC code (and maintaining those patches) which he'd prefer not to. It would be good to have this repeated or corrected here because my memory is flaky.

Another option would be to replace the lobby group chat by one run by either the clients themselves (peer-to-peer, but this involves NAT issues, so rather not), or XMPP (AKA "Jabber", a more modern protocol than IRC) with the MUC (multi-user chat) extension. I would think that libpurple provides both.

It could also be something running on the masterserver, maybe something HTTP like/compatible. Ideally the transport layer should be push, not pull though, such as websocket (and maybe 'activity streams' for the application/message protocol). This, however, would add plenty of new client (game) dependencies which aren't nice either.

The upside of both XMPP/MUC (over BOSH or websocket) or some other application protocol based on websocket would be that it's usually easy to connect to it from a web application (yes there are also web clients for IRC but those are technologically awful).

Yet another option for push-style group chats is SIMPLE (based on SIP), but I think this is actually a misnomer.

If we should ever shift to another protocol for the lobby chat (I don't really see this happening any time soon due to the extra dependencies it would introduce and the limited improvements it would provide), we should think about whether, and if so, how this should also be used during the game setup phase and / or in-game.

Back on topic: For now I guess we need to keep it simple, which may mean not having additional client information in the realname field.
« Last Edit: 16 September 2013, 17:19:25 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

ctz

  • Summoner
  • **
  • Posts: 46
  • aka cathaur, formerly lyra
    • View Profile
Re: Include version string in IRC real name
« Reply #2 on: 19 September 2013, 03:46:35 »
I implemented this.  No need to patch a 3rd party library.

Here is the result of a whois:
Code: [Select]
/whois MG_lyra_297
MG_lyra_297 [~MG_lyra_2@(host)]
realname : MegaGlestv3.8.0-dev|r4548M|Linux-X64|GNUC: 40703 [
channels : #megaglest-lobby
[...]

The realname includes the version, SVN revision, platform, and compiler.  As you can see, the compiler string is incomplete because didn't fit in 50 characters.  Some space could be saved by removing "MegaGlest" I suppose.

Here is a diff of the changes I made:
(click to show/hide)

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: Include version string in IRC real name
« Reply #3 on: 2 October 2013, 17:45:16 »
Personally I think it would be better to have the version string on a separate field, or combined with the svn revision, i.e. one of these:
Code: [Select]
MegaGlest|v3.8.0-dev|r4548M|Linux-X64|GNUC: 40703
MegaGlest|v3.8.0-dev+r4548M|Linux-X64|GNUC: 40703

Other than that I like this change (but cannot comment on the patch). If merged, it would also provide the foundation for removing the MG_ prefix off the nickname field.

There is one more field we can play with, which is the IRC username (~ + 9 characters). Currently this is just a (usually cut off) copy of the nickname. Instead, this could contain the random numbers which are currently part of the nickname. Or, maybe better, it could contain the MegaGlest (exactly 9 characters) identifier, allowing for more usable space in the real name field (which could then start with the 1 to 3 character sized random number).

That's a lot of back and forth, so here's what I think would be best:

username: ~MegaGlest (fixed)
realname: random number {1-3} + | + version string (variable length) + | + platform string (variable length) + | + compiler string (variable length)
nickname: player name (variable length)

realname and nickname may be cut off, depending on the total length of its elements.

Example:
username: ~MegaGlest
realname: 123|v3.8.0-dev|r4548M|Linux-X64|GNUC: 40703
nickname: Tom_Reynolds

Edit:
Hmm, nope, this doesn' work either, since we need unique nicknames not just amongst our userbase but also amongst all of the Freenode network. If someone will use a simple player name like Tom then it's pretty certain this is already taken by someone else on Freenode. So we can't get rid og the MG_ nickname prefix, but this doesn't impact the patch discussed here at all.
« Last Edit: 2 October 2013, 18:12:09 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Include version string in IRC real name
« Reply #4 on: 29 October 2013, 09:48:03 »
MG_ is used to seperate "normal" irc users from users inside the MG lobby.
So all in all I like Lyras way the best for the moment.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 474
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: Include version string in IRC real name
« Reply #5 on: 15 March 2017, 20:41:03 »
A good suggestion. This was recently implemented by titi, post v3.13.0 release

Closing.,,


 

anything