Skip to content

Commit

Permalink
17.93
Browse files Browse the repository at this point in the history
RADAR info msg on client connect
  • Loading branch information
tonikelope committed May 11, 2024
1 parent c795a22 commit 2607150
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>CoronaPoker</artifactId>
<version>17.92</version>
<version>17.93</version>
<packaging>jar</packaging>
<build>
<plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/tonikelope/coronapoker/AboutDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
*/
public class AboutDialog extends javax.swing.JDialog {

public static final String VERSION = "17.92";
public static final String VERSION = "17.93";
public static final String UPDATE_URL = "https://github.com/tonikelope/coronapoker/releases/latest";
public static final String TITLE = "¿De dónde ha salido esto?";
public static final int MAX_MOD_LOGO_HEIGHT = 75;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/tonikelope/coronapoker/BalanceDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public BalanceDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);

initComponents();
date.setText(Helpers.getFechaHoraActual() + " ("+Helpers.seconds2FullTime(GameFrame.getInstance().getConta_tiempo_juego())+")");

date.setText(Helpers.getFechaHoraActual() + " (" + Helpers.seconds2FullTime(GameFrame.getInstance().getConta_tiempo_juego()) + ")");

exit_button.requestFocus();

Expand Down
13 changes: 9 additions & 4 deletions src/main/java/com/tonikelope/coronapoker/Helpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -2539,11 +2539,15 @@ public void run() {
});
}

public static void mostrarMensajeInformativo(Container container, String msg, ImageIcon icon) {
mostrarMensajeInformativo(container, msg, "center", null, icon);
}

public static void mostrarMensajeInformativo(Container container, String msg) {
mostrarMensajeInformativo(container, msg, "center", null);
mostrarMensajeInformativo(container, msg, "center", null, null);
}

public static void mostrarMensajeInformativo(Container container, String msg, String align, Integer width) {
public static void mostrarMensajeInformativo(Container container, String msg, String align, Integer width, ImageIcon icon) {

final String mensaje = Translator.translate(msg);

Expand All @@ -2554,13 +2558,14 @@ public static void mostrarMensajeInformativo(Container container, String msg, St

if (SwingUtilities.isEventDispatchThread()) {

JOptionPane.showMessageDialog(container, label);
JOptionPane.showMessageDialog(container, label, "Info", JOptionPane.INFORMATION_MESSAGE, icon != null ? new ImageIcon(icon.getImage().getScaledInstance(DIALOG_ICON_SIZE, Math.round((float) (icon.getIconHeight() * DIALOG_ICON_SIZE) / icon.getIconWidth()), Image.SCALE_SMOOTH)) : icon);

} else {
Helpers.GUIRunAndWait(new Runnable() {
@Override
public void run() {
JOptionPane.showMessageDialog(container, label);
JOptionPane.showMessageDialog(container, label, "Info", JOptionPane.INFORMATION_MESSAGE, icon != null ? new ImageIcon(icon.getImage().getScaledInstance(DIALOG_ICON_SIZE, Math.round((float) (icon.getIconHeight() * DIALOG_ICON_SIZE) / icon.getIconWidth()), Image.SCALE_SMOOTH)) : icon);

}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/tonikelope/coronapoker/NewGameDialog.form
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,8 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="16" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/images/shield.png"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new ImageIcon(new ImageIcon(getClass().getResource(&quot;/images/shield.png&quot;)).getImage().getScaledInstance(32, 32, Image.SCALE_SMOOTH))" type="code"/>
</Property>
<Property name="text" type="java.lang.String" value="RADAR"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/tonikelope/coronapoker/NewGameDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import com.tonikelope.coronapoker.Helpers.JTextFieldRegularPopupMenu;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.io.File;
Expand Down Expand Up @@ -980,7 +981,7 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) {
});

radar_label.setFont(new java.awt.Font("Dialog", 1, 16)); // NOI18N
radar_label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/shield.png"))); // NOI18N
radar_label.setIcon(new ImageIcon(new ImageIcon(getClass().getResource("/images/shield.png")).getImage().getScaledInstance(32, 32, Image.SCALE_SMOOTH)));
radar_label.setText("RADAR");
radar_label.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
radar_label.addMouseListener(new java.awt.event.MouseAdapter() {
Expand Down Expand Up @@ -1325,7 +1326,7 @@ private void recover_checkboxActionPerformed(java.awt.event.ActionEvent evt) {//

pack();

Helpers.mostrarMensajeInformativo(this, "En el MODO RECUPERACIÓN se continuará la timba anterior desde donde se paró:\n\n1) Es OBLIGATORIO que los jugadores antiguos usen los MISMOS NICKS.\n\n2) Para poder continuar desde el PUNTO EXACTO (con la mismas cartas) es OBLIGATORIO que se conecten TODOS los jugadores antiguos. Si esto no fuera posible, se \"perderá\" la mano que estaba en curso cuando se interrumpió la timba.\n\n3) Está permitido que se unan a la timba jugadores nuevos (estarán la primera mano de espectadores).", "justify", (int) Math.round(getWidth() * 0.8f));
Helpers.mostrarMensajeInformativo(this, "En el MODO RECUPERACIÓN se continuará la timba anterior desde donde se paró:\n\n1) Es OBLIGATORIO que los jugadores antiguos usen los MISMOS NICKS.\n\n2) Para poder continuar desde el PUNTO EXACTO (con la mismas cartas) es OBLIGATORIO que se conecten TODOS los jugadores antiguos. Si esto no fuera posible, se \"perderá\" la mano que estaba en curso cuando se interrumpió la timba.\n\n3) Está permitido que se unan a la timba jugadores nuevos (estarán la primera mano de espectadores).", "justify", (int) Math.round(getWidth() * 0.8f), null);

} else {

Expand Down Expand Up @@ -1555,7 +1556,7 @@ private void random_labelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRS
+ "\n"
+ "<b>MODO CASINO:</b> este modo utiliza la API de Random.org para obtener una permutación de 52 elementos. La aleatoriedad de Random.org proviene de un generador de números ALEATORIOS AUTÉNTICOS obtenidos a partir de RUIDO ATMOSFÉRICO, siendo por tanto capaz de generar cualquiera de las permutaciones posibles de una baraja de póker de forma impredecible y equiprobable.\n"
+ "\n"
+ "<b>MODO PARANOICO:</b> este modo es un HÍBRIDO entre el MODO CASINO y el NORMAL. Primero se baraja usando el MODO CASINO y después se vuelve a barajar usando el MODO NORMAL. De esta forma, en un hipotético y MUY improbable caso de que la permutación devuelta por Random.org no fuera totalmente aleatoria por cualquier motivo (fortuito o malicioso), al volver a barajar quedaría neutralizado.", "justify", (int) Math.round(getWidth() * 0.8f));
+ "<b>MODO PARANOICO:</b> este modo es un HÍBRIDO entre el MODO CASINO y el NORMAL. Primero se baraja usando el MODO CASINO y después se vuelve a barajar usando el MODO NORMAL. De esta forma, en un hipotético y MUY improbable caso de que la permutación devuelta por Random.org no fuera totalmente aleatoria por cualquier motivo (fortuito o malicioso), al volver a barajar quedaría neutralizado.", "justify", (int) Math.round(getWidth() * 0.8f), null);
}//GEN-LAST:event_random_labelMouseClicked

private void radar_labelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_radar_labelMouseClicked
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/tonikelope/coronapoker/Translator.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class Translator {
private static void English() {

String[][] rosetta = {
{"El servidor ha activado el RADAR anti-trampas para esta partida.\nCualquier jugador podrá solicitar un informe anti-trampas de otro jugador durante la partida,\nel cual incluye una captura de pantalla del jugador (sin mostrar sus cartas) así como su listado de procesos del sistema.", "The server has activated anti-cheating RADAR for this game.\nAny player may request an anti-cheating report from another player during the game,\nwhich includes a screenshot of the player (without showing his cards) as well as his/her system process listing."},
{"HECHO A MANO EN ESPAÑA CON AMOR por tonikelope (c) 2020", "HANDMADE IN SPAIN WITH LOVE by tonikelope (c) 2020"},
{"Chat rápido", "Fast chat"},
{"Enviar imagen", "Send image"},
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/tonikelope/coronapoker/WaitingRoomFrame.form
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="main_scroll_panel" alignment="1" pref="850" max="32767" attributes="0"/>
<Component id="main_scroll_panel" alignment="1" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
Expand Down Expand Up @@ -84,7 +84,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="chat_notifications" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="chat_scroll" pref="50" max="32767" attributes="0"/>
<Component id="chat_scroll" pref="88" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
Expand Down Expand Up @@ -177,7 +177,7 @@
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="kick_user" max="32767" attributes="0"/>
<Component id="panel_conectados" pref="367" max="32767" attributes="0"/>
<Component id="panel_conectados" pref="739" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
Expand Down Expand Up @@ -517,8 +517,8 @@
</Component>
<Component class="javax.swing.JLabel" name="radar">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/images/shield.png"/>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new ImageIcon(new ImageIcon(getClass().getResource(&quot;/images/shield.png&quot;)).getImage().getScaledInstance(32, 32, Image.SCALE_SMOOTH))" type="code"/>
</Property>
<Property name="doubleBuffered" type="boolean" value="true"/>
</Properties>
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/com/tonikelope/coronapoker/WaitingRoomFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ private void mostrarMensajeInformativo(Container container, String msg) {

this.protect_focus = false;

Helpers.mostrarMensajeInformativo(container, msg, "center", null);
Helpers.mostrarMensajeInformativo(container, msg, "center", null, null);

this.protect_focus = focus_protection;
}
Expand All @@ -1248,7 +1248,7 @@ private void mostrarMensajeInformativo(Container container, String msg, String a

this.protect_focus = false;

Helpers.mostrarMensajeInformativo(container, msg, align, width);
Helpers.mostrarMensajeInformativo(container, msg, align, width, null);

this.protect_focus = focus_protection;
}
Expand Down Expand Up @@ -1523,6 +1523,12 @@ private void cliente() {

GameFrame.RADAR_AVAILABLE = Boolean.parseBoolean(recibido);

if (GameFrame.RADAR_AVAILABLE) {
Helpers.threadRun(() -> {
Helpers.mostrarMensajeInformativo(THIS, "El servidor ha activado el RADAR anti-trampas para esta partida.\nCualquier jugador podrá solicitar un informe anti-trampas de otro jugador durante la partida,\nel cual incluye una captura de pantalla del jugador (sin mostrar sus cartas) así como su listado de procesos del sistema.", new ImageIcon(getClass().getResource("/images/shield.png")));
});
}

//Añadimos al servidor
nuevoParticipante(server_nick, server_avatar, null, null, null, false, THIS.isUnsecure_server());
//Nos añadimos nosotros
Expand Down Expand Up @@ -2651,7 +2657,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGap(0, 0, 0)
.addGroup(panel_conLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(kick_user, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(panel_conectados, javax.swing.GroupLayout.DEFAULT_SIZE, 367, Short.MAX_VALUE)))
.addComponent(panel_conectados, javax.swing.GroupLayout.DEFAULT_SIZE, 739, Short.MAX_VALUE)))
);
panel_conLayout.setVerticalGroup(
panel_conLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
Expand Down Expand Up @@ -2765,7 +2771,7 @@ public void mouseClicked(java.awt.event.MouseEvent evt) {
}
});

radar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/shield.png"))); // NOI18N
radar.setIcon(new ImageIcon(new ImageIcon(getClass().getResource("/images/shield.png")).getImage().getScaledInstance(32, 32, Image.SCALE_SMOOTH)));
radar.setDoubleBuffered(true);

javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
Expand Down Expand Up @@ -3062,7 +3068,7 @@ public void mouseClicked(java.awt.event.MouseEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(chat_notifications)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(chat_scroll, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
.addComponent(chat_scroll, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
Expand Down
Binary file modified src/main/resources/images/shield.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2607150

Please sign in to comment.