All posts tagged c#

VGL Math – 2D/3D Video Game Math Library

I decided to get bold and start another open source project. This time it is related to the math involved in developing 2D and 3D video games. The project is hosted at http://code.google.com/p/vglmath. I decided to deem it a “VGL community project”; VGL being the company I founded a few months ago.

I’m looking for any pointers, contributors, or experts to make improvements or recommendations to the code. So please check it out. If you’re interested in contributing, please send me an email at cale@caledunlap.com so I can add your Google account to the members list.

And if you haven’t already, check out http://www.venomgamelabs.com!

Now for your entertainment for the evening:
httpv://www.youtube.com/watch?v=FRgYtp3HfvY

Angel Progress!!!!

So, I spent all day yesterday and already a little bit this morning working on Angel. Angel went from a service-only proof-of-concept to a server and client proof of concept in just under 12 hours. I’ve been stress-testing it a little bit this morning and it ran 10,000 “AddUser” commands in just under 3 minutes. Sounds slow? Well, let me explain everything that goes on in a single “AddUser” command (subject to change):

 

  1. Build the SOAP request (translate Angel data objects to SOAP-compatible objects). Request contains user information (Name, Alias, etc.)
  2. Connect to the Angel web service
  3. Send the command parameters to the web service
  4. Service writes a log entry to a text file (very verbosely)
  5. Service executes a database statement, storing the data
  6. Service checks for errors, if none, grab the user ID back out of the database (room for optimization here). If errors occured, put error description into the response object.
  7. Service builds a response object and sends it over the wire back to the client
  8. Client converts the SOAP-compatible object back to Angel data object types
  9. Client checks  the response object for success/failure from the server
  10. Client tears down SOAP connection

 

Now do that 10,000 times. 

This is my first time building a C++ SOAP client and I must say, with the help of gSOAP, it works great. It is the first time I’ve gotten a C# web service and a C++ client to play nicely together. We initially tried this with raw sockets, but it proved to be WAY too much of a hassle and there’s too much that could go wrong. This has worked 1000% more reliably than anything else I’ve tried. I’ve sort of been having that “mad scientist” feel about me the last few days since I’ve gotten this work–talking to myself, mumbling, swearing at my code, and then screaming “IT’S ALIVE!!!!!” when it finally worked.

KnowIT Releases First Version

Ok, so even though I didn’t get ALL of the bugs hammered out in KnowIT, I released a preliminary version of it over at Google Code. It hasn’t been reviewed yet by anybody, and I even have yet to install it from the installers I built, so I’m honestly not even sure if it will work. But regardless, I’ve tagged it as a release in SVN and I’ll probably be continuing to make improvements and modifications to it here and there. I just wanted it to get out the door so I could stop having that monkey on my back. Monkeys get heavy after a while.

CHALLENGE: Find my heap corruption

Alright, I’ve been fighting with some heap corruption for the last month or so with the Angel re-write I’ve started. The heap corruption is occurring in the client library test program, meaning the source is probably in the client library itself.

Here’s the source for the test program:

#include "AngelClient.h"

void main()
{

    AngelKV *kv = new AngelKV(L"data");
    kv->AddKV(L"Name",L"Cale Dunlap");
    kv->AddKV(L"Age",L"24");
    kv->AddKV(L"Alias",L"Mazor");

    AngelClient pClient = AngelClient("pantera","angeltest","angeltest");
    AngelResponse *pResponse = pClient.RunCommand( L"AddUser", kv );

    if( pResponse != NULL )
        delete pResponse;

    pClient.Disconnect();
}

The heap corruption is occurring in the default destructor of the AngelClient class. Here is the full source to the Angel Solution. The visual studio project/solution is for Visual Studio 2008. There’s a server and client written in C#, but right now I’m focusing on the client written in C++. I’m tempted to pay a reward to the person who finds it. If you happen to come across this post and find where my heap corruption is coming from, drop me a line at cale@caledunlap.com.

The error messages:

Things I’ve tried so far:

  • Replaced the socket library 3 times thinking it was something within the socket library
  • Rewrote the client class twice
  • Used STL for the linked lists and strings to remove any errors I may have put in doing the linked listing and string handling myself
  • Undid the STL stuff for the string handling because that obviously didn’t fix it, plus I was getting even more weirdness with using STL anyway, so it was a step in the wrong direction to begin with. There’s still a little bit of STL string stuff in there, but only for splitting key/value pairs.

I’m at wits end with this, and I need some help. Thank you.