Jump to content
Returning Members: Password Reset Required ×

Recommended Posts

Posted

Hello, I was wondering If I can get some insight to why some of my maps are causing issues like this. I've made 2 GIF images, showing the issue. This issue only happens in specific parts of the map. The main portion of the map is fine.

dd5835b33731a5a35525b0272944614b.gif

5fdfa6d45fae5393080afc998ea39e2e.gif

I'm not sure what the issue could be. I'd figure it was some type of map desync from client->server, but doesn't seem the case?

I've converted all the .DMaps from the client files to .map to use into my server, but that didnt resolve the issue.

Thoughts? Thanks!

Posted

Where would these scene objects coordinates be located? Is this something that’s in the sql?

No, it should be part of your map system. However you're loading those maps. If you're not loading the scene parts correctly (like if you're loading them upside down which some servers do), then things like bridges and trees will glitch out the players' jumps.

Posted

I’ll have to check out other bridges and what not, I assume it’ll happen to all of them if that’s the case?

Is this something that’s in the Map.cs or Dmap.cs?

Posted

I’ll have to check out other bridges and what not, I assume it’ll happen to all of them if that’s the case?

Is this something that’s in the Map.cs or Dmap.cs?

Yeah, bridges would be a little funky around the edges and stuff. And regarding where in your source that'd be ... no clue. I don't know what source you're using or where you got it from.

Posted

I’ll have to check out other bridges and what not, I assume it’ll happen to all of them if that’s the case?

Is this something that’s in the Map.cs or Dmap.cs?

Yeah, bridges would be a little funky around the edges and stuff. And regarding where in your source that'd be ... no clue. I don't know what source you're using or where you got it from.

I wish I knew what base this was. Is their any way I can find out? I had this server quite a while just sitting in my dropbox which I've been working on and off for learning purposes.

If anyone has similar issues, I'm still needing help with this! ^^

Posted
No clue. Maybe someone else has run into this issue before, but I haven't. Hard to debug without knowing anything about your source.
Posted
Set a breakpoint on the invalid jump function (it should be in your MsgAction processing for jump). Follow the callstack to see what is triggering the kickback you are seeing when you jump to an invalid coordinate.
Posted

Set a breakpoint on the invalid jump function (it should be in your MsgAction processing for jump). Follow the callstack to see what is triggering the kickback you are seeing when you jump to an invalid coordinate.

My guess is that there's a bug in the dmap to map converter and not the jump/walk. Maybe it'd be worth breakpointing that as well and stepping through it.

Posted

Check to make sure both client and server have the same map files.

Also why did you convert .dmap to .map? What was converted? Does the server you’re using specifically want .map? What is the makeup of a .map file since I only know .Dmap

Posted

Currently debugging this code, which is what keeps teleporting me back for invalid jumps.

                    if (client.Entity.Mode == Game.Enums.Mode.None)
                   {
                       client.Entity.Teleport(client.Map.ID, client.Entity.X, client.Entity.Y);
                   }
               }

This is what I said when I debug the line.

Map = Map
BaseID = {ushort} 1015
BodyGuards = {SafeDictionary<uint, Entity>} Count = 0
CloneCounter = Counter
Companions = {SafeDictionary<uint, Entity>} Count = 0
Entities = {SafeDictionary<uint, Entity>} Count = 645
EntityUIDCounter = Counter
EntityUIDCounter2 = Counter
Floor = Floor
FloorItems = {ConcurrentDictionary<uint, FloorItem>} Count = 3
FreezeMonsters = {bool} false
ID = {ushort} 1015
LastReload = {Time32} 1485429
Level = {ushort} 0
Npcs = {Dictionary<uint, INpc>} Count = 26
Path = {string} "map/map/island.dmap"
Portals = {List<Portal>} Count = 31
Scenes = {Map.SceneFile[]} null
StaticEntities = {SafeConcurrentDictionary<uint, StaticEntity>} Count = 0
Tables = {Dictionary<uint, IRoulette>} Count = 0
TempNpcs = {Dictionary<uint, INpc>} Count = 0
Timer = Class3<Map>
WasPKFree = {bool} false
Zones = {List<Zone>} Count = 0
disposed = {bool} false
portals = {Map.DMapPortal[]} null
Now = {Time32} 1714853
client = GameClient
clientstamp = {int} 842
generalData = Data
new_X = {ushort} 646
new_Y = {ushort} 744
oldX = {ushort} 657
oldY = {ushort} 744
serverstamp = {int} 841
speed = {int} 1

