diff --git a/mojotrollz/api/autoload.inc.php b/mojotrollz/api/autoload.inc.php index 34cd3d1..1a5a814 100644 --- a/mojotrollz/api/autoload.inc.php +++ b/mojotrollz/api/autoload.inc.php @@ -4,4 +4,5 @@ SYSTEM\autoload::registerFolder(dirname(__FILE__).'/server',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/realm',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/world',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/database',''); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/charcreation',''); \ No newline at end of file +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/charcreation',''); +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/client',''); \ No newline at end of file diff --git a/mojotrollz/api/client/AuthCmd.php b/mojotrollz/api/client/AuthCmd.php new file mode 100644 index 0000000..0302e28 --- /dev/null +++ b/mojotrollz/api/client/AuthCmd.php @@ -0,0 +1,16 @@ + account has been closed and is no longer available for use. Please go to /banned.html for further information. + const REALM_AUTH_NO_MATCH=0x04; ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see for more information + const REALM_AUTH_UNKNOWN2=0x05; ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see for more information + const REALM_AUTH_ACCOUNT_IN_USE=0x06; ///< This account is already logged into . Please check the spelling and try again. + const REALM_AUTH_PREPAID_TIME_LIMIT=0x07; ///< You have used up your prepaid time for this account. Please purchase more to continue playing + const REALM_AUTH_SERVER_FULL=0x08; ///< Could not log in to at this time. Please try again later. + const REALM_AUTH_WRONG_BUILD_NUMBER=0x09; ///< Unable to validate game version. This may be caused by file corruption or interference of another program. Please visit for more information and possible solutions to this issue. + const REALM_AUTH_UPDATE_CLIENT=0x0a; ///< Downloading + const REALM_AUTH_UNKNOWN3=0x0b; ///< Unable to connect + const REALM_AUTH_ACCOUNT_FREEZED=0x0c; ///< This account has been temporarily suspended. Please go to /banned.html for further information + const REALM_AUTH_UNKNOWN4=0x0d; ///< Unable to connect + const REALM_AUTH_UNKNOWN5=0x0e; ///< Connected. + const REALM_AUTH_PARENTAL_CONTROL=0x0f; ///< Access to this account has been blocked by parental controls. Your settings may be changed in your account preferences at +}; \ No newline at end of file diff --git a/mojotrollz/api/client/client.php b/mojotrollz/api/client/client.php new file mode 100644 index 0000000..23a03d2 --- /dev/null +++ b/mojotrollz/api/client/client.php @@ -0,0 +1,348 @@ + 0); +logdebug("--> a=%s",a.AsHexStr()); +Sha1Hash userhash,xhash,uhash; +userhash.UpdateData(_authstr); +userhash.Finalize(); +xhash.UpdateData(salt.AsByteArray(),salt.GetNumBytes()); +xhash.UpdateData(userhash.GetDigest(),userhash.GetLength()); +xhash.Finalize(); +x.SetBinary(xhash.GetDigest(),xhash.GetLength()); +logdebug("--> x=%s",x.AsHexStr()); +v=g.ModExp(x,N); +logdebug("--> v=%s",v.AsHexStr()); +A=g.ModExp(a,N); +logdebug("--> A=%s",A.AsHexStr()); +uhash.UpdateBigNumbers(&A, &B, NULL); +uhash.Finalize(); +u.SetBinary(uhash.GetDigest(), 20); +logdebug("--> u=%s",u.AsHexStr()); +S=(B - k*g.ModExp(x,N) ).ModExp((a + u * x),N); +logdebug("--> S=%s",S.AsHexStr()); +ASSERT(S.AsDword() > 0); + + +// calc M1 & M2 +unsigned int i=0; +char S1[16+1],S2[16+1]; // 32/2=16 :) +1 for \0 +// split it into 2 seperate strings, interleaved +for(i=0;i<16;i++){ + S1[i]=S.AsByteArray()[i*2]; + S2[i]=S.AsByteArray()[i*2+1]; +} + +// hash each one: +Sha1Hash S1hash,S2hash; +S1hash.UpdateData((const uint8*)S1,16); +S1hash.Finalize(); +S2hash.UpdateData((const uint8*)S2,16); +S2hash.Finalize(); +// Re-combine them +char S_hash[40]; +for(i=0;i<20;i++){ + S_hash[i*2]=S1hash.GetDigest()[i]; + S_hash[i*2+1]=S2hash.GetDigest()[i]; +} +_key.SetBinary((uint8*)S_hash,40); // used later when authing to world +logdebug("--> SessionKey=%s",_key.AsHexStr()); + +char Ng_hash[20]; +Sha1Hash userhash2,Nhash,ghash; +userhash2.UpdateData((const uint8*)user.c_str(),user.length()); +userhash2.Finalize(); +//printchex((char*)userhash2.GetDigest(),userhash2.GetLength(),true); +Nhash.UpdateBigNumbers(&N,NULL); +Nhash.Finalize(); +ghash.UpdateBigNumbers(&g,NULL); +ghash.Finalize(); +for(i=0;i<20;i++)Ng_hash[i] = Nhash.GetDigest()[i]^ghash.GetDigest()[i]; +//printchex(Ng_hash,20,true); + +BigNumber t_acc,t_Ng_hash; +t_acc.SetBinary((const uint8*)userhash2.GetDigest(),userhash2.GetLength()); +t_Ng_hash.SetBinary((const uint8*)Ng_hash,20); + + +Sha1Hash M1hash,M2hash; + +M1hash.UpdateBigNumbers(&t_Ng_hash,&t_acc,&salt,&A,&B,NULL); +M1hash.UpdateData((const uint8*)S_hash,40); +M1hash.Finalize(); + +M2hash.UpdateBigNumbers(&A,NULL); +M2hash.UpdateData((const uint8*)M1hash.GetDigest(),M1hash.GetLength()); +M2hash.UpdateData((const uint8*)S_hash,40); +M2hash.Finalize(); + +logdebug("== Common Hashes =="); +logdebug("--> M1=%s",toHexDump(M1hash.GetDigest(),M1hash.GetLength(),false).c_str()); +logdebug("--> M2=%s",toHexDump(M2hash.GetDigest(),M2hash.GetLength(),false).c_str()); + +// Calc CRC & CRC_hash +// i don't know yet how to calc it, so set it to zero +char crc_hash[20]; +memset(crc_hash,0,20); + +logdebug("--> CRC=%s",toHexDump((uint8*)crc_hash,20,false).c_str()); + + +// now lets prepare the packet +ByteBuffer packet; +packet << (uint8)AUTH_LOGON_PROOF; +packet.append(A.AsByteArray(),A.GetNumBytes()); +packet.append(M1hash.GetDigest(),M1hash.GetLength()); +packet.append(crc_hash,20); +packet << (uint8)0; // number of keys = 0 +packet << (uint8)0; // 1.11.x compatibility (needs one more 0) + +A = g^a +B = kv + g^b +u = H(A, B) +x = H(s, p) +S = (B - kg^x) ^ (a + ux) +K = H(S) +M = H(H(N) xor H(g), H(I), s, A, B, K) + */ + +$N = self::bchexdec($N); +$B = self::bchexdec($B); +$a = rand(1,19*8); +$x = 0; +$v = 0; +//$S = self::bchexdec($read['S']); +$salt = self::bchexdec($salt); +$unk2 = self::bchexdec($unk2); +$g = self::bchexdec($g); +$k = 3;// init BNs, default k to 3 +$user = 'ADMINISTRATOR'; // upper +$user_pass = 'ADMINISTRATOR'; // upper +$auth_str = $user.":".$user_pass; + +$userhash = sha1($auth_str); +$x = sha1($salt.$auth_str); +$v= bcpow($g, $x, $N); +$A = bcpow($g, $a, $N); +$u = sha1($A.$B); +$S= bcpow((bcsub($B, bcmul($k, bcpow($g, $x, $N)))),(bcadd($a, bcmul($u, $x))),$N); //(B - k*g.ModExp(x,N) ).ModExp((a + u * x),N); + +// calc M1 & M2 +$i = 0; +$S1 = ''; +$S2 = ''; +// split it into 2 seperate strings, interleaved +for($i=0;$i<16;$i++){ + $S1 .= substr($S, ($i*2)*2,2); + $S2 .= substr($S, ($i*2+1)*2,2); +} +// hash each one: +$S1hash = sha1($S1); +$S2hash = sha1($S2); +// Re-combine them +$S_hash = ''; +for($i=0;$i<20;$i++){ + $S_hash .= substr($S1hash, $i*2,2); + $S_hash .= substr($S2hash, $i*2,2); +} +$key = $S_hash;// used later when authing to world(session key) + +$userhash2 = sha1($user); +$Nhash = sha1($N); +$ghash = sha1($g); +$Ng_hash = ''; +for($i=0;$i<20;$i++){ + $Ng_hash .= hexdec(substr($Nhash, $i*2,2))^hexdec(substr($ghash, $i*2,2));}; + +$t_acc = $userhash2; +$t_Ng_hash = $Ng_hash; + +$M1hash = sha1($t_Ng_hash.$t_acc.$salt.$A.$B); +$M2hash = sha1($M1hash.$S_hash); + +$A_hex = self::bcdechex($A); + +// Calc CRC & CRC_hash +// i don't know yet how to calc it, so set it to zero +//... +$res = array( 'N' => $N, + 'A' => $A, + 'B' => $B, + 'g' => $g, + 'a' => $a, + 'u' => $u, + 'x' => $x, + 'v' => $v, + 'S' => $S, + 'salt' => $salt, + 'unk2' => $unk2, + 'user' => $user, + 'user_pass' => $user_pass, + 'auth_str' => $auth_str, + 'A_hex' => $A_hex, + 'M1hash' => $M1hash, + substr($A_hex,1,2), substr($A_hex,3,2),substr($A_hex,5,2),substr($A_hex,7,2),substr($A_hex,9,2),substr($A_hex,11,2),substr($A_hex,13,2),substr($A_hex,15,2),substr($A_hex,17,2),substr($A_hex,19,2),substr($A_hex,21,2),substr($A_hex,23,2),substr($A_hex,25,2),substr($A_hex,27,2),substr($A_hex,29,2),substr($A_hex,31,2),substr($A_hex,33,2),substr($A_hex,35,2),substr($A_hex,37,2),substr($A_hex,39,2),substr($A_hex,41,2),substr($A_hex,43,2),substr($A_hex,45,2),substr($A_hex,47,2),substr($A_hex,49,2),substr($A_hex,51,2),substr($A_hex,53,2),substr($A_hex,55,2),substr($A_hex,57,2),substr($A_hex,59,2),substr($A_hex,61,2),substr($A_hex,63,2)); +new WARNING(print_r($res,true)); + $out = pack('hh32h20hhhhhhhhhhhhhhhhhhhhhh', //'hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh',//'hh32h20hhhhhhhhhhhhhhhhhhhhhh', + AuthCmd::AUTH_LOGON_PROOF, //Command + $A_hex,//substr($A_hex,1,2), substr($A_hex,3,2),substr($A_hex,5,2),substr($A_hex,7,2),substr($A_hex,9,2),substr($A_hex,11,2),substr($A_hex,13,2),substr($A_hex,15,2),substr($A_hex,17,2),substr($A_hex,19,2),substr($A_hex,21,2),substr($A_hex,23,2),substr($A_hex,25,2),substr($A_hex,27,2),substr($A_hex,29,2),substr($A_hex,31,2),substr($A_hex,33,2),substr($A_hex,35,2),substr($A_hex,37,2),substr($A_hex,39,2),substr($A_hex,41,2),substr($A_hex,43,2),substr($A_hex,45,2),substr($A_hex,47,2),substr($A_hex,49,2),substr($A_hex,51,2),substr($A_hex,53,2),substr($A_hex,55,2),substr($A_hex,57,2),substr($A_hex,59,2),substr($A_hex,61,2),substr($A_hex,63,2), //A self::bcdechex($A), substr($A_hex,1,64),// $A_hex,// + $M1hash, //0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, //M1 $M1hash,//substr($M1hash,1,40),//$M1hash,// + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, //CRC + 0x00, //Keys + 0x00 //unk + ); + return $out; + } + + public static function import($ip){ + new INFO('Tryin to Connect to '.$ip); + $errno = $errstr = ''; + $fp = fsockopen($ip , 3724, $errno, $errstr, 1000); + //socket_set_blocking( $fp, false ); + if (!$fp) { + new ERROR("ERROR: $errno - $errstr"); + } else { + new INFO('Connection established'); + + $out = self::logon_challenge(); + new WARNING($out); + //new WARNING(bin2hex($out)); + fwrite($fp, $out); + $read = fread($fp, 119);//stream_get_contents($fp); //fread($fp, 1); + $read = self::server_logon_challenge($read); + new WARNING(print_r($read,true)); + $out = self::logon_proof($read['N'],$read['B'],$read['salt'],$read['unk2']); + new WARNING($out); + fwrite($fp, $out); + fclose($fp); + new WARNING("success"); + } + } + + private static function bchexdec($hex) + { + $dec = 0; + $len = strlen($hex); + for ($i = 1; $i <= $len; $i++) { + $dec = bcadd($dec, bcmul(strval(hexdec($hex[$i - 1])), bcpow('16', strval($len - $i)))); + } + return $dec; + } + private static function bcdechex($dec) { + $last = bcmod($dec, 16); + $remain = bcdiv(bcsub($dec, $last), 16); + if($remain == 0) { + return dechex($last); + } else { + return self::bcdechex($remain).dechex($last); + } + } +} diff --git a/mojotrollz/docu/mojo_zero/website.md b/mojotrollz/docu/mojo_zero/website.md new file mode 100644 index 0000000..f448d14 --- /dev/null +++ b/mojotrollz/docu/mojo_zero/website.md @@ -0,0 +1,205 @@ +# Funktionality +- Login/Register (openid) +- Server Info +- Vote -> gain Mojo +(- Donate -> gain Mojo) +- News +- Server Status + - Accounts count + - Characters count + - Uptime + - Top 10 +-Account + - Vote Stuff + - Accepte Votereward quests (no payment on website) + - Characters + - Inventory/Bank/GBank/Aditional Bank + - Model/Items/Stats... + - Skilltree(ig) -> share options?! + - Database (able 2 tag entrys for bugged/blizzlike/working...) + - Quests + - Creatures + Drop + - Items + - Skilltree(web) + - Archievements + - OnKill + - First kill mob + - Kill mob + - Kill Player + - OnQuestComplete + - OnRoll (100/1) (in lootroll) + - OnCraft + - OnLearn + - OnAHSell + - OnAHBuy + - OnAHCancel + - OnExplore + - OnDeath + - OnLoot (recieve any type of item) + - Minigames?! + - Low lvl materials + - lvling + - Round base duel +- Gm Tool + - Edit Database + - Deploy Database + - Servercontroll + - Shutdown + - Update + - Ticket Management + - Ingame Mail + - Character Management + - Backup + - Bugreports/Database error list/crashes + +# Login +- Required Data of the User + - Nick + - Password +- Forgotten Password? + - EMail + Link + - if set ask Date of Birth, ICQ number, Name, Lastname, Charactername +- Allow openid for login + +# Register +- Reuqired Data of the User + - Nickname + - Password x2 + - Captcha + - EMail +- Optional Data of the User(can be set later in profile, not while registering) + - Name + - Lastname + - ICQ + - Date of Birth +- Allow openid for retriving informations/registering + +# Server Info +- Name +- Game Version 2.4.3 +- Client Download +- Realmlist (file or text) +- Rates + Custom Content +- Average Lvltime guessed + +# Vote +- Set Charactername whom 2 send to. (if logged in -> character list is provided, if not you can type random name, leave blank or randomize for random character) +- Limitation of votes + +# News +- Server news, chronologically, requires one picture! (no more posts without pictures) + +# Server Status +- Accounts count +- Characters count +- Average Lvl time (only if its acceptable!) +- Uptime +- Top 10 + - TOP PVE + - TOP PVP + - TOP Quest + - TOP Guild + - TOP Playtime + - TOP BossKills + - TOP Firstkills + - TOP Firstkills Boss + - TOP Duels + +# Skilltree(web) -> costs mojo(how 2 transfere?) (should mostly start a quest to unlock the feature) +- Survival Tree - Character + - [C] Mojo Postbox (unlocks quest) + - [C] HS Cooldownreduction (unlocks quest) + - 3x + - [C/A] Dual Specc(changed on website/spell) + - on 8 x 1 chars + - [C/A] Dual Gear (changed on website/spell) + - on 8 x 1 chars + - [C] Tripple Gear + - on 1 char + - [C] Tripple Specc + - [C] Click on Button Spell -> to make ur char look nice -> buy skill click on button on website 2 gain shit + - [C] Tabarts(normal tabart quests) + - [C] Mana/Hp Pot quest(daily 5x pot on choise + task) + - [C] Scroll quests(daily 1x scroll of choise, insta completed) + - [C] Summon Trainer of ur Class 1d cd (spell?) (not in instances) (not indoor?) + - [C] Summon Trader + - [C] Summon Repairer + - [C] Multichar + - lvl 19 pvp + - lvl 39 pvp + - lvl 60 pvp/pve + + normal 70. + - [C] Craft cooldownreduction + 5% x 5 + - [C] MoreQuests in Questlog + - 10x 1 +- Trader Tree(Web Tree) - account + - [A] Database access + - Quests + - Items + - Creatures + - [A] AH Access (if Char is in City (CIIC)) + - Buy(only bid/also buyout) + - Sell(only bid/also buyout) + - [A] Bank Access (CIIC) + - Put + - Pop + - [A] Guildbank Access (CIIC) + - Put + - Pop + - [A] AH fee reduction + - [A] AH item count+ + - [A] Aditional Website bank per account(items are charbound) + - 5 + - 10 + - 15 + - 20 + - 25 + x3 pages +1 per alt max 6 + - [A] In between bank for characters on the same account (char in city can put/pop from that bank - not bop items ofc) + - 2 Slots + - 5 Slots + - 10 Slots + - [A] Permanent Auctions (1x bigger fee, keeps item in ah till all of that kind(or number) are sold) + - 1x 10 + - [A] Permanent Auctions dont count as normal auctions + - [A] Send Mail/Read Mail + - normal + - with gold + - with item + - with cod + - [A] Mojo AH (items/chars) for mojo (chars for green) + - [A] Trade AH (offer item/s, request item/s) + - [A] Charbank (have more then 8 chars on 1 acc) + - [A] Lend Chars -> chars can be logged by authorized pplz, but will be restored to the version before logging -> temporary transfere + - [A] Log more chars from one account +- GM Tree - account + - Ability to mark a quest as working(giving mojo if confirmed) + - Ability to mark a quest as bugged + - Ability to mark a quest as blizzlike + - .g i command available (all chars) + - .s i command available (all chars) + - .player reputation available (all chars) + - Ability to mark a Item as working + - Ability to mark a Item as bugged + - Ability to mark a Item as blizzlike + - Ability to mark a Mob as working + - Ability to mark a Mob as bugged + - Ability to mark a Mob as blizzlike + - GM character (testserver) + - GM character (liveserver) + - Moderator Character (liveserver) + - ingame commands for bugreport?! + +- Skills may require + - Approve + - Mojo(web) + - Bugreports / Accepted Bugreports + - Fixes / Accepted Fixes + - Playtime + - Gold + - Other Skills + - Character lvl x + - Achievement x + - Character Spell x + - Duel Win/loose \ No newline at end of file diff --git a/mojotrollz/sai/autoload.inc.php b/mojotrollz/sai/autoload.inc.php index e38f133..eb485b6 100644 --- a/mojotrollz/sai/autoload.inc.php +++ b/mojotrollz/sai/autoload.inc.php @@ -2,7 +2,6 @@ SYSTEM\autoload::registerFolder(dirname(__FILE__).'',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/saimod_mojotrollz_server_handling',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/saimod_mojotrollz_db_command',''); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/saimod_mojotrollz_db_creature',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/saimod_mojotrollz_db_event',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/saimod_mojotrollz_db_gossip',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/saimod_mojotrollz_db_item',''); diff --git a/mojotrollz/sai/register_modules.php b/mojotrollz/sai/register_modules.php index 663fc4b..d1546c2 100644 --- a/mojotrollz/sai/register_modules.php +++ b/mojotrollz/sai/register_modules.php @@ -1,7 +1,7 @@ query('SELECT * FROM creature_template LIMIT 100;'); - - $result = ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '; +class saimod_mojotrollz_db_creature extends \SYSTEM\SAI\SaiModule { + public static function sai_mod_saimod_mojotrollz_db_creature_action_search($search){ + return self::sai_mod_saimod_mojotrollz_db_creature($search); + } + public static function sai_mod_saimod_mojotrollz_db_creature($search='%'){ + + $def = array( 'Entry' => array('caption' => 'ID'), + 'ModelId1' => array('hidden' => false), + 'ModelId2' => array('hidden' => false), + 'Scale' => array('hidden' => true), + 'Family' => array('hidden' => false), + 'CreatureType' => array('hidden' => true), + 'InhabitType' => array('hidden' => true), + 'RegenerateHealth' => array('hidden' => true), + 'RacialLeader' => array('hidden' => true), + 'NpcFlags' => array('hidden' => true), + 'UnitFlags' => array('hidden' => true), + 'DynamicFlags' => array('hidden' => true), + 'ExtraFlags' => array('hidden' => true), + 'CreatureTypeFlags' => array('hidden' => true), + 'SpeedWalk' => array('hidden' => true), + 'SpeedRun' => array('hidden' => true), + 'HealthMultiplier' => array('hidden' => true), + 'ManaMultiplier' => array('hidden' => true), + 'DamageMultiplier' => array('hidden' => true), + 'DamageVariance' => array('hidden' => true), + 'ArmorMultiplier' => array('hidden' => true), + 'ExperienceMultiplier' => array('hidden' => true), + 'MinLevelHealth' => array('hidden' => true), + 'MaxLevelHealth' => array('hidden' => true), + 'MinLevelMana' => array('hidden' => true), + 'MaxLevelMana' => array('hidden' => true), + 'MinMeeleDmg' => array('hidden' => true), + 'MaxMeeleDmg' => array('hidden' => true), + 'MinRangedDmg' => array('hidden' => true), + 'MaxRangedDmg' => array('hidden' => true), + 'Armor' => array('hidden' => true), + 'MeeleAttackPower' => array('hidden' => true), + 'RangedAttackPower' => array('hidden' => true), + 'MeeleBaseAttackTime' => array('hidden' => true), + 'MaxMeleeDmg' => array('hidden' => true), + 'MeleeAttackPower' => array('hidden' => true), + 'RangedBaseAttackTime' => array('hidden' => true), + 'DamageSchool' => array('hidden' => true), + 'MinLootGold' => array('hidden' => true), + 'MaxLootGold' => array('hidden' => true), + 'LootId' => array('hidden' => false), + 'PickpocketLootId' => array('hidden' => false), + 'SkinningLootId' => array('hidden' => false), + 'KillCredit1' => array('hidden' => true), + 'KillCredit2' => array('hidden' => true), + 'MechanicImmuneMask' => array('hidden' => true), + 'MinMeleeDmg' => array('hidden' => true), + 'MeleeBaseAttackTime' => array('hidden' => true), + 'ResistanceHoly' => array('hidden' => true), + 'ResistanceFire' => array('hidden' => true), + 'ResistanceNature' => array('hidden' => true), + 'ResistanceFrost' => array('hidden' => true), + 'ResistanceShadow' => array('hidden' => true), + 'ResistanceArcane' => array('hidden' => true), + 'PetSpellDataId' => array('hidden' => true), + 'MovementType' => array('hidden' => true), + 'TrainerType' => array('hidden' => true), + 'TrainerSpell' => array('hidden' => true), + 'TrainerClass' => array('hidden' => true), + 'TrainerRace' => array('hidden' => true), + 'TrainerTemplateId' => array('hidden' => true), + 'VendorTemplateId' => array('hidden' => true), + 'GossipMenuId' => array('hidden' => true), + 'EquipmentTemplateId' => array('hidden' => true), + 'Civilian' => array('hidden' => true), + 'AIName' => array('hidden' => true), + 'ScriptName' => array('hidden' => false), + ); + + $res = \DBD\DB_CREATURE_TEMPLATE_SEARCH::QQ(array($search,$search,$search)); + $result = ''; + $result .= '
entrymodelid_1modelid_2namesubnameminlevelmaxlevelfaction_Afaction_Hnpcflagrankunit_classunit_flagsdynamicflagsfamilytrainer_typetrainer_spelltrainer_classtrainer_racetypetype_flagsAINameMovementTypeInhabitTypeCivilianRacialLeaderequipment_idtrainer_idvendor_idflags_extraScriptName
'; + $result_body = ''; + $first = true; while($row = $res->next()){ - $result .= ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '; + $result_body .= ''; + foreach($row as $key=>$data){ + //hidden + if( array_key_exists($key, $def) && + array_key_exists('hidden',$def[$key]) && + $def[$key]['hidden']){ + continue; + } + + if($first){ + if( array_key_exists($key, $def) && + array_key_exists('caption',$def[$key])){ + $key = $def[$key]['caption']; + } + $result .= '';} + $result_body .= ''; + } + $first=false; + $result_body .= ''; } + $result .= ''.$result_body; $result .= '
'.$row['Entry'].''.$row['modelid_1'].''.$row['modelid_2'].''.$row['name'].''.$row['subname'].''.$row['minlevel'].''.$row['maxlevel'].''.$row['faction_A'].''.$row['faction_H'].''.$row['npcflag'].''.$row['rank'].''.$row['unit_class'].''.$row['unit_flags'].''.$row['dynamicflags'].''.$row['family'].''.$row['trainer_type'].''.$row['trainer_spell'].''.$row['trainer_class'].''.$row['trainer_race'].''.$row['type'].''.$row['type_flags'].''.$row['AIName'].''.$row['MovementType'].''.$row['InhabitType'].''.$row['Civilian'].''.$row['RacialLeader'].''.$row['equipment_id'].''.$row['trainer_id'].''.$row['vendor_id'].''.$row['mechanic_immune_mask'].''.$row['flags_extra'].''.$row['ScriptName'].'
'.$key.''.$data.'
'; - return $result;} + return $result; + } + public static function html_li_menu(){return '
  • DB:Creatures
  • ';} public static function right_public(){return false;} public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} - public static function sai_mod_saimod_mojotrollz_db_creature_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array());} + public static function sai_mod_saimod_mojotrollz_db_creature_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array( + \SYSTEM\WEBPATH(new PSAI(),'saimod_mojotrollz_db_creature/saimod_mojotrollz_db_creature.js')));} public static function sai_mod_saimod_mojotrollz_db_creature_flag_css(){} - } \ No newline at end of file diff --git a/mojotrollz/sai/saimod_mojotrollz_import/autoload.inc.php b/mojotrollz/sai/saimod_mojotrollz_import/autoload.inc.php new file mode 100644 index 0000000..bf4bbc1 --- /dev/null +++ b/mojotrollz/sai/saimod_mojotrollz_import/autoload.inc.php @@ -0,0 +1,3 @@ +Import
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} + public static function sai_mod_saimod_mojotrollz_import_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array( + \SYSTEM\WEBPATH(new PSAI(),'saimod_mojotrollz_import/saimod_mojotrollz_import.js') + ));} + public static function sai_mod_saimod_mojotrollz_import_flag_css(){} + + public static function sai_mod_saimod_mojotrollz_import_action_import(){ + return client::import('127.0.0.1');} +} \ No newline at end of file diff --git a/mojotrollz/sai/saimod_mojotrollz_import/saimod_mojotrollz_import.sql b/mojotrollz/sai/saimod_mojotrollz_import/saimod_mojotrollz_import.sql new file mode 100644 index 0000000..84da986 --- /dev/null +++ b/mojotrollz/sai/saimod_mojotrollz_import/saimod_mojotrollz_import.sql @@ -0,0 +1,2 @@ +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1100, 42, 0, 0, 'saimod_mojotrollz_import', 'action', NULL); + diff --git a/mojotrollz/sai/saimod_mojotrollz_import/saimod_mojotrollz_import.tpl b/mojotrollz/sai/saimod_mojotrollz_import/saimod_mojotrollz_import.tpl new file mode 100644 index 0000000..5d4784a --- /dev/null +++ b/mojotrollz/sai/saimod_mojotrollz_import/saimod_mojotrollz_import.tpl @@ -0,0 +1,6 @@ +
    +

    Import

    +
    + +
    +
    \ No newline at end of file diff --git a/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.js b/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.js index 75f74cf..d4547a3 100644 --- a/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.js +++ b/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.js @@ -38,9 +38,42 @@ function init_saimod_mojotrollz_server_handling(){ data: { sai_mod: 'saimod_mojotrollz_server_handling', action: 'worldstop' }, + type: 'POST', + }); + update_worldstatus(); + }); + + $('#update').click(function(){ + $.ajax({ + url: SAI_ENDPOINT, + data: { sai_mod: 'saimod_mojotrollz_server_handling', + action: 'update' + }, type: 'POST', - - }); + }); + update_realmstatus(); + update_worldstatus(); + }); + + $('#rights').click(function(){ + $.ajax({ + url: SAI_ENDPOINT, + data: { sai_mod: 'saimod_mojotrollz_server_handling', + action: 'rights' + }, + type: 'POST', + }); + }); + + $('#deploy').click(function(){ + $.ajax({ + url: SAI_ENDPOINT, + data: { sai_mod: 'saimod_mojotrollz_server_handling', + action: 'deploy' + }, + type: 'POST', + }); + update_realmstatus(); update_worldstatus(); }); } @@ -50,6 +83,6 @@ function update_realmstatus(){ } function update_worldstatus(){ - $('status_world').load(SAI_ENDPOINT+'sai_mod=saimod_mojotrollz_server_handling&action=world status'); + $('status_world').load(SAI_ENDPOINT+'sai_mod=saimod_mojotrollz_server_handling&action=worldstatus'); } diff --git a/nbproject/project.properties b/nbproject/project.properties index 2250810..25e4634 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,3 +1,4 @@ +auxiliary.org-netbeans-modules-php-smarty.smarty-framework=true file.reference.Webdesign-system=../system include.path=\ ${php.global.include.path}