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