Jump to content
Eternal Lands Official Forums
headhunter88

ELC doesn't create elc.ini anymore

Recommended Posts

Hi!

 

I was running elc 1.0.1 using the from-source install gentoo provides.

Then I downloaded the current elc cvs version (about 13 hours ago) and compiled it.

It didn't work, so I removed it.

I also removed my .elc directory to make sure everything works fine.

 

Now my settings aren't saved anymore.

This is how ~/.elc looks like after the first run:

[jojo] [~] ls .elc

chat_log.txt  connection_log.txt  el.cfg  error_log.txt  srv_log.txt

 

What's wrong there? Looks like a bug to me. El.cfg only contains unreadable binary stuff, settings I make runtime aren't save as well.

 

Bye,

johannes :)

Share this post


Link to post
Share on other sites

Yea, el.ini has never been created on startup and you'd have to get a newer one from CVS. But it should now that I think about it if it doesn't find the el.ini - it's easy as hell, as you only have to do a:

 

FILE *f=fopen(elini,"w");
int i;
for(i=0;i<our_vars.no;i++) {
 switch(our_vars.var[i]->type){
 	case SPECINT:
 	case INT:
 	case BOOL:
   {
   int *p=our_vars.var[i]->var;
   fprintf(f,"#%s = %d\n",our_vars.var[i]->name, *p);
   break;
   }
 	case SPECCHAR:
 	case STRING:
   fprintf(f,"#%s = \"%s\"\n",our_vars.var[i]->name, our_vars.var[i]->var);
   break;
 	case FLOAT:
   {
   float *g=our_vars.var[i]->var;
   fprintf(f,"#%s = %g\n",our_vars.var[i]->name, *g);
   break;
   }
 }
}
fclose(f);

Or something like that, that was how I remembered it - it should be in the gtk-elconfig module somewhere :0)

 

Sure it won't be as good as the original el.ini but it'd be better than nothing :)

 

Anyway, I think that you should ask about your problems in the development forum, I'm sure that someone could be able to help you out, so you'd be able to use the CVS version.

Share this post


Link to post
Share on other sites

Do you still have the eternal-lands package installed? If so, move the default el.ini from /usr/share/games/eternal-lands/el.ini to your ~/.elc directory and edit it accordingly :)

 

<edit>I forgot, there's also an el.ini in the cvs sources. You can use this one instead of the default one.</edit>

Edited by Malaclypse

Share this post


Link to post
Share on other sites

Thanks for your replies!

 

FILE *f=fopen(elini,"w");

If "elini" is supposed to be "el.ini" and the working directory "~/.elc" (which I did not check in the source if this is provided), then at least an empty file should be created.

 

Anyway, the idea of copying back the original one back does the trick I think! THough this is a pretty nasty bug imo :/

Share this post


Link to post
Share on other sites

elini was just a var that I didn't bother creating (it'll be different from windows to linux, check the init.c for some info on how it's done) - it's not like that was a clean diff, but a proof-of-concept :angry: Understand that I don't have the source in front of me, as I'm writing this from a computer on the military base where I'm stationed.

Share this post


Link to post
Share on other sites
FILE *f=fopen(elini,"w");

If "elini" is supposed to be "el.ini" and the working directory "~/.elc" (which I did not check in the source if this is provided), then at least an empty file should be created.

That code is not in the client. The client has never stored el.ini before, the code that Wytter showed you was how the elconfig program writes out el.ini.

 

Now it may be a good idea to add storing el.ini to the client (but you really want to keep a backup in case the program messes up). However that would be a new feature, not a bug fix.

Share this post


Link to post
Share on other sites

You can always copy code from gtk-elconfig, it has all you'll need. Most of the functions I created were general purpose for loading and saving - the code used in saving could be implemented in elconfig.c in the client, then you'd even be able to create a larger configuration window inside EL that'd actually save the settings. That might be the best solution after all, as it gets annoying to maintain configuration tools alongside EL.

 

The functions would leave the el.ini intact and only change the different values if an existing el.ini has been found; otherwise it'd just write it to el.ini as seen above.

Share this post


Link to post
Share on other sites
You can always copy code from gtk-elconfig, it has all you'll need. Most of the functions I created were general purpose for loading and saving - the code used in saving could be implemented in elconfig.c in the client, then you'd even be able to create a larger configuration window inside EL that'd actually save the settings. That might be the best solution after all, as it gets annoying to maintain configuration tools alongside EL.

 

The functions would leave the el.ini intact and only change the different values if an existing el.ini has been found; otherwise it'd just write it to el.ini as seen above.

I'll take a look at it after I clean the the root window code up.

Share this post


Link to post
Share on other sites

I added support for saving el.ini to the client yesterday. It checks if there are variables not in your el.ini, or if you hasve changed them in the game using the %var = value commands, and if so, writes a new ini file. It keeps comments from the current ini, so you don't have to worry about losing those. This feature is optional, and is turned on by setting #write_ini_on_exit to 1 in el.ini.

 

There are two caveats:

a) it refuses to store your password. If you want you password automatically entered you will have to edit the ini file yourself.

B) for obvious reasons, if you set %write_ini_on_exit = 0 in the game, this is not stored in the file :)

 

See also el.ini from the CVS distribution.

Edited by Grum

Share this post


Link to post
Share on other sites

Great, I'll take a look at it tomorrow (for commenting, I won't be home this weekend, so I cannot compile it)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×