Thread: [Matrix] My server Gui

Page 1 of 3 123 LastLast
Results 1 to 10 of 24
  1. #1 [Matrix] My server Gui 
    Donator


    Join Date
    May 2012
    Posts
    249
    Thanks given
    92
    Thanks received
    96
    Rep Power
    78
    Here you go:

    check what your adding here :

    Spoiler for Media:

    Yell and chat : you can log the players yell and chat with them also and u can chose the hex color u want to chat with at settings tab and save it.

    Player status : contains Punishments and u can veiw the player stats even when they are offline.(Credits to matrix for Skill icons and codes)


    Commands and Promotions : includes all promotions and u can setlevel players give items and more.

    Item List (Credits to matrix development team for this).



    Ok here is how to add:

    First:
    Spoiler for GUI.java:

    Make a new Class in src/com/rs Called "GUI.java" add this code in it
    [Only registered and activated users can see links. ]

    Ok after that make a new Class in the same package called "About.java" add this in it
    Code:
    package com.rs;
    
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Point;
    import java.awt.Rectangle;
    import javax.swing.*;
    
    /**
     * About dialog of the VaporityRsPs Server GUI.
     */
    public class About extends JDialog {
        
        /**
    	 * 
    	 */
    	private static final long serialVersionUID = -4773962848966655527L;
    	
    	public About(JFrame parent) {
            super(parent,true);
            initComponents();
            pack();
            Rectangle parentBounds = parent.getBounds();
            Dimension size = getSize();
            // Center in the parent
            int x = Math.max(0, parentBounds.x + (parentBounds.width - size.width) / 2);
            int y = Math.max(0, parentBounds.y + (parentBounds.height - size.height) / 2);
            setLocation(new Point(x, y));
        }
        private void initComponents() {
            java.awt.GridBagConstraints gridBagConstraints;
    
            mainPanel = new JPanel();
            copyrightTextArea = new JTextArea();
            closeButton = new JButton();
    
            getContentPane().setLayout(new java.awt.GridBagLayout());
    
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("About "+Settings.SERVER_NAME+" GUI");
            mainPanel.setLayout(new java.awt.GridBagLayout());
            mainPanel.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(11, 11, 12, 12)));
            copyrightTextArea.setBackground(javax.swing.UIManager.getDefaults().getColor("Panel.background"));
            copyrightTextArea.setColumns(25);
            copyrightTextArea.setEditable(false);
            copyrightTextArea.setLineWrap(true);
            copyrightTextArea.setRows(8);
            copyrightTextArea.setText(Settings.SERVER_NAME+" GUI\n\nCopyright (c) 2013  "+Settings.SERVER_NAME+".");
            copyrightTextArea.setFont(new Font("",2,15));
            copyrightTextArea.setWrapStyleWord(true);
            copyrightTextArea.setBorder(null);
            copyrightTextArea.setFocusable(false);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
            gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
            gridBagConstraints.weightx = 1.0;
            gridBagConstraints.weighty = 1.0;
            gridBagConstraints.insets = new java.awt.Insets(24, 0, 24, 0);
            mainPanel.add(copyrightTextArea, gridBagConstraints);
    
            closeButton.setMnemonic('C');
            closeButton.setText("Close");
            closeButton.addActionListener(new java.awt.event.ActionListener() {
                @Override
    			public void actionPerformed(java.awt.event.ActionEvent evt) {
                    closeButtonActionPerformed(evt);
                }
            });
    
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST;
            mainPanel.add(closeButton, gridBagConstraints);
    
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
            gridBagConstraints.weightx = 1.0;
            gridBagConstraints.weighty = 1.0;
            getContentPane().add(mainPanel, gridBagConstraints);
    
        }                        
    
        private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {                                            
            setVisible(false);
            dispose();
        }                                           
                    
        private javax.swing.JButton closeButton;
        private javax.swing.JTextArea copyrightTextArea;
        private javax.swing.JPanel mainPanel;               
    
    }

    Ok now the gui needs some extra methods in your server so here they are :
    Spoiler for Methods you need:

    In your "IPBanL.java":
    add this method
    Code:
    public static void guiunban(Player player) {
    		player.setPermBanned(false);
    		player.setBanned(0);
    		edited = true;
    		save();
    	}
    In your "Commands.java":
    Spoiler for Commands:

    add these import
    Code:
    import com.rs.GUI;
    add this method:
    Code:
    public static void updateGUI(Player player, String message) {
    		if (!player.isDonator() && !player.isExtremeDonator() && player.getRights() == 0 && !player.isSupporter() && !player.isGraphicDesigner()) {
    			return;
    		}
    		GUI.updateChatLog("[Player]"+player.getDisplayName()+" : " + message +".\n");
    	}
    Then find:
    Code:
    case "yell":
    under
    Code:
    sendYell(player, Utils.fixChatMessage(message), false);
    add
    Code:
    updateGUI(player,Utils.fixChatMessage(message));
    then find
    Code:
    case "staffyell"
    and do the same


    Ok in "Player.java":

    Spoiler for Player.java:

    add this import:
    Code:
    import com.rs.GUI;
    then Find:
    Code:
    getPackets().sendGameMessage("Welcome to "
    under it add:
    Code:
    GUI.getGUI().PlayersON.setText("Players Online : "+World.getPlayers().size());
    then Find:
    Code:
    World.removePlayer(this);
    under it add:
    Code:
    GUI.getGUI().PlayersON.setText("Players Online : "+World.getPlayers().size());


    ok if u dont have IPMuteL.java here:
    Spoiler for IP Mute:

    Spoiler for IPMuteL.java:

    make a new file in com/rs/utils called "IPMuteL.java"
    and put this code in it
    Code:
    package com.rs.utils;
    
    import java.io.File;
    import java.util.concurrent.CopyOnWriteArrayList;
    
    import com.rs.game.player.Player;
    
    public final class IPMuteL {
    
    	public static CopyOnWriteArrayList<String> ipList;
    
    	private static final String PATH = "data/MutedIPS.ser";
    	private static boolean edited;
    
    	@SuppressWarnings("unchecked")
    	public static void init() {
    		File file = new File(PATH);
    		if (file.exists())
    			try {
    				ipList = (CopyOnWriteArrayList<String>) SerializableFilesManager
    						.loadSerializedFile(file);
    				return;
    			} catch (Throwable e) {
    				Logger.handle(e);
    			}
    		ipList = new CopyOnWriteArrayList<String>();
    	}
    
    	public static final void save() {
    		if (!edited)
    			return;
    		try {
    			SerializableFilesManager.storeSerializableClass(ipList, new File(
    					PATH));
    			edited = false;
    		} catch (Throwable e) {
    			Logger.handle(e);
    		}
    	}
    
    	public static boolean isMuted(String ip) {
    		return ipList.contains(ip);
    	}
    
    	public static void Mute(Player player, boolean loggedIn) {
    		if (loggedIn) {
    			ipList.add(player.getSession().getIP());
    		} else {
    			ipList.add(player.getLastIP());
    			SerializableFilesManager.savePlayer(player);
    		}
    		edited = true;
    	}
    
    	public static void unMute(Player player) {
    		ipList.remove(player.getLastIP());
    		edited = true;
    		save();
    	}
    
    	public static void checkCurrent() {
    		for (String list : ipList) {
    			System.out.println(list);
    		}
    	}
    
    	public static CopyOnWriteArrayList<String> getList() {
    		return ipList;
    	}
    
    }



    Spoiler for Commands.java:
    First : add this import in the top of the class
    Code:
    import com.rs.utils.IPMuteL;
    find
    Code:
    if (player.getMuted() > Utils.currentTimeMillis()) {
    			player.getPackets().sendGameMessage(
    					"You temporary muted. Recheck in 48 hours.");
    			return;
    		}
    add under it
    Code:
    if (IPMuteL.isMuted(player.getSession().getIP())) {
    				player.getPackets().sendGameMessage(
    						"You are IP muted.");
    				return;
    			}

    Spoiler for Launcher.java:

    first add this import at the top of the class
    Code:
    import com.rs.utils.IPMuteL;
    find
    Code:
    IPBanL.init();
    under it add
    Code:
    IPMuteL.init();
    then find
    Code:
    IPBanL.save();
    under it add
    Code:
    IPMuteL.save();



    Spoiler for WorldPacketsDecoder.java:

    first add this import
    Code:
    import com.rs.utils.IPMuteL;
    now find
    Code:
    } else if (packetId == CHAT_PACKET) {
    under it add
    Code:
    if (IPMuteL.isMuted(player.getSession().getIP())) {
    				player.getPackets().sendGameMessage(
    						"You are IP muted.");
    				return;
    			}
    do the same for
    Code:
    } else if (packetId == SEND_FRIEND_MESSAGE_PACKET) {


    ok add this to your lib folder
    [Only registered and activated users can see links. ]

    ok finaly in your Launcher.java

    Find:
    Code:
    Logger.log("Launcher", "Server took "
                    + (Utils.currentTimeMillis() - currentTime)
                    + " milli seconds to launch.");
    under that put:
    Code:
    GUI.setGui(new GUI());

    add this to your data/items/:
    [Only registered and activated users can see links. ]
    extract this rar in your data folder
    [Only registered and activated users can see links. ]


    okay thats it credits:
    Me.
    Matrix Development team.
    And all who thinks that i used his code .


    Ok if you have any problems errors post in here i will help you


    Would appreciate thanks if your going to use this.
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Copenhagen Mint LC


    Join Date
    Apr 2012
    Age
    23
    Posts
    1,518
    Thanks given
    406
    Thanks received
    367
    Rep Power
    475

    Why is it all out of place? Organize it a bit, it would look more professional.
    Great job though, will help people who need a control panel for quick access
    Reply With Quote  
     

  4. #3  
    Donator


    Join Date
    May 2012
    Posts
    249
    Thanks given
    92
    Thanks received
    96
    Rep Power
    78
    Quote Originally Posted by IamSiles View Post
    Why is it all out of place? Organize it a bit, it would look more professional.
    Great job though, will help people who need a control panel for quick access
    good point will do
    Reply With Quote  
     

  5. #4  
    Developer

    Holy Symbol's Avatar
    Join Date
    Dec 2011
    Age
    23
    Posts
    1,762
    Thanks given
    1,047
    Thanks received
    232
    Rep Power
    232
    Looks nice
    Spoiler for big sig:


    Reply With Quote  
     

  6. #5  
    Registered Member Jem Finch's Avatar
    Join Date
    Dec 2013
    Posts
    104
    Thanks given
    6
    Thanks received
    0
    Rep Power
    11
    pretty nice. will help many people. but yes fix the layout.
    proof of ownership (Kyle_Friz) - 8/17/17
    Reply With Quote  
     

  7. #6  
    Donator

    Old Oak's Avatar
    Join Date
    May 2011
    Age
    26
    Posts
    1,552
    Thanks given
    544
    Thanks received
    435
    Rep Power
    189
    It's not complete without a shutdown option.
    Reply With Quote  
     

  8. #7  
    Donator


    Join Date
    May 2012
    Posts
    249
    Thanks given
    92
    Thanks received
    96
    Rep Power
    78
    Quote Originally Posted by `Luke View Post
    It's not complete without a shutdown option.
    it is easy to edit you can just add any button u want in any tab or anything u see usefull

    BTW [by closing the gui it shutdown the server]
    Reply With Quote  
     

  9. #8  
    Registered Member
    Join Date
    Jan 2012
    Posts
    48
    Thanks given
    25
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by armark1ng2 View Post
    Here you go:

    check what your adding here :

    Spoiler for Media:

    Yell and chat : you can log the players yell and chat with them also and u can chose the hex color u want to chat with at settings tab and save it.

    Player status : contains Punishments and u can veiw the player stats even when they are offline.(Credits to matrix for Skill icons and codes)


    Commands and Promotions : includes all promotions and u can setlevel players give items and more.

    Item List (Credits to matrix development team for this).



    Ok here is how to add:

    First:
    Spoiler for GUI.java:

    Make a new Class in src/com/rs Called "GUI.java" add this code in it
    [Only registered and activated users can see links. ]

    Ok after that make a new Class in the same package called "About.java" add this in it
    Code:
    package com.rs;
    
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Point;
    import java.awt.Rectangle;
    import javax.swing.*;
    
    /**
     * About dialog of the VaporityRsPs Server GUI.
     */
    public class About extends JDialog {
        
        /**
    	 * 
    	 */
    	private static final long serialVersionUID = -4773962848966655527L;
    	
    	public About(JFrame parent) {
            super(parent,true);
            initComponents();
            pack();
            Rectangle parentBounds = parent.getBounds();
            Dimension size = getSize();
            // Center in the parent
            int x = Math.max(0, parentBounds.x + (parentBounds.width - size.width) / 2);
            int y = Math.max(0, parentBounds.y + (parentBounds.height - size.height) / 2);
            setLocation(new Point(x, y));
        }
        private void initComponents() {
            java.awt.GridBagConstraints gridBagConstraints;
    
            mainPanel = new JPanel();
            copyrightTextArea = new JTextArea();
            closeButton = new JButton();
    
            getContentPane().setLayout(new java.awt.GridBagLayout());
    
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("About "+Settings.SERVER_NAME+" GUI");
            mainPanel.setLayout(new java.awt.GridBagLayout());
            mainPanel.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(11, 11, 12, 12)));
            copyrightTextArea.setBackground(javax.swing.UIManager.getDefaults().getColor("Panel.background"));
            copyrightTextArea.setColumns(25);
            copyrightTextArea.setEditable(false);
            copyrightTextArea.setLineWrap(true);
            copyrightTextArea.setRows(8);
            copyrightTextArea.setText(Settings.SERVER_NAME+" GUI\n\nCopyright (c) 2013  "+Settings.SERVER_NAME+".");
            copyrightTextArea.setFont(new Font("",2,15));
            copyrightTextArea.setWrapStyleWord(true);
            copyrightTextArea.setBorder(null);
            copyrightTextArea.setFocusable(false);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
            gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
            gridBagConstraints.weightx = 1.0;
            gridBagConstraints.weighty = 1.0;
            gridBagConstraints.insets = new java.awt.Insets(24, 0, 24, 0);
            mainPanel.add(copyrightTextArea, gridBagConstraints);
    
            closeButton.setMnemonic('C');
            closeButton.setText("Close");
            closeButton.addActionListener(new java.awt.event.ActionListener() {
                @Override
    			public void actionPerformed(java.awt.event.ActionEvent evt) {
                    closeButtonActionPerformed(evt);
                }
            });
    
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTHEAST;
            mainPanel.add(closeButton, gridBagConstraints);
    
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
            gridBagConstraints.weightx = 1.0;
            gridBagConstraints.weighty = 1.0;
            getContentPane().add(mainPanel, gridBagConstraints);
    
        }                        
    
        private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {                                            
            setVisible(false);
            dispose();
        }                                           
                    
        private javax.swing.JButton closeButton;
        private javax.swing.JTextArea copyrightTextArea;
        private javax.swing.JPanel mainPanel;               
    
    }

    Ok now the gui needs some extra methods in your server so here they are :
    Spoiler for Methods you need:

    In your "IPBanL.java":
    add this method
    Code:
    public static void guiunban(Player player) {
    		player.setPermBanned(false);
    		player.setBanned(0);
    		edited = true;
    		save();
    	}
    In your "Commands.java":
    Spoiler for Commands:

    add these import
    Code:
    import com.rs.GUI;
    add this method:
    Code:
    public static void updateGUI(Player player, String message) {
    		if (!player.isDonator() && !player.isExtremeDonator() && player.getRights() == 0 && !player.isSupporter() && !player.isGraphicDesigner()) {
    			return;
    		}
    		GUI.updateChatLog("[Player]"+player.getDisplayName()+" : " + message +".\n");
    	}
    Then find:
    Code:
    case "yell":
    under
    Code:
    sendYell(player, Utils.fixChatMessage(message), false);
    add
    Code:
    updateGUI(player,Utils.fixChatMessage(message));
    then find
    Code:
    case "staffyell"
    and do the same


    Ok in "Player.java":

    Spoiler for Player.java:

    add this import:
    Code:
    import com.rs.GUI;
    then Find:
    Code:
    getPackets().sendGameMessage("Welcome to "
    under it add:
    Code:
    GUI.getGUI().PlayersON.setText("Players Online : "+World.getPlayers().size());
    then Find:
    Code:
    World.removePlayer(this);
    under it add:
    Code:
    GUI.getGUI().PlayersON.setText("Players Online : "+World.getPlayers().size());


    ok if u dont have IPMuteL.java here:
    Spoiler for IP Mute:

    Spoiler for IPMuteL.java:

    make a new file in com/rs/utils called "IPMuteL.java"
    and put this code in it
    Code:
    package com.rs.utils;
    
    import java.io.File;
    import java.util.concurrent.CopyOnWriteArrayList;
    
    import com.rs.game.player.Player;
    
    public final class IPMuteL {
    
    	public static CopyOnWriteArrayList<String> ipList;
    
    	private static final String PATH = "data/MutedIPS.ser";
    	private static boolean edited;
    
    	@SuppressWarnings("unchecked")
    	public static void init() {
    		File file = new File(PATH);
    		if (file.exists())
    			try {
    				ipList = (CopyOnWriteArrayList<String>) SerializableFilesManager
    						.loadSerializedFile(file);
    				return;
    			} catch (Throwable e) {
    				Logger.handle(e);
    			}
    		ipList = new CopyOnWriteArrayList<String>();
    	}
    
    	public static final void save() {
    		if (!edited)
    			return;
    		try {
    			SerializableFilesManager.storeSerializableClass(ipList, new File(
    					PATH));
    			edited = false;
    		} catch (Throwable e) {
    			Logger.handle(e);
    		}
    	}
    
    	public static boolean isMuted(String ip) {
    		return ipList.contains(ip);
    	}
    
    	public static void Mute(Player player, boolean loggedIn) {
    		if (loggedIn) {
    			ipList.add(player.getSession().getIP());
    		} else {
    			ipList.add(player.getLastIP());
    			SerializableFilesManager.savePlayer(player);
    		}
    		edited = true;
    	}
    
    	public static void unMute(Player player) {
    		ipList.remove(player.getLastIP());
    		edited = true;
    		save();
    	}
    
    	public static void checkCurrent() {
    		for (String list : ipList) {
    			System.out.println(list);
    		}
    	}
    
    	public static CopyOnWriteArrayList<String> getList() {
    		return ipList;
    	}
    
    }



    Spoiler for Commands.java:
    First : add this import in the top of the class
    Code:
    import com.rs.utils.IPMuteL;
    find
    Code:
    if (player.getMuted() > Utils.currentTimeMillis()) {
    			player.getPackets().sendGameMessage(
    					"You temporary muted. Recheck in 48 hours.");
    			return;
    		}
    add under it
    Code:
    if (IPMuteL.isMuted(player.getSession().getIP())) {
    				player.getPackets().sendGameMessage(
    						"You are IP muted.");
    				return;
    			}

    Spoiler for Launcher.java:

    first add this import at the top of the class
    Code:
    import com.rs.utils.IPMuteL;
    find
    Code:
    IPBanL.init();
    under it add
    Code:
    IPMuteL.init();
    then find
    Code:
    IPBanL.save();
    under it add
    Code:
    IPMuteL.save();



    Spoiler for WorldPacketsDecoder.java:

    first add this import
    Code:
    import com.rs.utils.IPMuteL;
    now find
    Code:
    } else if (packetId == CHAT_PACKET) {
    under it add
    Code:
    if (IPMuteL.isMuted(player.getSession().getIP())) {
    				player.getPackets().sendGameMessage(
    						"You are IP muted.");
    				return;
    			}
    do the same for
    Code:
    } else if (packetId == SEND_FRIEND_MESSAGE_PACKET) {


    ok add this to your lib folder
    [Only registered and activated users can see links. ]

    ok finaly in your Launcher.java

    Find:
    Code:
    Logger.log("Launcher", "Server took "
                    + (Utils.currentTimeMillis() - currentTime)
                    + " milli seconds to launch.");
    under that put:
    Code:
    GUI.setGui(new GUI());

    add this to your data/items/:
    [Only registered and activated users can see links. ]
    extracte this rar in your data folder
    [Only registered and activated users can see links. ]


    okay thats it credits:
    Me.
    Matrix Development team.
    And all who thinks that i used his code .


    Ok if you have any problems errors post in here i will help you


    Would appreciate thanks if your going to use this.
    nice gj,
    Reply With Quote  
     

  10. #9  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    26
    Posts
    9,736
    Thanks given
    1,754
    Thanks received
    3,102
    Rep Power
    5000
    Nice, sort of reminds me of that Jar tool; overall will be pretty helpful for matrix users.
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  11. #10  
    Registered Member
    Sirloin's Avatar
    Join Date
    Feb 2012
    Age
    24
    Posts
    784
    Thanks given
    186
    Thanks received
    175
    Rep Power
    105
    I just like the look and feel, gj though.
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Matrix II
    By Cjay0091 in forum Advertise
    Replies: 1044
    Last Post: 03-23-2016, 03:51 AM
  2. Replies: 23
    Last Post: 01-25-2013, 08:53 PM
  3. Replies: 11
    Last Post: 12-21-2012, 06:44 PM
  4. New Sig: Matrix
    By Wafflez in forum Showcase
    Replies: 7
    Last Post: 11-03-2007, 03:46 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •