[Dynamic maps] Whats wrong with my method

04/24/2011 18:03 _DreadNought_#1
Hey guys,

Once again I need some help, I've created a Dynamic map system for Impulses source but I dont understand why its not working.

I'm doing
-Server startup create a dynamic map counter starting at 10,000;
-upon a command @dynamic it trys to create it
-The command calls a void called MakeDynamic()
-The void makes a ushort newid and the counter get inc by one and then the counter get copied onto newid;
-The Dynamic() void is then called-
-Dynamic void then searched through gamemap.dat to find the players current mapid(in my case 1002) when it finds it, it also finds the path
-It then adds the map to the server(dict and map class) with the newid but original path as the real id
-Upon teleport to the NEW id with the path of a current map it just sits at Connecting to gameserver please wait...

So im adding a new map like so:
Code:
for (uint i = 0; i < MapCount; i++)
            {
                ushort BaseID = (ushort)BR.ReadUInt32();
                string Path = Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadInt32()));
                Console.WriteLine("Dynamic: MapID Read: {0}", BaseID);
                if (mapid == BaseID)
                {
                    Game.Map D = new Game.Map(newid, Path);
                    ServerBase.Kernel.Maps.Add(newid, D);
                    Console.WriteLine(newid + " Is the ID");
                    return true;
                }
                BR.ReadInt32();
            }
But it insists in not working.
04/24/2011 19:25 CptSky#2
My system use two things, a MapUID and a DMapID. All the server-side things use the MapUID, except when you send the MapID to the client. I use the DMapID so the client use the right map...

By example, the mine cave in the Adventure map use the same DMap that the conventional mine cave at Twin City.
Code:
1218 Adventure-8.1 1025 2114 10 1003 1278 1219 4294967295
The MapUID is 1218, so everywhere in the source, the map is considered as 1218. But when you want to spawn the character on a map (1010:74/86), I use the DMapID. In this case, it's 1025. It's the only time you need to know the "real" ID.

Maybe, it will help you to understand the dynamic map system.
04/24/2011 20:25 _DreadNought_#3
so like, When teleporting or whenever I need to tell the client my mapid respond with the real mapid?

so like
on teleport(client.map.realid, x,y)

but on everything else just have it client.map.id?
04/24/2011 23:10 CptSky#4
Quote:
Originally Posted by _DreadNought_ View Post
so like, When teleporting or whenever I need to tell the client my mapid respond with the real mapid?

so like
on teleport(client.map.realid, x,y)

but on everything else just have it client.map.id?
Yes. Exactly.