Skip to content

Commit

Permalink
Preparation 3.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
darknoon29 committed Feb 12, 2020
1 parent d7f877b commit c8f27ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
16 changes: 9 additions & 7 deletions _xtense.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// L'appel direct est interdit....
if (!defined('IN_SPYOGAME')) die("Hacking attempt");

use Ogsteam\Ogspy\Model\Mod_Model;
use Ogsteam\Ogspy\Model\Mod_Config_Model;

if (class_exists("Callback")) {
/**
* Class Attaques_Callback
Expand Down Expand Up @@ -74,7 +77,7 @@ function attack_rc($rapport)
return FALSE;

//On regarde dans les coordonnées de l'espace personnel du joueur qui insère les données via le plugin si il fait partie des attaquants et/ou des défenseurs
$query = "SELECT coordinates FROM " . TABLE_USER_BUILDING . " WHERE user_id='" . $user_data['user_id'] . "'";
$query = "SELECT `coordinates` FROM " . TABLE_USER_BUILDING . " WHERE `user_id` ='" . $user_data['user_id'] . "'";
$result = $db->sql_query($query);
$coordinates = array();
while ($coordinate = $db->sql_fetch_row($result))
Expand Down Expand Up @@ -130,7 +133,7 @@ function attack_rc($rapport)
}

//On vérifie que cette attaque n'a pas déja été enregistrée
$query = "SELECT attack_id FROM " . TABLE_ATTAQUES_ATTAQUES . " WHERE attack_user_id='" . $user_data['user_id'] . "' AND attack_date='$timestamp' AND attack_coord='$coord_attaque' ";
$query = "SELECT `attack_id` FROM " . TABLE_ATTAQUES_ATTAQUES . " WHERE `attack_user_id` ='" . $user_data['user_id'] . "' AND `attack_date`='$timestamp' AND `attack_coord`='$coord_attaque' ";
$result = $db->sql_query($query);
$nb = $db->sql_numrows($result);

Expand Down Expand Up @@ -162,7 +165,7 @@ function attack_rr($rapport)
$timestamp = $rapport['time'];
$coordonne = $rapport['coords'][0] . ":" . $rapport['coords'][1] . ":" . $rapport['coords'][2];
//On vérifie que ce recyclage n'a pas déja été enregistrée
$query = "SELECT recy_id FROM " . TABLE_ATTAQUES_RECYCLAGES . " WHERE recy_user_id='" . $user_data['user_id'] . "' AND recy_date='$timestamp' AND recy_coord='$coordonne' ";
$query = "SELECT `recy_id` FROM " . TABLE_ATTAQUES_RECYCLAGES . " WHERE `recy_user_id` ='" . $user_data['user_id'] . "' AND `recy_date` ='$timestamp' AND `recy_coord` ='$coordonne' ";
$result = $db->sql_query($query);
$nb = $db->sql_numrows($result);
// Si on ne trouve rien
Expand All @@ -180,10 +183,10 @@ function attack_rr($rapport)
function read_config ()
{
global $attack_config;

//récupération des paramètres de config
var $configs = mod_get_option('config');
foreach($configs as $config) $attack_config = unserialize($config);
$configs =(new Mod_Config_Model)->get_mod_config('Attaques', 'config');
$attack_config = json_decode($configs, true);
}

/*
Expand All @@ -198,4 +201,3 @@ function remove_htm($rapport)
$rapport = str_replace(".", "", $rapport);
return $rapport;
}

8 changes: 4 additions & 4 deletions update.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
if (version_compare( $version , '2.0.0.', '<')) {

// on insère les valeurs de configuration par défaut car changement de format de données
$sqldata = '{"transp":75,"layer":1,"defenseur":1,"histo":1}';
mod_set_option('config', $sqldata);
$config = '{\"transp\":75,\"layer\":1,\"defenseur\":1,\"histo\":1}';
mod_set_option('config', $config);

// on insère les valeurs bbcodes par défaut
$sqldata = '{"title":"#FFA500","m_g":"#00FF40","c_g":"#00FF40","d_g":"#00FF40","m_r":"#00FF40","c_r":"#00FF40","perte":"#FF0000","renta":"#00FF40"}';
mod_set_option('bbcodes', $sqldata);
$bbcodes = '{\"title\":\"#FFA500\",\"m_g\":\"#00FF40\",\"c_g\":\"#00FF40\",\"d_g\":\"#00FF40\",\"m_r\":\"#00FF40\",\"c_r\":\"#00FF40\",\"perte\":\"#FF0000\",\"renta\":\"#00FF40\"}';
mod_set_option('bbcodes', $bbcodes);
}


Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Gestion des attaques
2.0.0
2.0.2
Gestion des attaques,Attaques,attaques,attaques,index.php,1,0
3.2.0

0 comments on commit c8f27ad

Please sign in to comment.