Discussion:
[crossfire] Update client GLib dependency
Kevin Zheng
2014-05-08 01:25:59 UTC
Permalink
Hi there,

The GTKv2 client sources are split up into two parts, one for "common"
code that can be shared across different clients, and a "gtk-v2" part
that implements the GTK+ client itself.

GLib is a very useful library that provides portable data structures,
lexical scanners, threads, mutexes, timers, hook functions, and sockets.
Currently it is only used in the GTKv2 client because it is a dependency
of GTK+. I propose that GLib should be a dependency for the entire client.

1. There are lots of cool things that GLib will let us have that we
don't have now. Dynamically allocated strings, advanced data types, and
even a config file parser are all available from GLib.

2. GLib will make things more portable. I've been able to get the client
building on Windows again, but it's still very messy, particularly due
to excessive conditional compilation. GLib implements its own portable
sockets that can be used on multiple platforms.

3. GLib will make things less broken. Connecting to a server is a mess,
and sometimes freezes the client given the right circumstances.
Threading, callbacks, and parsing are messy, too.

4. GLib is already a dependency. Besides, on my system, the library and
all development files takes only 17 MB. Most people already have it
installed, because it is a dependency for Gtk, Qt, and more.

5. Even if somebody decides to write another client using SDL, OpenGL,
or maybe even Tcl, GLib can still be used and will still provide all of
its happy shiny benefits.

6. You probably don't care, since you're using the must shinier and
prettier and portable JXClient. So you should let me do whatever
satisfies my evil wishes.

Thanks,
Kevin Zheng
Tolga Dalman
2014-05-09 19:57:51 UTC
Permalink
Hi Kevin,
Post by Kevin Zheng
GLib is a very useful library that provides portable data structures,
lexical scanners, threads, mutexes, timers, hook functions, and sockets.
Currently it is only used in the GTKv2 client because it is a dependency of
GTK+. I propose that GLib should be a dependency for the entire client.
I like the idea and agree to all your arguments (with one comment below).
Post by Kevin Zheng
2. GLib will make things more portable. I've been able to get the client
building on Windows again, but it's still very messy, particularly due to
excessive conditional compilation. GLib implements its own portable sockets
that can be used on multiple platforms.
We should investigate, whether the socket code should be aligned with the
server part.
That said, I'm reluctant to make glib a dependency for the server as well.
However, I agree that portability (and, thus, better code) should be
in the focus. What alternatives do we at least for the socket code have ?
As discussed previously, SDL Net could be one such option amongst others.


Best regards
Tolga Dalman
Kevin Zheng
2014-05-09 20:21:04 UTC
Permalink
Post by Tolga Dalman
Post by Kevin Zheng
2. GLib will make things more portable. I've been able to get the client
building on Windows again, but it's still very messy, particularly due to
excessive conditional compilation. GLib implements its own portable sockets
that can be used on multiple platforms.
We should investigate, whether the socket code should be aligned with the
server part.
That said, I'm reluctant to make glib a dependency for the server as well.
However, I agree that portability (and, thus, better code) should be
in the focus. What alternatives do we at least for the socket code have ?
As discussed previously, SDL Net could be one such option amongst others.
There isn't exactly a whole lot to share. The protocol for the client
and server are different enough to require separate parsers for each.

I have seen command-line programs use GLib, for example, irssi comes to
mind. I have not seen purely command-line programs use SDLNet, probably
because it depends on SDL which in turn requires X11.

That said, I do not plan on making significant changes to the server at
this point. Right now I'm working on connection drop detection,
integrating Tolga's patches, and fixing Coverity detections.

Thanks,
Kevin Zheng
Nicolas Weeger
2014-05-11 13:23:25 UTC
Permalink
Hello.


I'm ok with using glib everywhere on the client, as long as you have fun with
that :)


Regards


Nicolas
Post by Kevin Zheng
Hi there,
The GTKv2 client sources are split up into two parts, one for "common"
code that can be shared across different clients, and a "gtk-v2" part
that implements the GTK+ client itself.
GLib is a very useful library that provides portable data structures,
lexical scanners, threads, mutexes, timers, hook functions, and sockets.
Currently it is only used in the GTKv2 client because it is a dependency
of GTK+. I propose that GLib should be a dependency for the entire client.
1. There are lots of cool things that GLib will let us have that we
don't have now. Dynamically allocated strings, advanced data types, and
even a config file parser are all available from GLib.
2. GLib will make things more portable. I've been able to get the client
building on Windows again, but it's still very messy, particularly due
to excessive conditional compilation. GLib implements its own portable
sockets that can be used on multiple platforms.
3. GLib will make things less broken. Connecting to a server is a mess,
and sometimes freezes the client given the right circumstances.
Threading, callbacks, and parsing are messy, too.
4. GLib is already a dependency. Besides, on my system, the library and
all development files takes only 17 MB. Most people already have it
installed, because it is a dependency for Gtk, Qt, and more.
5. Even if somebody decides to write another client using SDL, OpenGL,
or maybe even Tcl, GLib can still be used and will still provide all of
its happy shiny benefits.
6. You probably don't care, since you're using the must shinier and
prettier and portable JXClient. So you should let me do whatever
satisfies my evil wishes.
Thanks,
Kevin Zheng
_______________________________________________
crossfire mailing list
crossfire at metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.metalforge.org/pipermail/crossfire/attachments/20140511/0683278c/attachment.pgp>
Loading...