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

Zirius

New member
Messages
261
Points
0
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.

 
select * from guild_castle;

default_hmm.gif


 
select * from guild_castle;

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

gc.png

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

 
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

 
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.

 
Last edited by a moderator:
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 wrongnot only some rows might be missing, but the rows are also not in order

the correct way is

Code:
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
 
Last edited by a moderator:
Back
Top