Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9def444442 | ||
|
|
cae6aa2305 | ||
|
|
14d80dc2f3 | ||
|
|
cb38bcd270 |
6
.github/workflows/bump-version.yml
vendored
6
.github/workflows/bump-version.yml
vendored
@@ -1,4 +1,5 @@
|
|||||||
# This workflow will tag the merge commit when merging a PR into the master branch.
|
# This workflow will tag the merge commit when merging a PR into the master branch.
|
||||||
|
# Add "#patch", "#minor", or "#major" at end of the merge commit subject to dictate the type of bump.
|
||||||
|
|
||||||
name: Bump version
|
name: Bump version
|
||||||
on:
|
on:
|
||||||
@@ -16,7 +17,8 @@ jobs:
|
|||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
- name: Bump version and push tag
|
- name: Bump version and push tag
|
||||||
uses: anothrNick/github-tag-action@v1
|
uses: anothrNick/github-tag-action@1.55.0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
WITH_V: true
|
WITH_V: true
|
||||||
|
BRANCH_HISTORY: last
|
||||||
@@ -32,7 +32,8 @@ import tools.PacketCreator;
|
|||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.time.OffsetDateTime;
|
import java.sql.Timestamp;
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@@ -40,7 +41,7 @@ import java.time.OffsetDateTime;
|
|||||||
*/
|
*/
|
||||||
public final class ReportHandler extends AbstractPacketHandler {
|
public final class ReportHandler extends AbstractPacketHandler {
|
||||||
public final void handlePacket(InPacket p, Client c) {
|
public final void handlePacket(InPacket p, Client c) {
|
||||||
int type = p.readByte(); //01 = Conversation claim 00 = illegal program
|
int type = p.readByte(); //00 = Illegal program claim, 01 = Conversation claim
|
||||||
String victim = p.readString();
|
String victim = p.readString();
|
||||||
int reason = p.readByte();
|
int reason = p.readByte();
|
||||||
String description = p.readString();
|
String description = p.readString();
|
||||||
@@ -58,7 +59,7 @@ public final class ReportHandler extends AbstractPacketHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(6, victim + " was reported for: " + description));
|
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(6, victim + " was reported for: " + description));
|
||||||
addReport(c.getPlayer().getId(), Character.getIdByName(victim), 0, description, null);
|
addReport(c.getPlayer().getId(), Character.getIdByName(victim), 0, description, "");
|
||||||
} else if (type == 1) {
|
} else if (type == 1) {
|
||||||
String chatlog = p.readString();
|
String chatlog = p.readString();
|
||||||
if (chatlog == null) {
|
if (chatlog == null) {
|
||||||
@@ -80,17 +81,16 @@ public final class ReportHandler extends AbstractPacketHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addReport(int reporterid, int victimid, int reason, String description, String chatlog) {
|
private void addReport(int reporterid, int victimid, int reason, String description, String chatlog) {
|
||||||
try (Connection con = DatabaseConnection.getConnection();
|
try (Connection con = DatabaseConnection.getConnection();
|
||||||
PreparedStatement ps = con.prepareStatement("INSERT INTO reports (`reporttime`, `reporterid`, `victimid`, `reason`, `chatlog`, `description`) VALUES (?, ?, ?, ?, ?, ?)")) {
|
PreparedStatement ps = con.prepareStatement("INSERT INTO reports (`reporttime`, `reporterid`, `victimid`, `reason`, `chatlog`, `description`) VALUES (?, ?, ?, ?, ?, ?)")) {
|
||||||
ps.setString(1, OffsetDateTime.now().toString());
|
ps.setTimestamp(1, Timestamp.from(Instant.now()));
|
||||||
ps.setInt(2, reporterid);
|
ps.setInt(2, reporterid);
|
||||||
ps.setInt(3, victimid);
|
ps.setInt(3, victimid);
|
||||||
ps.setInt(4, reason);
|
ps.setInt(4, reason);
|
||||||
ps.setString(5, chatlog);
|
ps.setString(5, chatlog);
|
||||||
ps.setString(6, description);
|
ps.setString(6, description);
|
||||||
ps.addBatch();
|
ps.executeUpdate();
|
||||||
ps.executeBatch();
|
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user