Hallow[Online]

Development Blog!

Archive for the ‘Programming Development’ Category

Hallow[Online] Restructured…

leave a comment »

After careful consideration, I’ve completely restructured everything that I’ve had working. It’s all in an attempt to be more organized…. Yes… I rewrote it all in the process.

It is now:

  • Cleaner/Well organized
  • Easier to read
  • Easier to comprehend 
I still need some pimping art help, as requested back in my post “In need of GUI, Character, and Font Artists.

Written by FuRom

October 7, 2008 at 8:03 pm

The reason I made the C# JSON.NET wrapper!

leave a comment »

The reason I created the JSON.NET wrapper for Hallow[Online] is because I knew it would be simple and I needed managable packets. I wanted more than just one command being sent at a time to be possible as well. Curently I have the packets being parsed through REGEX like HTTP headers almost, not to mention how I was using String.Split() to tear all the data apart in the packets on the server side. 1 packet would be 1 command + pure string data. Now that I’m parsing JSON, it’s a usable object of commands that I can loop through and read the data of. Here’s a textagram of how it worked.

1 Packet (old way)
COMMAND, DATA
The data would look like: “value1|value2|value3”

1 Packet (new way)
COMMAND, DATA
COMMAND, DATA
COMMAND, DATA
COMMAND, DATA
The data now looks like: ‘Data_Name’ : ‘Value’, ‘Data_Name’ : ‘Value’

Written by FuRom

October 3, 2008 at 11:05 pm

Posted in Programming Development

Tagged with , ,

JSON.NET [Updated]

leave a comment »

I’ve decided to start work on a JSON reader/writer wrapper so that I can pimp out the packets that I sent to/from the server. It’ll be simpe to use and I’ll release it here when it’s complete.

UPDATE
The JSON wrapper has been MADE! It’s simple as hell. Written in JScript, it’s a .NET wrapper that is accessible by any and all .NET applications. It’s a good idea to use Microsoft.JScript to manage the JSON objects. The download is licensed under an MIT license. The README.TXT file explains how it works in C#.

Download: Rapidshare (5kb) Hallow[JS].ZIP

Written by FuRom

October 3, 2008 at 7:24 pm

Posted in Programming Development

Tagged with , ,

Eye Gouging Sounds…

leave a comment »

Today I realized that I needed SOUNDS! I couldn’t make DirectSound work the way I wanted. Not to mention the size of the DirectX SDK (which was greately unappreciated). In the end, I settled for a non-open source sound wrapper. irrKlang is what I settled for. It’s easy to use and free for non-commercial use. It’s pretty sad though. Not all of Hallow[Online] will be open source anymore but I’m able to back up irrKlang. They don’t care if you don’t buy their license until AFTER you’ve made money off your product. Not to mention that the licensing is pretty cheap.

I considered XNA for the development but I’m not fond of making users download the XNA framework on top of the .NET 3.0 framework that I’m forcing upon them. Also other options flickered across my computer screen, I just didn’t like them. irrKlang won, the end.

Also, I’d like to mention, Hallow [Online] WILL come with the irrKlang dependencies, so that people can compile the source from the fresh download.

Written by FuRom

September 30, 2008 at 11:56 pm

MySQL Connector/NET is EVIL!

leave a comment »

Well, I finally got around to figuring out how to sterilize the SQL queries. Originally, I was under the assumption that MySqlCommand.Parameters.AddWithValue() would do it without me having to edit too much in my SELECT statement but thanks to the POOR documentation on sterilizing the query, it took me HOURS to figure it out. Now that I’ve figured it out, I’ll help out EVERYONE that has ran across the SAME problem by just SHOWING and example below.

MySqlCommand mysqlCmd = new MySqlCommand("SELECT * FROM accounts WHERE (username = ?username) and (password = ?password)", MySqlConnection);
mysqlCmd.Parameters.AddWithValue("?username", "MY USERNAME");
mysqlCmd.Parameters.AddWithValue("?password", "MY SECRET PASSWORD");
mysqlCmd.Prepare();
MySqlDataReader mysqlReader = mysqlCmd.ExecuteReader();
while (mysqlReader.Read())
{
// Reader stuff here...
}

Written by FuRom

September 26, 2008 at 9:09 pm

The SceneSwitch() Riddle!

leave a comment »

Today I started development with 2 overall goals.

  • Make User Login Possible
  1. Add Login GUI form elements
  2. Add easy access controls for GUI form elements
  3. Upon login, switch from LOGIN -> GAME_MAP (they’re GUI scene titles).
  4. Add MySQL check on serverside.
  • Detach connection from client and reserve it for after the login is established.
After I had ALL of that accomplished, I had to test everything thouroughly, like always. I had GUI test elements in GAME_MAP scene. It was the chat box. You press the return/enter key to access it (gain focus to it). The problem was that, after login, pressing enter would crash the game. I assumed the issue had to be with the new elements I added. I tried to retest the way I had it before it messed up. I just removed the elements and left a button to switch scenes from LOGIN -> GAME_MAP.
It worked PERFECTLY like it originally did. So what was the problem? After hours of messing with line after line of codes I finally figured it out. Irrlicht.NET has a problem with IGUIElement focus! If you have an element in focus and just send it into oblivion without removing it’s focus, you can’t just use device.IGUIElement.SetFocus() again for some reason. I redid my SceneSwitcher() function to make sure all the elements that I have in the GUITable (hash table) is removed from focus if it is focused on.
This one single problem prevented me from ever getting to reserving the connection for logged in users only. That’ll only take 5 mins to implement though.

Written by FuRom

September 25, 2008 at 10:46 pm