image.png?width=1497&height=904

Check to make sure both client and server have the same map files.

Also why did you convert .dmap to .map? What was converted? Does the server you’re using specifically want .map? What is the makeup of a .map file since I only know .Dmap

It's what my server does. I make a folder in the database folder, and make sure the folder is called "map/map/blahblah.dmap", and it'll convert all of them with "id.map" and send them all to "maps" folder and yeah my server loads only from .map. I have saw some servers load directly from just dmaps.

Posted

Currently debugging this code, which is what keeps teleporting me back for invalid jumps.

                    if (client.Entity.Mode == Game.Enums.Mode.None)
                   {
                       client.Entity.Teleport(client.Map.ID, client.Entity.X, client.Entity.Y);
                   }
               }

This is what I said when I debug the line.

Map = Map
BaseID = {ushort} 1015
BodyGuards = {SafeDictionary<uint, Entity>} Count = 0
CloneCounter = Counter
Companions = {SafeDictionary<uint, Entity>} Count = 0
Entities = {SafeDictionary<uint, Entity>} Count = 645
EntityUIDCounter = Counter
EntityUIDCounter2 = Counter
Floor = Floor
FloorItems = {ConcurrentDictionary<uint, FloorItem>} Count = 3
FreezeMonsters = {bool} false
ID = {ushort} 1015
LastReload = {Time32} 1485429
Level = {ushort} 0
Npcs = {Dictionary<uint, INpc>} Count = 26
Path = {string} "map/map/island.dmap"
Portals = {List<Portal>} Count = 31
Scenes = {Map.SceneFile[]} null
StaticEntities = {SafeConcurrentDictionary<uint, StaticEntity>} Count = 0
Tables = {Dictionary<uint, IRoulette>} Count = 0
TempNpcs = {Dictionary<uint, INpc>} Count = 0
Timer = Class3<Map>
WasPKFree = {bool} false
Zones = {List<Zone>} Count = 0
disposed = {bool} false
portals = {Map.DMapPortal[]} null
Now = {Time32} 1714853
client = GameClient
clientstamp = {int} 842
generalData = Data
new_X = {ushort} 646
new_Y = {ushort} 744
oldX = {ushort} 657
oldY = {ushort} 744
serverstamp = {int} 841
speed = {int} 1

image.png?width=1497&height=904

Check to make sure both client and server have the same map files.

Also why did you convert .dmap to .map? What was converted? Does the server you’re using specifically want .map? What is the makeup of a .map file since I only know .Dmap

It's what my server does. I make a folder in the database folder, and make sure the folder is called "map/map/blahblah.dmap", and it'll convert all of them with "id.map" and send them all to "maps" folder and yeah my server loads only from .map. I have saw some servers load directly from just dmaps.

When you breakpoint it, what condition is causing it to fall through to that else?

Posted

When you breakpoint it, what condition is causing it to fall through to that else?

