Changeset 132 for db


Ignore:
Timestamp:
Nov 17, 2007, 7:51:18 PM (17 years ago)
Author:
hosiplan
Message:

+ Heartstone - Funkce, díky které se může hráč sám portnout "domů"
+ XP restarter - Funkce, která umí nastavit XP na 0
+ Vylepšen export characteru

Location:
db
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • db/character.php

    r118 r132  
    4141/* ############### Konec Nastavení scriptu ############### */
    4242
    43 
    44  
    45   $nick = $_POST['username']; $heslo = $_POST['pass'];
    46   $zakodovane_heslo = sha1(STRTOUPPER($nick).":".STRTOUPPER($heslo));
    47 
    48   SwitchDB(2); // nastavení databáze na realmd
    49   $sql_acc = @mysql_query("SELECT * FROM `account` WHERE (`username`='$nick' AND `I`='$zakodovane_heslo') LIMIT 1 ");
    50   if( mysql_num_rows($sql_acc) == 1 ) {
    51     $sql_acc = mysql_fetch_array($sql_acc);
    52 
    53     SwitchDB(1); // nastavení databáze na mangos
    54     $sql_user = @mysql_query("SELECT * FROM `character` WHERE `guid`='".addslashes($_POST['char'])."' AND `account`='".$sql_acc['id']."' LIMIT 1 ");
     43    $sql_user = @mysql_query("SELECT * FROM `character` WHERE `guid`='".addslashes($_GET['char'])."' AND `account`='".$user['acc']."' LIMIT 1 ");
    5544    if( mysql_num_rows($sql_user) == 1 ) {
    5645      $sql_user = mysql_fetch_array($sql_user);
     
    5847      SwitchDB(3); // nastavení databáze na web
    5948      $limit_sql = mysql_query("SELECT * FROM `acc_down_char` WHERE (`acc`='".$sql_user['account']."' AND `char`='".$sql_user['guid']."') ORDER BY `date` DESC");
    60       if( mysql_num_rows($limit_sql) > 0 ){ 
     49      if( mysql_num_rows($limit_sql) > 0 ){
    6150        $limit_sql = mysql_fetch_array($limit_sql);
    6251        if( date("d-m-Y", $limit_sql['date']) == date("d-m-Y", time()) ){
     
    140129
    141130      } else { echo "Nemůžete stahovat cizí postavu !"; exit; };
    142     } else { echo "Špatný account nebo heslo ! "; exit; };
    143131
    144132
  • db/databaze_tabulky/sql.sql

    r118 r132  
    187187  PRIMARY KEY  (`id`)
    188188) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
     189
     190--
     191-- Struktura tabulky `acc_heartstone`
     192--
     193-- Vytvoření: Sobota 17. listopadu 2007, 19:00
     194-- Poslední změna: Sobota 17. listopadu 2007, 19:00
     195--
     196
     197CREATE TABLE `acc_heartstone` (
     198`id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
     199`acc` BIGINT( 20 ) UNSIGNED NOT NULL ,
     200`char` BIGINT( 20 ) UNSIGNED NOT NULL ,
     201`date` BIGINT( 20 ) UNSIGNED NOT NULL ,
     202`ip` VARCHAR( 15 ) NOT NULL
     203) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
  • db/include/myacc.php

    r118 r132  
    11<?php
    22if (!defined('IN_CODE') OR $user['loged'] != 1 ){ exit; };
     3 
     4  $sql_select = $BasicWiewer->myAcc();
    35
    4   $sql_select = $BasicWiewer->myAcc();
     6  require_once './include/position_reset.php';
     7  require_once './include/xp_reset.php';
     8
     9  if( !empty($_GET['heartstone']) AND is_numeric($_GET['heartstone']) )
     10  {
     11    SwitchDB(3); // nastavení databáze na web
     12    $limit_sql = mysql_query("SELECT * FROM `acc_heartstone` WHERE (`acc`='".$sql_select['result']['acc']['id']."' AND `char`='".$_GET['heartstone']."') ORDER BY `date` DESC LIMIT 1");
     13    if( mysql_num_rows($limit_sql) > 0 ){
     14      $limit_sql = mysql_fetch_array($limit_sql);
     15      if( date("d-m-Y", $limit_sql['date']) != date("d-m-Y", time()) ){
     16        SwitchDB(1); // nastavení databáze na mangos
     17        $PosRess = new PosRess($_GET['heartstone']);
     18        if( $PosRess->char_name != false ){
     19          $PosRess->GoHome();
     20          $PosRess->GoHomeDone();
     21          SwitchDB(3); // nastavení databáze na web
     22          mysql_query("INSERT INTO `acc_heartstone` (`acc`,`char`,`date`,`ip`) VALUES ('".$sql_select['result']['acc']['id']."','".$_GET['heartstone']."','".time()."','".$_SERVER["REMOTE_ADDR"]."')  ");
     23          };
     24        };
     25      };
     26  };
     27
     28  if( !empty($_GET['resetxp']) AND is_numeric($_GET['resetxp']) )
     29  {
     30    SwitchDB(1); // nastavení databáze na mangos
     31    $XpRess = new XpRess(4);
     32    $XpRess->ShowXp();
     33    $XpRess->XpRestart();
     34    $XpRess->XpRestartDone();
     35  };
     36 
     37
    538?>
    639
  • db/index.php

    r118 r132  
    195195
    196196    switch($id){
    197       case 'character': $general_include = "./character.php"; break;
     197      case 'char': $general_include = "./character.php"; break;
    198198      default: $general_include = "./hlavni.php"; break;
    199199      };
  • db/post_read.php

    r118 r132  
    694694          $this->sql_select['result']['other']['chars'] .= "<td title=\"Rasa\">".$Database['race'][$this->sql_select['result']['char'][$i]['race']]."</td>";
    695695          $this->sql_select['result']['other']['chars'] .= "<td title=\"Povolání\">".$Database['class'][$this->sql_select['result']['char'][$i]['class']]."</td>\n";
    696           $this->sql_select['result']['other']['chars'] .= "<td> - <a href=\"./character.php?char=".$this->sql_select['result']['char'][$i]['guid'].$this->sid."\">Exportovat</a></td></tr>\n";
     696          $this->sql_select['result']['other']['chars'] .= "<td> - <a href=\"./index.php?char=".$this->sql_select['result']['char'][$i]['guid'].$this->sid."\" target=\"_blank\">Exportovat</a></td>\n";
     697          $this->sql_select['result']['other']['chars'] .= "<td> - <a href=\"./index.php?id=myacc&amp;heartstone=".$this->sql_select['result']['char'][$i]['guid'].$this->sid."\">Heartstone</a></td>\n";
     698          $this->sql_select['result']['other']['chars'] .= "<td> - <a href=\"./index.php?id=myacc&amp;resetxp=".$this->sql_select['result']['char'][$i]['guid'].$this->sid."\">ResetXP</a></td></tr>\n";
    697699          };
    698700        if( $this->sql_select['result']['char_count'] == 0 ){
Note: See TracChangeset for help on using the changeset viewer.