Saturday, June 24, 2006

Enumerations in C#

Enumerations are a great construct.They allow you to create a type limited to a set of constant values. Because of this, they are type-safe. Best suited to use them are numerical values like int, long and byte.

The .Net framework makes extensive use of enums-Days of the Week, for example. Using enums eliminates common errors like passing invalid arguments to a function.

For example, you may have a function that accepts the numerical equivalent of a day of the week. It may only accept an integer from 1 to 7. But nothing prevents the code from calling it with a value of 8,9 or 10, etc. Using enumerations, you can define a custom type DayofWeek:

enum DayofWeek
{
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
}

So, instead of:
public void foo(int DayOfWeek)
{
}

we have:
public void foo(DayofWeek day)
{
}

By default, each constant in the enumerations will be given an integer value starting from 0. So Monday will have a value of 0, and so on.

Now you won't have to worry about your function being called with invalid arguments.



Till then, see ya!
Peace!

Wednesday, June 21, 2006

My so-called Lineage II Life

I play Lineage II on a private server. I've never played on retail but I think I have a fair amount of knowledge about the game.

I have 2 characters, a spellsinger and a Bounty hunter. The spellsinger came first. When you play on a low rate server, you have to think about which class to use as your first character. It's important that this character requires minimal equipment but can level up fast so that you can save more adena to 'fund' your next character.

So I chose an elven mystic character which later on became a spellsinger. Elven mystics are fragile but they more than make up for it due to their casting speed and fair amount of damage inflicted.

Why choose a mystic (a damage dealer mystic, that is), you might ask? Simple. It's because you level up faster. You kill more mobs faster and it's low maintenance.

After leveling up my mystic to 52, I created my real money-maker. A dwarf. More specifically, a scavenger dwarf.

You see scavengers make a lot more adena because of their spoil skill. They can get extra number of drops than any other character would normally get from a mob.

Leveling up a dwarf is hard, time consuming and most of all--boring! But if you want to make enough adena in order buy upper grade equipment(top C grade to A grade), a scavenger-and a warsmith, if I may add, is important.

BTW, I play on Staris server of L2 Extreme

Cya!
Peace!

Saturday, June 17, 2006

You are using an Invalid IP to access this site!

If you ever come across this error message on your PHP nuke sites, don't fret. It's just am error message coming from the nuke sentinel module.
Open nukesentinel.php in the includes folder and search for

if($nsnst_const['remote_ip']=="none") { die(_AB_INVALIDIP); }


Comment out this line and you're done!