I'm not sure fully what you mean by 'fall through'. But I'm hope I'm right. However I was curious and did comment out the "teleport" function under the if statement and see what would happen, Basically just disconnects my client. I've just copied the entire portion of this code. It's checking:

                if (Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null])
               {

otherwise it'll be this:

                }
               else
               {
                   if (client.Entity.Mode == Game.Enums.Mode.None)
                   {
                       client.Entity.Teleport(client.Map.ID, client.Entity.X, client.Entity.Y);
                   }

I've included the entire portion of the start of the if down to the else.

            if (Map != null)
           {
               if (Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null])
               {
                   if (Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 16)
                   {
                       client.Entity.Action = Game.Enums.ConquerAction.Jump;
                       client.Entity.Facing = Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
                       client.Entity.X = new_X;
                       client.Entity.Y = new_Y;
                       if (client.Entity.MapID == CaptureTheFlag.MapID)
                           CheckForFlag(client);
                       client.SendScreen(generalData, true);
                       client.Screen.Reload(generalData);

                       if (client.Entity.MapID == CaptureTheFlag.MapID)
                       {
                           foreach (INpc current2 in client.Map.Npcs.Values)
                           {
                               if (current2.MapID == CaptureTheFlag.MapID && Kernel.GetDistance(client.Entity.X,
                                       client.Entity.Y, current2.X, current2.Y) < 17)
                               {
                                   current2.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.MapID == 3856 && Kernel.SpawnNemesis2)
                       {
                           foreach (INpc Npc in client.Map.Npcs.Values)
                           {
                               if (Npc.MapID == 3856 && (Npc.UID == 3080) &&
                                   Kernel.GetDistance(client.Entity.X, client.Entity.Y, Npc.X, Npc.Y) < 17)
                               {
                                   Npc.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.MapID == 1927 && Kernel.SpawnBanshee2)
                       {
                           foreach (INpc Npc in client.Map.Npcs.Values)
                           {
                               if (Npc.MapID == 1927 && (Npc.UID == 2999) &&
                                   Kernel.GetDistance(client.Entity.X, client.Entity.Y, Npc.X, Npc.Y) < 17)
                               {
                                   Npc.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.MapID == 1020 && Kernel.Titan2)
                       {
                           foreach (INpc Npc in client.Map.Npcs.Values)
                           {
                               if (Npc.MapID == 1020 && (Npc.UID == 29996) &&
                                   Kernel.GetDistance(client.Entity.X, client.Entity.Y, Npc.X, Npc.Y) < 17)
                               {
                                   Npc.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.MapID == 1010 && Kernel.Ganoderma2)
                       {
                           foreach (INpc Npc in client.Map.Npcs.Values)
                           {
                               if (Npc.MapID == 1010 && (Npc.UID == 29995) &&
                                   Kernel.GetDistance(client.Entity.X, client.Entity.Y, Npc.X, Npc.Y) < 17)
                               {
                                   Npc.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.MapID == 3935 && Kernel.AlluringWitchHisCrystals2)
                       {
                           foreach (INpc Npc in client.Map.Npcs.Values)
                           {
                               if (Npc.MapID == 3935 && (Npc.UID == 29994) &&
                                   Kernel.GetDistance(client.Entity.X, client.Entity.Y, Npc.X, Npc.Y) < 17)
                               {
                                   Npc.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.InteractionInProgress && client.Entity.InteractionSet)
                       {
                           if (client.Entity.Body == 1003 || client.Entity.Body == 1004)
                           {
                               if (Kernel.GamePool.ContainsKey(client.Entity.InteractionWith))
                               {
                                   Client.GameClient ch = Kernel.GamePool[client.Entity.InteractionWith];
                                   Data general = new Data(true);
                                   general.UID = ch.Entity.UID;
                                   general.wParam1 = new_X;
                                   general.wParam2 = new_Y;
                                   general.ID = 0x9c;
                                   ch.Send(general.ToArray());
                                   ch.Entity.Action = Game.Enums.ConquerAction.Jump;
                                   ch.Entity.X = new_X;
                                   ch.Entity.Y = new_Y;
                                   ch.Entity.Facing = Kernel.GetAngle(ch.Entity.X, ch.Entity.Y, new_X, new_Y);
                                   ch.SendScreen(generalData, true);
                                   ch.Screen.Reload(general);
                                   client.SendScreen(generalData, true);
                                   client.Screen.Reload(general);
                               }
                           }
                       }

                       if (Kernel.GetDistance(client.Entity.X, client.Entity.Y, 73, 98) < 3 &&
                           client.Entity.MapID == 4020) //TOWEROFMYSTERY
                       {
                           client.Entity.Teleport(3998, 90, 352);
                       }

                       if (Kernel.GetDistance(client.Entity.X, client.Entity.Y, 40, 66) <= 1 && client.Entity.InTOM ||
                           Kernel.GetDistance(client.Entity.X, client.Entity.Y, 46, 44) <= 1 &&
                           client.Entity.InTOM) //TOWEROFMYSTERY
                       {
                           client.MessageBox("Do you want to leave the Tower of Mystery?",
                               p => { p.Entity.Teleport(4020, 84, 74); });
                       }
                   }
                   else
                   {
                       client.Disconnect();
                   }
               }
               else
               {
                   if (client.Entity.Mode == Game.Enums.Mode.None)
                   {
                       client.Entity.Teleport(client.Map.ID, client.Entity.X, client.Entity.Y);
                   }
               }
           }
           else
           {
               if (Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 17)
               {
                   client.Entity.Action = Game.Enums.ConquerAction.Jump;
                   client.Entity.Facing = Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
                   client.Entity.X = new_X;
                   client.Entity.Y = new_Y;
                   client.SendScreen(generalData, true);
                   client.Screen.Reload(generalData);
               }
               else
               {
                   client.Disconnect();
               }
           }

My guess is that there's a bug in the dmap to map converter and not the jump/walk. Maybe it'd be worth breakpointing that as well and stepping through it.

I do know, for some reason when I add all my dmaps from my client into my server database for conversion folder "map/map/.dmap" that goes into "maps" folder for server to load as .map. It only converts like 236 dmaps, and not all of them. Misses maps like twin city for example. But I do have a backup of maps, which I merge. Just odd to me.

Posted

When you breakpoint it, what condition is causing it to fall through to that else?

I'm not sure fully what you mean by 'fall through'. But I'm hope I'm right. However I was curious and did comment out the "teleport" function under the if statement and see what would happen, Basically just disconnects my client. I've just copied the entire portion of this code. It's checking:

                if (Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null])
               {

otherwise it'll be this:

                }
               else
               {
                   if (client.Entity.Mode == Game.Enums.Mode.None)
                   {
                       client.Entity.Teleport(client.Map.ID, client.Entity.X, client.Entity.Y);
                   }

I've included the entire portion of the start of the if down to the else.

            if (Map != null)
           {
               if (Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null])
               {
                   if (Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 16)
                   {
                       client.Entity.Action = Game.Enums.ConquerAction.Jump;
                       client.Entity.Facing = Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
                       client.Entity.X = new_X;
                       client.Entity.Y = new_Y;
                       if (client.Entity.MapID == CaptureTheFlag.MapID)
                           CheckForFlag(client);
                       client.SendScreen(generalData, true);
                       client.Screen.Reload(generalData);

                       if (client.Entity.MapID == CaptureTheFlag.MapID)
                       {
                           foreach (INpc current2 in client.Map.Npcs.Values)
                           {
                               if (current2.MapID == CaptureTheFlag.MapID && Kernel.GetDistance(client.Entity.X,
                                       client.Entity.Y, current2.X, current2.Y) < 17)
                               {
                                   current2.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.MapID == 3856 && Kernel.SpawnNemesis2)
                       {
                           foreach (INpc Npc in client.Map.Npcs.Values)
                           {
                               if (Npc.MapID == 3856 && (Npc.UID == 3080) &&
                                   Kernel.GetDistance(client.Entity.X, client.Entity.Y, Npc.X, Npc.Y) < 17)
                               {
                                   Npc.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.MapID == 1927 && Kernel.SpawnBanshee2)
                       {
                           foreach (INpc Npc in client.Map.Npcs.Values)
                           {
                               if (Npc.MapID == 1927 && (Npc.UID == 2999) &&
                                   Kernel.GetDistance(client.Entity.X, client.Entity.Y, Npc.X, Npc.Y) < 17)
                               {
                                   Npc.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.MapID == 1020 && Kernel.Titan2)
                       {
                           foreach (INpc Npc in client.Map.Npcs.Values)
                           {
                               if (Npc.MapID == 1020 && (Npc.UID == 29996) &&
                                   Kernel.GetDistance(client.Entity.X, client.Entity.Y, Npc.X, Npc.Y) < 17)
                               {
                                   Npc.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.MapID == 1010 && Kernel.Ganoderma2)
                       {
                           foreach (INpc Npc in client.Map.Npcs.Values)
                           {
                               if (Npc.MapID == 1010 && (Npc.UID == 29995) &&
                                   Kernel.GetDistance(client.Entity.X, client.Entity.Y, Npc.X, Npc.Y) < 17)
                               {
                                   Npc.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.MapID == 3935 && Kernel.AlluringWitchHisCrystals2)
                       {
                           foreach (INpc Npc in client.Map.Npcs.Values)
                           {
                               if (Npc.MapID == 3935 && (Npc.UID == 29994) &&
                                   Kernel.GetDistance(client.Entity.X, client.Entity.Y, Npc.X, Npc.Y) < 17)
                               {
                                   Npc.SendSpawn(client);
                               }
                           }
                       }

                       if (client.Entity.InteractionInProgress && client.Entity.InteractionSet)
                       {
                           if (client.Entity.Body == 1003 || client.Entity.Body == 1004)
                           {
                               if (Kernel.GamePool.ContainsKey(client.Entity.InteractionWith))
                               {
                                   Client.GameClient ch = Kernel.GamePool[client.Entity.InteractionWith];
                                   Data general = new Data(true);
                                   general.UID = ch.Entity.UID;
                                   general.wParam1 = new_X;
                                   general.wParam2 = new_Y;
                                   general.ID = 0x9c;
                                   ch.Send(general.ToArray());
                                   ch.Entity.Action = Game.Enums.ConquerAction.Jump;
                                   ch.Entity.X = new_X;
                                   ch.Entity.Y = new_Y;
                                   ch.Entity.Facing = Kernel.GetAngle(ch.Entity.X, ch.Entity.Y, new_X, new_Y);
                                   ch.SendScreen(generalData, true);
                                   ch.Screen.Reload(general);
                                   client.SendScreen(generalData, true);
                                   client.Screen.Reload(general);
                               }
                           }
                       }

                       if (Kernel.GetDistance(client.Entity.X, client.Entity.Y, 73, 98) < 3 &&
                           client.Entity.MapID == 4020) //TOWEROFMYSTERY
                       {
                           client.Entity.Teleport(3998, 90, 352);
                       }

                       if (Kernel.GetDistance(client.Entity.X, client.Entity.Y, 40, 66) <= 1 && client.Entity.InTOM ||
                           Kernel.GetDistance(client.Entity.X, client.Entity.Y, 46, 44) <= 1 &&
                           client.Entity.InTOM) //TOWEROFMYSTERY
                       {
                           client.MessageBox("Do you want to leave the Tower of Mystery?",
                               p => { p.Entity.Teleport(4020, 84, 74); });
                       }
                   }
                   else
                   {
                       client.Disconnect();
                   }
               }
               else
               {
                   if (client.Entity.Mode == Game.Enums.Mode.None)
                   {
                       client.Entity.Teleport(client.Map.ID, client.Entity.X, client.Entity.Y);
                   }
               }
           }
           else
           {
               if (Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 17)
               {
                   client.Entity.Action = Game.Enums.ConquerAction.Jump;
                   client.Entity.Facing = Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
                   client.Entity.X = new_X;
                   client.Entity.Y = new_Y;
                   client.SendScreen(generalData, true);
                   client.Screen.Reload(generalData);
               }
               else
               {
                   client.Disconnect();
               }
           }

My guess is that there's a bug in the dmap to map converter and not the jump/walk. Maybe it'd be worth breakpointing that as well and stepping through it.

I do know, for some reason when I add all my dmaps from my client into my server database for conversion folder "map/map/.dmap" that goes into "maps" folder for server to load as .map. It only converts like 236 dmaps, and not all of them. Misses maps like twin city for example. But I do have a backup of maps, which I merge. Just odd to me.

What is

If(Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null]))

doing?

I presume checking if the new x and y are a valid space. breakpoint there, inspect map.floor and compare your coordinates. I don't know the structure but if you share more information maybe we can help you identify the exact problem. Others have pointed out the scene was not loaded properly. Basically there is a mismatch somehow between what your client percieves as navigatable terrain and what your server percieves as navigatable terrain.

Map.Floor, and where it loads data in is what you should be tracking down.

Posted

What is

If(Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null]))

doing?

I presume checking if the new x and y are a valid space. breakpoint there, inspect map.floor and compare your coordinates. I don't know the structure but if you share more information maybe we can help you identify the exact problem. Others have pointed out the scene was not loaded properly. Basically there is a mismatch somehow between what your client percieves as navigatable terrain and what your server percieves as navigatable terrain.

Map.Floor, and where it loads data in is what you should be tracking down.

    public class Floor
   {
       [Flags]
       public enum DMapPointFlag : byte
       {
           Invalid = 1,
           Monster = 2,
           Item = 4,
           RaceItem = 8
       }
       public class Size
       {
           public int Width, Height;
           public Size(int width, int height)
           {
               Width = width;
               Height = height;
           }
           public Size()
           {
               Width = 0;
               Height = 0;
           }
       }
       public Size Bounds;
       public DMapPointFlag[,] Locations;
       public uint FloorMapID;
       public Floor(int width, int height, uint mapID)
       {
           FloorMapID = mapID;
           Bounds = new Size(width, height);
           Locations = new DMapPointFlag[width, height];
       }
       public bool this[int x, int y, MapObjectType type, object obj = null]
       {
           get
           {
               if (y >= Bounds.Height || x >= Bounds.Width || x < 0 || y < 0)
                   return false;

               DMapPointFlag filltype = Locations[x, y];

               if (type == MapObjectType.InvalidCast) return (filltype & DMapPointFlag.Invalid) == DMapPointFlag.Invalid;
               if ((filltype & DMapPointFlag.Invalid) == DMapPointFlag.Invalid) return false;
               if (type == MapObjectType.Player) return true;
               else if (type == MapObjectType.Monster)
                   return (filltype & DMapPointFlag.Monster) != DMapPointFlag.Monster;
               else if (type == MapObjectType.Item)
                   return (filltype & DMapPointFlag.Item) != DMapPointFlag.Item;
               else if (type == MapObjectType.StaticEntity)
                   return (filltype & DMapPointFlag.RaceItem) != DMapPointFlag.RaceItem;
               return false;
           }
           set
           {
               if (y >= Bounds.Height || x >= Bounds.Width || x < 0 || y < 0)
                   return;
               DMapPointFlag filltype = Locations[x, y];

               if (value)
               {
                   if (type == MapObjectType.InvalidCast)
                       TakeFlag(x, y, DMapPointFlag.Invalid);
                   if (type == MapObjectType.Item)
                       TakeFlag(x, y, DMapPointFlag.Item);
                   if (type == MapObjectType.Monster)
                       TakeFlag(x, y, DMapPointFlag.Monster);
                   if (type == MapObjectType.StaticEntity)
                       TakeFlag(x, y, DMapPointFlag.RaceItem);
               }
               else
               {
                   if (type == MapObjectType.InvalidCast)
                       AddFlag(x, y, DMapPointFlag.Invalid);
                   if (type == MapObjectType.Item)
                       AddFlag(x, y, DMapPointFlag.Item);
                   if (type == MapObjectType.Monster)
                       AddFlag(x, y, DMapPointFlag.Monster);
                   if (type == MapObjectType.StaticEntity)
                       AddFlag(x, y, DMapPointFlag.RaceItem);
               }
           }
       }
       public DMapPointFlag AddFlag(int x, int y, DMapPointFlag extraFlag)
       {
           Locations[x, y] |= extraFlag;
           return Locations[x, y];
       }
       public DMapPointFlag TakeFlag(int x, int y, DMapPointFlag extraFlag)
       {
           Locations[x, y] &= ~extraFlag;
           return Locations[x, y];
       }
   }

This is my map.floor method. If you like you can add me on discord as well (Natalynn#4100)

I do notice in my breakpoint, not sure if its normal?

image.png?width=458&height=181

The coordinates:

image.png?width=1118&height=904

Posted

What is

If(Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null]))

doing?

I presume checking if the new x and y are a valid space. breakpoint there, inspect map.floor and compare your coordinates. I don't know the structure but if you share more information maybe we can help you identify the exact problem. Others have pointed out the scene was not loaded properly. Basically there is a mismatch somehow between what your client percieves as navigatable terrain and what your server percieves as navigatable terrain.

Map.Floor, and where it loads data in is what you should be tracking down.

    public class Floor
   {
       [Flags]
       public enum DMapPointFlag : byte
       {
           Invalid = 1,
           Monster = 2,
           Item = 4,
           RaceItem = 8
       }
       public class Size
       {
           public int Width, Height;
           public Size(int width, int height)
           {
               Width = width;
               Height = height;
           }
           public Size()
           {
               Width = 0;
               Height = 0;
           }
       }
       public Size Bounds;
       public DMapPointFlag[,] Locations;
       public uint FloorMapID;
       public Floor(int width, int height, uint mapID)
       {
           FloorMapID = mapID;
           Bounds = new Size(width, height);
           Locations = new DMapPointFlag[width, height];
       }
       public bool this[int x, int y, MapObjectType type, object obj = null]
       {
           get
           {
               if (y >= Bounds.Height || x >= Bounds.Width || x < 0 || y < 0)
                   return false;

               DMapPointFlag filltype = Locations[x, y];

               if (type == MapObjectType.InvalidCast) return (filltype & DMapPointFlag.Invalid) == DMapPointFlag.Invalid;
               if ((filltype & DMapPointFlag.Invalid) == DMapPointFlag.Invalid) return false;
               if (type == MapObjectType.Player) return true;
               else if (type == MapObjectType.Monster)
                   return (filltype & DMapPointFlag.Monster) != DMapPointFlag.Monster;
               else if (type == MapObjectType.Item)
                   return (filltype & DMapPointFlag.Item) != DMapPointFlag.Item;
               else if (type == MapObjectType.StaticEntity)
                   return (filltype & DMapPointFlag.RaceItem) != DMapPointFlag.RaceItem;
               return false;
           }
           set
           {
               if (y >= Bounds.Height || x >= Bounds.Width || x < 0 || y < 0)
                   return;
               DMapPointFlag filltype = Locations[x, y];

               if (value)
               {
                   if (type == MapObjectType.InvalidCast)
                       TakeFlag(x, y, DMapPointFlag.Invalid);
                   if (type == MapObjectType.Item)
                       TakeFlag(x, y, DMapPointFlag.Item);
                   if (type == MapObjectType.Monster)
                       TakeFlag(x, y, DMapPointFlag.Monster);
                   if (type == MapObjectType.StaticEntity)
                       TakeFlag(x, y, DMapPointFlag.RaceItem);
               }
               else
               {
                   if (type == MapObjectType.InvalidCast)
                       AddFlag(x, y, DMapPointFlag.Invalid);
                   if (type == MapObjectType.Item)
                       AddFlag(x, y, DMapPointFlag.Item);
                   if (type == MapObjectType.Monster)
                       AddFlag(x, y, DMapPointFlag.Monster);
                   if (type == MapObjectType.StaticEntity)
                       AddFlag(x, y, DMapPointFlag.RaceItem);
               }
           }
       }
       public DMapPointFlag AddFlag(int x, int y, DMapPointFlag extraFlag)
       {
           Locations[x, y] |= extraFlag;
           return Locations[x, y];
       }
       public DMapPointFlag TakeFlag(int x, int y, DMapPointFlag extraFlag)
       {
           Locations[x, y] &= ~extraFlag;
           return Locations[x, y];
       }
   }

This is my map.floor method. If you like you can add me on discord as well (Natalynn#4100)

I do notice in my breakpoint, not sure if its normal?

image.png?width=458&height=181

The coordinates:

image.png?width=1118&height=904

Breakpoint

   public bool this[int x, int y, MapObjectType type, object obj = null]
  
  

and figure out where in the getter or setter its failing.

Posted

Breakpoint

   public bool this[int x, int y, MapObjectType type, object obj = null]
  
  

and figure out where in the getter or setter its failing.

Okay. This is get;

image.png?width=1394&height=873

Posted

Breakpoint

   public bool this[int x, int y, MapObjectType type, object obj = null]
  
  

and figure out where in the getter or setter its failing.

Okay. This is get;

image.png?width=1394&height=873

So it's returning false on the bounds check and that is what leads to your kickback and the fall through to the else?

Posted
Great so you have a debugging point here, figure out why those coordinates are false when you load them in. Something is off with your maps which we had a hunch for but now you have the process by which you confirmed it.
Posted

Great so you have a debugging point here, figure out why those coordinates are false when you load them in. Something is off with your maps which we had a hunch for but now you have the process by which you confirmed it.

Well, Im not sure if you read the other post. But when I converted my dmaps to .map, it only gave me like 236 of them or so. Shouldn't there be more for a 6325 client? I Figured there would be cause twin city wasnt even in that map conversion.

Posted

Edit, resolved the issues. If you have any issues like this. Just make sure to manually extract 7z files + copy dmaps for conversion.

Thanks for the help! ^^ <3

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...