Category: C# Conversion

Converting C++ code to C# code.

Compile Errors Defeated!

There are now no more compile errors.  It took just under 5 months to fix 75,000+ errors, giving me a fix rate of 15,000 per month (500 a day).  Not bad for something I only worked on in my spare time on a “as I feel like it” basis. After the compile errors were squashed,

Down to Only Six!

I’ve been working on the code the whole day.  The compile error count is now down to 6. The trouble is that each of these six remaining errors will be extremely painful to fix.

< 300

The compile error count is now 297, with gains mainly due to date and time function rewrites. Even though there were a lot of changes involved in the conversion, dealing with a System.TimeSpan and a System.DateTime is far more pleasant than the ugly and annoying integer math involved in C-style dates.  To get the number

Under 500

The compile error count is now down to 486. Most of the network communications code has been rewritten.  TCP/IP programming in C# is much like it is in C, but WAAAAY smoother — none of those ridiculous sizeof(sockaddr_in) parameters, etc.

More Fixes

The compile error count is now down to 614.

Today’s Code

Most of today’s coding involved rewriting string functions. The error count is now down to 834, with every gain a battle.

Under 1,000

I spent pretty much the whole day working on the codebase.  Every error clobbered is becoming a pretty hard-fought battle.  Even so, I seem to be winning.  Of course, after the errors are done, that doesn’t mean the work is over — far from it. The error count is now down to 949.

.Net XML Serialization

Most of the saving and loading of MUD data in Basterne 2 was handled by low-level C functions that used a custom text file format for each data type. That is just a bad idea. Save and load functions were typically dozens or hundreds of lines of code with lots of room for error and

Under 2,000

The compile error count is now down to 1,900. It feels like there will be a running codebase relatively soon.

Shiny New Logs

Today I replaced the old-school C-style logging routines with new C# code based on the System.Diagnostics.TraceListener class.  That may not mean much to you, but trust me — logging is way better now. The compile error count is now down to 2,205.

Random Numbers

I finally got around to replacing the old outmoded random number generator that the MUD has been using for ages. It’s the Mitchell-Moore algorithm and is present in just about every free codebase. I ended up building a class that lets you select one of three random number generators to run the MUD engine on.

More Progress

The compile error count is now down to 2,654. I’ve also added a codebase section to FindMUD since it seems that codebase downloads are getting harder and harder to track down these days.  There are only a handful posted, but I expect that the list will grow as the site evolves.

Under 3,000

The compile error count is now down to 2,779. Some of the remaining code rewrites remaining are pretty significant: Telnet/Network Code. Data File Saving/Loading (I’m seriously considering rewriting data storage as database-based rather than XML-based). Low-level string processing routines. If you think about it, those three things are all you need to build a MUD

A Pretty Good Chunk

Compile errors are now down to 3,293. It feels a little strange to re-implement some of the core C-language character functions in C#.  Things like isdigit(), isspace(), and isalpha() are easy enough to rewrite, but there’s just something a little surreal about it.

Under 4,000

The compiler error count is now down to 3,896.