summaryrefslogtreecommitdiff
path: root/tools/HPMHookGen/HPMDataCheckGen.pl
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-11-03 08:15:05 -0200
committershennetsind <ind@henn.et>2014-11-03 08:15:05 -0200
commitbee4c9d36f4a27e39cc76dc5d6c5f876ed44a678 (patch)
tree79f9aec5171e8aed2d701bf67167f260e05f41db /tools/HPMHookGen/HPMDataCheckGen.pl
parent239d480487e24294975f35ed55f210837ad1088e (diff)
parentce3f4bfbe016ea69c855146667ba9bd9e0e2e221 (diff)
downloadhercules-bee4c9d36f4a27e39cc76dc5d6c5f876ed44a678.tar.gz
hercules-bee4c9d36f4a27e39cc76dc5d6c5f876ed44a678.tar.bz2
hercules-bee4c9d36f4a27e39cc76dc5d6c5f876ed44a678.tar.xz
hercules-bee4c9d36f4a27e39cc76dc5d6c5f876ed44a678.zip
Merge branch 'master' of github.com:HerculesWS/Hercules
Signed-off-by: shennetsind <ind@henn.et> Conflicts: src/map/battle.c
Diffstat (limited to 'tools/HPMHookGen/HPMDataCheckGen.pl')
-rw-r--r--tools/HPMHookGen/HPMDataCheckGen.pl16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/HPMHookGen/HPMDataCheckGen.pl b/tools/HPMHookGen/HPMDataCheckGen.pl
index 7ec1ba7e4..f950152d1 100644
--- a/tools/HPMHookGen/HPMDataCheckGen.pl
+++ b/tools/HPMHookGen/HPMDataCheckGen.pl
@@ -13,6 +13,8 @@ local $ENV{XML_SIMPLE_PREFERRED_PARSER} = 'XML::Parser'; # 0m4.256s
#local $ENV{XML_SIMPLE_PREFERRED_PARSER} = 'XML::SAX::Expat'; # 0m14.186s
#local $ENV{XML_SIMPLE_PREFERRED_PARSER} = 'XML::LibXML::SAX'; # 0m7.055s
+my $HPMDataCheckAPIVer = 1;
+
my @files = grep { -f } grep { /[^h]\.xml/ } glob 'doxyoutput/xml/struct*.xml';
my %out;
@@ -24,8 +26,15 @@ foreach my $file (@files) {
my @filepath = split(/[\/\\]/, $data->{compounddef}->{location}->{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},
+ type => $plugintypes,
+ };
my $name = "${foldername}_${filename}_H";
- push @{ $out{$name} }, $data->{compounddef}->{compoundname};
+ push @{ $out{$name} }, $symboldata;
}
my $fname = '../../src/common/HPMDataCheck.h';
@@ -49,8 +58,10 @@ foreach my $key (sort keys %out) {
#ifdef $key
EOF
foreach my $entry (@{ $out{$key} }) {
+ my $entryname = $$entry{name};
+ my $entrytype = $$entry{type};
print FH <<"EOF"
- { "$entry", sizeof(struct $entry) },
+ { "$entryname", sizeof(struct $entryname), $entrytype },
EOF
}
print FH <<"EOF"
@@ -62,6 +73,7 @@ EOF
print FH <<"EOF";
};
HPExport unsigned int HPMDataCheckLen = ARRAYLENGTH(HPMDataCheck);
+HPExport int HPMDataCheckVer = $HPMDataCheckAPIVer;
#endif /* HPM_DATA_CHECK_H */
EOF