Oct 29 2007

final project

Well, I ended up getting my final project for my networking class. However, it isn’t really my FINAL, FINAL project… He has yet to give us our programming project 3 to do, due to some out-of-control circumstances. But we did get this one, which gives us time to think about what we want to do, and we can obviously start it now to get a leg up on it.

The project is… Well, just a distributed systems project. I get to choose what I want to do as long as it fits the whole server and client mold. That’s GREAT! I was hoping that it was going to be like that. This will give me an excuse to spend all kinds of hours on a small gaming project, that I could potentially carry on with after this class is over.

But… What in the world am I going to do?

I haven’t had any sort of revelation on what I know I want to do. However, I’ve thought about some things.

  • [Not Bad] Create a Tic-Tac-Toe game.
    • People can Create a ‘Table’ where another person could click to join the table.
    • People can View a ‘Table’ where people can see what is going on
    • … And other stuff …
    • Created in C#, using nothing Fancy.
  • [Challenging] Create a 2D top-down style game, and allow clients to connect to the “world.” They’ll be able to run around, see other clients.
    • In addition, they could ‘Talk’ to each other.
      • Via Chat Bubbles
      • Via a In-Game Console
    • Game Portion
      • If more than one player is on the plane, a “FIND AND SEEK” game will initiate. This will dump player-specific orbs (via, color) all over the place, and the player with the most orbs collected AFTER all have been collected, Wins! Simple enough.
      • In addition, but probably one of hard concepts to implement is allowing a weapon to be used to fire bullets, or a hammer to smash, at the players orbs (which shatters them, which makes the other player not able to collect).
    • Using C++ and SDL

I’m all about challenging projects. But I only have until December 13th to finish it. I COULD partner with somebody, but I’m hesitant to do that for this project. I enjoy this, and with that, it would be hard to find a dedicated individual that would want to spend as much time as I want too on the project.

If you have any ideas, let me know!


Oct 24 2007

spring 08!

Enrollment for the next semester started this Monday.

I decided to cut my Christmas break short to take an intersession course.  This will help me a bit.  I’ll be taking two coding courses, one of which is a major time consuming beast — operating systems.   There are not a lot of classes to select from for the intersession, but I found one, “Social Construction of Serial Murder.”  It sounds interesting, and If for some reason in the future I have a crazy co-worker, god forbid, I can tell… and run away. Kidding. ;)

Other than that, the regular session will consist of 12 hours:

  • Enterprise Information Systems (A Database course, with a funky name)
  • Operating Systems I (You could imagine how time consuming this will be)
  • Business Strategy
  • Intro to Operation Management

So, I’m buffering the first two with Management courses.  If for some reason I do have spare time, I can work on an independent project.  I also might take a 3d course at the game institute.

I ended up getting a scholarship this year for being in Iraq.  So it looks like my military service paid for 4 years of school.  Nice, eh?  I knew all of that pain/sacrifice was worth going through…


Oct 18 2007

networking project completed

I ended up finishing the project for my networking class last night. I spent the entire night on Tuesday implementing a Remote Method Invocation (RMI) service for the application. That ended up taking me about 4 hours, and the project as a whole ended up taking around 10-15 hours of solid coding. The RMI implementation ended up being a lot easier than I thought it was going to be.

This application is coded in C#.

The goals:

  • [met] Develop a Server and Client Chat Interaction
  • [met] Develop a Server Directory that is implemented via RMI or RPC
  • [met] [Extra Credit] Allow the directory to update the Active Server List for anybody who disconnected

Bugs:

There are a few bugs that I didn’t have time to iron out. One of which revolves around how data is sent from the Client side. If the client sends a message, and then receives a message, the next message that the client sends will fail to send.

Ignore grammatical errors… ;)

The Server:

The server was actually implemented as a functional server/chat. Some people just developed a server, just to be a server. Where as, I wanted to build the application for expandability. I wrote it so that the admin of the server could have more options for the chat session. For example: Being able to monitor the chat, kicking people, locking the chat room, etc.

The server maintains a few threads, one of which listens for new connections. Once connection has been established, I create a new Client object that is completely taken care of by that object. This allowed me to keep track of all kinds of data on the user. Is the user still connected? What is the users name, IP Address, Port?

Another thread manages the Remote Message Invocation object, and sends/receives data to update the chat directory.

Overall, it’s pretty functional.

The Client:

The client, is simply the client. Once the user starts the client, they will need to either A) Refresh the Chat Directory, or B) Enter a known server location to connect too. But, if that server is actually running, then they’d know by refreshing the chat directory. All servers must register with the chat directory.

The Chat Directory:

This little puppy is bad ass, and no, not just because I didn’t shrink this image down like I did the others. RMI is a pretty interesting, and the way it works is sweet.

For simplistic sake, you basically create a library (.dll) that the server, client, and directory shares. That library allows each application to directly access the directory by simply creating a channel to communicate through. Very easy, coding wise.

For example, the server creates a new object based off of the library, which connects to the chat directory:

