Today however, I got to work pretty much the whole day.
I had some extra money this paycheck, so I went ahead and purchased a license for Torque2d. Thinking maybe I could use it to hack together a client for my server. I read on their public forums that they really didn't have much in the way of network capability in it yet, so I figured I could hack my socket library in somehow and use it to communicate.
I was right. First I'd like to say that it was a huge pain in the ass, and it took me about 6 hours to get my library to compile inside their engine. I couldn't get their engine to compile under Dev-Cpp which is what I am using to code the server, so I had to compile it with the Visual Studio 2005 beta. The Torque2d application compiled pretty easily under VS2005 with a couple little gotchas that were easy to fix.
The pain came when I implemented a scriptable object from C++ to wrap my socket library in. My library includes winsock, which apparently conflicts with the engine, because they have a source file in the engine that reimplements the new operator. For no reason that I can tell.
I tried about everything I could think of to resolve the name conflict. Finally I ended up just commenting out portions of their redefined operators and crossed my fingers. As far as I can tell the executable is running fine without them, so they are going to stay that way.
Tommorow after I get up ill implement my protocol on the T2d side and see if I can get the scripting engine to create objects on the fly over the network. The objects support callbacks from c++ to the scripting side, so I don't see this as a problem. I just have to get familiar with their scripting a little more. If I can create a "datablock" (their script based idea of a structure) in c++ and pass it to a script side callback function from the network object I won't have any problem from there.
I'm actually kind of excited about using T2d to do the client. Their scripting language is really flexible. I went through the tutorials that came with the engine. You really can do a basic side scrolling shooter like the one they have up for download in about an hour.
So now that I have my network library crammed in there I am going to bed, I'll post again tommorow.