Page 1 of 1

[1.1] zfc9000 - text based RCON utility

Posted: Tue Dec 16, 2014 2:27 am
by Dusk
Image

ZFC9000 is a text-based RCON utility. It is fully textual, and as such may be used over SSH connections for instance. It supports in-game colorcodes, input history + a subset of readline shortcuts. It also features a nicklist on the right side of the screen, as well as tab auto-completion.

To use, either:
  • use the command line: zfc9000 <address> <password>
  • use Ctrl-N within the application to create a new connection
Source code here: https://bitbucket.org/crimsondusk/zfc9000
Downloads here: https://bitbucket.org/crimsondusk/zfc9000/downloads

Let this prove useful for server admins.
Thanks to TerminusEst13 for helping name this.

RE: [1.0] zfc9000 - text based RCON utility

Posted: Tue Dec 16, 2014 7:35 pm
by Monsterovich
Hm... How Can I fix this?
[spoiler]

Code: Select all

[  6%] Building CXX object CMakeFiles/zfc9000.dir/sources/coloredline.o
In file included from /disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/main.h:37:0,
                 from /disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/coloredline.h:32,
                 from /disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/coloredline.cpp:31:
/disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/format.h: In function ‘String make_format_argument(size_t)’:
/disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/format.h:46:57: error: call of overloaded ‘from_number(size_t&)’ is ambiguous
 FORMAT_OVERLOAD (size_t) { return String::from_number (a); }
                                                         ^
/disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/format.h:46:57: note: candidates are:
In file included from /disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/main.h:34:0,
                 from /disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/coloredline.h:32,
                 from /disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/coloredline.cpp:31:
/disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/mystring.h:108:16: note: static String String::from_number(int)
  static METHOD from_number (int a) -> String;
                ^
/disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/mystring.h:109:16: note: static String String::from_number(long int)
  static METHOD from_number (long a) -> String;
                ^
/disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/mystring.h:110:16: note: static String String::from_number(long unsigned int)
  static METHOD from_number (unsigned long a) -> String;
                ^
/disk/Distfiles/crimsondusk-zfc9000-8f47c682e248/sources/mystring.h:111:16: note: static String String::from_number(double)
  static METHOD from_number (double a) -> String;
[/spoiler]
Dusk wrote:Downloads (i.e. a simple binary I compiled) here:
I couldn't run the binary, because it's for x86_64. D:

RE: [1.0] zfc9000 - text based RCON utility

Posted: Tue Dec 16, 2014 9:26 pm
by Dusk
Can you check if applying this fixes the issue?

RE: [1.0] zfc9000 - text based RCON utility

Posted: Tue Dec 16, 2014 9:37 pm
by Monsterovich
Dusk wrote: Can you check if applying this fixes the issue?
Yeah your patch works. Thank you!

RE: [1.0] zfc9000 - text based RCON utility

Posted: Thu Dec 18, 2014 7:52 pm
by DevilHunter
This is awesome, and Yes I know its new still but very basic. Have yet to test this out fully however...

RE: [1.0] zfc9000 - text based RCON utility

Posted: Tue Dec 23, 2014 9:54 am
by DevilHunter
Hmm.. Upon further testing this.. I come to figure out, that if you open another screen like, screen -dmS Rconzfc , then screen -raAd Rconzfc.. and then cd into its directory then do the ./zfc9000 IP:Port RconPass , then the CTRL + Q cmd does not work. CTRL + N works, but that's it.

No clue as to why this happens.

RE: [1.0] zfc9000 - text based RCON utility

Posted: Wed Jul 22, 2015 6:37 pm
by Leonard
I managed to get a fully functional build for windows.

Image

I however encountered a few little problems:
  • The console would immediately close at startup. I had to remove the "FreeConsole" call in the _WIN32 def. Not sure why you added this, it works fine on the default console.
  • Pressing enter wouldn't work.
    Simple fix, this is because windows linebreaks are different from linux (0x0D + 0x0A instead of just 0x0A) so I just had to add case '\r': on top of case '\n':.
  • The colors didn't work at all.
    The fix was very simple again, I simply needed to use the proper type (chtype instead of int) when using Interface::color_pair.
  • After fixing the colors, they were mixed up. I don't know why, but blue was swapped with red and yellow was swapped with cyan so I just changed the color enums.
I made a patch if you wish to include it and make zfc a bit more compatible with windows with all those changes except for the color enums reordering as that would probably break on linux instead, I hope maybe there's a define in curses.h that could fix this.
Here's a link to the compiled exe if anyone want it.

RE: [1.0] zfc9000 - text based RCON utility

