Changeset 137
- Timestamp:
- Nov 17, 2007, 8:57:23 PM (17 years ago)
- Location:
- db/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
db/include/myacc.php
r136 r137 19 19 mysql_query("INSERT INTO `acc_heartstone` (`acc`,`char`,`date`,`ip`) VALUES ('".$sql_select['result']['acc']['id']."','".$_GET['heartstone']."','".time()."','".$_SERVER["REMOTE_ADDR"]."') "); 20 20 }; 21 } 22 else{ 23 print("Dnes už byla postava jednou přesunuta! Zkuste to zítra.<br>\n"); 24 } 25 } 26 else{ 27 SwitchDB(1); // nastavení databáze na mangos 28 $PosRess = new PosRess($_GET['heartstone']); 29 if( $PosRess->char_name != false ){ 30 $PosRess->GoHome(); 31 $PosRess->GoHomeDone(); 32 SwitchDB(3); // nastavení databáze na web 33 mysql_query("INSERT INTO `acc_heartstone` (`acc`,`char`,`date`,`ip`) VALUES ('".$sql_select['result']['acc']['id']."','".$_GET['heartstone']."','".time()."','".$_SERVER["REMOTE_ADDR"]."') "); 21 34 }; 22 35 }; -
db/include/position_reset.php
r136 r137 16 16 global $user; 17 17 $sql = mysql_query("SELECT * FROM `character` WHERE `guid` = '".$this->char_id."' AND `account`='".$user['acc']."' LIMIT 1"); 18 $ load= mysql_fetch_array($sql);19 if( $ load['online'] != 0 )18 $this->character = mysql_fetch_array($sql); 19 if( $this->character['online'] != 0 ) 20 20 { 21 print("Nemůžete přesouvat postavu, která je online! Nejprve se odhlašte!<br> ");21 print("Nemůžete přesouvat postavu, která je online! Nejprve se odhlašte!<br>\n"); 22 22 $this->char_name = false; 23 23 } 24 24 else 25 25 { 26 $this->char_name = $ load["name"];26 $this->char_name = $this->character["name"]; 27 27 } 28 28 } 29 29 30 public function GoHome()30 public function StartLocation() 31 31 { 32 $sql_home = mysql_query("SELECT * FROM ` character_homebind` WHERE `guid` = '".$this->char_id."' LIMIT 1");32 $sql_home = mysql_query("SELECT * FROM `playercreateinfo` WHERE `race` = '".$this->character['race']."' AND `class` = '".$this->character['class']."' LIMIT 1"); 33 33 $load_home = mysql_fetch_array($sql_home); 34 34 $home_char_map = $load_home["map"]; … … 44 44 `position_z` = '".$home_char_position_z."' 45 45 WHERE `guid` ='".$this->char_id."' LIMIT 1"); 46 echo "Přesouvám postavu : ".$this->char_name.".<br>"; 46 print("Přesouvám postavu : ".$this->char_name." na startovní lokaci.<br>"); 47 } 48 } 49 50 public function GoHome() 51 { 52 $sql_home = mysql_query("SELECT * FROM `character_homebind` WHERE `guid` = '".$this->char_id."' LIMIT 1"); 53 $load_home = mysql_fetch_array($sql_home); 54 $home_char_map = $load_home["map"]; 55 $home_char_position_x = $load_home["position_x"]; 56 $home_char_position_y = $load_home["position_y"]; 57 $home_char_position_z = $load_home["position_z"]; 58 if (isset($home_char_map) AND isset ($home_char_position_x) AND isset ($home_char_position_y) AND isset ($home_char_position_z)) 59 { 60 $save = mysql_query("UPDATE `character` SET 61 `map` = '".$home_char_map."' , 62 `position_x` ='".$home_char_position_x."' , 63 `position_y` = '".$home_char_position_y."' , 64 `position_z` = '".$home_char_position_z."' 65 WHERE `guid` ='".$this->char_id."' LIMIT 1"); 66 print("Přesouvám postavu : ".$this->char_name." domů.<br>"); 67 } 68 else 69 { 70 $this->StartLocation(); 47 71 } 48 72 } … … 65 89 if ($home_char_map == $char_map AND $home_char_position_x == $char_position_x AND $home_char_position_y == $char_position_y AND $home_char_position_z == $char_position_z) 66 90 { 67 echo "Postava : ".$this->char_name." přesunuta !<br>";91 print("Postava : ".$this->char_name." přesunuta !<br>"); 68 92 } 69 93 else 70 94 { 71 echo "Postavu : ".$this->char_name." se nepovedlo přesunout !<br>";95 print("Postavu : ".$this->char_name." se nepovedlo přesunout !<br>"); 72 96 } 73 97 } -
db/include/xp_reset.php
r136 r137 5 5 var $char_id; 6 6 var $char_name; 7 var $poradi = 856; // XP je an pozici 857 ale začínáme od 0 7 8 8 9 function __construct($char_id) … … 34 35 $data_old = $load_res["data"]; 35 36 $pole = explode(" ",$data_old); 36 // XP - 857 37 $poradi = 857; 38 $poradi = $poradi - 1; 39 echo "Postava ".$this->char_name." má ".$pole[$poradi]." XP.<br>\n"; 37 if( !isset($pole[$this->poradi]) ) 38 { 39 print("Postava nemá definované XP! Je to závažná chyba v databázi!<br>\n"); 40 } 41 else{ 42 print("Postava ".$this->char_name." má ".$pole[$this->poradi]." XP.<br>\n"); 43 } 40 44 } 41 45 … … 46 50 $data_old = $load_res["data"]; 47 51 $pole = explode(" ",$data_old); 48 // XP - 857 49 $poradi = 857; 50 $poradi = $poradi - 1; 51 $pole[$poradi] = "0"; 52 $save = mysql_query("UPDATE `character` SET `data` = '".$pole."' WHERE `guid` ='".$this->char_id."' LIMIT 1"); 52 $pole[$this->poradi] = 0; 53 if( !isset($pole[$this->poradi]) ) 54 { 55 print("Postava nemá definované XP! Je to závažná chyba v databázi!<br>\n"); 56 } 57 else{ 58 mysql_query("UPDATE `character` SET `data` = '".implode(" ", $pole)."' WHERE `guid` ='".$this->char_id."' LIMIT 1"); 59 }; 53 60 } 54 61 … … 59 66 $data_old = $load_res["data"]; 60 67 $pole = explode(" ",$data_old); 61 // XP - 857 62 $poradi = 857; 63 $poradi = $poradi - 1; 64 if ( $pole[$poradi] == "0") 68 if( !isset($pole[$this->poradi]) ) 65 69 { 66 echo "Restart XP dokončen !<br>\n"; 70 print("Postava nemá definované XP! Je to závažná chyba v databázi!<br>\n"); 71 } 72 elseif ( $pole[$this->poradi] == 0 ) 73 { 74 print("Restart XP dokončen !<br>\n"); 67 75 } 68 76 else 69 77 { 70 echo "Restart XP se nezdařil !<br>\n";78 print("Restart XP se nezdařil !<br>\n"); 71 79 } 72 80 }
Note:
See TracChangeset
for help on using the changeset viewer.