Server Help

Misc User Apps - SideCN

Hakaku - Thu Sep 03, 2009 1:11 am
Post subject: SideCN
In light of the other thread, I decided to give it a go myself at designing a chat client. This is my first time actually writing anything in C#, and my first time writing an application period, so the code is probably not as optimized as it could be. It's still very basic and lacks a few things such as both squad messaging and private messaging using / (though :name: works), any form of proper player name sorting whatsoever, and it doesn't handle errors yet. I was also experimenting with loading and saving settings, and using languages (?language en-US, fr-CA, es-ES, or ja-JP) for the fun of it (though I couldn't figure out how to make the client send ascii rather than unicode, so 'é' will not be properly rendered for Continuum users).



Also, Windows-only and no source for now (at least, not until I clean it up some).
Doc Flabby - Thu Sep 03, 2009 7:51 am
Post subject: Re: SideCN
Hakaku wrote:
I was also experimenting with loading and saving settings, and using languages (?language en-US, fr-CA, es-ES, or ja-JP) for the fun of it (though I couldn't figure out how to make the client send ascii rather than unicode, so '?' will not be properly rendered for Continuum users).


You need to get it to send an ANSI encoding (8 bits, ASCII is only 7bits).

If you want japanese to work convert it to UTF-8, but only other SideCN clients will be able to read it once you go outside the standard ASCII character set. (Continuum i think uses page 1140, but this is a total guess, you're have to experiement)
Code: Show/Hide

//for utf8
byte[] utf8String = Encoding.UTF8.GetBytes(srcString);

//using codepage 1140, i'm guessing this is what  continuum uses , but  I'm not sure which code page continuum uses, if you find this out you will be able to make the convertions work.  I just know the codepage it uses has the Euro (?) Symbol but not the GBP (?) symbol.

byte[] codepage1140String = System.Text.Encoding.GetEncoding(1140).GetBytes(mystring)


For more info, and a list of pages: http://msdn.microsoft.com/en-us/library/system.text.encodinginfo.getencoding.aspx
Hakaku - Thu Sep 03, 2009 7:50 pm
Post subject:
I'll give it a shot, but I'm not convinced Continuum uses a specific codeset at all, the given characters are all arbitrary to me. As for non-latin writing systems, I suppose you could just check the string against a regular expression to see if it contains characters outside Continuum's range, and send Unicode instead; either that, or less appropriately, use the interface's current language-culture to assume the encoding. I'm more concerned about handling characters that Continuum already supports.
Louis - Fri Sep 04, 2009 12:00 pm
Post subject:
nice client hak icon_smile.gif
Doc Flabby - Fri Sep 04, 2009 4:12 pm
Post subject:
Hakaku wrote:
I'll give it a shot, but I'm not convinced Continuum uses a specific codeset at all, the given characters are all arbitrary to me.

It has to because character data is always encoded using a codepage. Often a program just uses the codepage that the system is currently using, but as ? symbols don't work (which they should if it was doing that) it must used a fixed codepage, so that all continuum clients use the same codepage.
Louis - Sat Sep 05, 2009 4:19 pm
Post subject:
i think your correct doc
Bak - Sat Sep 05, 2009 6:44 pm
Post subject:
The way I'd do it is to just use the received byte as the image index in the font bitmap file. What's the codepage nonsense about?
Cheese - Mon Sep 07, 2009 12:26 am
Post subject:
YOU'RE correct, doc is correct.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group