Posted: Wed Jul 22, 2015 8:21 pm
by Dusk
Ah, interesting.

The FreeConsole() call exists because pdcurses-win32a uses its own window for the application. So there will be both a console window and a pdcurses window if the console window isn't removed. I guess that needs to be ifdef'd.

What curses library did you use?

RE: [1.0] zfc9000 - text based RCON utility

Posted: Wed Jul 22, 2015 8:42 pm
by DevilHunter

Code: Select all

C:\home\skulltag\zfc9000-1.0>ldd zfc9000
        linux-vdso.so.1 =>  (0x00007fff6b9fc000)
        libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007f690b292000)
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f690b069000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f690ad64000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f690ab4e000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f690a788000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f690a583000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f690a27d000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f690b4d0000)
(yes I'm aware it says C:\home\skulltag\zfc9000 MiFU made it to where it looked like a dos shell. And that its still "skulltag" Dunno, ask MiFU on that one, guess hes not used to naming the folder Zandronum)

Appealingly, this still happens on Linux. In Windows, it works just fine. Also when I fire it up on linux, it will say "Unable to initialize color pair 81 (-1, -1)" I'm using zfc9000 1.1-3c02a72 (4361621) built from source.

RE: [1.0] zfc9000 - text based RCON utility

Posted: Wed Jul 22, 2015 8:51 pm
by Ænima
Cool! Now to compile it for Android ...

RE: [1.0] zfc9000 - text based RCON utility

Posted: Wed Jul 22, 2015 9:49 pm
by Leonard
Dusk wrote:What curses library did you use?
I just used the standard (?) PDCurses distribution.

RE: [1.0] zfc9000 - text based RCON utility

Posted: Wed Jul 22, 2015 11:17 pm
by Dusk
I've taken and addressed these issues now. I've also added support for MSVC 2010 and greater. I'm thinking about tagging 1.1 now if nothing bad arises.
Ænima wrote: Cool! Now to compile it for Android ...
If you have a shell account somewhere, you can use e.g. ConnectBot to ssh in and use zfc9000 from that. Administering servers from your phone, anyone? :P
DevilHunter wrote: linux-vdso.so.1 => (0x00007fff6b9fc000)
I don't know what linux-vdso.so.1 is but googling it yields some stack overflow links, e.g. http://unix.stackexchange.com/questions/45277
Unable to initialize color pair 81 (-1, -1)
Hrm, let's see about that.

RE: [1.0] zfc9000 - text based RCON utility

Posted: Wed Jul 22, 2015 11:53 pm
by Combinebobnt
Nice black text on a black background

RE: [1.0] zfc9000 - text based RCON utility

Posted: Thu Jul 23, 2015 11:09 am
by Monsterovich
Combinebobnt wrote: Nice black text on a black background
Background translucency ftw, but not in Windows console.

P.S.

Replace "max" with "zfc::max" to fix this error.

Code: Select all

/disk/Distfiles/zfc9000/sources/main.cpp: In function ‘int main(int, char**)’:
/disk/Distfiles/zfc9000/sources/main.cpp:90:30: error: ‘max’ was not declared in this scope
    highest = max (highest, fd);

RE: [1.0] zfc9000 - text based RCON utility

Posted: Mon Jan 11, 2016 1:14 am
by Dusk
Alright, version 1.1 has finally been released. Features:
  • Now works on Windows, a prebuilt binary is provided. Should work on XP upwards.
  • Supports tab-autocompletion, a feature provided by Zandronum 2.0 and newer servers (unfortunately 1.x support was lost in this because of short-sightedness in the RCON protocol. Oh well, who uses that anyway?)
  • Added some basic IRC-like commands: /connect <address> <password>, /disconnect and /quit. It should be obvious what these do.
  • ZFC's own messages are now printed in blue so that they can be distinguished from the remote server's messages
  • Alt+backspace now removes the word before the text cursor.
  • Pressing Ctrl+Q now disconnects from the server. Pressing it again while disconnected quits ZFC.
Download

RE: [1.1] zfc9000 - text based RCON utility

Posted: Mon Jan 11, 2016 1:36 am
by Tiger
This is rather cool, no joke. Now we have the GUI methods and now - the CUI for those that prefer it. Good luck with this project

RE: [1.1] zfc9000 - text based RCON utility

Posted: Mon Jan 11, 2016 1:44 am
by Dusk
I guess it works as a preference but the reason it exists is accessibility. If you can ssh, you can admin servers, and a lot of things can ssh nowadays. With a shell account you can admin servers from e.g. your phone.

EDIT: Went and did exactly that:
Image