Page MenuHomeSchine - Phabricator

Starmade | BlockConfigImport.xml not import recipes.
Confirmed task for development, NormalPublic

Description

I do:

<Config>

<Element>
</Element> 
<Recipes>
  modified the standard recipes
</Recipes>

</Config>

-does not work

Or he does not support?

Details

Task Type
Bug
Testing Results
Affected Gamemode(s)
Single and Multi
Reproducible
Yes
Last tested (version)
starmade-build_20150820_221933
Category
Blockconfig
Hardware/Software/System
OS-Specific
No
Hardware-Specific
No
Video Card Vendor
uncertain

Event Timeline

Zeta-X11 updated the task description. (Show Details)Aug 30 2015, 11:37 AM
Zeta-X11 changed Category from none/unspecified to Blockconfig.
Zeta-X11 changed Affected Gamemode(s) from none/unspecified to Single and Multi.
Zeta-X11 changed Reproducible from uncertain to Yes.
Zeta-X11 set Last tested (version) to starmade-build_20150820_221933.
Zeta-X11 edited Serverconfig (server.cfg). (Show Details)
Zeta-X11 edited Clientconfig (settings.cfg). (Show Details)
Zeta-X11 added a subscriber: Zeta-X11.
Zeta-X11 created this task.
Restricted Application added a project: Issue Navigation. · View Herald TranscriptAug 30 2015, 11:37 AM
AndyP shifted this object from the S1 Public space to the S3 Starmade space.Aug 30 2015, 9:43 PM
AndyP changed the visibility from "Custom Policy" to "Public (No Login Required)".
AndyP changed the edit policy from "Task Author" to "Starmade (Project)".
AndyP set Task Type to Bug.
AndyP set OS-Specific to No.
AndyP set Hardware-Specific to No.
AndyP set Video Card Vendor to uncertain.
AndyP moved this task from New / Unconfirmed to Open / Validated on the Issue Navigation board.
AndyP added a subscriber: AndyP.
AndyP claimed this task.
AndyP removed AndyP as the assignee of this task.
AndyP triaged this task as Normal priority.

-Validated-
I am not sure if this is supported, I guess no, but after confirming it should just go into development for a reply.

thakyZ claimed this task.Sep 1 2015, 5:59 PM
thakyZ added a comment.Sep 1 2015, 6:12 PM

Confirmed. Also there is no option to import the recipes when importing the block config where you choose the fields to import in the block editor.

thakyZ changed the task status from Open to In Queue (Game).Sep 1 2015, 6:12 PM
Restricted Application edited projects, added Game Development, Starmade; removed Issue Navigation. · View Herald TranscriptSep 1 2015, 6:12 PM
AndyP removed thakyZ as the assignee of this task.Dec 20 2015, 10:44 PM

Assignee 'thakyZ' left the testing team.

lancake claimed this task.Apr 17 2016, 10:25 AM

This would be nice to be able to do. We use custom blocks on our server, and not being able to transfer the recipes upon version update, requiring manual updates to the /data/config/BlockConfig.xml file, is definitely not good.

Hello brother modder.

If the server lives on Linux, you can use this bash script.
The script is not mine, found on the Internet.

zamena='/home/t1000/Server-hard/zamena'                  # file that contain replacement text
srcfile2='/home/t1000/Server-hard/server/StarMade/customBlockConfig/BlockConfigImport.xml'    # file that contain replacement text
srcfile='/home/t1000/MOD/in/uploads/BlockConfig.xml'  # source file
outfile='/home/t1000/Server-hard/server/StarMade/data/config/BlockConfig.xml' # output file   
beginBlock='<Recipes>'                # start string of text block that would be replaced. Should be the Regular expression.
endBlock='</Config>'  # end string of text block that would be replaced. Should be the Regular expression.
######################
# No user intervention beyond this point !!!!!!!!!
######################
cat "${srcfile2}" | sed -n '/Recipes/,/Config/w '$zamena''
cat "${srcfile}" | awk -v replace="${zamena}" -v a="${beginBlock}" -v b="${endBlock}" 'BEGIN {
    c=""; x=1;
    while (x != 0 && x != -1) {
        x=getline < replace
        if (x != 0) c=c $0 "\n";
    }
    if (x == -1) { print "Error while reading file: " replace "  Exiting..."; exit 1; }
}
{   if ( $0 ~a && skip == 0) { skip=1; print c; }
    if ( $0 ~b && skip == 1) { skip=0; next; }
}!skip' > "${outfile}"

Of course you need to fix the file paths.
Carefully, the script completely replaces the list of recipes.
zamena - file with permissions r-v, you need to create an empty file manually.

Benevolent27 added a comment.EditedJan 15 2017, 5:28 AM

Hello brother modder.
If the server lives on Linux, you can use this bash script.
The script is not mine, found on the Internet.

zamena='/home/t1000/Server-hard/zamena'                  # file that contain replacement text
srcfile2='/home/t1000/Server-hard/server/StarMade/customBlockConfig/BlockConfigImport.xml'    # file that contain replacement text
srcfile='/home/t1000/MOD/in/uploads/BlockConfig.xml'  # source file
outfile='/home/t1000/Server-hard/server/StarMade/data/config/BlockConfig.xml' # output file   
beginBlock='<Recipes>'                # start string of text block that would be replaced. Should be the Regular expression.
endBlock='</Config>'  # end string of text block that would be replaced. Should be the Regular expression.
######################
# No user intervention beyond this point !!!!!!!!!
######################
cat "${srcfile2}" | sed -n '/Recipes/,/Config/w '$zamena''
cat "${srcfile}" | awk -v replace="${zamena}" -v a="${beginBlock}" -v b="${endBlock}" 'BEGIN {
    c=""; x=1;
    while (x != 0 && x != -1) {
        x=getline < replace
        if (x != 0) c=c $0 "\n";
    }
    if (x == -1) { print "Error while reading file: " replace "  Exiting..."; exit 1; }
}
{   if ( $0 ~a && skip == 0) { skip=1; print c; }
    if ( $0 ~b && skip == 1) { skip=0; next; }
}!skip' > "${outfile}"

Of course you need to fix the file paths.
Carefully, the script completely replaces the list of recipes.
zamena - file with permissions r-v, you need to create an empty file manually.

Oh awesome. Thank you! I'll give it a whirl and see how it goes. I was messing around with a program called "xmlstarlet", which I was planning on using to read configs, then transfer data to new configs. This way it would retain any changes from version to version, but I hadn't quite gotten to figuring it all out just yet.

AndyP changed the task status from In Queue (Game) to In Queue.Mar 10 2017, 5:13 PM
Restricted Application added a project: Blockconfig. · View Herald TranscriptMar 10 2017, 5:13 PM
AndyP moved this task from Backlog / Unclassed to Beta on the Blockconfig board.Mar 11 2017, 8:31 PM