sOLARiZ.de | Gaming Blog

Go to:

  • Blog
  • Games
  • Tool.Box
  • Photos
  • /me

League of Legends Changelog Tracker

Juli 21, 2012

League of Legends Changelog Tracker

Auf einer Unterseite des Blogs tracke ich seit geraumer Zeit, mehr oder minder automatisiert, League of Legends Changelogs pro Champion. Wie gesagt, das ganze ist teilweise automatisiert – so wird automatisch erkannt ob es sich um einen buff oder nerf handelt. Was bisher noch nicht automatisch funktionierte war die Zuordnung der Patchnotes zum jeweiligen Champ. Das ganze habe ich nun mal einem kleinen Update unterzogen, somit brauche ich künftig nur noch die neue Patch Version eintragen und die Ergebnisse kontrollieren. Dabei hilft mir dann ein kleines PHP Script

Und das sieht dann in etwa so aus:

PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
require("setup.ini.php");
mysql_connect($SQL['host'],$SQL['user'],$SQL['pass']) or die( mysql_error() );
mysql_select_db($SQL['db']);
mysql_set_charset("UTF-8");
 
// Get known champs
$CHAMPS = array();
$CHAMPID = array();
$Q = mysql_query("SELECT `name`,`cid` FROM `lol_champs` ORDER BY `name`");
while($R = mysql_fetch_array($Q)) {
    $name = strtolower($R['name']);
    $CHAMPS[] .= $name;
    $CHAMPID[$name] = $R['cid'];
}
 
// Text vorbereiten
$text = $_POST['text'];
$text = str_replace(array("<br>","</br>","<br/>","<br />"), "\n", $text);
$text = str_replace("</ul>", "</ul>\n", $text);
$text = str_replace("</b>", "</b>\n", $text);
$text = str_replace("<ul>", "\n<ul> ", $text);
$text = str_replace("<li>", "\n<li> ", $text);
$text = str_replace("<b>", "\n<b> ", $text);
$text = str_replace(array("(Remade)","(Rework)"), "", $text);
 
$patch_ver = mysql_real_escape_string($_POST['ver']);
echo "<h1>".$patch_ver."</h1>";
 
// if(!$version) die("Keine Version angegeben!");
// Version in DB prüfen
$Q = mysql_query("SELECT `ver` FROM `lol_versions` WHERE `ver`='".mysql_real_escape_string($patch_ver)."' LIMIT 1");
if(mysql_affected_rows() < 1) {
    die("Version unknown");
}
 
// Processing
$data = explode("\n", $text);
$foundchamp = false;
$champ_changes = "";
$isAbility = false;
foreach ($data as $line) {
    $line = trim(str_replace(array("\r","\n"), "", $line));
    // skip empty lines
    if($line && strlen($line) > 1) {
        // Champ Detect
 
        #echo $line."\r\n================================\r\n";
        if(stristr($line, "<b>")) {
            preg_match("#<b>([A-Za-z\(\)'\.\ ]*)</b>#i", $line,$res);
            $match = trim(str_replace(array("(Remade)"),"", $res[1]));
 
            if( in_array( strtolower($match), $CHAMPS) ) {
                $foundchamp = trim($match);
                echo "<b>".$foundchamp." [".$CHAMPID[strtolower($foundchamp)]."]</b><br>";
            } else {
                // Möglicherweise eine genannte ability
                $changelog = trim(strip_tags($line));
                if(strlen($changelog)>3) {
                    echo "<li><b>".$changelog."</b></li>\n";
                    $champ_changes .= "[ability]".$changelog."[/ability]"."\r\n";
                }
                $isAbility = true;
            }
        } else {
            // Changes pro Champ eintragen
 
            if($foundchamp !== false) {
 
                $changelog = trim(strip_tags($line));
                if(strlen($changelog)>8) {
                    echo "<li>".$changelog."</li>\n";
                    if($isAbility == true) {
                        $champ_changes .= "[sub]".$changelog."[/sub]"."\r\n";
                    } else {
                        $champ_changes .= $changelog."\r\n";
                    }
 
                }
            }
        }// end camp detect
 
        // Champ bei geschlossenem UL beenden
        if(stristr($line, "</ul>")) {
            if($isAbility) {
                // Nicht beenden wenn in einer ability verschachtelung
                $isAbility = false;
            } else {
                if($champ_changes !== "") {
                    // Prüfen ob diese patch_ver für den champ bereits eingetragen wurde
                    $query = "SELECT `id` FROM `lol_changelog` WHERE `ver`='".$patch_ver."' AND  `champ`='".intval($CHAMPID[strtolower($foundchamp)])."' LIMIT 1";
                    $Q = mysql_query($query);
                    if(mysql_affected_rows() < 1) {
                        // Ok noch nicht eingetragen
                        echo '<span style="color: green;">Add new Changes to DB</span><br />';
                        $query = "INSERT INTO `lol_changelog` SET `ver`='".$patch_ver."',`champ`='".intval($CHAMPID[strtolower($foundchamp)])."',`text`='".mysql_real_escape_string($champ_changes)." ';";
                        //echo $query;
                        $Q = mysql_query($query);
                    } else {
                        // bereits eingetragen
                        echo '<span style="color: red;">Skipped, already in DB</span><br />';
                    }
                }
                $foundchamp = false;
                $champ_changes = "";
            }
        }
    }// end if skip empty lines
 
}

