Jump to content
Eternal Lands Official Forums
Aislinn

Can't log in - The rules.xml file was not found

Recommended Posts

libxml2 2.12 is the only version on the system installed, so i think it uses correct one

the code inside condition:

#if LIBXML_VERSION >= 21200
    xmlCtxtSetMaxAmplification (ctxt, 100);
#endif

is definitely ran

4900 #if LIBXML_VERSION >= 21200                                                     
4901     xmlCtxtSetMaxAmplification (ctxt, 100);                                     
4902     printf("set new max amplification, i think?\n");                                                                                                                                    
4903 #endif                                                                          
➜  eternallands ./el.linux.bin
set new max amplification, i think?
➜  eternallands 

Testing with xmllint:

➜  eternallands xmllint --version 
xmllint: using libxml version 21200
   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Unicode Regexps Automata Schemas Schematron Modules Debug Zlib
➜  eternallands xmllint --noent actor_defs/actor_defs.xml
actor_defs/actor_defs.xml:143: parser error : Maximum entity amplification factor exceeded, see xmlCtxtSetMaxAmplification.
        &elf_female;
                    ^
➜  eternallands xmllint --noent --max-ampl 100 actor_defs/actor_defs.xml | wc -l
80618

(that's a lot of lines!)

 

It looks like it reads the defs in ok with functon read_actor_defs, ok variable is = 1 all the way through the if block in read_actor_defs function:

4881 int read_actor_defs (const char *dir, const char *index)

until getting assigned 0 by return val from parse_actor_defs function, at line:

4924         ok = parse_actor_defs (root); 

at second iteration of 'for' loop in parse_actor_defs function, first iteration: ok = 1, then ok = 0, wish i knew why, or how to test whats going on better
 

Share this post


Link to post
Share on other sites

I narrowed it down to problem with sound

in:

4476 int parse_actor_nodes(actor_types *act, const xmlNode *cfg, const xmlNode *defaults)

i added printfs as this:

4546             } else if (!strcmp(name, "neck")) {                                 
4547                 ok &= parse_actor_neck(act, item, defaults);                    
4548             } else if (!strcmp(name, "sounds")) {                               
4549 #ifdef NEW_SOUND                                                                
4550                 printf("neck ok: %i\n", ok);                                    
4551                 ok &= parse_actor_sounds(act, item->children);                  
4552                 printf("sound ok: %i\n", ok);                                   
4553 #endif  //NEW_SOUND                 

output when running el:

➜  eternallands ./el.linux.bin
neck ok: 1
sound ok: 0
neck ok: 1
sound ok: 0
neck ok: 1
sound ok: 0
neck ok: 1
sound ok: 0
...

recompiled with NEW_SOUND commented out in make.defaults:

12 #FEATURES += NEW_SOUND           # Enables extended sound effects system   

and game loads and can log in chars.

found out that this is the culprit for me:

3620     if (!have_sound_config) return 0;           

inside:

3611 int parse_actor_sounds(actor_types *act, const xmlNode *cfg)                    
3612 {                                                                               
3613     const xmlNode *item;                                                        
3614     char str[255];                                                              
3615     int ok;                                                                     
3616     int i;                                                                      
3617                                                                                 
3618     if (cfg == NULL) return 0;                                                  
3619     if (!have_sound_config) return 0;    // returns here, hence "ok &=" in caller gets zeroed
3620                                        

Looks like sound system for EL is broken for me. Im using pulseaudio as my sound server, but EL for some reason wants to use pipewire.

Which is installed on system as dependency of some packages but not used as sound server.

Now to figure out how to make EL keep using pulseaudio. :(

Share this post


Link to post
Share on other sites

Ok so having

#disable_sound= 1

in el.ini will trigger the if statement

diff --git a/actor_scripts.c b/actor_scripts.c
index be4fd426..530a2f06 100755
--- a/actor_scripts.c
+++ b/actor_scripts.c
@@ -11,6 +11,7 @@
 #include "draw_scene.h"
 #include "elconfig.h"
 #include "errors.h"
+#include "elloggingwrapper.h"
 #include "gamewin.h"
 #include "hud_statsbar_window.h"
 #include "interface.h"
@@ -4922,7 +4923,14 @@ void init_actor_defs()
        memset (actors_defs, 0, sizeof (actors_defs));
        memset (attached_actors_defs, 0, sizeof (attached_actors_defs));
        set_invert_v_coord();
-       read_actor_defs ("actor_defs", "actor_defs.xml");
+       if (read_actor_defs ("actor_defs", "actor_defs.xml") != 1)
+       {
+               char *message = "This is likely the libxml2 > v2.10 issue\nSee https://www.eternal-lands.com/forum/index.php?/topic/61996-cant-log-in-the-rulesxml-file-was-not-found\n";
+               LOG_ERROR(message);
+               fprintf(stderr, message);
+               FATAL_ERROR_WINDOW("Failed to read actor defs. See Going to exit.");
+               exit(1);
+       }
 }

from commit: commit d067d1548c8906dc1ef56d6b2cb9bd901612caf6
 

 

Now i need to figure out how to deal with this:

[ALSOFT] (EE) Failed to connect PipeWire event context (errno: 112)

but that's different topic :(

Edited by AnnaH

Share this post


Link to post
Share on other sites

Wow, that's an unintended consequence of adding the return value check for the read_actor_defs() call!

I've had a quick look at what you have found and I think you found a long standing bug.   If the statement:

	if (!have_sound_config) return 0;

returns zero, the defs for sound are never loaded, even when you enable sound later.  I would suggest we just remove the check completely which will fix part of the long standing bug and also fix the issue you have with return value check for the read_actor_defs() call failing too.

 

Edit: Perhaps safer for now, leave the have_sound_config and return 1 to just prevent the error.

 

I'll check some more later, but what do you think?

Edited by bluap

Share this post


Link to post
Share on other sites

Yep, I've seen your latest fix in repo, looks good!

Thanks

 

(also fixed my EL sound by just recompiling OpenAL without pipewire support, so that's good too)

(also also, sorry A. for spamming your thread instead of using edit, in my defense it was 5am)

Edited by AnnaH

Share this post


Link to post
Share on other sites

Thanks for finding the problem with my additional checks, that could have lay hidden for ages.

Glade you fixed your audio, we'll need to keep a look out for that.

Share this post


Link to post
Share on other sites

@bluapI am not very familiar with creating makefiles, therefore I ask for help. 

 

I was able to build an old version of libxml2 which did not have the problem we are discussing. I put it into a separate directory e. g. the EL build dir or even runtime dir. Of course el still uses the system wide libxml2 because of the systems preferences (even after rebuild). 

Can you tell me how to convince the build system to use the separate version in the current Dir of EL while modifying the "Makefile.linux". This should be possible, isn´t it?

 

Thanks

Erdie

Share this post


Link to post
Share on other sites

Which distro are you using?  On Arch for example, I have installed the old version and will hold the package until the updated version arrives.  If you build your own package, most packages will support installing into the /usr/local tree which would be picked up by the build and at runtime, hopefully.  If not you may have to remove the old package too.

Share this post


Link to post
Share on other sites

If you feel like experimenting, you may try pointing build system to custom location of your libraries if they are not in default locations on system.

Never done it with EL, but generally in other projects its done with flags to preprocessor and linker, e.g.:

CPPFLAGS="-I /your/path/to/libxml2/include ${CPPFLAGS}"
LDFLAGS="-L/your/path/to/libxml2/lib ${LDFLAGS}"

and  option -rpath for runtime linking with

LDFLAGS="-Wl,-rpath,/your/path/to/libxml2/lib ${LDFLAGS}"

 

edit:

looks like el's Makefile doesn't use CPPFLAGS, so just prepend the "-I ..." option from CPPFLAGS to both CFLAGS and CXXFLAGS

 

edit 2:

since you are also on Gentoo, another option is to use version of libxml2 from upstream github by unmasking version "9999" with

echo '=dev-libs/libxml2-9999 **' >> /etc/portage/package.accept_keywords/libxml2

and rebuild libxml2

emerge --oneshot --ask --verbose --quiet-build dev-libs/libxml2

which you can later update with emerge @live-rebuild target to emerge, because 9999 version are not picked up in normal emerge --update @world target.

And when version 2.12 gets stabilized in portage tree, switch back by removing unmask from accept_keywords

Edited by AnnaH

Share this post


Link to post
Share on other sites
On 10/3/2023 at 11:16 PM, bluap said:

Which distro are you using?  On Arch for example, I have installed the old version and will hold the package until the updated version arrives.  If you build your own package, most packages will support installing into the /usr/local tree which would be picked up by the build and at runtime, hopefully.  If not you may have to remove the old package too.

 

I am using Gentoo. If your custom lib is loaded depends on the search priority where the system is looking for the libs. I can use /usr/local/lib but the problem is, that /usr/lib will be search before /usr/local/lib and if it is found, the version of /usr/local/lib will not be used. BTW: I masked the new version of libxml2 up to now and that the whole system uses the old version but this cannot be done forever because there are other apps using libxml2 and some of them might get broken once they are no more compatible with version 10.4.* Therefore I am looking for a better way e.g. convince the EL build system to look into the local dir ./. before looking into/usr/lib. But I do not exactly know how to archive that.

Share this post


Link to post
Share on other sites

It's time!  2.12 released!  Going to give it a whirl, fingers crossed.

 

warning: libxml2: ignoring package upgrade (2.10.4-6 => 2.12.0-1)

 

Result:  Nope. Still not working.

[actor_scripts.c:4931] Failed to read actor defs. See logs, going to exit.

                                                       OK

 

 

Edit 2: I recompiled and got this error:

>

          named_colours.cpp: In member function ‘void ELGL_Colour::Colour_Container::load_xml()’:
named_colours.cpp:103:28: error: ‘xmlReadFile’ was not declared in this scope
  103 |                 if ((doc = xmlReadFile(file_name.c_str(), NULL, 0)) == NULL)
      |                            ^~~~~~~~~~~
make: *** [Makefile.linux:171: named_colours.o] Error 1


 

 

 

Share this post


Link to post
Share on other sites
7 hours ago, Aislinn said:

Edit 2: I recompiled and got this error:


named_colours.cpp:103:28: error: ‘xmlReadFile’ was not declared in this scope
  103 |                 if ((doc = xmlReadFile(file_name.c_str(), NULL, 0)) == NULL)
      |                            ^~~~~~~~~~~
diff --git a/asc.c b/asc.c
index dc046479..79057202 100644
--- a/asc.c
+++ b/asc.c
@@ -5,6 +5,7 @@
 #include <ctype.h>
 #include <iconv.h>
 #include <errno.h>
+#include <libxml/encoding.h>
 #include "asc.h"
 #include "errors.h"
 #include "md5.h"
diff --git a/named_colours.cpp b/named_colours.cpp
index 6d46b4f9..65874370 100644
--- a/named_colours.cpp
+++ b/named_colours.cpp
@@ -15,6 +15,7 @@
 #include <string>
 #include <cstring>
 #include <sstream>
+#include <libxml/parser.h>

 #include "asc.h"
 #include "elloggingwrapper.h"

you can patch with those two #includes for now

Edited by AnnaH

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum 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.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×