This commit was manufactured by cvs2svn to create tag 'buildscript'.
[IRC.git] /
1 public class ChatSocket {
2     flag Initialized;
3     flag ProcessRoom;
4     flag InRoom;
5     Room room;
6     String roomrequest;
7     Socket sock;
8
9     public ChatSocket() {
10     }
11
12     public boolean processRead(Socket s) {
13         byte buffer[]=new byte[1024];
14         int length=s.read(buffer);
15         String st=new String(buffer);
16         String curr=st.subString(0, length);
17         if (roomrequest!=null) {
18             StringBuffer sb=new StringBuffer(roomrequest);
19             sb.append(curr);
20             curr=sb.toString();
21         }
22         roomrequest=curr;
23         if (roomrequest.indexOf("\n")>=0) {
24             return true;
25         }
26         return false;
27     }
28     public void processRoom(RoomObject ro) {
29         ro.getChatRoom(roomrequest).addParticipant(this);
30     }
31 }