mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Added connection speed information per user (milliseconds the ping needs). Some minor changes to server console.
This commit is contained in:
parent
1285df5da3
commit
b98c16f061
20 changed files with 166 additions and 54 deletions
|
|
@ -1233,17 +1233,17 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
disableButtons();
|
||||
setStatusText("Not connected");
|
||||
disableButtons();
|
||||
hideGames();
|
||||
hideTables();
|
||||
if (JOptionPane.showConfirmDialog(MageFrame.this, "The connection to server was lost. Reconnect?", "Warning", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
|
||||
session.disconnect(false);
|
||||
tablesPane.clearChat();
|
||||
// session.disconnect(false);
|
||||
// tablesPane.clearChat();
|
||||
if (performConnect()) {
|
||||
enableButtons();
|
||||
}
|
||||
} else {
|
||||
setStatusText("Not connected");
|
||||
hideGames();
|
||||
hideTables();
|
||||
// } else {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ import javax.swing.table.AbstractTableModel;
|
|||
import javax.swing.table.JTableHeader;
|
||||
import javax.swing.table.TableColumn;
|
||||
import javax.swing.table.TableColumnModel;
|
||||
import javax.swing.table.TableRowSorter;
|
||||
import mage.client.MageFrame;
|
||||
import mage.remote.MageRemoteException;
|
||||
import mage.remote.Session;
|
||||
|
|
@ -152,6 +153,7 @@ public class ChatPanel extends javax.swing.JPanel {
|
|||
initComponents();
|
||||
jTablePlayers.setBackground(new Color(0, 0, 0, 0));
|
||||
jTablePlayers.setForeground(Color.white);
|
||||
jTablePlayers.setRowSorter(new TableRowSorter(tableModel));
|
||||
setBackground(new Color(0, 0, 0, 100));
|
||||
if (jScrollPaneTxt != null) {
|
||||
jScrollPaneTxt.setBackground(new Color(0, 0, 0, 100));
|
||||
|
|
@ -301,7 +303,7 @@ public class ChatPanel extends javax.swing.JPanel {
|
|||
|
||||
class TableModel extends AbstractTableModel {
|
||||
|
||||
private final String[] columnNames = new String[]{"Players", "Info", "Games"};
|
||||
private final String[] columnNames = new String[]{"Players", "Info", "Games", "Connection"};
|
||||
private UsersView[] players = new UsersView[0];
|
||||
|
||||
public void loadData(Collection<RoomUsersView> roomUserInfoList) throws MageRemoteException {
|
||||
|
|
@ -334,6 +336,8 @@ public class ChatPanel extends javax.swing.JPanel {
|
|||
return players[arg0].getInfoState();
|
||||
case 2:
|
||||
return players[arg0].getInfoGames();
|
||||
case 3:
|
||||
return players[arg0].getInfoPing();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue