Update SR
This commit is contained in:
@ -29,14 +29,14 @@ public class db_connect extends DB.base {
|
||||
close();
|
||||
}
|
||||
|
||||
public void insertDice(String userName, String userId, String command, String result, String kanal) {
|
||||
public void insertDice(String userName, String userId, String command, String result, String kanal, long MsgID, String wurfdaten) {
|
||||
if(!isActive())
|
||||
return;
|
||||
|
||||
open();
|
||||
try {
|
||||
conn = getConn();
|
||||
String SQL_INSERT = "INSERT INTO shadowrun_log (benutzer, benutzerId, wurf, ergebnis, kanal) VALUES (?,?,?,?,?)";
|
||||
String SQL_INSERT = "INSERT INTO shadowrun_log (benutzer, benutzerId, wurf, ergebnis, kanal, msgId, wurfdaten) VALUES (?,?,?,?,?,?,?)";
|
||||
|
||||
PreparedStatement preparedStatement = conn.prepareStatement(SQL_INSERT);
|
||||
preparedStatement.setString(1, userName);
|
||||
@ -44,6 +44,8 @@ public class db_connect extends DB.base {
|
||||
preparedStatement.setString(3, command);
|
||||
preparedStatement.setString(4, result);
|
||||
preparedStatement.setString(5, kanal);
|
||||
preparedStatement.setLong(6, MsgID);
|
||||
preparedStatement.setString(7, wurfdaten);
|
||||
preparedStatement.executeUpdate();
|
||||
|
||||
}
|
||||
@ -131,6 +133,36 @@ public class db_connect extends DB.base {
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
public Map<String, String> getMesssage(Long MsgId) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
|
||||
if(!isActive()) {
|
||||
return result;
|
||||
}
|
||||
result.put("lang", "de");
|
||||
|
||||
open();
|
||||
try {
|
||||
conn = getConn();
|
||||
String SQL_SELECT = "SELECT * FROM shadowrun_log where MsgID = ?";
|
||||
|
||||
PreparedStatement preparedStatement = conn.prepareStatement(SQL_SELECT);
|
||||
preparedStatement.setLong(1, MsgId);
|
||||
ResultSet rs = preparedStatement.executeQuery();
|
||||
|
||||
while (rs.next()) {
|
||||
result.put("benutzerId", rs.getString("benutzerId"));
|
||||
result.put("wurfdaten", rs.getString("wurfdaten"));
|
||||
}
|
||||
|
||||
}
|
||||
catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
close();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user