 |
|
It is currently Mon Sep 06, 2010 5:44 am
|
View unanswered posts | View active topics
| Welcome |
|
|
Welcome to Bainscape
You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today! |
|
Page 1 of 1
|
[ 1 post ] |
|
| Author |
Message |
|
Rachael
|
Post subject: Nulls - seperating myth from fact! [A must read] Posted: Wed Jul 28, 2010 7:15 pm |
|
Joined: Tue Jul 08, 2008 6:41 pm Posts: 4 Reputation: 100
Location: County Durham, England
|
Now, I've noticed a lot of people post about how much nulls annoy them and that I should stop being so crap/lazy and just fix them/buy an anti-null, or some other similar implication. So I've decided to cover everything I know to stop the confusion. Be warned, this will be a somewhat long and detailed dissertation, so if you don't feel like doing a bit of reading, this probably isn't for you.
Let's start with the actual definition of a null. Wikipedia describes it as:Wikipedia.org wrote: Null means "nothing" or without value or consequence. Now, most of you perceive a null for the server as something which causes crashes, or an inability to play (in many forms, such as being unable to walk or perform actions). So, if "null" actually just means nothing, why is it so bad for the server?
Now, to explain what a null is for the server. In programming languages, a null is just a filler value - just something that's thrown back when nothing else was programmed to. for example, let's say you're doing some kind of popularity quiz in a magazine that decides how popular you are depending upon the score you got. So, their results table would look something like:
- 100: Stud - 50: Awesome - 25: Unpopular etc, etc.Now, let's also say that the person who wrote this quiz overlooked something, and made it possible to achieve a score over 100. Since there's no popularity rank for a score over 100, the person taking the quiz wouldn't know how to rank themselves. In the world of programming, that person would have just been ranked as the allmighty null, since there was no valid result the quiz could return otherwise. So in short, a null is a counter-measure which automatically exists in programming to prevent programs from crashing when no valid result can be expected. So, nulls are actually a good thing, right? Well yes, yes they are.
Now you're probably a bit confused. I've just explained to you why nulls are a good thing. Up until now, you've understood nulls to be a malicious form of server-stopping sharks. So, why do nulls cause the server to crash (and other similar undesirable effects)? Now, as I have explained, nulls occur when a piece of code is executed using settings which can't return any valid results (well, no results at all actually). That by itself causes no major problems, as it would simply blow over and the single player, whoever happened to execute that code, would just disconnect harmlessly.
"So, why does the server crash at all, if that's the case?" is probably what you're thinking now. Now, some code pieces rely on a valid result in order to continue. So, when they receive a null (or nothing), realising that it hasn't received the desired result, the code executes itself again, in an attempt to receive valid data. However, since the parameters aren't changing, it just receives nothing, over and over and over. This is what causes the server to crash. To be a bit more clear... The server has managed to trap itself within a small fragment of code, so all other coding in the server is no longer being effectively run, and has become redundant. Well that explains what nulls do and why they're bad.
Now, here's a list of dos and don'ts - I'd like you all to read this part, to stop all of you from claiming to know what causes nulls, and believe me, the majority of you are miles off (don't worry, I'll explain why).Things that don't cause nulls:- Custom items - The "yell" command - (Suprisingly enough) SpammingThings that do cause nulls:- Certain pieces of my crappy codingNow, to explain why these things do and don't cause nulls.
Custom items are entirely client-sided function. Nulls are caused by oversights in the actual server. Just think for a second - a "custom item" is just an item that's been added that wouldn't usually be in a standard 317 client. So, if I were to use a 602 client - which has the most "custom items" ever, surely I'd be in for an unimaginable amount of nulls? Clearly not.
The yell command is just a command. As said before, nulls are caused by coding oversights. The yell command itself is one of the most worked on and advanced commands in the server (possibly with the exception of "buy" and "sell", for various reasons) and has been thoroughly tested by myself. At no point does the yell fail to return any valid data, and so it does not cause any nulls whatsoever.
Spamming the chatbox is just talking a lot. The 317 chat engine is stable and can't really be faulted otherwise. Trust me, it doesn't cause any problems.
Certain pieces of my crappy coding are the only thing that cause nulls here. These are completely server-sided, so don't go critisizing the client. Don't get me wrong, I haven't given up on these things. I do my best in my spare time to find the source of any nulls and errors where I see them and try to fix them. There could be any number of code fragments which cause nulls so an immediate fix isn't just going to happen overnight. Hopefully you have learnt a few things from this and should answer a few of your questions. This should also explain why things such as the legendary "anti-null" simply don't exist. If there is anything here you don't exactly understand, don't hesitate to post and possibly myself or another forums user will be able to help you.Thank you for reading!
_________________
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 1 post ] |
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
|
 |