Updated conf merger script to just merge everything, and normalize the line endings so git doesn't complain.

This commit is contained in:
LexManos 2012-08-10 18:25:11 -07:00
parent dd319a2938
commit 49385961d9
3 changed files with 52 additions and 50 deletions

View File

@ -1,9 +1,4 @@
searge,name,side,desc
func_74611_a,getStringValue,0,Gets a String by navigating the hierarchy below this node.
func_74612_b,getArrayNode,0,"Gets a List of JsonNodes, representing a JSON array, by navigating the hierarchy below this node."
func_74614_d,getFields,0,return the fields associated with this node
func_74615_c,getText,0,
func_74789_a,parse,0,Parse the specified JSON String
func_70000_a,addServerStatsToSnooper,2,
func_70001_b,addServerTypeToSnooper,2,
func_70002_Q,isSnooperEnabled,2,Returns whether snooping is enabled or not.
@ -1894,7 +1889,11 @@ func_74603_a,withElement,2,Adds the given element to the array that will be buil
func_74604_a,build,2,
func_74608_a,withFieldBuilder,2,
func_74610_b,getElements,2,
func_74611_a,getStringValue,2,Gets a String by navigating the hierarchy below this node.
func_74612_b,getArrayNode,2,"Gets a List of JsonNodes, representing a JSON array, by navigating the hierarchy below this node."
func_74613_a,wrapExceptionsFor,2,
func_74614_d,getFields,2,return the fields associated with this node
func_74615_c,getText,2,
func_74616_a,getType,2,
func_74618_a,asList,2,
func_74628_a,shortForm,2,
@ -1991,6 +1990,7 @@ func_74785_a,format,2,
func_74786_a,formatJsonNode,2,
func_74787_a,format,2,
func_74788_a,parse,2,Parse the character stream from the specified Reader into a JsonRootNode object.
func_74789_a,parse,2,Parse the specified JSON String
func_74792_a,decompress,2,
func_74793_a,safeWrite,2,
func_74794_a,read,2,Reads from a CompressedStream.

1 searge name side desc
func_74611_a getStringValue 0 Gets a String by navigating the hierarchy below this node.
func_74612_b getArrayNode 0 Gets a List of JsonNodes, representing a JSON array, by navigating the hierarchy below this node.
func_74614_d getFields 0 return the fields associated with this node
func_74615_c getText 0
func_74789_a parse 0 Parse the specified JSON String
2 func_70000_a addServerStatsToSnooper 2
3 func_70001_b addServerTypeToSnooper 2
4 func_70002_Q isSnooperEnabled 2 Returns whether snooping is enabled or not.
1889 func_74604_a build 2
1890 func_74608_a withFieldBuilder 2
1891 func_74610_b getElements 2
1892 func_74611_a getStringValue 2 Gets a String by navigating the hierarchy below this node.
1893 func_74612_b getArrayNode 2 Gets a List of JsonNodes, representing a JSON array, by navigating the hierarchy below this node.
1894 func_74613_a wrapExceptionsFor 2
1895 func_74614_d getFields 2 return the fields associated with this node
1896 func_74615_c getText 2
1897 func_74616_a getType 2
1898 func_74618_a asList 2
1899 func_74628_a shortForm 2
1990 func_74786_a formatJsonNode 2
1991 func_74787_a format 2
1992 func_74788_a parse 2 Parse the character stream from the specified Reader into a JsonRootNode object.
1993 func_74789_a parse 2 Parse the specified JSON String
1994 func_74792_a decompress 2
1995 func_74793_a safeWrite 2
1996 func_74794_a read 2 Reads from a CompressedStream.

View File

