Jump to content

[7428] New .map file format and some fixes


Auntie Mangos

Recommended Posts

  • Replies 121
  • Created
  • Last Reply

Top Posters In This Topic

I'm running mangos on Linux and I still have problem extracting the new map files. I have recompiled ad according to instructions. Running it generates 1206 maps files, but the lowest numbered file is 2692527.map. No 0004331.map gets generated.

Link to comment
Share on other sites

I'm running mangos on Linux and I still have problem extracting the new map files. I have recompiled ad according to instructions. Running it generates 1206 maps files, but the lowest numbered file is 2692527.map. No 0004331.map gets generated.

I ran small tests and did come to result that linux refuses to read 3 .MPQ files...

These files are common, common-2 and new lichking one.

In other way I tried to open them in text editor and text editor fails to open them as well where as it can open others... So I have no idea what causes the real problem...

Link to comment
Share on other sites

I ran small tests and did come to result that linux refuses to read 3 .MPQ files...

These files are common, common-2 and new lichking one.

In other way I tried to open them in text editor and text editor fails to open them as well where as it can open others... So I have no idea what causes the real problem...

These are large files. That might explain why the text editor can't open them. They are all larger than 2Gb. I think they are the only files that large.

I put in some printfs and found that fopen fails with "Value too large for defined data type". But why now? What changed in the patch that could have an effect on this? Any change in libraries or compiler settings?

Link to comment
Share on other sites

Hm for me "ad" refuses to extract any DBC files and maps since the new map format when compiled on 64bit Ubuntu.

Looks somehow like file extraction is screwed somewhere.

I chose "Release" in cmake wizzard. I could swear it worked fine with the "old" version, a few commits before the new format. Now the output is merely:

Map & DBC Extractor
===================

Detected locale: enGB
Opening ./Data/enGB/locale-enGB.MPQ
Opening ./Data/enGB/patch-enGB.MPQ
Opening ./Data/enGB/patch-enGB-2.MPQ
Extracting dbc files...
Extracted 0 DBC files

Detected locale: deDE
Opening ./Data/deDE/locale-deDE.MPQ
Opening ./Data/deDE/patch-deDE.MPQ
Opening ./Data/deDE/patch-deDE-2.MPQ
Extracting dbc files...
Extracted 0 DBC files

Using locale: enGB
Opening ./Data/enGB/locale-enGB.MPQ
Opening ./Data/enGB/patch-enGB.MPQ
Opening ./Data/enGB/patch-enGB-2.MPQ
Opening ./Data/common.MPQ
Opening ./Data/common-2.MPQ
Opening ./Data/lichking.MPQ
Opening ./Data/expansion.MPQ
Opening ./Data/patch.MPQ
Opening ./Data/patch-2.MPQ
Extracting maps...
Read Map.dbc file... Fatal error: Invalid Map.dbc file format!

However, the precompiled ad.exe still worked fine (don't have 32bit libmpq shared lib for the precompiled linux binary, so back to wine...)

Link to comment
Share on other sites

On 32bit linux fopen can't open large files (>2Gb i think). System.cpp uses fopen to test if a file exists. The code that reads the files uses open (not fopen) with flag O_LARGEFILE. Before the map patch these files where just read, not tested for existens. One solution could be to change the exitens test to use open. The following patch works for me:

--- a/contrib/extractor/System.cpp
+++ b/contrib/extractor/System.cpp
@@ -1,6 +1,9 @@
#define _CRT_SECURE_NO_DEPRECATE

#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include <deque>
#include <set>
#include <cstdlib>
@@ -81,9 +84,10 @@ void CreateDir( const std::string& Path )

bool FileExists( const char* FileName )
{
-    if(FILE* fp = fopen( FileName, "rb" ))
+    int fd = open( FileName, O_RDONLY | O_LARGEFILE );
+    if(fd >= 0)
    {
-        fclose(fp);
+        close(fd);
        return true;
    }

Link to comment
Share on other sites

Hm...not sure if it's a good idea to go that low-level for that anyway. POSIX way to check file existence/permissions would be access() from unistd.h...that would work nearly everywhere except Windows of course :rolleyes:

#ifndef WIN32
bool FileExists( const char* FileName )
{
   if( access(FileName, F_OK) || access(FileName, R_OK) ) return false;
   return true;
}
#else
bool FileExists( const char* FileName )
{...windows code...}

That would be all to check for existence and read access. The actual reading seems to be part of libmpq, and if it fails to handle the file it seems to be caught in MPQArchive::MPQArchive() anyway...?

Link to comment
Share on other sites

There are few problems with portals, hearthstones, battle grounds and arenas ...

With some players, those problems occur when they are on a mount or when they jump before the teleportation : they die.

With some others players, when they take a portal (...) without a mount : they die.

Some ideas ?

Link to comment
Share on other sites

There are few problems with portals, hearthstones, battle grounds and arenas ...

With some players, those problems occur when they are on a mount or when they jump before the teleportation : they die.

With some others players, when they take a portal (...) without a mount : they die.

Some ideas ?

i believe thats unrelated, it was posted in another thread about the portal to the mages in SW. It apparently has something to do with them taking fall damage after the port.

Link to comment
Share on other sites

It apparently has something to do with them taking fall damage after the port.

This related to recieve outdated movement packets from clients from past after server side teleport that considered by fall code as fall. But bug not in fall code, but in not implementing some way to skip outdated packets in case near (same map) teleport. Maybe need rememeber time of teleport and skill any packets with in packet time < remembered. Or after send teleport packet to client skill all movement pakcets until some client confirmation about teleport packet recieve. Anyway this optopic for thread.

Link to comment
Share on other sites

/root/mangos-old/extractor_v2/loadlib/loadlib.cpp:8:27: error: ..\\mpq_libmpq.h: No such file or directory

I think you use not recent sources.

In recent sources:

#include "../mpq_libmpq.h"

Hmmm, or modified. This fiel has been added and not chnage in this line from creating.

I think you must get proper not modified soueces instead attempt fix manually your existed version.

Link to comment
Share on other sites

i ran all those, then i used the ad.exe from the files above
Where in _above_ you found ad.exe o.O

_Only_ _single_ appropriate ad.exe for your version if you build from own sources in contrib/extractor directory.

BUT this can not work if you have some stranged way modifed source. And you already prove by quoted lines that you have its in modified state.

Link to comment
Share on other sites

Ohhh ok, thank you very much Hiki, i went to the git site and got the ad.exe file and guess what, IT WORKED xDDDDDDD

Now, i'm about to extract the vmaps jopefully it wil work also because the last one i got was crashing when assembling the vmaps.

So far so good, at least i can start the server with those maps i created.

And Vladi thanks for your releases. but maybe for a future refence can you add on the ad.exe a comment with the version extrated of the file and which one you need for the server you are runnnig.

Link to comment
Share on other sites

To this I can add, while blink started to work a bit better, now it launch us sideways (a bit off of the straight trajectory) or even backwards. Sometimes for no apparent reason.

I am teleported backward when there is an obstacle in front of me. Try to Blink in front of a closed door.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use