You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 07:26:18 +00:00
fix(rcon): bind offline respect counters correctly
GiveRespect inverted the offline SQL parameters for respects_given and respects_received. Online users received the intended counters, but offline users had the two persisted counters swapped. Bind respect_given to respects_given and respect_received to respects_received, with a contract test to keep the RCON offline path aligned.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.eu.habbo.messages.rcon;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class GiveRespectContractTest {
|
||||
private static String giveRespectSource() throws Exception {
|
||||
return Files.readString(Path.of("src/main/java/com/eu/habbo/messages/rcon/GiveRespect.java"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void offlineRespectGrantBindsGivenAndReceivedToMatchingColumns() throws Exception {
|
||||
String source = giveRespectSource();
|
||||
|
||||
assertTrue(source.contains("statement.setInt(1, object.respect_given);"),
|
||||
"respects_given must be incremented with respect_given");
|
||||
assertTrue(source.contains("statement.setInt(2, object.respect_received);"),
|
||||
"respects_received must be incremented with respect_received");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user