I have the following Problem:
Following code will be excuted in onServerStart:
Method parse:
In sv_config.ini:
Normally should work everything well.
But what i get from the above code:
Following code will be excuted in onServerStart:
Code:
string entry = GetServerCFG("EpicZombie", "mp_dome", "nothing");
if (entry.CompareTo("nothing")!=0)
{
ServerLog(LogType.LogConsole, "before splitting with !:" + entry);
String[] coords = entry.Split(new Char[] { '!' });
ServerLog(LogType.LogConsole, "before splitting with !:" + entry.Length);
ServerLog(LogType.LogConsole, "before splitting wit2 !:" + coords.Length);
List<Vector> newPos = new List<Vector>();
newPos.Add(parse(coords[0]));
newPos.Add(parse(coords[1]));
BoxPositions["mp_dome"] = newPos;
entry = null;
}
Method parse:
Code:
private Vector parse(String s)
{
ServerLog(LogType.LogConsole, "Before splitting with ,:" + s.Length);
ServerLog(LogType.LogConsole, "Before splitting with ,:" + s);
String[] coord = s.Split(new Char[] { ',' });
ServerLog(LogType.LogConsole, "After splitting with ,:" + coord.Length);
ServerLog(LogType.LogConsole, "After splitting with ,: " + coord[0] + " " + coord[1] + " " + coord[2]);
return new Vector(Int32.Parse(coord[0]), Int32.Parse(coord[1]), Int32.Parse(coord[2]));
}
In sv_config.ini:
Code:
[EpicZombie]
mp_dome=67,-347,-352!825,-648,0
Normally should work everything well.
But what i get from the above code:
- The ServerLog Methods in OnServerStart prints nothing, not even a newline
- ServerLog(LogType.LogConsole, "Before splitting with ,:" + s.Length); give s me a length of 0/ But it even prints something
- resulting a C# IndexOutOfBounds exception in return new Vector(Int32.Parse(coord[0]), Int32.Parse(coord[1]), Int32.Parse(coord[2]));