Results 1 to 15 of 15
- 12-04-2011, 08:56 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Java Source Chat Applet - Bytecode
Hello all,
I am new at the "Java Forums", i am here to learn to java and this is probably one of the best forums on the net. I need some help regarding my current java applet source (based on netbeans).
I would like to edit and read the original functions, commands, options in the java source to edit basic things like changing the command from kick to remove for example. But i have a problem i dont know how this works, maybe somebody can provide me and tell me how this code part works, i have taken a random java source file to show what exactly i am talking about:
attrlist.add(new ClientAttr((byte)43, "banned"));Java Code:if(inputCommand.equals("kick") && vector.size() >= 1) { attrlist.add(new ClientAttr((byte)43, "banned")); sendCommand((byte)26, s, (String)vector.elementAt(0), attrlist); } if(inputCommand.equals("sop") && vector.size() >= 1 && getParameter("sop") != null) { attrlist.add(new ClientAttr((byte)43, vector.size() >= 2 ? (String)vector1.elementAt(1) : getParameter("sop"))); sendCommand((byte)26, null, (String)vector.elementAt(0), attrlist); }
sendCommand((byte)26, s, (String)vector.elementAt(0), attrlist);
How can i understand how this command works, how can i edit this command for example if i only able to see BYTE(26). Where does this code gets the information from, which java file? how can i decode and translate in order to RE-EDIT it?
Please can somebody provide me information to understand this.
Thank you very much guys.
Best regards,
Nino
- 12-04-2011, 09:16 PM #2
Re: Java Source Chat Applet - Bytecode
What class is the sendCommand() method in? Is there any API doc for that class?How can i understand how this command works
Without doc for the method, it is very hard to know how to use it.
- 12-04-2011, 09:18 PM #3
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
- 12-04-2011, 09:23 PM #4
Re: Java Source Chat Applet - Bytecode
Where did you get this program? Who wrote it?
What class is the sendCommand code in? Does that class extend another where sendCommand is defined?
What import statements are in the program that would show the packages the program is using.
- 12-04-2011, 09:26 PM #5
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Java Source Chat Applet - Bytecode
will this help?Java Code:public void sendCommand(Command command) throws Exception { if(debug) System.err.println((new StringBuilder("Sending ")).append(command).toString()); setBackground(clrCommand); cxn.sendCommand(command); repaint(); if(idler != null) idler.activity(); } private void sendCommand(byte byte0, String s, String s1, AttrList attrlist) { try { if(s1 != null && s1.length() > 0 && !s1.equals("*")) attrlist.add(new ClientAttr((byte)2, s1)); if(s != null) attrlist.add(new ClientAttr((byte)12, s)); sendCommand(new Command(byte0, attrlist)); } catch(Exception exception) { setStatus(exception); } } private void sendCommand(byte byte0, String s, String s1) { sendCommand(byte0, s, s1, new AttrList()); } private void sendCommand(byte byte0, AttrList attrlist) { sendCommand(byte0, null, null, attrlist); } private void sendCommand(byte byte0) { sendCommand(byte0, null, null, new AttrList()); }
- 12-04-2011, 09:28 PM #6
Re: Java Source Chat Applet - Bytecode
One small step closer.
What class is the cxn object? It also has a sendCommand() method.
Why are you messing around with what looks like a program that does complicated stuff that I've never seen anyone work with before?
There are a lot of basics that you need to learn before trying to do this.
- 12-04-2011, 09:31 PM #7
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Java Source Chat Applet - Bytecode
This is what i could find about CXn.Java Code:public void paint(Graphics g) { if(cxn == null) return; g.setColor(getBackground()); g.setPaintMode(); for(; pendingEvents.size() > 0; pendingEvents.removeElementAt(0)) doEventInternal((Event)pendingEvents.elementAt(0)); } private void cleanupChat() { hide(); removeAllChatListeners(); chats.remove(getParameter("name")); if(cxn != null) { Connection connection = cxn; cxn = null; connection.destroy(); } if(idler != null) idler.quit(); } public boolean connect(String s, int i) { if(cxn != null) cleanupChat(); doInternalEvent("connecting"); try { cxn = new Connection(s == null ? getCodeBase().getHost() : s, i, this); doInternalEvent("connect"); } catch(Exception exception) { setStatus(exception); doInternalEvent("error"); } if(cxn != null) try { Vector vector = new Vector(); parseStrings(vector, ',', getParameter("idletime")); if(vector.size() > 0) { for(int j = 0; j < vector.size(); j++) vector.setElementAt(new Integer((String)vector.elementAt(j)), j); idler = new Idler(this, vector); } } catch(Exception exception1) { exception1.printStackTrace(); } return true; } private Connection cxn;
- 12-04-2011, 09:34 PM #8
Re: Java Source Chat Applet - Bytecode
Where is the definition of the variable cxn? That will show what class it is.
I see where it is given the value of a new Connection.
What package is the Connection class in? Does it have something to do with SQL?
- 12-04-2011, 09:36 PM #9
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Java Source Chat Applet - Bytecode
- 12-04-2011, 09:42 PM #10
Re: Java Source Chat Applet - Bytecode
Sorry, this looks like it is past your current knowledge level. I suggested in post #6
Why are you messing around with what looks like a program that does complicated stuff that I've never seen anyone work with before?
There are a lot of basics that you need to learn before trying to do this.
You need to find some doc for this program so you can understand what it does.
Can you contact the author?
- 12-04-2011, 09:48 PM #11
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Java Source Chat Applet - Bytecode
Hi,
Currently i am having the original java chat source as i said in the last post.
My goal is, i would like to know how i can EDIT the chat commands for example. (i will not edit it, but a java coder will do it for me). The chat applet needs a chat server, i am currently trying to explain how to INPLENT all functions, chat, commands, to the chat server. I have all descriptions how commands work, but for example at the HTML document i have different parameters:
So my questions is HOW does it com i am not able to find these parameters names in the original source, if it actually getting the information from the HTML files to the java applet.Java Code:textparams = ''; textparams += '<param name="joined" value=" < |%1% komt het kanaal binnen >">\n'; textparams += '<param name="myjoined" value=" < |%1% komt kanaal %12% binnen >">\n'; textparams += '<param name="parted" value=" < |%1% verlaat het kanaal >">\n';
Thanks!
- 12-04-2011, 09:54 PM #12
Re: Java Source Chat Applet - Bytecode
Look at all the calls to getParameter() in the Applet to see if any of them could have those Strings.i am not able to find these parameters names in the original source,
Add a println before each of the getParameter() calls and print out the value of its argument if the arguments are hard to understand.
I assume you are talking about how the applet get the values from the <param tag in the html file with the <applet tags.
- 12-04-2011, 09:56 PM #13
Member
- Join Date
- Dec 2010
- Posts
- 16
- Rep Power
- 0
Re: Java Source Chat Applet - Bytecode
- 12-04-2011, 10:00 PM #14
Re: Java Source Chat Applet - Bytecode
If that is the only call to getParameter() in the applet code then I can not answer this question.if it actually getting the information from the HTML files to the java applet.
- 12-04-2011, 10:01 PM #15
Similar Threads
-
source code for j2me voice chat
By armin in forum New To JavaReplies: 6Last Post: 05-21-2011, 11:18 AM -
Open Source web based Java Chat application
By anitha2324 in forum Advanced JavaReplies: 4Last Post: 07-01-2009, 08:55 AM -
Help with bytecode in java
By coco in forum New To JavaReplies: 3Last Post: 04-16-2009, 08:48 AM -
how to display chat window in both source and destination machine
By bu.pradeep in forum NetworkingReplies: 1Last Post: 08-08-2008, 03:20 AM -
Chat Applet in HTML
By Flynazn in forum Java AppletsReplies: 3Last Post: 05-27-2008, 09:26 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks