You last visited: Today at 18:14
Advertisement
Character changed while changing map. Do not abuse Commands.
Discussion on Character changed while changing map. Do not abuse Commands. within the Nostale forum part of the MMORPGs category.
01/11/2020, 05:10
#1
elite*gold: 0
Join Date: Dec 2019
Posts: 9
Received Thanks: 0
Character changed while changing map. Do not abuse Commands.
Code:
[05:03:54][WARN][ChangeMapInstance]: Character changed while changing map. Do not abuse Commands.
System.IndexOutOfRangeException: Der Index war außerhalb des Arraybereichs.
bei OpenNos.PathFinder.BestFirstSearch.LoadBrushFireJagged(GridPos user, GridPos[][] Grid, Int16 MaxDistance) in C:\Users\Administrator\Desktop\Reworked Source\OpenNos.PathFinder\BestFirstSearch.cs:Zeile 234.
bei OpenNos.GameObject.BattleEntity.UpdateBushFire() in C:\Users\Administrator\Desktop\Reworked Source\OpenNos.GameObject\BattleEntity.cs:Zeile 1636.
bei OpenNos.GameObject.Networking.ServerManager.ChangeMapInstance(Int64 characterId, Guid mapInstanceId, Nullable`1 mapX, Nullable`1 mapY, Boolean noAggroLoss) in C:\Users\Administrator\Desktop\Reworked Source\OpenNos.GameObject\Networking\ServerManager.cs:Zeile 653.
habe ich schon gefunden.
mein Code
Code:
namespace OpenNos.PathFinder
{
public static class BestFirstSearch
{
#region Methods
public static List<Node> Backtrace(Node end)
{
List<Node> path = new List<Node>();
while (end.Parent != null)
{
end = end.Parent;
path.Add(end);
}
path.Reverse();
return path;
}
public static List<Node> FindPathJagged(GridPos start, GridPos end, GridPos[][] Grid)
{
int GridX = Grid.Length;
int GridY = Grid[0].Length;
if (GridX <= start.X || GridY <= start.Y || start.X < 0 || start.Y < 0)
{
return new List<Node>();
}
Node node = new Node();
Node[][] grid = JaggedArrayExtensions.CreateJaggedArray<Node>(GridX, GridY);
if (grid[start.X][start.Y] == null)
{
grid[start.X][start.Y] = new Node(Grid[start.X][start.Y]);
}
Node startingNode = grid[start.X][start.Y];
MinHeap path = new MinHeap();
// push the start node into the open list
path.Push(startingNode);
startingNode.Opened = true;
// while the open list is not empty
while (path.Count > 0)
{
// pop the position of node which has the minimum `f` value.
node = path.Pop();
if (grid[node.X][node.Y] == null)
{
grid[node.X][node.Y] = new Node(Grid[node.X][node.Y]);
}
grid[node.X][node.Y].Closed = true;
//if reached the end position, construct the path and return it
if (node.X == end.X && node.Y == end.Y)
{
return Backtrace(node);
}
// get neigbours of the current node
List<Node> neighbors = GetNeighborsJagged(grid, node, Grid);
for (int i = 0, l = neighbors.Count; i < l; ++i)
{
Node neighbor = neighbors[i];
if (neighbor.Closed)
{
continue;
}
// check if the neighbor has not been inspected yet, or can be reached with
// smaller cost from the current node
if (!neighbor.Opened)
{
if (neighbor.F == 0)
{
neighbor.F = Heuristic.Octile(Math.Abs(neighbor.X - end.X), Math.Abs(neighbor.Y - end.Y));
}
neighbor.Parent = node;
if (!neighbor.Opened)
{
path.Push(neighbor);
neighbor.Opened = true;
}
else
{
neighbor.Parent = node;
}
}
}
}
return new List<Node>();
}
public static List<Node> GetNeighborsJagged(Node[][] Grid, Node node, GridPos[][] MapGrid)
{
int GridX = Grid.Length;
int GridY = Grid[0].Length;
short x = node.X, y = node.Y;
List<Node> neighbors = new List<Node>();
bool s0 = false, d0 = false, s1 = false, d1 = false, s2 = false, d2 = false, s3 = false, d3 = false;
int IndexX;
int IndexY;
// ↑
IndexX = x;
IndexY = y - 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
s0 = true;
}
// →
IndexX = x + 1;
IndexY = y;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
s1 = true;
}
// ↓
IndexX = x;
IndexY = y + 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
s2 = true;
}
// ←
IndexX = x - 1;
IndexY = y;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
s3 = true;
}
d0 = s3 || s0;
d1 = s0 || s1;
d2 = s1 || s2;
d3 = s2 || s3;
// ↖
IndexX = x - 1;
IndexY = y - 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && d0 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
}
// ↗
IndexX = x + 1;
IndexY = y - 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && d1 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
}
// ↘
IndexX = x + 1;
IndexY = y + 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && d2 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
}
// ↙
IndexX = x - 1;
IndexY = y + 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && d3 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
}
return neighbors;
}
public static Node[][] LoadBrushFireJagged(GridPos user, GridPos[][] Grid, short MaxDistance = 255)
{
int GridX = Grid.Length;
int GridY = Grid[0].Length;
Node[][] grid = JaggedArrayExtensions.CreateJaggedArray<Node>(GridX, GridY);
Node node = new Node();
if (grid[user.X][user.Y] == null)
{
grid[user.X][user.Y] = new Node(Grid[user.X][user.Y]);
}
Node Start = grid[user.X][user.Y];
MinHeap path = new MinHeap();
// push the start node into the open list
path.Push(Start);
Start.Opened = true;
// while the open list is not empty
while (path.Count > 0)
{
// pop the position of node which has the minimum `f` value.
node = path.Pop();
if (grid[node.X][node.Y] == null)
{
grid[node.X][node.Y] = new Node(Grid[node.X][node.Y]);
}
grid[node.X][node.Y].Closed = true;
// get neighbors of the current node
List<Node> neighbors = GetNeighborsJagged(grid, node, Grid);
for (int i = 0, l = neighbors.Count; i < l; ++i)
{
Node neighbor = neighbors[i];
if (neighbor.Closed)
{
continue;
}
// check if the neighbor has not been inspected yet, or can be reached with
// smaller cost from the current node
if (!neighbor.Opened)
{
if (neighbor.F == 0)
{
double distance = Heuristic.Octile(Math.Abs(neighbor.X - node.X), Math.Abs(neighbor.Y - node.Y)) + node.F;
if (distance > MaxDistance)
{
neighbor.Value = 1;
continue;
}
neighbor.F = distance;
grid[neighbor.X][neighbor.Y].F = neighbor.F;
}
neighbor.Parent = node;
if (!neighbor.Opened)
{
path.Push(neighbor);
neighbor.Opened = true;
}
else
{
neighbor.Parent = node;
}
}
}
}
return grid;
}
public static List<Node> TracePathJagged(Node node, Node[][] Grid, GridPos[][] MapGrid)
{
List<Node> list = new List<Node>();
if (MapGrid == null || Grid == null || node.X >= Grid.Length || node.Y >= Grid[0].Length || node.X < 0 || node.Y < 0 || Grid[node.X][node.Y] == null)
{
node.F = 100;
list.Add(node);
return list;
}
Node currentnode = Grid[node.X][node.Y];
while (currentnode.F != 1 && currentnode.F != 0)
{
Node newnode = GetNeighborsJagged(Grid, currentnode, MapGrid)?.OrderBy(s => s.F).FirstOrDefault();
if (newnode != null)
{
list.Add(newnode);
currentnode = newnode;
}
}
return list;
}
#endregion
}
}
danke schon mal
so bald ich die map wechsel oder ein neuen charakter angelege passiert das ..^^
01/11/2020, 09:13
#2
elite*gold: 0
Join Date: Aug 2019
Posts: 97
Received Thanks: 3
Quote:
Originally Posted by
Melonchen
Code:
[05:03:54][WARN][ChangeMapInstance]: Character changed while changing map. Do not abuse Commands.
System.IndexOutOfRangeException: Der Index war außerhalb des Arraybereichs.
bei OpenNos.PathFinder.BestFirstSearch.LoadBrushFireJagged(GridPos user, GridPos[][] Grid, Int16 MaxDistance) in C:\Users\Administrator\Desktop\Reworked Source\OpenNos.PathFinder\BestFirstSearch.cs:Zeile 234.
bei OpenNos.GameObject.BattleEntity.UpdateBushFire() in C:\Users\Administrator\Desktop\Reworked Source\OpenNos.GameObject\BattleEntity.cs:Zeile 1636.
bei OpenNos.GameObject.Networking.ServerManager.ChangeMapInstance(Int64 characterId, Guid mapInstanceId, Nullable`1 mapX, Nullable`1 mapY, Boolean noAggroLoss) in C:\Users\Administrator\Desktop\Reworked Source\OpenNos.GameObject\Networking\ServerManager.cs:Zeile 653.
habe ich schon gefunden.
mein Code
Code:
namespace OpenNos.PathFinder
{
public static class BestFirstSearch
{
#region Methods
public static List<Node> Backtrace(Node end)
{
List<Node> path = new List<Node>();
while (end.Parent != null)
{
end = end.Parent;
path.Add(end);
}
path.Reverse();
return path;
}
public static List<Node> FindPathJagged(GridPos start, GridPos end, GridPos[][] Grid)
{
int GridX = Grid.Length;
int GridY = Grid[0].Length;
if (GridX <= start.X || GridY <= start.Y || start.X < 0 || start.Y < 0)
{
return new List<Node>();
}
Node node = new Node();
Node[][] grid = JaggedArrayExtensions.CreateJaggedArray<Node>(GridX, GridY);
if (grid[start.X][start.Y] == null)
{
grid[start.X][start.Y] = new Node(Grid[start.X][start.Y]);
}
Node startingNode = grid[start.X][start.Y];
MinHeap path = new MinHeap();
// push the start node into the open list
path.Push(startingNode);
startingNode.Opened = true;
// while the open list is not empty
while (path.Count > 0)
{
// pop the position of node which has the minimum `f` value.
node = path.Pop();
if (grid[node.X][node.Y] == null)
{
grid[node.X][node.Y] = new Node(Grid[node.X][node.Y]);
}
grid[node.X][node.Y].Closed = true;
//if reached the end position, construct the path and return it
if (node.X == end.X && node.Y == end.Y)
{
return Backtrace(node);
}
// get neigbours of the current node
List<Node> neighbors = GetNeighborsJagged(grid, node, Grid);
for (int i = 0, l = neighbors.Count; i < l; ++i)
{
Node neighbor = neighbors[i];
if (neighbor.Closed)
{
continue;
}
// check if the neighbor has not been inspected yet, or can be reached with
// smaller cost from the current node
if (!neighbor.Opened)
{
if (neighbor.F == 0)
{
neighbor.F = Heuristic.Octile(Math.Abs(neighbor.X - end.X), Math.Abs(neighbor.Y - end.Y));
}
neighbor.Parent = node;
if (!neighbor.Opened)
{
path.Push(neighbor);
neighbor.Opened = true;
}
else
{
neighbor.Parent = node;
}
}
}
}
return new List<Node>();
}
public static List<Node> GetNeighborsJagged(Node[][] Grid, Node node, GridPos[][] MapGrid)
{
int GridX = Grid.Length;
int GridY = Grid[0].Length;
short x = node.X, y = node.Y;
List<Node> neighbors = new List<Node>();
bool s0 = false, d0 = false, s1 = false, d1 = false, s2 = false, d2 = false, s3 = false, d3 = false;
int IndexX;
int IndexY;
// ↑
IndexX = x;
IndexY = y - 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
s0 = true;
}
// →
IndexX = x + 1;
IndexY = y;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
s1 = true;
}
// ↓
IndexX = x;
IndexY = y + 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
s2 = true;
}
// ←
IndexX = x - 1;
IndexY = y;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
s3 = true;
}
d0 = s3 || s0;
d1 = s0 || s1;
d2 = s1 || s2;
d3 = s2 || s3;
// ↖
IndexX = x - 1;
IndexY = y - 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && d0 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
}
// ↗
IndexX = x + 1;
IndexY = y - 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && d1 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
}
// ↘
IndexX = x + 1;
IndexY = y + 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && d2 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
}
// ↙
IndexX = x - 1;
IndexY = y + 1;
if (GridX > IndexX && GridY > IndexY && IndexX >= 0 && IndexY >= 0 && d3 && MapGrid[IndexX][IndexY].IsWalkable())
{
if (Grid[IndexX][IndexY] == null)
{
Grid[IndexX][IndexY] = new Node(MapGrid[IndexX][IndexY]);
}
neighbors.Add(Grid[IndexX][IndexY]);
}
return neighbors;
}
public static Node[][] LoadBrushFireJagged(GridPos user, GridPos[][] Grid, short MaxDistance = 255)
{
int GridX = Grid.Length;
int GridY = Grid[0].Length;
Node[][] grid = JaggedArrayExtensions.CreateJaggedArray<Node>(GridX, GridY);
Node node = new Node();
if (grid[user.X][user.Y] == null)
{
grid[user.X][user.Y] = new Node(Grid[user.X][user.Y]);
}
Node Start = grid[user.X][user.Y];
MinHeap path = new MinHeap();
// push the start node into the open list
path.Push(Start);
Start.Opened = true;
// while the open list is not empty
while (path.Count > 0)
{
// pop the position of node which has the minimum `f` value.
node = path.Pop();
if (grid[node.X][node.Y] == null)
{
grid[node.X][node.Y] = new Node(Grid[node.X][node.Y]);
}
grid[node.X][node.Y].Closed = true;
// get neighbors of the current node
List<Node> neighbors = GetNeighborsJagged(grid, node, Grid);
for (int i = 0, l = neighbors.Count; i < l; ++i)
{
Node neighbor = neighbors[i];
if (neighbor.Closed)
{
continue;
}
// check if the neighbor has not been inspected yet, or can be reached with
// smaller cost from the current node
if (!neighbor.Opened)
{
if (neighbor.F == 0)
{
double distance = Heuristic.Octile(Math.Abs(neighbor.X - node.X), Math.Abs(neighbor.Y - node.Y)) + node.F;
if (distance > MaxDistance)
{
neighbor.Value = 1;
continue;
}
neighbor.F = distance;
grid[neighbor.X][neighbor.Y].F = neighbor.F;
}
neighbor.Parent = node;
if (!neighbor.Opened)
{
path.Push(neighbor);
neighbor.Opened = true;
}
else
{
neighbor.Parent = node;
}
}
}
}
return grid;
}
public static List<Node> TracePathJagged(Node node, Node[][] Grid, GridPos[][] MapGrid)
{
List<Node> list = new List<Node>();
if (MapGrid == null || Grid == null || node.X >= Grid.Length || node.Y >= Grid[0].Length || node.X < 0 || node.Y < 0 || Grid[node.X][node.Y] == null)
{
node.F = 100;
list.Add(node);
return list;
}
Node currentnode = Grid[node.X][node.Y];
while (currentnode.F != 1 && currentnode.F != 0)
{
Node newnode = GetNeighborsJagged(Grid, currentnode, MapGrid)?.OrderBy(s => s.F).FirstOrDefault();
if (newnode != null)
{
list.Add(newnode);
currentnode = newnode;
}
}
return list;
}
#endregion
}
}
danke schon mal
so bald ich die map wechsel oder ein neuen charakter angelege passiert das ..^^
Add me discord Grandel#4356
Similar Threads
[HELP]ABOUT CHANGING EUDEMON WHILE COMPOS
01/20/2011 - EO PServer Hosting - 5 Replies
here is the problem .. while I compos copper rhino .. it chnge be yeti .. why ? can u all help me .. i've search butno found ..:o
http://img28.imageshack.us/img28/3591/606244.jpg
Uploaded with ImageShack.us
[Guide] Just changing the drops of VIP maps without changing of its place
10/08/2010 - EO PServer Guides & Releases - 2 Replies
in revo's DB when u add the VIP tele it apears on the old market ..
some ppl dont know how to change its place thats why i made this query for them
delete from cq_generator where id >= 0113 and id <= 0128;
INSERT INTO `cq_generator` VALUES ('0113', '8900', '0062', '0033', '0001', '0001', '0001', '0025', '0001', '0110', '0000', '0000', '0000', '0000', '0000');
INSERT INTO `cq_generator` VALUES ('0114', '8900', '0072', '0037', '0001', '0001', '0001', '0025', '0001', '0110', '0000',...
[Key Commands] Default Key Commands for the beginners
10/01/2008 - General Gaming Releases - 0 Replies
Default keybindings:
Abilities Window V
Backpack Window: B
Career Window: K
Character Window: C
Battlegroup Window: Left Alt + R
Developer Window: ;
Guild Window: G
Help Window: H
Summons changed 1-3,Potions changed 4-9
06/28/2008 - General Gaming Discussion - 11 Replies
hello ever tired of pressing multiple keys to summon cell and sick of it? now here`s the all in one solution. Go to =C:\Program Files\Softnyx\Rakion\ControlsSV and replace the file. the original one is the change back if u dont like it. thanks will be apprreciated.:)
All times are GMT +2. The time now is 18:16 .