Author |
Message |
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Wed Jun 06, 2007 11:35 pm Post subject: Bringing zones together |
|
|
|
|
I got bored so I made a biller. (Yeah...)
In a little over a day I have added this:
-------------------------------------------------------------------------------
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.
|
When I broadcast it sends "BROADCAST:PID:SOUND:TEXT" but only to that one zone.
How do I make it so it sends to everything connected to that port without it having to be a DGRAM socket where I would have to specify an ip and port for each zone.
Because my socket isn't DGRAM, socket.send doesn't seem to exist. How do I send strings of information to all clients connected. Will I have to turn it into bytes and so on?
This is Java because python wasn't splitting the strings of information correctly. |
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Thu Jun 07, 2007 1:20 am Post subject: |
|
|
|
|
You'll have to be careful with Java string splitting as well.
BLAH:BLAH:
Will result in 2 array items, not 3. _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Thu Jun 07, 2007 1:37 am Post subject: |
|
|
|
|
I haven't messed with chats yet. I wonder how I will do that.
Yea so if I make it say info[3] (arguments) then the second BLAH will be info[4]. Thats gay. |
|
Back to top |
|
|
Maverick
Age:39 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
Posted: Thu Jun 07, 2007 1:52 am Post subject: |
|
|
|
|
wow
You made it all out of scratch or did you use existing code? _________________
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Thu Jun 07, 2007 2:22 am Post subject: |
|
|
|
|
Well I added Commands to Skybill. All the bnews, buptime. btime... all that was from what I coded earlier. The squad/messaging is all I really had to focus on. I didn't take anything from any biller that I didn't already code. So yes it is scratch. |
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Thu Jun 07, 2007 2:46 am Post subject: |
|
|
|
|
Ah but can yours do what mine does (besides adding ops, lol)?
BTW, it's now running on hyperion.mineplowers.com incase the zone was red (you can update your dir listing). |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Thu Jun 07, 2007 2:54 am Post subject: |
|
|
|
|
I'm working on it
I probably will never release/use it once I'm done. Just a project. if it looks really nice then I might. We'll see.
Edit: I made it so chats = squadchat for now.
I'm just testing my chat stuff. Right now if you type ';hey' it will send to everyone online in your squad. I'll have to figure out how I'm going to make multiple chats. That is also only zone-wide right now. I think I have an idea about how I can use a DGRAM socket to send chats and broadcasts net-wide.
EDIT II: Would anyone like to help me send messages?
Each zone is connected to the biller on it's own thread to keep them from clashing. |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Thu Jun 07, 2007 9:39 pm Post subject: |
|
|
|
|
Messages: Just have each thread poll some function for messages waiting to be received. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Thu Jun 07, 2007 9:59 pm Post subject: |
|
|
|
|
UBill.java
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();
}
}
|
Part of UBillConnect.java
PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
|
Each zone has it's own out and in. If one zone sends: CHAT:X:X to the biller then the biller sends the CHATTXT, but only out with out.println(....);
I need CHATTXT to be sent to every 'out' that exists in any new UBillConnect. |
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Fri Jun 08, 2007 2:37 am Post subject: |
|
|
|
|
I used your biller to see how CHAT and CHATTXT worked. (Thanks for commenting your code ).
I'll see what I can do. |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Fri Jun 08, 2007 2:44 am Post subject: |
|
|
|
|
Wow, now I get it working in python.
Python seems to send things faster. I'll stick with java since I can probably do more with that and I already coded a thousand lines. |
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Fri Jun 08, 2007 3:52 pm Post subject: |
|
|
|
|
I'm still having trouble. I can't seem to figure out how to make the classes reach each other. Basically it looks like I'll have to store the collection in UBill, do the command in UBillConnect, go back to UBill to find the collection, and then figure out how to make sure it sends to all of them.
I've never done anything like this before. I've been googling forever.
EDIT:
I have everything done with the chats except for sending them to other zones.
I think that's really all I have left to do unless I feel like making an aliasing system. I try to make it all non-mysql so there are no drivers involved and not everyone can use mysql.
I know it's slower and not as efficent and more work, but it takes hard work to make a good looking biller anyway.
If you have any dumbed down code to help me get these threads to work with each other let me know.
UBill -> UBillConnect (broadcast cmd is found and work is done) -> UBill (Sends to all zones connected) <-- that is what I need somehow.
I can always port it to python if I get bored in the future.
Also, which is better, md5 or SHA? The only way to decode md5 is to md5 a string and see if it equals the md5 string right? I would think that was secure enough. |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Sun Jun 10, 2007 3:46 pm Post subject: |
|
|
|
|
I LOVE YOU! Thank you so much. You will be added in the huge thanks part of the credits.
Thanks again. |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Jun 12, 2007 9:29 pm Post subject: |
|
|
|
|
That's not a Factory, Smong, it's a Singleton! Get your design patterns right. |
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Jun 13, 2007 10:03 am Post subject: |
|
|
|
|
Heh I don't care only when I handed in some work the other day the guy said why didn't you use a "factory pattern" it works like this ... |
|
Back to top |
|
|
Cerium Server Help Squatter
Age:41 Gender: Joined: Mar 05 2005 Posts: 807 Location: I will stab you. Offline
|
Posted: Wed Jun 13, 2007 5:48 pm Post subject: |
|
|
|
|
factories create lots of objects
singletons create a single object _________________ There are 7 user(s) ignoring me right now. |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Fri Jun 15, 2007 4:47 am Post subject: |
|
|
|
|
Whatever it's called it worked for me. Smong was added to bversion, display message on entry, and readme. I will be releasing it for beta testing after I beta test it myself and change a few things. Any suggested commands/functions? |
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Fri Jun 15, 2007 5:21 am Post subject: |
|
|
|
|
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). |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Fri Jun 15, 2007 12:18 pm Post subject: |
|
|
|
|
I haven't touched banners yet. I'll do that today when I get home. I added ?resetpassword for netops and I'll add ?adduser. |
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Fri Jun 15, 2007 5:18 pm Post subject: |
|
|
|
|
haha but how am i suppose to have fun, if i don't pound you and your biller to death. |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Fri Jun 15, 2007 5:30 pm Post subject: |
|
|
|
|
Then it will be fun when I reverse enginner your biller and combine it with mine to crush yours hard core. |
|
Back to top |
|
|
|