Thread: 100% Timed Mutes and Bans (Done the correct way, with correct conventions)

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26
  1. #11  
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    Since all this talk of "correct conventions" is starting to annoy me.
    banAssistant should BanAssistant, if you knew the conventions and not just been swept up in the hype.
    Don't worry, Be happy.
    Reply With Quote  
     

  2. #12  
    Registered Member
    AMG A Bear's Avatar
    Join Date
    Jun 2008
    Posts
    1,157
    Thanks given
    27
    Thanks received
    87
    Rep Power
    945
    Quote Originally Posted by Daniel View Post
    Since all this talk of "correct conventions" is starting to annoy me.
    banAssistant should BanAssistant, if you knew the conventions and not just been swept up in the hype.
    I guess I mixed the name of class files with variables. Thanks for refreshing my memory then.
    Quote Originally Posted by The Night Life View Post
    Errm. I had a similar idea a very long time ago, about instead of current rs's gameframe, (622) making a rsps with about a 1645 or something. Make it look like you walked outside. I even gathered proffesional computer programmers to help, but bailed on the idea after i realized if we all worked on it non-stop for months at a time, we'd barely get any progress. (unless you wanted to half ass it)
    Reply With Quote  
     

  3. #13  
    Registered Member
    netzo's Avatar
    Join Date
    Feb 2008
    Age
    28
    Posts
    1,226
    Thanks given
    402
    Thanks received
    135
    Rep Power
    185
    Very nice, thanks

    Can anyone create Ban command with Uername Case_id Start_date End_date inserting into database?

    or just make for me correct insert lines:

    My lines:

    Code:
                Statement stmt = MySQL.conn.createStatement();
                stmt.execute("INSERT INTO `banned_users` (`Username`, `Case_Id`, `Start_date`, `End_date`) VALUES ('"+p.username+"','"+player+"', '"+today+"', '"+expireDate+"')");
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #14  
    Registered Member

    Join Date
    Aug 2007
    Posts
    2,395
    Thanks given
    2
    Thanks received
    63
    Rep Power
    558
    You missed a convention i guess, and a one which you should never forget: Capitalize the first letter of a class (and other first letter if you got more words)
    Other then that you might execute your queries in a threadpool, but it looks fine
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #15  
    Registered Member
    AMG A Bear's Avatar
    Join Date
    Jun 2008
    Posts
    1,157
    Thanks given
    27
    Thanks received
    87
    Rep Power
    945
    Quote Originally Posted by netzo View Post
    Very nice, thanks

    Can anyone create Ban command with Uername Case_id Start_date End_date inserting into database?

    or just make for me correct insert lines:

    My lines:

    Code:
                Statement stmt = MySQL.conn.createStatement();
                stmt.execute("INSERT INTO `banned_users` (`Username`, `Case_Id`, `Start_date`, `End_date`) VALUES ('"+p.username+"','"+player+"', '"+today+"', '"+expireDate+"')");
    No, I'm pretty sure that wouldn't work.

    And thanks Jonas.
    Quote Originally Posted by The Night Life View Post
    Errm. I had a similar idea a very long time ago, about instead of current rs's gameframe, (622) making a rsps with about a 1645 or something. Make it look like you walked outside. I even gathered proffesional computer programmers to help, but bailed on the idea after i realized if we all worked on it non-stop for months at a time, we'd barely get any progress. (unless you wanted to half ass it)
    Reply With Quote  
     

  6. #16  
    Registered Member
    netzo's Avatar
    Join Date
    Feb 2008
    Age
    28
    Posts
    1,226
    Thanks given
    402
    Thanks received
    135
    Rep Power
    185
    Quote Originally Posted by call me bear View Post
    No, I'm pretty sure that wouldn't work.

    And thanks Jonas.
    My ban code:

    Code:
    package server.players.Commands;
    
    import java.sql.Statement;
    
    import server.*;
    import server.players.*;
    import server.players.MiscHandlers.*;
    
    public class BanUser implements Command {
        @Override
        public void execute(client client, String command) {
        if (client.playerRights >= 2) {
                    try {
                        String otherPName = command.substring(8);
                        int otherPIndex = PlayerHandler.getPlayerID(otherPName);
    
                        if (otherPIndex != -1) {
                            client p = (client) server.playerHandler.players[otherPIndex];
    
                Statement stmt = MySQL.conn.createStatement();
                stmt.execute("INSERT INTO `banned_users` (`Username`, `Case_Id`, `Start_date`, `End_date`) VALUES ('"+p.username+"', '"+player+"', '"+today+"', '"+expireDate+"')");
    
                p.disconnected = true;
                client.CAM().sendMessage("You have banned "+p.username+"!");
                        } else {
                           client.CAM().sendMessage("The name doesn't exist."); 
                        }
                    } catch (Exception e) { 
                        client.CAM().sendMessage("Try entering a name you want to ban..");
                    }
                }
        }
    }
    Just need to edit inserting into db.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #17  
    Registered Member
    Division's Avatar
    Join Date
    Dec 2009
    Age
    26
    Posts
    2,208
    Thanks given
    41
    Thanks received
    78
    Rep Power
    97
    for how long is this ban/mute 48 hours?
    Reply With Quote  
     

  8. #18  
    Banned

    Join Date
    Jan 2009
    Age
    28
    Posts
    2,662
    Thanks given
    66
    Thanks received
    207
    Rep Power
    0
    Couldn't You Just Do somthing like this for the time instead of all the date gregorian stuffs


    Code:
    public long banRelease;
    private static long Day_1 = (1000 * 3600 * 24);
    Code:
    private void addBan(int daysBanned){
              banRelease = System.currentTimeMillis() + (Day_1 * daysBanned)
    }
    Code:
    private void liftBans(String Player){
               if(banRelease <= System.currentTimeMillis())
    }
    Reply With Quote  
     

  9. #19  
    Registered Member shapaklekas's Avatar
    Join Date
    Feb 2008
    Posts
    256
    Thanks given
    12
    Thanks received
    13
    Rep Power
    0
    How i can make to show player show how much time left until mute end?
    Reply With Quote  
     

  10. #20  
    Registered Member Akeid's Avatar
    Join Date
    May 2009
    Posts
    911
    Thanks given
    22
    Thanks received
    15
    Rep Power
    37
    thanks so much dude , this looks crazy
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    MSN: [email protected]
    Reply With Quote  
     

Page 2 of 3 FirstFirst 123 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •