Jump to content
Eternal Lands Official Forums
freeone3000

ELChat2

Recommended Posts

ELChat2? Why the "2"?

elchat, originally developed by Wytter, was a chat-only implementation of the Eternal Lands protocol, favored by those on slow computers or with outdated graphics cards. However, it has since become difficult to maintain due to changes in the protocol and the platforms involved.

 

My Project

As a replacement for elchat, I have developed ELChat2, an unofficial chat-only client. It currently reads system-wide el.ini for options, supplemented with its local el.ini, parses the local server.lst for configuration and connection options, and fully supports the EL Protocol bindings. (Most actions are unsupported, and only a limited set of client-side commands are implemented) It uses an entirely new implementation of the EL Protocol, asio (Which fixes the intermittent issues elchat had with SDL_Net).

 

Code

Code is http://bitbucket.org/freeone3000/elchat2/overview/ (Mercurial repository)

Packaged builds are http://bitbucket.org/freeone3000/elchat2/downloads/

 

Tech Details:

The client sends five types of packets: LOG_IN, HEART_BEAT, PING_RESPONSE, SEND_PM, and RAW_TEXT. There is no support for any more commands to be sent through the user interface. It is clearly flagged as an illegal, as it sends neither SEND_OPENING_SCREEN or SEND_VERSION. This is intentional, as long as it is not an officially-allowed client. As the server defaults to "test" instead of "main", playing with it on the test server should be fine.

 

Due to the feature restrictions (chat-only, curses-based ui) it uses much fewer system resources than el.exe. EL.exe here uses about 110MB RAM in console. ELChat2.exe uses about 1.5MB. In addition, ELChat2.exe uses nearly no processing power and immeasurably small amounts of graphical resources.

 

Proposal to Users

I submit this for public user testing. Compiled binaries for linux and win32 will be available within the week. Please, mention ALL issues on this thread, so that they can be fixed as soon as possible. I am also taking (reasonable) feature requests.

 

Proposal to Admins

Once this client has proven its user-friendliness, stability, and usefulness to your satisfaction, I humbly ask that you consider a method to confirm this as a legal, secondary client. The lower system requirements and wider range of platforms (all POSIX + Win32) will allow more to connect, chat, and enjoy than otherwise could.

Edited by freeone3000

Share this post


Link to post
Share on other sites

How's this project going?

 

I just tried it and was unable to compile. The provided build.sh didn't work, ELNetworkLib/ELClient.h (tries) to include chat_gui.h but cannot find it. I tried putting a copy of chat_gui.h in the ELNetworkLib directory and it got further, but still errors.

 

/tmp/cc2vxBtA.o: In function `elchat2::on_text(elnetworklib::Client*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
callbacks.cpp:(.text+0x1da): undefined reference to `elchat2gui::get_gui()'
/tmp/cc2vxBtA.o: In function `elchat2::actor_added(elnetworklib::Client*, std::vector<unsigned char, std::allocator<unsigned char> > const&)':
callbacks.cpp:(.text+0x478): undefined reference to `elchat2gui::get_gui()'
/tmp/cc2vxBtA.o: In function `elchat2::actor_removed(elnetworklib::Client*, std::vector<unsigned char, std::allocator<unsigned char> > const&)':
callbacks.cpp:(.text+0x5bd): undefined reference to `elchat2gui::get_gui()'
/tmp/cc2vxBtA.o: In function `elchat2::new_minute(elnetworklib::Client*, std::vector<unsigned char, std::allocator<unsigned char> > const&)':
callbacks.cpp:(.text+0x6c9): undefined reference to `elchat2gui::get_gui()'
/tmp/cckUM7fn.o: In function `main':
main.cpp:(.text+0x80f): undefined reference to `elchat2gui::get_gui()'
collect2: ld returned 1 exit status

 

I was however able to get the precompiled binary running. My distro now provides boost libs version 1.45 and at first i tried just making symlinks with the older name pointing to the newer version, but obviously they're not that compatible... however, i put the older 1.41 versions (libboost_date_time.so.1.41.0 and libboost_thread-mt.so.1.41.0) in it's directory and just used:

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./ELChat2

