• Advertisement
Sign in to follow this  
  • entries
    557
  • comments
    1237
  • views
    422686

Yay, code

Sign in to follow this  

85 views

This confuses me.

My stress test app is pretty much done. But in order for me to give code to people, I'll have to give away half my source code. I'm going to rewrite it (again) to use plain old sockets, then I can just post the source code in a couple of files. Ukh.
I don't have nearly as much free time to code now, either. I get home from work at about 18:45, and by the time I get something to eat, check my forums, mail, etc and am ready to code, it's 19:30 - 20:00. So that gives me about 3 hours max to code. It's midnight now, and I have to get up at 8am. Ukh. Oh well, never mind.

The servers seem to be working fine. I haven't had any errors from them, or crashes or anything. The only problem I have had is connect() on my stress tester failing with winsock code 10061, presumably because 50 sockets try to connect at once and SYN flood the server, since it's listen() backlog is only 5. I'll try changing that and see if it helps. Even if it doesn't, it's not much of a problem. The client can just try to reconnect.

I found a couple of minor issues with message sizes in the server. I have a GameMessage struct, which just contains a message ID and a message length. Then I have derived classes that include more members, and I set the message ID and length accordingly. The server was setting the length wrongly for some messages (A few send a struct, then a string, for instance [E.g. chat messages]). E.g. GameMessage_Talk had it's length set to sizeof(GameMessage_Talk), but the message was sent, followed by a string, so the client messed up.

I just thought of something else I should add; I should count how many times a client has sent an unrecognised message in a row. If they send more than a couple, disconnect them, since it's likely someone trying to flood me with gibberish.

I also added a bunch of users and characters to my DB. 1000 users, each with 2 characters. It was actually pretty speedy. About 3 seconds to do all 3000 INSERTs (From my code). Although since I have a silly amount of indexes, my index for the characters table is larger than the data itself. I'm sure there's stuff I can remove:
Click to enlarge

Anyway, bed.
Sign in to follow this  


2 Comments


Recommended Comments

Try using a real database server for an MMORPG, such as MS SQL! Man, I moved today, so no more internets and Tiberia for a while :(

Toolmaker

Share this comment


Link to comment
MySQL is fine so far, and I already have it set up. I can always just swap out my database class later on if MySQL becomes a problem.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement