Author |
Message |
Hakaku Server Help Squatter
Joined: Apr 07 2006 Posts: 299 Location: Canada Offline
|
Posted: 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).
SideCN.rar - 38.92 KB
File downloaded or viewed 54 time(s)
|
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: 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)
//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 _________________ Rediscover online gaming. Get Subspace | STF The future...prehaps
|
|
Back to top |
|
|
Hakaku Server Help Squatter
Joined: Apr 07 2006 Posts: 299 Location: Canada Offline
|
Posted: 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.
|
|
Back to top |
|
|
Louis Newbie
Joined: Aug 24 2009 Posts: 20 Offline
|
Posted: Fri Sep 04, 2009 12:00 pm Post subject: |
|
|
|
|
nice client hak
|
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: 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.
|
|
Back to top |
|
|
Louis Newbie
Joined: Aug 24 2009 Posts: 20 Offline
|
Posted: Sat Sep 05, 2009 4:19 pm Post subject: |
|
|
|
|
i think your correct doc
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Mon Sep 07, 2009 12:26 am Post subject: |
|
|
|
|
YOU'RE correct, doc is correct. _________________ SSC Distension Owner
SSCU Trench Wars Developer
|
|
Back to top |
|
|
|