diff options
author | Haruna <haru@dotalux.com> | 2014-11-15 17:04:09 +0100 |
---|---|---|
committer | Haruna <haru@dotalux.com> | 2014-11-15 17:04:09 +0100 |
commit | a6f077063eeff08ee27ae5170de1bb5cf4b2defb (patch) | |
tree | 9bb5ab158230301e604918883ce6d06c31890341 /tools/HPMHookGen/HPMDataCheckGen.pl | |
parent | 77b88fe80b907122b24d698938538c22e029d25f (diff) | |
parent | 7f9fa7f59a82682fb139be4301e9a12a99644a19 (diff) | |
download | hercules-a6f077063eeff08ee27ae5170de1bb5cf4b2defb.tar.gz hercules-a6f077063eeff08ee27ae5170de1bb5cf4b2defb.tar.bz2 hercules-a6f077063eeff08ee27ae5170de1bb5cf4b2defb.tar.xz hercules-a6f077063eeff08ee27ae5170de1bb5cf4b2defb.zip |
Merge pull request #388 from 4144/charplugins
char server plugins
Diffstat (limited to 'tools/HPMHookGen/HPMDataCheckGen.pl')
-rw-r--r-- | tools/HPMHookGen/HPMDataCheckGen.pl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/HPMHookGen/HPMDataCheckGen.pl b/tools/HPMHookGen/HPMDataCheckGen.pl index f950152d1..01728341d 100644 --- a/tools/HPMHookGen/HPMDataCheckGen.pl +++ b/tools/HPMHookGen/HPMDataCheckGen.pl @@ -20,17 +20,18 @@ my %out; foreach my $file (@files) { my $xml = new XML::Simple; - my $data = $xml->XMLin($file); - next unless $data->{compounddef}->{includes}; # means its a struct from a .c file, plugins cant access those so we don't care. - next if $data->{compounddef}->{compoundname} =~ /::/; # its a duplicate with a :: name e.g. struct script_state {<...>} ay; - my @filepath = split(/[\/\\]/, $data->{compounddef}->{location}->{file}); + my $data = $xml->XMLin($file, ForceArray => 1); + my $filekey = (keys $data->{compounddef})[0]; + next unless $data->{compounddef}->{$filekey}->{includes}; # means its a struct from a .c file, plugins cant access those so we don't care. + next if $data->{compounddef}->{$filekey}->{compoundname}->[0] =~ /::/; # its a duplicate with a :: name e.g. struct script_state {<...>} ay; + my @filepath = split(/[\/\\]/, $data->{compounddef}->{$filekey}->{location}->[0]->{file}); my $foldername = uc($filepath[-2]); my $filename = uc($filepath[-1]); $filename =~ s/-/_/g; $filename =~ s/\.[^.]*$//; my $plugintypes = 'SERVER_TYPE_UNKNOWN'; $plugintypes = 'SERVER_TYPE_ALL' if $foldername eq 'COMMON'; $plugintypes = "SERVER_TYPE_${foldername}" if $foldername =~ /^(LOGIN|CHAR|MAP)/; my $symboldata = { - name => $data->{compounddef}->{compoundname}, + name => $data->{compounddef}->{$filekey}->{compoundname}->[0], type => $plugintypes, }; my $name = "${foldername}_${filename}_H"; |