...and it then ran fine, connected up to the test server, i logged on, sent myself a test pm, spoke in local, etc... looks good :)

 

Would be great if it could connect to the main server and us be allowed to use it there. :)

 

EDIT:

I got the code snapshot tagged as "tip" here and then was able to compile using cmake and make. :)

 

When i clone the repo using

hg clone https://bitbucket.org/freeone3000/elchat2

it seems to not get the latest st00f... or something, anyways it doesn't match the files in the repo as viewed via the site/web.

 

EDIT2:

2 things;

When you PM someone, where it should say "[PM to Whoever: blah]" it says "[PM from Whoever: blah]", like the PM came from them, rather than you sending to them. It does work fine, it just says "from" where it should say "to".

 

The other thing, the start of channel messages is a VERY dark colour, the "[Whoever @ N]:" bit, basically unreadable.

Edited by Korrode

Share this post


Link to post
Share on other sites

Huh. I'm amazed someone found this of use, after all this time.

 

It seems you're working on the "default" branch. This branch has fallen out of use, and probably only worked in MSVC++ anyway. I'm willing to update it, but if you're willing to deal with a (slightly) larger binary and an (n|pd)curses depend (when compiling, not linking - `ldd` confirms no runtime depend), you should run switch over to the hg "guified_library" branch. (The plan was to branch off these nasty changes which require *gui callbacks* in the network lib to be gone, but I never got around to it. The project's been sitting dormant for some time.)

 

The branch switch detailed above can be done by

hg up -C guified_library

. Note that the newer version uses CMake. To avoid problems, create a new directory as a sibling to the repository directory, cd to that, and run

cmake ../elchat2

. (This is also the closest thing to a doc detailing this - the project's been sitting dormant for some time, and honestly, no one has asked for it but you). I did have to push a change fixing the CMake file such that the network lib is built dynamically, instead of statically, so you'll need to pull that.

 

In summary: Pull for the latest fix, use the "guified_library" branch unless you have a reason not to, and use CMake to make the build file, and it should compile.

 

As for your other two issues, I've made a note of them, and I'll get to them whenever I can. Following the repository'll allow you to get it sooner than I post a new build (which may be never, depending on demand).

 

EDIT: Outstanding PM issue fixed. Color issue not fixed, as [username @ ch]: shouldn't even be *in* a color (and it's showing up white here - I have the other colors, so...)

Edited by freeone3000

Share this post


Link to post
Share on other sites

I've installed korrode's compilation and also installed boost-libs.

 

I logged on an alt with it, she is present ingame as a regular character, you just can't do anything or see anything other than a limited F1 console.

Also very nice minimal cpu memory usage.

Very useful, and I'll see how it goes.

 

Thank you korrode and freeone3000.

Share this post


Link to post
Share on other sites

I'm getting this error:

 

