我的问题是,我的 get string 函数没有返回所有变量,只返回前 16 个变量。这对我来说以前很好用,但我不确定我做了什么改变以使其无法正常工作。
您可以访问http://gen.emudevs.com/index.php?p=tc_creature和 viewsource 来查看我的表单输入。
这是表单提交到的 PHP 操作:
<?php
session_start();
include('tc_func.php');
$trinityFunc = new TrinityCoreFunc();
$trinityFunc->entry = $_POST['entryId'];
$trinityFunc->name = $_POST['name_val'];
$trinityFunc->subname = $_POST['subname'];
$trinityFunc->modelid1 = $_POST['DisplayId1'];
$trinityFunc->modelid2 = $_POST['DisplayId2'];
$trinityFunc->modelid3 = $_POST['DisplayId3'];
$trinityFunc->modelid4 = $_POST['DisplayId4'];
$trinityFunc->minLevel = $_POST['minlevel'];
$trinityFunc->maxLevel = $_POST['maxlevel'];
$trinityFunc->faction_A = $_POST['alliance'];
$trinityFunc->faction_H = $_POST['horde'];
$trinityFunc->scale = $_POST['scale'];
$trinityFunc->rank = $_POST['ranks'];
$trinityFunc->dmg_multiplier = $_POST['dmgmultiplier'];
$trinityFunc->mindmg = $_POST['mindamage'];
$trinityFunc->maxdmg = $_POST['maxdamage'];
$trinityFunc->attacktime = $_POST['attacktime'];
$trinityFunc->health = $_POST['health'];
$trinityFunc->mana = $_POST['mana'];
$trinityFunc->armor = $_POST['armor'];
$trinityFunc->movementId = $_POST['movementid'];
$trinityFunc->lootid = $_POST['lootid'];
$trinityFunc->movementtype = $_POST['movementtype'];
$trinityFunc->vehicleId = $_POST['vehicleid'];
$trinityFunc->mingold = $_POST['mingold'];
$trinityFunc->maxgold = $_POST['maxgold'];
$trinityFunc->equipmentId = $_POST['equipmentid'];
$trinityFunc->resistance = $_POST['resistance1'];
$trinityFunc->resistance2 = $_POST['resistance2'];
$trinityFunc->resistance3 = $_POST['resistance3'];
$trinityFunc->resistance4 = $_POST['resistance4'];
$trinityFunc->resistance5 = $_POST['resistance5'];
$trinityFunc->resistance6 = $_POST['resistance6'];
$trinityFunc->scriptname = $_POST['scriptname'];
$trinityFunc->AIName = $_POST['ainame'];
/* TYPE */
switch ($_POST['tctype_option'])
{
case "None":
$trinityFunc->type = 0;
break;
case "Beast":
$trinityFunc->type = 1;
break;
case "Dragonkin":
$trinityFunc->type = 2;
break;
case "Demon":
$trinityFunc->type = 3;
break;
case "Elemental":
$trinityFunc->type = 4;
break;
case "Giant":
$trinityFunc->type = 5;
break;
case "Undead":
$trinityFunc->type = 6;
break;
case "Humanoid":
$trinityFunc->type = 7;
break;
case "Critter":
$trinityFunc->type = 8;
break;
case "Mechanical":
$trinityFunc->type = 9;
break;
case "Not Specified":
$trinityFunc->type = 10;
break;
case "Totem":
$trinityFunc->type = 11;
break;
case "Non-Combat Pet":
$trinityFunc->type = 12;
break;
case "Gas Cloud":
$trinityFunc->type = 13;
break;
}
/* FAMILY */
switch ($_POST['tcfamily_option']) // $trinityFunc->family
{
case "None":
$trinityFunc->family = 0;
break;
case "Wolf":
$trinityFunc->family = 1;
break;
case "Cat":
$trinityFunc->family = 2;
break;
case "Spider":
$trinityFunc->family = 3;
break;
case "Bear":
$trinityFunc->family = 4;
break;
case "Boar":
$trinityFunc->family = 5;
break;
case "Crocolisk":
$trinityFunc->family = 6;
break;
case "Carrion Bird":
$trinityFunc->family = 7;
break;
case "Crab":
$trinityFunc->family = 8;
break;
case "Gorilla":
$trinityFunc->family = 9;
break;
case "Raptor":
$trinityFunc->family = 11;
break;
case "Tallstrider":
$trinityFunc->family = 12;
break;
case "Felhunter":
$trinityFunc->family = 15;
break;
case "Voidwalker":
$trinityFunc->family = 16;
break;
case "Succubus":
$trinityFunc->family = 17;
break;
case "Doomguard":
$trinityFunc->family = 19;
break;
case "Scorpid":
$trinityFunc->family = 20;
break;
case "Turtle":
$trinityFunc->family = 21;
break;
case "Imp":
$trinityFunc->family = 23;
break;
case "Bat":
$trinityFunc->family = 24;
break;
case "Hyena":
$trinityFunc->family = 25;
break;
case "Owl":
$trinityFunc->family = 26;
break;
case "Wind Serpent":
$trinityFunc->family = 27;
break;
case "Remote Control":
$trinityFunc->family = 28;
break;
case "Felguard":
$trinityFunc->family = 29;
break;
case "Dragonhawk":
$trinityFunc->family = 30;
break;
case "Ravager":
$trinityFunc->family = 31;
break;
case "Warp Stalker":
$trinityFunc->family = 32;
break;
case "Sporebat":
$trinityFunc->family = 33;
break;
case "Nether Ray":
$trinityFunc->family = 34;
break;
case "Serpent":
$trinityFunc->family = 35;
break;
case "Moth":
$trinityFunc->family = 37;
break;
case "Chimaera":
$trinityFunc->family = 38;
break;
case "Devilsaur":
$trinityFunc->family = 39;
break;
case "Ghoul":
$trinityFunc->family = 40;
break;
case "Silithid":
$trinityFunc->family = 41;
break;
case "Worm":
$trinityFunc->family = 42;
break;
case "Rhino":
$trinityFunc->family = 43;
break;
case "Wasp":
$trinityFunc->family = 44;
break;
case "Core Hound":
$trinityFunc->family = 45;
break;
case "Spirit Beast":
$trinityFunc->family = 46;
break;
}
/* UNIT CLASS */
switch ($_POST['tcclass_option']) // $trinityFunc->unit_class
{
case "None":
$trinityFunc->unit_class = 0;
break;
case "Warrior":
$trinityFunc->unit_class = 1;
break;
case "Paladin":
$trinityFunc->unit_class = 2;
break;
case "Rogue":
$trinityFunc->unit_class = 4;
break;
case "Mage":
$trinityFunc->unit_class = 8;
break;
}
/* NPC FLAG */
switch ($_POST['tcflag_option']) // $trinityFunc->npcflag
{
case "None":
$trinityFunc->npcflag = 0;
break;
case "Gossip":
$trinityFunc->npcflag = 1;
break;
case "Quest Giver":
$trinityFunc->npcflag = 2;
break;
case "Trainer":
$trinityFunc->npcflag = 16;
break;
case "Profession Trainer":
$trinityFunc->npcflag = 64;
break;
case "Vendor":
$trinityFunc->npcflag = 128;
break;
case "Gossip & Vendor":
$trinityFunc->npcflag = 129;
break;
case "Vendor Ammo":
$trinityFunc->npcflag = 256;
break;
case "Vendor Food":
$trinityFunc->npcflag = 512;
break;
case "Vendor Poison":
$trinityFunc->npcflag = 1024;
break;
case "Vendor Reagent":
$trinityFunc->npcflag = 2048;
break;
case "Repairer":
$trinityFunc->npcflag = 4096;
break;
case "Flight Master":
$trinityFunc->npcflag = 8192;
break;
case "Spirit Healer":
$trinityFunc->npcflag = 16384;
break;
case "Spirit Guide":
$trinityFunc->npcflag = 32768;
break;
case "Innkeeper":
$trinityFunc->npcflag = 65536;
break;
case "Banker":
$trinityFunc->npcflag = 131072;
break;
case "Petitioner":
$trinityFunc->npcflag = 262144;
break;
case "Tabard Designer":
$trinityFunc->npcflag = 524288;
break;
case "Battlemaster":
$trinityFunc->npcflag = 1048576;
break;
case "Auctioneer":
$trinityFunc->npcflag = 2097152;
break;
case "Stable Master":
$trinityFunc->npcflag = 4194304;
break;
case "Guild Banker":
$trinityFunc->npcflag = 8388608;
break;
case "Spellclick":
$trinityFunc->npcflag = 16777216;
break;
case "Mailbox":
$trinityFunc->npcflag = 67108864;
break;
}
/* UNIT FLAGS */
switch ($_POST['tcunitflag_option']) // $trinityFunc->unit_flags
{
case "None":
$trinityFunc->unit_flags = 0;
break;
case "Server Controlled":
$trinityFunc->unit_flags = 1;
break;
case "Not Attackable":
$trinityFunc->unit_flags = 2;
break;
case "Disable Movement":
$trinityFunc->unit_flags = 4;
break;
case "PvP Attackable":
$trinityFunc->unit_flags = 8;
break;
case "Rename":
$trinityFunc->unit_flags = 16;
break;
case "Preparation":
$trinityFunc->unit_flags = 32;
break;
case "Not Attackable_1":
$trinityFunc->unit_flags = 128;
break;
case "Immune to PC":
$trinityFunc->unit_flags = 256;
break;
case "Immune to NPC":
$trinityFunc->unit_flags = 512;
break;
case "Looting":
$trinityFunc->unit_flags = 1024;
break;
case "Pet in Combat":
$trinityFunc->unit_flags = 2048;
break;
case "PvP":
$trinityFunc->unit_flags = 4096;
break;
case "Silenced":
$trinityFunc->unit_flags = 8192;
break;
case "Pacified":
$trinityFunc->unit_flags = 131072;
break;
case "Stunned":
$trinityFunc->unit_flags = 262144;
break;
case "In Combat":
$trinityFunc->unit_flags = 524288;
break;
case "Taxi Flight":
$trinityFunc->unit_flags = 1048576;
break;
case "Disarmed":
$trinityFunc->unit_flags = 2097152;
break;
case "Confused":
$trinityFunc->unit_flags = 4194304;
break;
case "Fleeing":
$trinityFunc->unit_flags = 8388608;
break;
case "Player Controlled":
$trinityFunc->unit_flags = 16777216;
break;
case "Not Selectable":
$trinityFunc->unit_flags = 33554432;
break;
case "Skinnable":
$trinityFunc->unit_flags = 67108864;
break;
case "Mount":
$trinityFunc->unit_flags = 134217728;
break;
case "Sheathe":
$trinityFunc->unit_flags = 1073741824;
break;
}
/* UNIT FLAGS TWO */
switch ($_POST['tcunitflag2_option']) // $trinityFunc->unit_flags2
{
case "None":
$trinityFunc->unit_flags2 = 0;
break;
case "Feign Death":
$trinityFunc->unit_flags2 = 1;
break;
case "Ignore Reputation":
$trinityFunc->unit_flags2 = 4;
break;
case "Comprehend Language":
$trinityFunc->unit_flags2 = 8;
break;
case "Mirror Image":
$trinityFunc->unit_flags2 = 16;
break;
case "Force Move":
$trinityFunc->unit_flags2 = 64;
break;
case "Disarm Offhand":
$trinityFunc->unit_flags2 = 128;
break;
case "Disarm Ranged":
$trinityFunc->unit_flags2 = 1024;
break;
case "Regenerate Power":
$trinityFunc->unit_flags2 = 2048;
break;
case "Allow Enemy Interact":
$trinityFunc->unit_flags2 = 16384;
break;
case "Allow Cheat Spells":
$trinityFunc->unit_flags2 = 262144;
break;
}
/* TYPE FLAGS */
switch ($_POST['tctypeflag_option']) // $trinityFunc->type_flags
{
case "None":
$trinityFunc->type_flags = 0;
break;
case "Tamable":
$trinityFunc->type_flags = 1;
break;
case "Ghost":
$trinityFunc->type_flags = 2;
break;
case "Dead Interact":
$trinityFunc->type_flags = 128;
break;
case "Herb Loot":
$trinityFunc->type_flags = 256;
break;
case "Mining Loot":
$trinityFunc->type_flags = 512;
break;
case "Mounted Combat":
$trinityFunc->type_flags = 2048;
break;
case "Aid Players":
$trinityFunc->type_flags = 4096;
break;
case "Engineer Loot":
$trinityFunc->type_flags = 32768;
break;
case "Exotic":
$trinityFunc->type_flags = 65536;
break;
}
/* EXTRA FLAGS */
switch ($_POST['tcextraflag_option']) // $trinityFunc->extraflags
{
case "None":
$trinityFunc->extraflags = 0;
break;
case "Instance Bind":
$trinityFunc->extraflags = 1;
break;
case "Civilian":
$trinityFunc->extraflags = 2;
break;
case "Don't Parry":
$trinityFunc->extraflags = 4;
break;
case "Don't Counter Attack w/Parry":
$trinityFunc->extraflags = 8;
break;
case "Don't Block":
$trinityFunc->extraflags = 16;
break;
case "Don't Crush":
$trinityFunc->extraflags = 32;
break;
case "Don't give XP":
$trinityFunc->extraflags = 64;
break;
case "Trigger":
$trinityFunc->extraflags = 128;
break;
case "Immune to taunt auras":
$trinityFunc->extraflags = 256;
break;
case "World Event":
$trinityFunc->extraflags = 16384;
break;
case "Guard":
$trinityFunc->extraflags = 32768;
break;
case "Don't Crit":
$trinityFunc->extraflags = 131072;
break;
case "Don't Gain Skill":
$trinityFunc->extraflags = 262144;
break;
case "Taunt Dimnish":
$trinityFunc->extraflags = 524288;
break;
case "All Dimnish":
$trinityFunc->extraflags = 1048576;
break;
case "Dungeon Boss":
$trinityFunc->extraflags = 2097152;
break;
}
/* MECHANIC IMMUNE MASK */
switch ($_POST['tcimmune_option']) // $trinityFunc->mechanic_immune_mask
{
case "None":
$trinityFunc->mechanic_immune_mask = 0;
break;
case "ALL":
$trinityFunc->mechanic_immune_mask = 2147483647;
break;
case "Charm":
$trinityFunc->mechanic_immune_mask = 1;
break;
case "Disoriented":
$trinityFunc->mechanic_immune_mask = 2;
break;
case "Disarm":
$trinityFunc->mechanic_immune_mask = 4;
break;
case "Distract":
$trinityFunc->mechanic_immune_mask = 8;
break;
case "Fear":
$trinityFunc->mechanic_immune_mask = 16;
break;
case "Grip":
$trinityFunc->mechanic_immune_mask = 32;
break;
case "Root":
$trinityFunc->mechanic_immune_mask = 64;
break;
case "Pacify":
$trinityFunc->mechanic_immune_mask = 128;
break;
case "Silence":
$trinityFunc->mechanic_immune_mask = 256;
break;
case "Sleep":
$trinityFunc->mechanic_immune_mask = 512;
break;
case "Snare":
$trinityFunc->mechanic_immune_mask = 1024;
break;
case "Stun":
$trinityFunc->mechanic_immune_mask = 2048;
break;
case "Freeze":
$trinityFunc->mechanic_immune_mask = 4096;
break;
case "Knockout":
$trinityFunc->mechanic_immune_mask = 8192;
break;
case "Bleed":
$trinityFunc->mechanic_immune_mask = 16384;
break;
case "Bandage":
$trinityFunc->mechanic_immune_mask = 32768;
break;
case "Polymorph":
$trinityFunc->mechanic_immune_mask = 65536;
break;
case "Banish":
$trinityFunc->mechanic_immune_mask = 131072;
break;
case "Shield":
$trinityFunc->mechanic_immune_mask = 262144;
break;
case "Shackle":
$trinityFunc->mechanic_immune_mask = 524288;
break;
case "Mount":
$trinityFunc->mechanic_immune_mask = 1048576;
break;
case "Infected":
$trinityFunc->mechanic_immune_mask = 2097152;
break;
case "Turn":
$trinityFunc->mechanic_immune_mask = 4194304;
break;
case "Horror":
$trinityFunc->mechanic_immune_mask = 8388608;
break;
case "Invulnerability":
$trinityFunc->mechanic_immune_mask = 16777216;
break;
case "Interrupt":
$trinityFunc->mechanic_immune_mask = 33554432;
break;
case "Daze":
$trinityFunc->mechanic_immune_mask = 67108864;
break;
case "Discovery":
$trinityFunc->mechanic_immune_mask = 134217728;
break;
case "Immune Shield":
$trinityFunc->mechanic_immune_mask = 268435456;
break;
case "Sapped":
$trinityFunc->mechanic_immune_mask = 536870912;
break;
case "Enraged":
$trinityFunc->mechanic_immune_mask = 1073741824;
break;
}
foreach ($_POST as $param_name => $param_val) {
echo "Param: $param_name Value: $param_val<br />\n";
}
foreach 只是为了测试返回的值
这是生成信息的包含的 tc_func.php:
<?php
session_start();
class TrinityCoreFunc
{
/* Creature Template */
var $creatureTemplateStructure;
var $entry, $modelid1, $modelid2, $modelid3, $modelid4, $name, $subname, $minLevel, $maxLevel, $faction_A, $faction_H, $npcflag, $scale, $rank, $mindmg, $maxdmg, $dmg_multiplier, $attacktime,
$unit_class, $unit_flags, $unit_flags2, $family, $type, $type_flags, $lootid, $resistance, $resistance2, $resistance3, $resistance4, $resistance5, $resistance6, $vehicleId, $mingold, $maxgold,
$AIName, $movementtype, $health, $mana, $armor, $movementId, $equipmentId, $mechanic_immune_mask, $extraflags, $scriptname;
// Generator
var $generateStructure;
function TrinityCoreFunc()
{
/* Creature Template */
$this->creatureTemplateStructure = array("INSERT INTO `creature_template` (`entry`,", "`difficulty_entry_1`,", "`difficulty_entry_2`,", "`difficulty_entry_3`,", "`KillCredit1`,", "`KillCredit2`,",
"`modelid1`,", "`modelid2`,", "`modelid3`,", "`modelid4`,", "`name`,", "`subname`,", "`IconName`,", "`gossip_menu_id`,", "`minlevel`,", "`maxlevel`,", "`exp`,", "`faction_A`,", "`faction_H`,",
"`npcflag`,", "`speed_walk`,", "`speed_run`,", "`scale`,", "`rank`,", "`mindmg`,", "`maxdmg`,", "`dmgschool`,", "`attackpower`,","`dmg_multiplier`,", "`baseattacktime`,", "`rangeattacktime`,",
"`unit_class`,", "`unit_flags`,", "`unit_flags2`,", "`dynamicflags`,", "`family`,", "`trainer_type`,", "`trainer_spell`,", "`trainer_class`,", "`trainer_race`,", "`minrangedmg`,", "`maxrangedmg`,",
"`rangedattackpower`,", "`type`,", "`type_flags`,", "`lootid`,", "`pickpocketloot`,", "`skinloot`,", "`resistance1`,", "`resistance2`,", "`resistance3`,", "`resistance4`,", "`resistance5`,",
"`resistance6`,", "`spell1`,", "`spell2`,", "`spell3`,", "`spell4`,", "`spell5`,", "`spell6`,", "`spell7`,", "`spell8`,", "`PetSpellDataId`,", "`VehicleId`,", "`mingold`,", "`maxgold`,", "`AIName`,",
"`MovementType`,", "`InhabitType`,", "`HoverHeight`,", "`Health_mod`,", "`Mana_mod`,", "`Armor_mod`,", "`RacialLeader`,", "`questItem1`,", "`questItem2`,", "`questItem3`,", "`questItem4`,", "`questItem5`,",
"`questItem6`,", "`movementId`,", "`RegenHealth`,", "`equipment_id`,", "`mechanic_immune_mask`,", "`flags_extra`,", "`ScriptName`,", "`WDBVerified`) VALUES (");
/* End Creature Template */
$this->entry = 0;
$this->modelid1 = 0;
$this->modelid2 = 0;
$this->modelid3 = 0;
$this->modelid4 = 0;
$this->name = "";
$this->subname = "";
$this->minLevel = 0;
$this->maxLevel = 0;
$this->faction_A = 0;
$this->faction_H = 0;
$this->npcflag = 0;
$this->scale = 1;
$this->rank = 0;
$this->mindmg = 0;
$this->maxdmg = 0;
$this->dmg_multiplier = 0;
$this->attacktime = 2000;
$this->unit_class = 0;
$this->unit_flags = 0;
$this->unit_flags2 = 0;
$this->family = 0;
$this->type = 0;
$this->type_flags = 0;
$this->lootid = 0;
$this->resistance = 0;
$this->resistance2 = 0;
$this->resistance3 = 0;
$this->resistance4 = 0;
$this->resistance5 = 0;
$this->resistance6 = 0;
$this->vehicleId = 0;
$this->mingold = 0;
$this->maxgold = 0;
$this->AIName = "";
$this->movementtype = 0;
$this->health = 0;
$this->mana = 0;
$this->armor = 0;
$this->movementId = 0;
$this->equipmentId = 0;
$this->mechanic_immune_mask = 0;
$this->extraflags = 0;
$this->scriptname = "";
}
function GetCreatureGenerateStructure()
{
$this->generateStructure = $this->entry . ", 0, 0, 0, 0, 0, " . $this->modelid1 . ", " . $this->modelid2 . ", " . $this->modelid3 . ", " . $this->modelid4 . ", '" . $this->name . "', '"
. $this->subname . "', '', 0, " . $this->minLevel . ", " . $this->maxLevel . ", 0, " . $this->faction_A . ", " . $this->faction_H . ", " . $this->npcflag . ", 1, 1, " . $this->scale . ", " . $this->rank . ", "
. $this->mindmg . ", " . $this->maxdmg . ", 0, 0, " . $this->dmg_multiplier . ", " . $this->attacktime . ", 2000, " . $this-> unit_class . ", " . $this->unit_flags . ", " . $this->unit_flags2 . ", 8, "
. $this->family . ", 0, 0, 0, 0, 0, 0, 0, " . $this->type . ", " . $this->type_flags . ", " . $this->lootid . ", 0, 0, " . $this->resistance . ", " . $this->resistance2 . ", "
. $this->resistance3 . ", " . $this->resistance4 . ", " . $this->resistance5 . ", " . $this->resistance6 . ", 0, 0, 0, 0, 0, 0, 0, 0, 0, " . $this->vehicleId . ", " . $this->mingold . ", "
. $this->maxgold . ", '" . $this->AIName . "', 1, 1, 1, " . $this->health . ", " . $this->mana . ", " . $this->armor . ", 0, 0, 0, 0, 0, 0, 0, " . $this->movementId . ", 1, "
. $this->equipmentId . ", " . $this->mechanic_immune_mask . ", " . $this->extraflags . ", '" . $this->scriptname . "', 1);";
return $this->generateStructure;
}
function GetCreatureTemplateStructure()
{
$val = "";
for ($i = 0; $i < count($this->creatureTemplateStructure); $i++)
{
$val .= $this->creatureTemplateStructure[$i];
}
return $val;
}
}
所以问题是,从 GetCreatureGenerateStructure 返回 generateStructure 只给出前 16 个发布的变量,其余的显示空白。
我希望这里有人能看到我看不到的东西。我已经为此压力一个多星期了,我没有想法。