@ -1,23 +1,4 @@
param,name,side
p_79000_1_,par1IUpdatePlayerListBox,1
p_79003_0_,par0DedicatedServer,1
p_79004_0_,par0ServerGUI,1
p_79013_0_,par0GuiStatsComponent,1
p_79015_1_,par1ArrayOfLong,1
p_actionPerformed_1_,par1ActionEvent,1
p_focusGained_1_,par1FocusEvent,1
p_i4100_1_,par1DedicatedServer,1
p_i4101_1_,par1GuiLogOutputHandler,1
p_i4102_1_,par1JTextArea,1
p_i4103_1_,par1MinecraftServer,1
p_i4104_1_,par1ServerGUI,1
p_i4104_2_,par2JTextField,1
p_i4105_1_,par1MinecraftServer,1
p_i4106_1_,par1DedicatedServer,1
p_i4107_1_,par1ServerGUI,1
p_i4108_1_,par1DedicatedServer,1
p_i4109_1_,par1GuiStatsComponent,1
p_publish_1_,par1LogRecord,1
p_70000_1_,par1PlayerUsageSnooper,2
p_70001_1_,par1PlayerUsageSnooper,2
p_70003_1_,par1Str,2
@ -6534,8 +6515,14 @@ p_78944_1_,par1WorldRenderer,2
p_78944_2_,par2WorldRenderer,2
p_78946_1_,par1WorldRenderer,2
p_78946_2_,par2WorldRenderer,2
p_79000_1_,par1IUpdatePlayerListBox,2
p_79003_0_,par0DedicatedServer,2
p_79004_0_,par0ServerGUI,2
p_79013_0_,par0GuiStatsComponent,2
p_79015_1_,par1ArrayOfLong,2
p_accept_1_,par1File,2
p_accept_2_,par2Str,2
p_actionPerformed_1_,par1ActionEvent,2
p_appletResize_1_,par1,2
p_appletResize_2_,par2,2
p_compareTo_1_,par1Obj,2
@ -6544,6 +6531,7 @@ p_compare_2_,par2Obj,2
p_containsKey_1_,par1Obj,2
p_containsValue_1_,par1Obj,2
p_equals_1_,par1Obj,2
p_focusGained_1_,par1FocusEvent,2
p_format_1_,par1LogRecord,2
p_getArrayNode_1_,par1ArrayOfObj,2
p_getParameter_1_,par1Str,2
@ -9124,12 +9112,24 @@ p_i4048_1_,par1Str,2
p_i4049_1_,par1Str,2
p_i4049_2_,par2Str,2
p_i4050_1_,par1BouncyCastleProvider,2
p_i4100_1_,par1DedicatedServer,2
p_i4101_1_,par1GuiLogOutputHandler,2
p_i4102_1_,par1JTextArea,2
p_i4103_1_,par1MinecraftServer,2
p_i4104_1_,par1ServerGUI,2
p_i4104_2_,par2JTextField,2
p_i4105_1_,par1MinecraftServer,2
p_i4106_1_,par1DedicatedServer,2
p_i4107_1_,par1ServerGUI,2
p_i4108_1_,par1DedicatedServer,2
p_i4109_1_,par1GuiStatsComponent,2
p_implies_1_,par1Permission,2
p_init_1_,par1,2
p_init_2_,par2CipherParameters,2
p_main_0_,par0ArrayOfStr,2
p_paint_1_,par1Graphics,2
p_parse_1_,par1Str,2
p_publish_1_,par1LogRecord,2
p_putAll_1_,par1Map,2
p_put_1_,par1Obj,2
p_put_2_,par2Obj,2

