DC++ at the local Bazaar

The latest news about the developing of DC++ are about the change of the repository from Subversion to Bazaar.

How does this affect the normal DC++ user ? The answer is, with nothing at all. It just affects the more advanced users that can compile their own binaries from the latest source code, or the people that want to contribute with patches or something.

Bazaar is a new version control system similar to CVS and Subversion that presumably has more advantages than the other two. You can still use the old svn repository from sourceforge, because the new bazaar one and this one will be auto synchronized ( with some few days delay, the most ), the sole difference is that the commits are now made first to the bazaar and then they appear into the svn repository.

To have access to the bazaar, you need the bazaar client, available from here. Also , to install bzr you need Python 2.4 the least.
Once you have it installed and in your path, you can simply checkout the repository by :
bzr branch http://bazaar.launchpad.net/~dcplusplus-team/dcplusplus/trunk dcplusplus
This will checkout the entire repository into the dcplusplus folder.
First difference from subversion : the initial checkout lasts much longer , because all the revisions are being downloaded ( diffs between them anyway ), so after the checkout you don’t need internet connection to update to any older revision or see the diffs . It took here about 5-8 minutes to complete, so be patient.
Don’t worry about the space this all thing is taking, even if it’s branching all the revisions, I heard it still uses less space than the svn checkout ( hi arne =).

If you had commit access to the repository or you are in the dcplusplus-team, I can explain how to gain ssh access to the repository.
If you use linux, you need a ssh tool that can create a key and use it as login ( standard ssh I think it works…)
For windows, I used PuTTY. You can get it from here. You need PuTTY.exe, Pageant.exe, Plink.exe and PuTTYgen.exe.

Start up PuTTYgen.exe and generate new key (Notice the nice randomness generation =).
Save both the public and private keys.
Go to the launchpad site and into your profile go to Add SSH key and paste the public key information from PuttyGen ( some strings that puttygen puts in some box where it says : “Public key for pasting into authorized files… “)

Now open up PuTTY.exe, and connect to bazaar.launchpad.net using SSH. You will be asked to add into Putty’s cache the server’s fingerprint. Pick “Yes” so that the fingerprint is being added permanently. ( This is required so that you can connect using plink, otherwise it can’t connect because it doesn’t recognize the fingerprint as “safe” ).

Open up pageant.exe and load your private key into it ( the one generated with puttygen ).

Now, add a new variable to your system ( Right click my computer, advanced, environment variables ) named BZR_SSH and set the value to plink.

Open up console and try
bzr branch bzr+ssh://<name>@bazaar.launchpad.net/~dcplusplus-team/dcplusplus/trunk dcplusplus
Where <name> is your launchpad nickname.
There you go.

What arne suggests about commiting : “then in the dcplusplus folder “bzr reconfigure –checkout”. That’ll configure bzr to work just like svn, committing each revision you make to the main repository when you do “bzr commit”. Alternatively, you don’t do the reconfigure thing, and all your “bzr commit” commits will be local until you do a bzr push”

I’ve been reluctant about this whole Bazaar since I don’t see any real advantage about it over svn. Maybe time will tell.
I’m also waiting for feedback or help requests if my post wasn’t explanatory enough.

Note to translators

The next release is drawing near and if you speak any language apart from English you can help by translating DC++ into your language. All old language files have now been imported (well, at least those that could be salvaged), so all you need to do is to go over to launchpad and start translating! If you don’t like the web interface, I suggest you download the language template and use an app such as poEdit to edit the translations (remember to import the existing translations to your language from launchpad before starting!). There’s a nice introduction to translation using gettext here.

DC++ 0.701 crashes on startup?

It may happen that your freshly installed/downloaded DC++ 0.701 crashes as soon as you start it (or die without any error message, just it simply doesn’t start). This is caused by an unhandled exception which is going to be handled in the upcoming releases. To workaround this problem, create a Certificates folder in your DC++ installation directory.

Note that this workaround also won’t let your System Stability Index to drop :P

Cross-compiling DC++ on Linux

Just some notes:

  • If you use a binary-based distribution, don’t use the default STLport – that’ll have been compiled for the native platform, not Win32. Compile your own copy from source, however you do it.
  • Your distribution might have a MinGW cross-compiler already packaged and available. Debian, Ubuntu, and possibly RPM distributions (I don’t use any and thus can’t verify that). The Gentoo site is down, so I didn’t check.
  • The default MinGW filename prefix in build_util.py is i386-mingw32. You might need to adjust that, either by setting the MINGW_PREFIX variable or just editing build_util.py. For example, the correct prefix on my development system is i586-mingw32msvc.
  • On at least the versions of the MinGW runtime packaged with the Linux distribution I use, commdlg.h lacks the OPENFILENAME_SIZE_VERSION_400 constant (it’s 76 decimal) and winuser.h XBUTTON1/XBUTTON2 (VK_* and MK_* aren’t the same). Get the corrected header files from the official MinGW download site if necessary; they’re as portable as necessary.
  • Certain older versions of SCons on MinGW are vulnerable to a bug which DC++’s build system triggers. Either update SCons or apply the patch available if you experience that bug.
  • Finally, regardless of platform, using SCons’s —implicit-deps-unchanged option can dramatically speed up compiles if not too much has changed.