TcpChannel newChan = new TcpChannel();
ChannelServices.RegisterChannel(newChan, true);

remObject = (RemoteObject)Activator.GetObject(typeof(RMIService.RemoteObject), “tcp://localhost:8030/RemotingServer”);

From there, you have access to all of the Directories functions. So if you wanted to get the names of all of the chat rooms listed on the directory side, you would just type

private String[] chatRoomList = new string[20];
chatRoomList = remObject.getNames();

And now the Server side (or the client), would be updated.

So, yeah. This Directory maintains a list of chat rooms that the servers have started. Once the server starts, it registers with this directory, and the directory then used to update each the Server and the Client. If a server does end up quitting, then before the form closes, it sends a message to the directory saying “Bye, dude,” and the directory removes all association (name, ip, port), from the list.

Results:

It went well, and I’m thinking about continuing it to play around some more. We’ll see how the grader finds it.

If you’d like to tinker with it, throw me a message on AIM at <aim marine>. I would post executables and source, if it wasn’t for having a few bugs.

The Mysterious Vanishing act of Static Form Controls in C#:

This had me completely baffled for quite some time… For some reason, forms don’t really like static form controls. And, you really need static form controls if you want to manipulate any sort of control through a Thread. Now that I think about it, I probably could have called a function from the thread to update it… Hmm… But, yeah… When the form goes to reload, it throws away the controls that are static, and if you’re lucky, it’ll erase all code pertaining to the control as well. Nice, eh? There seems to be no solution that I know of, just C# not enjoying the fact that you’re making controls static one bit.

 


Oct 8 2007

Loooooonggggg Daaaaaay

What a long day.

I had a biology exam this evening, so studying consumed any of my off time between classes. I feel pretty good about the exam, especially considering the difficulty of this particular exam. A lot of the material revolves around cell structures, mitosis, meiosis, and a few other things I don’t want to think about right now. Most of this stuff should be review from high school biology, but it has been nearly 10 years since I had my last biology class. If that wouldn’t make you feel old, I don’t know… It makes me feel old.

I’m making some decent progress on the chat client. I’ll be knocking some things off of the plate tonight so I can spend tomorrow doing some coding. I’ll add more about the project next week. For now, It’s time to relax.


Oct 3 2007

networking

Started a TCP chat client/server yesterday.  It’s mainly…. GUI right now.  I decided to code in C# instead of Java.  No particular reason, as both languages are incredibly similar.  I just wanted to dip into C# some more, and I felt that this would be a good time to do it.  We’ll see how it works out.  I have until the 17th to finish it.  Essentially, the application should do the following:

  • Provide a Chat Service utilizing a TCP connection-oriented service
  • Provide a Directory that will allow other clients to view the active servers
    • Allow the client to select from these servers to connect too
  • Extra Credit: Remove Servers from the Directory that have disconnected

Had an ACM meeting today, which Union Pacific provided some excellent pizza and soda for.

Talk about some incredible projects.  They have this one project that essentially is the platform that maintains and displays all of the data for the trains on their network.  This ‘old’ platform JUST got replaced within the last week.  That ‘old’ platform had been in use for nearly 40 years, and was developed using some really old languages.  I think they said that in their IT department, about 4 or 5 people knew the code thoroughly.  And because of that, they invested 100 million into developing a up-to-date platform. Thank goodness.  It looks a LOT better, and is a LOT more functional.  Why in the world does it take 40 years to replace such a dysfunctional system?


Oct 1 2007

Fall Break

Well, we had the day off from school today, which gave me some extra time to study up on some things.  I didn’t get as much as I wanted to get done this weekend, due to taking a trip back home, but the semester is charging full steam ahead.

October is here, and that means that enrollment is just around the corner.   It looks like I can take 16 credit hours in the spring or fall, and the other semester will need 13 hours.  I’m still determining what classes I want to take for my electives, but I need to get with some people to figure out what direction I should take.  I’m getting pretty anxious to graduate, if this blog couldn’t tell.  I miss work.

Today, Nokia made a pretty interesting move in the GPS market.  They ended up buying a company Navteq.  Navteq produces the maps that you might see being used on Garmin products.  As you can imagine, this is a nice strategic movement for Nokia.  Having Navteq will help Nokia provide a GPS enabled phone.  But this pretty much slammed Garmin’s stock against the wall, and nailed it between the legs.  Garmin’s stock fell to it’s knees pretty bad today.  I’ve got to think irrational selling on some of those investors.  I don’t see this 8.1 billion dollar buy from Nokia to be something that shatters Garmin.  But there sure were a ton of people jumping ship.  It ended up falling ~12% at the EOD and at times it was down around 16%.

Anyways, I took a nice hit from this.  But, with all things, once investors see the light, they’ll come back.  For now it’s at a nice discount. :)

If you are a student, and are interested in investing, head to www.updown.com.

In other news, Kansas State football smashed the University of Texas.  What a great game. GO CATS!