Jump to content
  • 0
Sign in to follow this  
Zirius

Are the list of enabled castle maps in db/castle_db.txt are in SQL?

Question

in console, Hercules says perfectly how many castle maps are only enabled,so I'm wondering if they are also recorded in database, if so, where are them?

 

If not, can somebody please give me an example or snippet that updates an SQL table of which and only castle maps are enabled.

 

I am in a venture to create a script so that my fluxcp to dynamically get updated.

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

select * from guild_castle;

:hmm:

 

Thanks for leading me, going to my db and comparing to what my console says, seems like it doesn't record castle properly?

 

post-6720-0-21049400-1409337663_thumb.png

 

I activated 6 castles in my castle_db.txt as console says, by SQL only have 10 entries.

Share this post


Link to post
Share on other sites
  • 0

huh ? by default, you should have 34 castles loaded

what do you mean by "activate 6 castles" ?

removed some of them ?

 

those without entries in SQL, also means those castles are not conquered

 

when my character AnnieRuru conquered Kriemhild (prtg_cas01)

SQL will generate a row

15,2,0,0,0,0, ....

where 15 is castle ID for Kriemhild

2 is my AnnieRuru's guild ID

 

but map-server.exe will still be loading 34 castle as long as you don't comment any of them in castle_db.txt

so even with just 1 line in sql table, the rest are being readed as 0

means those castle are not yet conquered

Share this post


Link to post
Share on other sites
  • 0

huh ? by default, you should have 34 castles loaded

what do you mean by "activate 6 castles" ?

removed some of them ?

 

those without entries in SQL, also means those castles are not conquered

 

when my character AnnieRuru conquered Kriemhild (prtg_cas01)

SQL will generate a row

15,2,0,0,0,0, ....

where 15 is castle ID for Kriemhild

2 is my AnnieRuru's guild ID

 

but map-server.exe will still be loading 34 castle as long as you don't comment any of them in castle_db.txt

so even with just 1 line in sql table, the rest are being readed as 0

means those castle are not yet conquered

 

Yes, thanks. Actually I commented them out on my castle db so Hercules only loads 6 castles.

 

What I wish is that those 6 castles activated in my castle db, conquered or not, to be recorded on SQL, so that I can call them out on my flux cp and list them, and get their info.

 

Is there a way to do this mam? I only need them to appear in my SQL database.

Edited by Zirius

Share this post


Link to post
Share on other sites
  • 0

nonono, you have to do the scripting part yourself

 

I understand that you are expecting something like

query_sql "select guild_id from guild_castle", .@gid;for ( .@i = 0; .@i <= 34; .@i++ )dispbottom "the castle "+ .castle$[.@i] +" has been conquered by "+ getguildname( .@gid[.@i] );setarray .castle$[0], "Neuschwanstein", "Hohenschwangau", "Nuernberg", .....
which is wrong

not only some rows might be missing, but the rows are also not in order

 

the correct way is

prontera,156,184,5	script	kjhsdkfjhs	100,{	.@nb = query_sql( "select castle_id, guild_id from guild_castle", .@castle_id, .@gid );	// --- build another array according to the castle ID	for ( .@i = 0; .@i < .@nb; .@i++ )		.@castle[ .@castle_id[.@i] ] = .@gid[.@i];	// --- now you can list them safely	for ( .@i = 0; .@i < 34; .@i++ ) {		if ( .@castle[.@i] )			dispbottom "castle ID "+ .@i +" has been conquered by "+ getguildname( .@castle[.@i] );		else			dispbottom "castle ID "+ .@i +" has not been conquer";	}	end;}
tested

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.