mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-12-13 14:49:03 +00:00
login/register working and Websocket partially implemented
This commit is contained in:
@@ -20,8 +20,6 @@
|
||||
<orderEntry type="library" name="Maven: junit:junit:4.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
|
||||
<orderEntry type="module" module-name="Server" />
|
||||
<orderEntry type="library" name="Maven: org.java-websocket:Java-WebSocket:1.3.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.42" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-text:1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mongodb:mongo-java-driver:2.10.1" level="project" />
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
package net.simon987.npcplugin.io;
|
||||
|
||||
import com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException;
|
||||
import net.simon987.server.ServerConfiguration;
|
||||
import net.simon987.server.game.ControllableUnit;
|
||||
import net.simon987.server.io.DatabaseManager;
|
||||
import net.simon987.server.logging.LogManager;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class StatsDatabaseManager extends DatabaseManager {
|
||||
|
||||
@@ -18,32 +12,7 @@ public class StatsDatabaseManager extends DatabaseManager {
|
||||
|
||||
public void saveVaultCompletion(ControllableUnit unit, String dimension) {
|
||||
|
||||
Connection connection = getConnection();
|
||||
|
||||
try {
|
||||
|
||||
PreparedStatement p = connection.prepareStatement("INSERT INTO mar_vault_clear " +
|
||||
"(username, clear_time, vault_id) VALUES (?,?,?)");
|
||||
p.setString(1, unit.getParent().getUsername());
|
||||
p.setInt(2, 0);
|
||||
p.setString(3, dimension);
|
||||
|
||||
int result = p.executeUpdate();
|
||||
|
||||
LogManager.LOGGER.fine("Saved vault clear (" + result + " rows changed)");
|
||||
|
||||
} catch (MySQLIntegrityConstraintViolationException e) {
|
||||
LogManager.LOGGER.fine("This vault was already cleared by " + unit.getParent().getUsername());
|
||||
} catch (SQLException e) {
|
||||
LogManager.LOGGER.severe(e.getMessage());
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user