(Bear in mind this isn't directed at you Korvacs, I'd never baby a post like this if it was lol)
The return value on Random.Next returns:
>=min, <max
Meaning it should never *logically* produce a number that wouldn't suffice as an index. HOWEVER! There are exceptions to this rule, where is the max is 0, 0 will be returned. So what if the Length of the array is 0, we can't index 0; now can we? So therefore logically From[0] would produce an exception where From.Length is 0.
So the solution would be
Code:
if (From.Length > 0)
ItemID = (uint)From[Rnd.Next(From.Count)];
Get rid of the whole if (From != null) scope. When would From ever equal null when we initialize it just a couple lines before our if-statement and never set it back to null.
Error in the Console 5165 07/11/2010 - CO2 Private Server - 8 Replies hi, i have a co pserver 5165 non-hamachi
i got an error, i can't login , it block in "login to game server"
and take a look at the Console
http://img188.imageshack.us/img188/4123/errorqo.p ng
And here is my GameWorker.cs:
using System;
Error with 5165 06/23/2010 - CO2 Private Server - 7 Replies I get this error when i debug the project in c#
http://img139.imageshack.us/img139/6204/errorcy.j pg
Any idea how can i fix this?
Edit: I'm getting another error when a char log in
http://img28.imageshack.us/img28/4418/error2zh.jp g
5165 Error! 03/04/2010 - CO2 Private Server - 4 Replies I followed Korvacs guide to run a 5165 server on Windows 7. Afterwards I tried to run the server, it got to the point where it says "Dmaps loaded successfully in 208 milliseconds"
At that point it will go back to Visual C# and highlight
In DMap.cs line 124
I need help.
5165 Error X_X 02/20/2010 - CO2 Private Server - 1 Replies Aite since i like aint a decent coder, I got a error on ma source
The name 'Skill' does not exist in this current context
It was for the Reflect Fix Release,
for (int n = 0; n < 5; n++)
{
BW.Write((byte)0);//WH Count
[Help] plz what is that error 5165 12/31/2009 - CO2 Private Server - 11 Replies when im made my server non hamachi in 5165 thats give me that error when any one try to logging to my server and he can't log and im changed the source and still same prop
http://i46.tinypic.com/1zvu99s.jpg