1 param name side
p_79000_1_ par1IUpdatePlayerListBox 1
p_79003_0_ par0DedicatedServer 1
p_79004_0_ par0ServerGUI 1
p_79013_0_ par0GuiStatsComponent 1
p_79015_1_ par1ArrayOfLong 1
p_actionPerformed_1_ par1ActionEvent 1
p_focusGained_1_ par1FocusEvent 1
p_i4100_1_ par1DedicatedServer 1
p_i4101_1_ par1GuiLogOutputHandler 1
p_i4102_1_ par1JTextArea 1
p_i4103_1_ par1MinecraftServer 1
p_i4104_1_ par1ServerGUI 1
p_i4104_2_ par2JTextField 1
p_i4105_1_ par1MinecraftServer 1
p_i4106_1_ par1DedicatedServer 1
p_i4107_1_ par1ServerGUI 1
p_i4108_1_ par1DedicatedServer 1
p_i4109_1_ par1GuiStatsComponent 1
p_publish_1_ par1LogRecord 1
2 p_70000_1_ par1PlayerUsageSnooper 2
3 p_70001_1_ par1PlayerUsageSnooper 2
4 p_70003_1_ par1Str 2
6515 p_78944_2_ par2WorldRenderer 2
6516 p_78946_1_ par1WorldRenderer 2
6517 p_78946_2_ par2WorldRenderer 2
6518 p_79000_1_ par1IUpdatePlayerListBox 2
6519 p_79003_0_ par0DedicatedServer 2
6520 p_79004_0_ par0ServerGUI 2
6521 p_79013_0_ par0GuiStatsComponent 2
6522 p_79015_1_ par1ArrayOfLong 2
6523 p_accept_1_ par1File 2
6524 p_accept_2_ par2Str 2
6525 p_actionPerformed_1_ par1ActionEvent 2
6526 p_appletResize_1_ par1 2
6527 p_appletResize_2_ par2 2
6528 p_compareTo_1_ par1Obj 2
6531 p_containsKey_1_ par1Obj 2
6532 p_containsValue_1_ par1Obj 2
6533 p_equals_1_ par1Obj 2
6534 p_focusGained_1_ par1FocusEvent 2
6535 p_format_1_ par1LogRecord 2
6536 p_getArrayNode_1_ par1ArrayOfObj 2
6537 p_getParameter_1_ par1Str 2
9112 p_i4049_1_ par1Str 2
9113 p_i4049_2_ par2Str 2
9114 p_i4050_1_ par1BouncyCastleProvider 2
9115 p_i4100_1_ par1DedicatedServer 2
9116 p_i4101_1_ par1GuiLogOutputHandler 2
9117 p_i4102_1_ par1JTextArea 2
9118 p_i4103_1_ par1MinecraftServer 2
9119 p_i4104_1_ par1ServerGUI 2
9120 p_i4104_2_ par2JTextField 2
9121 p_i4105_1_ par1MinecraftServer 2
9122 p_i4106_1_ par1DedicatedServer 2
9123 p_i4107_1_ par1ServerGUI 2
9124 p_i4108_1_ par1DedicatedServer 2
9125 p_i4109_1_ par1GuiStatsComponent 2
9126 p_implies_1_ par1Permission 2
9127 p_init_1_ par1 2
9128 p_init_2_ par2CipherParameters 2
9129 p_main_0_ par0ArrayOfStr 2
9130 p_paint_1_ par1Graphics 2
9131 p_parse_1_ par1Str 2
9132 p_publish_1_ par1LogRecord 2
9133 p_putAll_1_ par1Map 2
9134 p_put_1_ par1Obj 2
9135 p_put_2_ par2Obj 2

View File