Linking CXX executable ELChat2
CMakeFiles/ELChat2.dir/callbacks.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
callbacks.cpp:(.text+0x1280): undefined reference to `boost::system::generic_category()'
callbacks.cpp:(.text+0x128a): undefined reference to `boost::system::generic_category()'
callbacks.cpp:(.text+0x1294): undefined reference to `boost::system::system_category()'
CMakeFiles/ELChat2.dir/callbacks.cpp.o: In function `boost::asio::error::get_system_category()':
callbacks.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x7): undefined reference to `boost::system::system_category()'
CMakeFiles/ELChat2.dir/config.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
config.cpp:(.text+0xa80): undefined reference to `boost::system::generic_category()'
config.cpp:(.text+0xa8a): undefined reference to `boost::system::generic_category()'
config.cpp:(.text+0xa94): undefined reference to `boost::system::system_category()'
CMakeFiles/ELChat2.dir/main.cpp.o: In function `main':
main.cpp:(.text+0x9a8): undefined reference to `boost::thread::join()'
CMakeFiles/ELChat2.dir/main.cpp.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0xf63): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0xf6d): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0xf77): undefined reference to `boost::system::system_category()'
CMakeFiles/ELChat2.dir/main.cpp.o: In function `std::auto_ptr<boost::thread>::~auto_ptr()':
main.cpp:(.text._ZNSt8auto_ptrIN5boost6threadEED2Ev[_ZNSt8auto_ptrIN5boost6threadEED5Ev]+0x14): undefined reference to `boost::thread::~thread()'
../ELChat2GUI/libELChat2GUI.a(common_gui.cpp.o): In function `__static_initialization_and_destruction_0(int, int)':
common_gui.cpp:(.text+0xbb8): undefined reference to `boost::system::generic_category()'
common_gui.cpp:(.text+0xbc2): undefined reference to `boost::system::generic_category()'
common_gui.cpp:(.text+0xbcc): undefined reference to `boost::system::system_category()'
../ELChat2GUI/libELChat2GUI.a(pdcurses_gui.cpp.o): In function `__static_initialization_and_destruction_0(int, int)':
pdcurses_gui.cpp:(.text+0x1d1f): undefined reference to `boost::system::generic_category()'
pdcurses_gui.cpp:(.text+0x1d29): undefined reference to `boost::system::generic_category()'
pdcurses_gui.cpp:(.text+0x1d33): undefined reference to `boost::system::system_category()'
../ELNetworkLib/libELNetworkLib.so: undefined reference to `vtable for boost::detail::thread_data_base'
../ELNetworkLib/libELNetworkLib.so: undefined reference to `boost::detail::thread_data_base::~thread_data_base()'
../ELNetworkLib/libELNetworkLib.so: undefined reference to `typeinfo for boost::detail::thread_data_base'
../ELNetworkLib/libELNetworkLib.so: undefined reference to `boost::thread::start_thread()'
collect2: ld returned 1 exit status
make[2]: *** [ELChat2/ELChat2] Error 1
make[1]: *** [ELChat2/CMakeFiles/ELChat2.dir/all] Error 2
make: *** [all] Error 2

Share this post


Link to post
Share on other sites

You seem to be linking against a version of boost_system other than the one I need (1.42). I'll update the dependencies file to reference version numbers for the libs I need, and look into making CMake check versions for its depends. (Currently, it just asserts you *have* boost_system, not whether it's the correct version or not.)

Share this post


Link to post
Share on other sites
Color issue not fixed, as [username @ ch]: shouldn't even be *in* a color (and it's showing up white here - I have the other colors, so...)

What about the inactive channels?

 

edit:

i.e.

elchat2_dark.png

A lighter grey would be nice :)

 

Great work btw.

 

Also @Hussam:

Seems to compile fine against my 1.45 boost libs.

Edited by Korrode

Share this post


Link to post
Share on other sites

Aisy and Hussam if u have a min could u test building my Arch package for it?

 

PKGBUILD (and also a binary package) here:

http://www.paradoxcomputers.com.au/arch/packages/elchat2-hg/

http://aur.archlinux.org/packages.php?ID=46892

 

This package also installs libELNetworkLib (edit: I changed it to be statically linked)... it should be a separate package as stuff related to it is (edit: part of) why there's a "==> WARNING: Package contains reference to $srcdir" on build. elchat2 looks for the library in the $srcdir because that was it's location during it's build time. However, it does work if $srcdir gets removed as the package installs libELNetworkLib.so to /usr/lib/ and it falls-back to there.

 

I'll separate it into 2 packages (or fix the warning some other way) later, but for now this should work fine. :)

 

It's just 'elchat2' to run it btw, not 'ELChat2'.

 

 

edit:

oh, and the servers.lst it uses is in /usr/share/elchat2/. I haven't included a servers.lst that makes it connect to the main server by default (yet), so adjust the port for the 'test' entry in that file to connect to main server.

Edited by Korrode

Share this post


Link to post
Share on other sites

Okay. I've posted a possible fix for it - change the gray to 700/1000 from its previous value, and added some new handling for terminals which don't support redefining colors creating new colors. (Grey isn't a standard color.) Those whose terminals support fewer than 6 color-pairs, and those whose terminals don't do colors at all, now get a nasty exception. I plan to introduce a monochrome mode sometime in the futures for these clients, but everyone else should be fine. (Those who can't redefine colors create new colors get a standard white-on-black, so it'd be hard to tell off-channel from on-channel.)

 

EDIT: If you updated in the time between I first posted and when I edited, you'll need to pull again - apparently can_change_color() doesn't do what I thought it did, and I now check the return value of init_color properly. (Not the other ones, but there success is less critical and more determined.)

Edited by freeone3000

Share this post


Link to post
Share on other sites

fo3k, I noticed you listed asio as a dependency. I don't have it installed but elchat2 still builds fine... would I get some benefit if i compiled with asio installed?

 

I added my Arch Linux package to the AUR, for now i'm changing the ELNetworkLib to be static, but once there's another piece of software using it (and an Arch package for it), i'll split it to a separate package.

 

Also, when producing a package in Arch it checks the contents of the files about to be packaged for occurrences of full paths to the director(y/ies) it was built in... i get a warning saying there are references in the ELChat2 binary. It seems whatever reference(s) exist are inconsequential, so no big deal, but thought i'd mention it.

 

Another thing; When i was compiling with ELNetworkLib still set as shared, I couldn't figure out any way to compile against an existing system copy of libELNetworkLib.so. An LDD of a default compile also shows the binary looking for the shared library in the build directories, however if i removed the build directories it did fallback to the libELNetworkLib.so I had installed in /usr/lib. I did come up with a way to have the linking process at the end of compiling point to the system library (in /usr/bin) by default, but I had to mess with a couple of CMakeLists.txt to achieve it.

 

All of the above is just technicalities and inconsequential to usage, just thought i'd mention it.

 

 

In regards to a wishlist of feature requests:

If it were to write a chatlog to somewhere like ~/.elchat2/chat_log.txt, that'd be nice... and the ability to scroll back through the console history would be awesome. Also, #afk functionality like the normal client would be great too.

Edited by Korrode

Share this post


Link to post
Share on other sites

If you compiled without boost::asio, I'm honestly not sure how it could work - ELNetworkLib exclusively uses asio for network communications.

 

The circular reference is why, originally, this was not 'default' - ELNetworkLib has a dependency on ELChat2, *somewhere*. Grepping through the source, it doesn't appear it's there, so I'm now considering merging the branch back into the default. It's probably only there because of how the executable is linked.

 

As for the others, I'll add them to the issues tracker, and get on them when I have time. (I may need to find another developer who knows the stuff, due to my time constraints.)

Edited by freeone3000

Share this post


Link to post
Share on other sites

Aisy and Hussam if u have a min could u test building my Arch package for it?

 

PKGBUILD (and also a binary package) here:

http://www.paradoxcomputers.com.au/arch/packages/elchat2-hg/

http://aur.archlinux.org/packages.php?ID=46892

yes, it works. thank you :)

 

Also @Hussam:

Seems to compile fine against my 1.45 boost libs.

I forgot to mention. I rebuilt the boost package and now elchat2 builds O.o

Edited by hussam

Share this post


Link to post
Share on other sites

I did a merge of the repository branches such that all branches are closed except "default". "default" will henceforth be the branch with the most stable source tree (ie, it'll always compile). Script should probably be updated such that it draws them from "default" instead of "guified_library".

 

(Also got the chat logging feature done in full, but I think the directory handling's a little shaky. Other features are on the way.)

Share this post


Link to post
Share on other sites
(Also got the chat logging feature done in full, but I think the directory handling's a little shaky. Other features are on the way.)

 

It indeed appears to be shaky: It did not write to my ~/.elc/main/chat_log.txt as you requested in-game that I test.

Share this post


Link to post
Share on other sites
(Also got the chat logging feature done in full, but I think the directory handling's a little shaky. Other features are on the way.)

 

It indeed appears to be shaky: It did not write to my ~/.elc/main/chat_log.txt as you requested in-game that I test.

Indeed it shouldn't. It'll write to the config specified in servers.lst, in a manner such that getenv("HOME")+"/"+config_dir+"/"+"chat_log.txt" is the filename. If you're running on the main server (which you probably shouldn't be, unless someone knows better), it'll be "main" by default. If you're on the test server (which you should be), it'll be test, such that the full path will result in

~/.elc/test/chat_log.txt

.

Share this post


Link to post
Share on other sites
If you're running on the main server (which you probably shouldn't be, unless someone knows better), it'll be "main" by default. If you're on the test server (which you should be), it'll be test, such that the full path will result in
~/.elc/test/chat_log.txt

.

Radu gave us the go ahead to use it on the main server. ;)

 

I'll test the new features and update the package in Arch's AUR to use the default branch shortly. :) Thanks.

 

 

EDIT:

chat logging seems to be working well, nice work. :)

 

For Arch users: AUR package is updated.

 

EDIT2:

Also fo3k, maybe have the binary take a command line parameter so we can choose a server based on the names in servers.lst?

i.e.

./ELChat2 main
./ELChat2 pk
etc.

 

Or is there some way to do this already that i've missed?

My understanding of it's functionality atm is that it always connects to the "test" entry in servers.lst, and thus adjusting the port for that entry is the only way to connect to other servers, hence it writes to ~/.elc/test/chatlog.txt (despite the fact i'm on another server).

 

EDIT4:

I see the functionality to grab the first command line parameter (argv[1]) is there already, I guess you just forcibly use "test" at try due to it's prior unofficial status.

I'm enjoying learning a bit about C reading your code :>

 

EDIT5:

In regards to #afk functionality, if it's easier to just implement the same functionality as when the AFK time is set to 0 in the main client, that'd be enough imo... well, it would for me anyways :>

Edited by Korrode

Share this post


Link to post
Share on other sites

I just tried your updated AUR package, korrode.

I seem to only be able to log on to the test server.

(Going to bed now so will fuss with it more in the morning.)

Share this post


Link to post
Share on other sites

EDIT4:

I see the functionality to grab the first command line parameter (argv[1]) is there already, I guess you just forcibly use "test" at try due to it's prior unofficial status.

I'm enjoying learning a bit about C reading your code :>

I worry about this - A lot of stuff I do isn't perfect, or even well-designed, C++ code. (And surely isn't C.)

I just tried your updated AUR package, korrode.

I seem to only be able to log on to the test server.

(Going to bed now so will fuss with it more in the morning.)

Anyway, this issue is fixed.

 

EDIT5:

In regards to #afk functionality, if it's easier to just implement the same functionality as when the AFK time is set to 0 in the main client, that'd be enough imo... well, it would for me anyways :>

 

And this is done as you've said, but I still plan on putting the timer in eventually.

Edited by freeone3000

Share this post


Link to post
Share on other sites

I just tried your updated AUR package, korrode.

I seem to only be able to log on to the test server.

(Going to bed now so will fuss with it more in the morning.)

Anyway, this issue is fixed.

...and the AUR package is updated so the shell script passes command line parameters.

 

 

EDIT5:

In regards to #afk functionality, if it's easier to just implement the same functionality as when the AFK time is set to 0 in the main client, that'd be enough imo... well, it would for me anyways :>

And this is done as you've said, but I still plan on putting the timer in eventually.

Nice, thanks.

Share this post


Link to post
Share on other sites

I just tried your updated AUR package, korrode.

I seem to only be able to log on to the test server.

(Going to bed now so will fuss with it more in the morning.)

Anyway, this issue is fixed.

...and the AUR package is updated so the shell script passes command line parameters.

Pfft of course, I never put in a parameter, so it automatically went to test. That's what happens when I mess with things too close to bedtime ;)

Works like a charm with ./ELChat2 main

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×