Ejemplo n.º 1
0
 public function RegisterPlanet($id)
 {
     $this->id = $id;
     $lng = new Lang();
     $imagen = $this->GenerateImage();
     $temperatura = $this->GenerateTemp();
     $temp_promd = $this->TempPromd();
     $db = new Connect();
     $sql = "INSERT INTO planetas (id_ppal,id_dueno,nombre,imagen,metal,cristal,tritio,materia,campos,campos_usados,temperatura,temp_promd,pos,sistema) \n       VALUES ('{$this->id}','{$this->id}','{$lng->x_ppal}','{$imagen}',1000,1000,0,8000,180,0,\n       '{$temperatura}','{$temp_promd}','{$this->orbit}','{$this->solar}');";
     $sql .= "INSERT INTO edificios (id_planeta) VALUES ('{$this->id}');";
     $sql .= "UPDATE generales SET \n        ultima_pos='{$this->orbit}', ultimo_sis='{$this->solar}' LIMIT 1;";
     $mquery = $db->multi_query($sql);
     $db->close();
     unset($sql, $sql2, $db, $imagen, $id_planet, $lng, $this->id, $temp_promd, $temperatura, $mquery);
 }