@ -218,11 +218,6 @@ def setup_fml(fml_dir, mcp_dir):
updatemd5_side(commands, CLIENT)
updatemd5_side(commands, SERVER)
reset_logger()
#Delete /common/cpw to get rid of the Side/SideOnly classes used in decompilation
cpw_dir = os.path.join(mcp_dir, 'src', 'common', 'cpw')
if os.path.isdir(cpw_dir):
shutil.rmtree(cpw_dir)
os.chdir(fml_dir)
@ -273,6 +268,11 @@ def apply_fml_patches(fml_dir, mcp_dir, src_dir, copy_files=True):
has_client = os.path.isdir(os.path.join(src_dir, 'minecraft'))
has_server = os.path.isdir(os.path.join(src_dir, 'minecraft_server'))
#Delete /common/cpw to get rid of the Side/SideOnly classes used in decompilation
cpw_dir = os.path.join(src_dir, 'common', 'cpw')
if os.path.isdir(cpw_dir):
shutil.rmtree(cpw_dir)
#patch files
print 'Applying Forge ModLoader patches'
sys.stdout.flush()
@ -527,8 +527,17 @@ def setup_mcp(fml_dir, mcp_dir, dont_gen_conf=True):
#update workspace
print 'Fixing MCP Workspace'
merge_tree(os.path.join(fml_dir, 'eclipse'), os.path.join(mcp_dir, 'eclipse'))
def normaliselines(in_filename):
in_filename = os.path.normpath(in_filename)
tmp_filename = in_filename + '.tmp'
with open(in_filename, 'rb') as in_file:
with open(tmp_filename, 'wb') as out_file:
out_file.write(in_file.read().replace('\r\n', '\n'))
shutil.move(tmp_filename, in_filename)
def get_conf_copy(mcp_dir, fml_dir):
#Lets grab the files we dont work on
for file in ['astyle.cfg', 'version.cfg', 'patches/minecraft_ff.patch', 'patches/minecraft_server_ff.patch', 'newids.csv']:
@ -539,6 +548,7 @@ def get_conf_copy(mcp_dir, fml_dir):
if os.path.exists(dst_file):
os.remove(dst_file)
shutil.copy(src_file, dst_file)
normaliselines(dst_file)
print 'Grabbing: ' + src_file
ff_server = os.path.normpath(os.path.join(fml_dir, 'conf', 'patches', 'minecraft_server_ff.patch'))
@ -558,7 +568,7 @@ def get_conf_copy(mcp_dir, fml_dir):
' int var4 = p_77874_1_.func_72841_b("map");'
]
os.remove(ff_server)
with open(ff_server, 'w') as f:
with open(ff_server, 'wb') as f:
for line in data:
f.write(line.rstrip('\r\n') + '\n')
@ -615,7 +625,7 @@ def gen_merged_srg(mcp_dir, fml_dir):
common[type][key] = value #+ ' #S'
#Print joined retroguard files
with open(os.path.join(fml_dir, 'conf', 'joined.srg'), 'w') as f:
with open(os.path.join(fml_dir, 'conf', 'joined.srg'), 'wb') as f:
for type in ['PK:', 'CL:', 'FD:', 'MD:']:
for key in sorted(common[type]):
f.write('%s %s %s\n' % (type, key, common[type][key]))
@ -660,7 +670,7 @@ def gen_merged_exc(mcp_dir, fml_dir):
joined = dict(common.items() + server.items())
#Print joined mcinjector files
with open(os.path.join(fml_dir, 'conf', 'joined.exc'), 'w') as f:
with open(os.path.join(fml_dir, 'conf', 'joined.exc'), 'wb') as f:
for key in sorted(joined):
f.write('%s=%s\n' % (key, joined[key]))
@ -699,22 +709,14 @@ def gen_shared_searge_names(common_srg, common_exc):
def gen_merged_csv(common_map, in_file, out_file, main_key='searge'):
reader = csv.DictReader(open(in_file, 'r'))
print 'Generating merged csv for %s' % os.path.basename(in_file)
sides = {'client': [], 'server': [], 'common': []}
common = []
added = []
for row in reader:
side = int(row['side'])
if row[main_key] in common_map:
if not row[main_key] in added:
row['side'] = '2'
sides['common'].append(row)
added.append(row[main_key])
elif side == 0:
sides['client'].append(row)
else:
sides['server'].append(row)
writer = csv.DictWriter(open(out_file, 'wb'), fieldnames=reader.fieldnames)
if not row[main_key] in added:
row['side'] = '2'
common.append(row)
added.append(row[main_key])
writer = csv.DictWriter(open(out_file, 'wb'), fieldnames=reader.fieldnames, lineterminator='\n')
writer.writeheader()
for key in ['client', 'server', 'common']:
for row in sorted(sides[key], key=lambda row: row[main_key]):
writer.writerow(row)
for row in sorted(common, key=lambda row: row[main_key]):
writer.writerow(row)