Code: Show/Hide ------------------------------------------------------------------------------- NetOp Commands: ?broadcast Owner Commands: None Sysop Commands: None Smod Commands: ?addop, ?removeop Mod Commands: ?banip, ?bkick, ?getip ------------------------------------------------------------------------------- Misc Commands: ?binfo, ?bnews, ?btime, ?buptime, ?bversion, ?coin, ?man, ?sex MSG Commands: ?message, ?messages, msgdel Other Commands: ?password, ?listop, ?listall Squad Commands: ?squadjoin, ?squadpassword, ?squadowner, ?squadlist, ?squadkick ------------------------------------------------------------------------------- Note: Syntax differs for some commands. Type ?man <command> for help. |
Code: Show/Hide import java.net.*; import java.io.*; public class UBill { public static void main(String[] args) throws IOException { ServerSocket serverSocket = null; boolean listening = true; try { serverSocket = new ServerSocket(2555); System.out.println("Starting UBill 0.1..."); } catch (IOException e) { System.err.println("Could not listen on port: 2555."); System.exit(-1); } while (listening) new UBillConnect(serverSocket.accept()).start(); serverSocket.close(); } } |
Code: Show/Hide PrintWriter out = new PrintWriter(socket.getOutputStream(), true); BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream())); |
BDwinsAlt wrote: | |
|
Code: Show/Hide while (listening) { UBillConnect u = new UBillConnect(serverSocket.accept()); collection.add(u); u.start(); } ... broadcast(msg) { for each u in collection: u.send(msg) } |
Code: Show/Hide public UBill u = new UBill(); |
Code: Show/Hide public class UBillFactory
{ private static UBill u; public static getUBill() { if (u == null) u = new UBill(); return u; } } |
Smong wrote: |
How about making it save banners. Make sure there are ?changepassword and ?adduser op commands (and an option to not allow new users, so only ?adduser can be used). |
BDwinsAlt wrote: |
-prizes himself prox (huge radius) and fires a huge bomb towards cypher (he used up all his repels and I have anti on. All he can do is esc q)
Muhahaha. ![]() J/k <3 If they want mysql they will go to you. If they don't do mysql, they will (hopefully) come to me. All is fair. |
BDwinsAlt wrote: |
Login uses... Name:MD5Password:Squad:Email (?setemail) |
Code: Show/Hide Password: bob
Salt: md83e Hash("bobmd83e"): 8d4b2a76f3d0e82aecab9cf0cc46bd10 John:8d4b2a76f3d0e82aecab9cf0cc46bd10:md83e:Winners:spam@aol.com |
Doc Flabby wrote: |
don't use md5 for passwords ... it can be cracked in a few hours using a bot-net/distributed computer. |
BDwinsAlt wrote: |
Ok I'm going to salt + md5, and then put it into sha-512. Is that secure enough? |
Code: Show/Hide /* Author: BDwinsAlt Edited: June 20, 2007 [4:33 AM] Credits: Smong - Showing me factory classes allowing me to send messages across zones. Doc Flabby - Commenting his code to show me how ASSS handles events. Mine GO Boom - Keeping me in line and allowing me to continue posting on his fourms. CypherJF - Being a cool friend and giving me ideas. (Love ya) Sass - Didn't help me with biller, but he is cool. (Lova ya, too) Hamm - Being patient while I was updating the biller. Sonic VI - Allowing me to test my netban command on an actual player and not myself. *God* - For being there for me and allowing me to have the things I need in order to live and code. *** ~Important Information~ *** ---------------------------------------------------------------------- pid = Player ID cmd = Command that was sent arg = argument for that command bang = user's bang level (5 = Netop ... 1 = Mod [0 for Player] ) out = The thing used to send the message. ---------------------------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Send can be modified to send sounds if you like. E.X: send = "MSG:" + pid + ":12:"; [Use right before out.println()] See ?newbie command for more information. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ This is the only part I can leave open source because of security issues. ~ Existing commands won't get sent here; there is no use in trying to get passwords this way. TIP: Don't seperate parts of a command with a colon, this will cause multi args and you are only granted one. Split them using something else (like a semicolon or something). [Until I edit] */ import java.io.*; public class UBillCmd { // Create a way for UBillConnect to get the information to send. // Handle all commands here public void handleCmd(String pid, String cmd, String arg, int bang, PrintWriter out) { // This is just to keep you from typing it each time. String send = "MSG:" + pid + ":0:"; // Find out if a command is equals to something below. // *About* if (cmd.equalsIgnoreCase("about")) { out.println(send + "I am a simple, lonely biller. I just sit here and listen to all your commands."); } // *Bstaff* else if (cmd.equalsIgnoreCase("bstaff")) { try { // Opens bstaff.txt file for reading. BufferedReader in = new BufferedReader(new FileReader("bstaff.txt")); String lines = in.readLine(); // Starts while loop while(lines != null) { out.println(send + lines); // Sends the text to the player line by line lines = in.readLine(); // Reads the next line } in.close(); // Closes the file // End while Loop } catch(Exception e){out.println(send + "Unable to locate bstaff.txt.");} // If file doesn't exist } // *Levels* else if (cmd.equalsIgnoreCase("levels")) { out.println(send + "NetOp = 5"); out.println(send + "Owner = 4"); out.println(send + "SysOp = 3"); out.println(send + "SMod = 2"); out.println(send + "Mod = 1"); } // *Poetry* else if (cmd.equalsIgnoreCase("poetry")) { out.println(send + "Roses are red. Violets are blue. All my base are belong to you."); } // ~~ Start Man section ~~ else if (cmd.equalsIgnoreCase("man")) { if (arg.equalsIgnoreCase("")) { out.println(send + "Ect. Commands: ?about, ?bstaff, ?levels, ?poetry"); } else if (arg.equalsIgnoreCase("about")) { out.println(send + "Args: None"); out.println(send + "Syntax: ?about"); out.println(send + "Description: Sends a little information about the biller."); } else if (arg.equalsIgnoreCase("bstaff")) { out.println(send + "Args: None"); out.println(send + "Syntax: ?bstaff"); out.println(send + "Description: Displays biller staff."); } else if (arg.equalsIgnoreCase("levels")) { out.println(send + "Args: None"); out.println(send + "Syntax: ?levels"); out.println(send + "Description: Displays the different operating levels."); } else if (arg.equalsIgnoreCase("poetry")) { out.println(send + "Args: None"); out.println(send + "Syntax: ?poetry"); out.println(send + "Description: Displays a simple, geeky poem."); } } // End Man section else if (cmd.equalsIgnoreCase("newbie") && bang == 0) { // Example of sending things your own way using different sounds and bang levels. out.println("MSG:" + pid + ":3:" + "Newb!"); } } // End handleCmd } // End Class |