Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unintrusive vanilla state #443

Draft
wants to merge 4 commits into
base: 1.20-Unified
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public enum ServerSafetyLevel {
*/
UNINTRUSIVE,

/**
* Same as UNINTRUSIVE, but also checks that the server type is vanilla.
* This only changes the tooltip to better inform the user, functionality remains identical to UNINTRUSIVE.
*/
UNINTRUSIVE_VANILLA,

/**
* For servers that have <code>enforce-secure-profile</code> enabled, or enforce signed messages
* through some other means. Users of this mod can choose to play on those servers regardless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static boolean isInSingleplayer() {
}

public static boolean isDetermined() {
return current != ServerSafetyLevel.UNINTRUSIVE && current != ServerSafetyLevel.UNDEFINED
return current != ServerSafetyLevel.UNINTRUSIVE && current != ServerSafetyLevel.UNINTRUSIVE_VANILLA && current != ServerSafetyLevel.UNDEFINED
&& current != ServerSafetyLevel.UNKNOWN;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.Instant;
import java.util.Base64;
import java.util.Objects;
import java.util.UUID;

import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -88,6 +89,9 @@ private void onEvaluateTrustLevel(PlayerChatMessage playerChatMessage, Component
} else {
if (playerChatMessage.hasSignature() && ServerSafetyState.getCurrent() == ServerSafetyLevel.SECURE) {
ServerSafetyState.updateCurrent(ServerSafetyLevel.UNINTRUSIVE);

if(Objects.equals(Minecraft.getInstance().getCurrentServer().status.getString(), "vanilla")) // Doesn't seem correct, but close
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

ServerSafetyState.updateCurrent(ServerSafetyLevel.UNINTRUSIVE_VANILLA);
}

var evaluate = ChatTrustLevel.evaluate(playerChatMessage, component, instant);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,11 @@ private int getSpriteSet(ServerSafetyLevel level) {
return switch (level) {
case INSECURE -> 0;
case UNINTRUSIVE -> 1;
case SECURE, SINGLEPLAYER -> 2;
case REALMS -> 3;
case UNKNOWN -> 4;
case UNDEFINED -> 5;
case UNINTRUSIVE_VANILLA -> 2;
case SECURE, SINGLEPLAYER -> 3;
case REALMS -> 4;
case UNKNOWN -> 5;
case UNDEFINED -> 6;
};
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/nochatreports/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"gui.nochatreports.safety_status.secure": "This server has No Chat Reports installed, or prevents your messages from being reportable in some other known way. You can chat safely.",
"gui.nochatreports.safety_status.singleplayer": "You can always chat safely in singleplayer and self-hosted LAN worlds.",
"gui.nochatreports.safety_status.unintrusive": "This server allows you to send unsigned messages which cannot be reported to Mojang. Unless some kind of plugin is installed on the server that prevents chat reports - vanilla clients will still send signed messages, display unsigned messages as \"Unverified\" and not show them if \"Only Show Secure Chat\" is enabled in chat options.",
"gui.nochatreports.safety_status.unintrusive_vanilla": "This server allows you to send unsigned messages which cannot be reported to Mojang. Because this is a vanilla server, vanilla clients will still send signed messages, display unsigned messages as \"Unverified\" and not show them if \"Only Show Secure Chat\" is enabled in chat options.",
"gui.nochatreports.safety_status.insecure": "This server currently demands all chat messages to be signed. All signed messages are a potentially incriminating evidence that can be used against you in a chat report.",
"gui.nochatreports.safety_status.insecure_signing": "You have enabled chat signing, which makes all your messages a potentially incriminating evidence that can be used against you in a chat report.",
"gui.nochatreports.safety_status.realms": "This is a Realms server. Not only is there no way to prevent chat reports here, but Mojang also employs automated chat monitoring to identify potential \"online harms\" and escalate them to human review, whether the owner of the Realm likes it or not. Your only hope is chat encryption.",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/nochatreports/lang/et_ee.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"gui.nochatreports.safety_status.secure": "Sellele serverile on paigaldatud mod No Chat Reports või see piirab sinu sõnumitest teatamist mõnel muul teadaoleval viisil. Sa saad turvaliselt vestelda.",
"gui.nochatreports.safety_status.singleplayer": "Üksikmängus saad sa alati turvaliselt vestelda.",
"gui.nochatreports.safety_status.unintrusive": "See server võimaldab saata signeerimata sõnumeid, mida ei saa Mojangile teatada. Kui serveris pole mõnda vestlusest teatamise piiramise pluginat, saadavad vanillikliendid siiski signeeritud sõnumeid, kuvavad signeerimata sõnumeid \"kinnitamata sõnumitena\" ning ei kuva neid üldse, kui vestlusseadetes on lubatud \"Vaid turvaline vestlus\".",
"gui.nochatreports.safety_status.unintrusive_vanilla": "See server võimaldab saata signeerimata sõnumeid, mida ei saa Mojangile teatada. Kuna see on vanilliserver, saadavad vanillikliendid siiski signeeritud sõnumeid, kuvavad signeerimata sõnumeid \"kinnitamata sõnumitena\" ning ei kuva neid üldse, kui vestlusseadetes on lubatud \"Vaid turvaline vestlus\".",
"gui.nochatreports.safety_status.insecure": "See server nõuab hetkel kõikide mängijasõnumite signeerimist. Kõik signeeritud sõnumid on potentsiaalselt süüdistav asitõend, mida saab raportis sinu vastu kasutada.",
"gui.nochatreports.safety_status.insecure_signing": "Oled lubanud vestluse signeerimise, mis teeb kõik su sõnumid potentsiaalselt süüdistavaks asitõendiks, mida saab raportis sinu vastu kasutada.",
"gui.nochatreports.safety_status.realms": "See on Realmsi server. Lisaks sellele, et siin ei saa vestlusest teatamist keelata, kasutab Mojang ka automaatset vestlusseiret, et tuvastada potentsiaalsed \"võrgukäitumise rikkumised\" ning saata need edasi inimkontrolli, olenemata sellest, kas see meeldib realmi omanikule või mitte. Sinu ainus lootus on vestluse krüpteerimine.",
Expand Down
Loading