Nun fehlt mir nur noch die Vollautomatisierung. Hey Riot baut mal ne API :)

Jedenfalls wurden mal im Zuge des Updates auch die letzten Patchnotes nachgetragen. Diablo 3 macht derweil weniger Fun als ich es gerne hätte und auch Endless Space war schneller “Ausgelutscht” als ich es gehofft habe. Von daher nun mal ab und an wieder eine Runde LoL – Nach einigne Monaten Abstinenz muss man da aber erst mal wieder rein kommen :) Viel neues.

 

  •  http://solariz.de/league-of-legends-changelog-history

 


0 Comments
0 Pings & Trackbacks
Antworten abbrechen
Subscribe

Werbung

Recent posts

  • Unitymedia APN Linux Surfstick

    Mai 6, 2013

  • http://solariz.de/wp-content/uploads/2013/05/enrage-post_gfx-47x47.jpg
    Neveronline UX Fails

    Mai 3, 2013

  • The battle for the Freljord

    April 30, 2013

  • http://solariz.de/wp-content/uploads/2013/04/battlefield-golf-squad-47x47.jpg
    Battlefield Konsole Abschalten

    April 20, 2013

  • http://solariz.de/wp-content/uploads/2013/04/league-of-legends-2on2-2vs2-47x47.jpg
    League of Legends 2vs2 Map?

    April 19, 2013

Comments

  • zu LegendsHD the League of Legends HDR ModTry to press SHIFT+F12 in game to toggle the mod.
  • zu LegendsHD the League of Legends HDR ModWhen I run LoL, it displays the little blurb about ENB and
  • zu Unitymedia APN Linux SurfstickJa aber ich verwende den E220 mit dem E173 hatte ich auch
  • zu Unitymedia APN Linux SurfstickIch habe bei mir das Problem, dass mein Raspberry Pi (Model B,
  • zu LegendsHD the League of Legends HDR ModYa it does not seem to matter what mod I use, as

Connect

Artikel oder Blog hat gefallen ? Folge mir doch einfach, mittlerweile gibt es einige sinnvolle Möglichkeiten dazu. Ob RSS Feed, Currents, Google+ oder auf Twitter, mehr dazu gibt es hier.

Random Blogroll

  • Psychochild's Blog
  • Caschy`s Blog
  • geek Sisters
  • DjRedstorm.com
·gesamte Blogroll ansehen

Netzwerk Zeugs

Blogverzeichnis - Blog Verzeichnis bloggerei.de Bloggeramt.de Blog Top Liste - by TopBlogs.de Wikio - Top Blog - Gaming

Copyright by Marco Goetze, solariz.de

  • About
  • Hier werben
  • Impressum
assumption
QR Code Business Card

Gib die Ziel-Adresse ein

Oder verlinke auf bestehende Inhalte

    Es wurde kein Suchbegriff angegeben. Es werden die aktuellsten Inhalte angezeigt.
      Abbrechen