-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
316 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package logparser4hon; | ||
|
||
import java.awt.Component; | ||
import java.io.File; | ||
import java.io.FilenameFilter; | ||
import javax.swing.JFileChooser; | ||
import javax.swing.JOptionPane; | ||
import javax.swing.filechooser.FileFilter; | ||
import javax.swing.filechooser.FileNameExtensionFilter; | ||
|
||
/** | ||
* | ||
* @author Slam | ||
*/ | ||
public class LogParser4HoN { | ||
|
||
private static File fichero; | ||
private static JFileChooser selector; | ||
private static FileFilter filtro; | ||
static analizador scan; | ||
|
||
public static void main(String[] args) { | ||
System.out.println("Log parser para Heroes of Newert\n" | ||
+ "Creado por Slam para SNET 2021"); | ||
filtro = new FileNameExtensionFilter("Archivo log", "log"); | ||
selector = new JFileChooser(); | ||
selector.setFileFilter(filtro); | ||
selector.setMultiSelectionEnabled(true); | ||
selector.showOpenDialog(null); | ||
//fichero = selector.getSelectedFile(); | ||
File[] files = selector.getCurrentDirectory().listFiles(new FilenameFilter() { | ||
@Override | ||
public boolean accept(File dir, String name) { | ||
return name.contains("log") ? true : false; | ||
} | ||
}); | ||
System.out.println("Partidas encontradas: " + files.length); | ||
for (File f : files) { | ||
fichero = f; | ||
if (fichero != null) { | ||
System.out.println("\nLog: " + fichero.getAbsolutePath()); | ||
scan = new analizador(); | ||
scan.CargarLog(fichero); | ||
scan.EscribirSalida(); | ||
} | ||
} | ||
} | ||
|
||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
package logparser4hon; | ||
|
||
/** | ||
* | ||
* @author Slam | ||
*/ | ||
public class jugador { | ||
|
||
private int equipo; | ||
private int posicion; | ||
private String nick; | ||
private String ip; | ||
private int kills; | ||
private int deaths; | ||
private int asistencias; | ||
private int nivel_alcanzado; | ||
//private int experiencia; | ||
private int oro; | ||
private int juegos_ganados; | ||
private int juegos_perdidos; | ||
|
||
public jugador() { | ||
this.equipo = 0; | ||
this.posicion = 0; | ||
this.nick = " "; | ||
this.ip = " "; | ||
this.kills = 0; | ||
this.deaths = 0; | ||
this.asistencias = 0; | ||
this.nivel_alcanzado = 0; | ||
this.oro = 0; | ||
this.juegos_ganados = 0; | ||
this.juegos_perdidos = 0; | ||
} | ||
|
||
public jugador(int equipo, int posicion, String nick, String ip, int kills, int deaths, int asistencias, int nivel_alcanzado, int oro, int juegos_ganados, int juegos_perdidos) { | ||
this.equipo = equipo; | ||
this.posicion = posicion; | ||
this.nick = nick; | ||
this.ip = ip; | ||
this.kills = kills; | ||
this.deaths = deaths; | ||
this.asistencias = asistencias; | ||
this.nivel_alcanzado = nivel_alcanzado; | ||
this.oro = oro; | ||
this.juegos_ganados = juegos_ganados; | ||
this.juegos_perdidos = juegos_perdidos; | ||
} | ||
|
||
public int getEquipo() { | ||
return equipo; | ||
} | ||
|
||
public void setEquipo(int equipo) { | ||
this.equipo = equipo; | ||
} | ||
|
||
public int getPosicion() { | ||
return posicion; | ||
} | ||
|
||
public void setPosicion(int posicion) { | ||
this.posicion = posicion; | ||
} | ||
|
||
public String getNick() { | ||
return nick; | ||
} | ||
|
||
public void setNick(String nick) { | ||
this.nick = nick; | ||
} | ||
|
||
public String getIp() { | ||
return ip; | ||
} | ||
|
||
public void setIp(String ip) { | ||
this.ip = ip; | ||
} | ||
|
||
public int getKills() { | ||
return kills; | ||
} | ||
|
||
public void contarAsesinatos() { | ||
kills++; | ||
} | ||
|
||
public int getDeaths() { | ||
return deaths; | ||
} | ||
|
||
public void contarMuertes() { | ||
deaths++; | ||
} | ||
|
||
public int getAsistencias() { | ||
return asistencias; | ||
} | ||
|
||
public void contarAsistencias() { | ||
asistencias++; | ||
} | ||
|
||
public int getNivel_alcanzado() { | ||
return nivel_alcanzado; | ||
} | ||
|
||
public void setNivel_alcanzado(int nivel_alcanzado) { | ||
this.nivel_alcanzado = nivel_alcanzado; | ||
} | ||
|
||
public int getOro() { | ||
if (oro < 0) { | ||
oro = 0; | ||
} | ||
return oro; | ||
} | ||
|
||
public void setOro(int oro) { | ||
this.oro = oro; | ||
} | ||
|
||
public int getJuegos_ganados() { | ||
return juegos_ganados; | ||
} | ||
|
||
public void setJuegos_ganados(int juegos_ganados) { | ||
this.juegos_ganados = juegos_ganados; | ||
} | ||
|
||
public int getJuegos_perdidos() { | ||
return juegos_perdidos; | ||
} | ||
|
||
public void setJuegos_perdidos(int juegos_perdidos) { | ||
this.juegos_perdidos = juegos_perdidos; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
/* | ||
INFO_DATE date:"2021/27/01" time:"00:14:43" | ||
INFO_SERVER name:"Unnamed Server" | ||
INFO_GAME name:"HoN Russian Local" version:"1.0.45b" | ||
INFO_MATCH name:"SoyDotTtA's Game" id:"4294967295" | ||
INFO_MAP name:"grimmscrossing" version:"0.0.0" | ||
*/ | ||
package logparser4hon; | ||
|
||
import java.util.LinkedList; | ||
|
||
/** | ||
* | ||
* @author Slam | ||
*/ | ||
public class partida { | ||
|
||
private String version; | ||
private String nombre; | ||
private String fecha; | ||
private String hora; | ||
private String mapa; | ||
private int vencedor; | ||
//private LinkedList<jugador> players = new LinkedList<>(); | ||
private jugador[] players1; | ||
private int cantPlayers; | ||
|
||
public partida() { | ||
players1 = new jugador[10]; | ||
cantPlayers = 0; | ||
} | ||
|
||
public partida(String version, String nombre, String fecha, String hora, String mapa) { | ||
this.version = version; | ||
this.nombre = nombre; | ||
this.fecha = fecha; | ||
this.hora = hora; | ||
this.mapa = mapa; | ||
players1 = new jugador[10]; | ||
vencedor = 0; | ||
cantPlayers = 0; | ||
} | ||
|
||
public void Vencedor(int winner) { | ||
this.vencedor = winner; | ||
} | ||
|
||
public int obtenerVencedor() { | ||
return vencedor; | ||
} | ||
|
||
public String getVersion() { | ||
return version; | ||
} | ||
|
||
public void setVersion(String version) { | ||
this.version = version; | ||
} | ||
|
||
public String getMapa() { | ||
return mapa; | ||
} | ||
|
||
public void setMapa(String mapa) { | ||
this.mapa = mapa; | ||
} | ||
|
||
public void addPlayer(jugador player) { | ||
if (cantPlayers < 10 && !existeJugador(player)) { | ||
players1[cantPlayers++] = player; | ||
} | ||
//players.add(player); | ||
} | ||
|
||
public boolean existeJugador(jugador player) { | ||
for (jugador j : players1) { | ||
if (j != null) { | ||
if (j.equals(player)) { | ||
return true; | ||
} | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
public jugador[] getJugadores() { | ||
return players1; | ||
} | ||
|
||
public String getNombre() { | ||
return nombre; | ||
} | ||
|
||
public void setNombre(String nombre) { | ||
this.nombre = nombre; | ||
} | ||
|
||
public String getFecha() { | ||
return fecha; | ||
} | ||
|
||
public void setFecha(String fecha) { | ||
this.fecha = fecha; | ||
} | ||
|
||
public String getHora() { | ||
return hora; | ||
} | ||
|
||
public void setHora(String hora) { | ||
this.hora = hora; | ||
} | ||
|
||
public int getCantPlayers() { | ||
return cantPlayers;//players.size(); | ||
} | ||
|
||
public void actualizarCantPlayers(){ | ||
int tcant=0; | ||
for(jugador j:players1){ | ||
if(j!=null) | ||
tcant++; | ||
} | ||
cantPlayers = tcant; | ||
} | ||
} |