Compare commits

..

9 Commits

Author SHA1 Message Date
Ponk
9def444442 Fix version bump not obeying merge commit message (#157) #patch
* Fix version bump not obeying merge commit message

* Test the fix to bump-version

* Fix reference to specific tag of github-tag-action

* Dummy patch commit #patch

* Clean up testing of bump-version
2022-12-27 15:07:12 +01:00
Ponk
cae6aa2305 Merge pull request #156 from P0nk/fix/saving-gm-report #patch
Fix saving in-game report
2022-12-27 14:12:47 +01:00
P0nk
14d80dc2f3 Fix saving "Illegal program claim" report
No chatlog is provided in the packet for this type
2022-12-27 14:08:20 +01:00
P0nk
cb38bcd270 Fix wrong timestamp format when saving report 2022-12-27 14:08:20 +01:00
Ponk
176ce6a3bd Merge pull request #150 from P0nk/bug-147/cwkpq-summons #patch
Fix error summoning master guardians on CWKPQ last stage
2022-10-16 12:32:51 +02:00
P0nk
f267b1fc0b Fix error summoning master guardians on CWKPQ last stage 2022-10-16 12:30:01 +02:00
Ponk
ea0bdb55af Merge pull request #149 from P0nk/tag-merge-commit
Tag the merge commit instead of last commit in the PR #patch
2022-10-16 11:56:24 +02:00
P0nk
4004b36bfa Tag the merge commit instead of last commit in the PR
The merge commit is more suitable since it provides some context
and groups up all the commits.
2022-10-16 11:53:29 +02:00
Ponk
d0a4c416e4 Merge pull request #148 from P0nk/versioning
Define versioning scheme
2022-10-16 10:06:55 +02:00
3 changed files with 16 additions and 14 deletions

View File

@@ -1,10 +1,9 @@
# 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
on:
pull_request:
types:
- closed
push:
branches:
- master
@@ -18,7 +17,8 @@ jobs:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/github-tag-action@v1
uses: anothrNick/github-tag-action@1.55.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
WITH_V: true
BRANCH_HISTORY: last

View File

@@ -35,11 +35,13 @@ function action(mode, type, selection) {
cm.mapMessage(6, "Engarde! Master Guardians approach!");
for (var i = 0; i < 10; i++) {
var mob = eim.getMonster(9400594);
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (Math.random() * 1337), 276));
const xPos = Math.floor(-1337 + (Math.random() * 1337))
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(xPos, 276));
}
for (var i = 0; i < 20; i++) {
var mob = eim.getMonster(9400582);
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (Math.random() * 1337), 276));
const xPos = Math.floor(-1337 + (Math.random() * 1337))
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(xPos, 276));
}
eim.setIntProperty("glpq6", 1);
cm.dispose();

View File

@@ -32,7 +32,8 @@ import tools.PacketCreator;
import java.sql.Connection;
import java.sql.PreparedStatement;
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 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();
int reason = p.readByte();
String description = p.readString();
@@ -58,7 +59,7 @@ public final class ReportHandler extends AbstractPacketHandler {
return;
}
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) {
String chatlog = p.readString();
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();
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(3, victimid);
ps.setInt(4, reason);
ps.setString(5, chatlog);
ps.setString(6, description);
ps.addBatch();
ps.executeBatch();
ps.executeUpdate();
} catch (SQLException ex) {
ex.printStackTrace();
}