Don’t forget that you can make topic suggestions for blog posts in our “Blog Topic Suggestion Box!”

How to generate CID taken?

Or rather, how not to generate CID taken?

I guess most of you already know that on ADC the clients are identified by their CID. Which means that two clients with the same CID cannot enter to the hub at the same time.

And a lot of hubowners, website maintainers, etc provide clients with some basic settings for download to ease the start for the users. Which means that you start a clean new client, set up some common things you’d like to (like a default nick, coloring, timestamp, add some hubs as a favorite etc.), then rar/zip the whole thing and put it on your website.

What happens if you do that? Since the clients your users are going to download includes the PID setting too, all users will have the same CID, so they can’t enter to the same hub while the other users are in, they are going to get “CID taken”; and I’m not sure that an inexperienced user can figure out what should he change in the settings to get rid of that.

So I ask anyone who distributes clients with some settings preset in them, edit DCPlusPlus.xml before publishing and remove the <CID>…</CID> from the xml. Or rather, distribute the clients without the xml file.

A footnote: you may notice that the settings xml contains a CID tag instead of a PID tag. That’s historical and haven’t changed yet, but that’s the PID. So please don’t distribute it otherwise everyone’s CID’s going to be taken.

Help the file!

Since I’ve been posting a bunch of “how to compile this and that” posts lately, I am going to do that today as well.

And this time, with DC++’s help file.

It’s an easy task, requiring basically only one program from Microsoft; HTML Help Workshop.

Download HTML Help Workshop and install it in C:/Program Files. (Or wherever the %ProgramFiles% system variable point to.)

Now go in the help/ directory in DC++’s source and run compile.cmd. This will automatically generate a new ‘version’ of the changelog in the helpfile, and (temporarily) copy res/users.bmp so one of the FAQs can take advantage of it. The help file will now appear in app/ (extension .chm).
If you want to change the language of the help file, feel free to do that. It’s just to open the .html files in an editor and change the text. (Remember? It’s HTML Help Workshop.)

If you want to add or remove a file from the help file;

  1.   Open toc.hhc in a text editor and add the file in an appropriate LI/object-tag.
  2. Open help.vcproj in a text editor and add the file in an appropriate File-tag.
  3. Open DCPlusPlus.hhp in a text editor and add the file in the [FILES] part. If you want it to have an alias, and be “call-able” from DC++, add it as well under the [ALIAS] part.
  4. Modify index.html (or whatever other file you want to point to your new file).
  5. Run compile.cmd.

If you want to upload it so others can take advantage of your change, feel free to upload it to the Language tracker.
Something many may not know about, is that the help file require one other program to be viewable. It is Internet Explorer. Yes. So, while the .chm is initially constructed by platform independent HTML files, the end help file is not.

Compiling DC++ with Visual Studio 2003

This guide is about compiling DC++ on Windows, with Visual studio 2003.

To compile DC++, you will need a few things.

First, download the DC++ source, and unpack it in C:\dcplusplus\dcplusplus696\. (So you got C:\dcplusplus\dcplusplus696\windows, C:\dcplusplus\dcplusplus696\client etc.)

Download STLport, and unpack it in C:\dcplusplus\STL so you got C:\dcplusplus\STL\config etc.

Download WTL and unpack it in C:\dcplusplus\WTL so you got C:\dcplusplus\WTL\include etc.

Download the latest SDK, or get the natupnp.h file from Bugzilla. Place it in C:\dcplusplus\natupnp\. (I think I have it in some Visual Studio include path, but this should work fine too.)

Download YaSSL and unpack it in C:\dcplusplus\YaSSL so you got C:\dcplusplus\YaSSL\certs etc.

Download Python and install it. (I got mine in the default folder)

Enter C:\dcplusplus\dcplusplus696\. Open up DCPlusPlus.rc and change the line #include “wtl\\atlres.h” to #include “atlres.h”

Open up the workspace (DCPlusPlus.sln)

Under the Tools menu, press Options.

Go to Projects and then VC++ Directories.

Under ‘Show directories for’ select ‘Include files’.

Add the STL folder, WTL\include folder, YaSSL folder and then the natupnp folder. (They should be in the top.)

Under the Build menu, press Build solution and Visual Studio should compile you an executable that is located in C:\dcplusplus\dcplusplus696\app\.

To change Python path, go to client->Header Files->StringDefs.h->Properties->Custom build step and change the appropriate values.