Advertisement
Advertisement
| 05.08.2008 at 05:37PM PDT, ID: 23388135 | Points: 500 |
|
[x]
Attachment Details
|
||
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 05.08.2008 at 11:02PM PDT, ID: 21530641 |
| 05.09.2008 at 04:09AM PDT, ID: 21531644 |
| 05.09.2008 at 06:32AM PDT, ID: 21532549 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: |
// CLIENT THREAD RUN
@Override
public void run(){
try {
//wachten op inkomende message
boolean stop = false;
while(!stop) {
Object messageObject = istream.readObject();
if(messageObject instanceof String){
String s = (String) messageObject;
if (s.equals("LIST")){
messageObject = (Vector) readObject();
JOptionPane.showMessageDialog(frmTheMainForm,"Message: " + (Vector<Speler>) messageObject);
frmTheMainForm.fillUpPlayerList((Vector<Speler>) messageObject);
}
}
}
} catch(IOException ex){
ex.printStackTrace();
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
} finally {
try {
if (link != null){
//stap 5: connectie sluiten (gebeurt nu door clienthandler)
ostream.writeObject("QUIT!!!");
link.close();
}
}
catch(IOException e){
e.printStackTrace();
}
}
}
// PLAYER CREATED
public PokerPlayerConnection(Socket link, cPokerServer server){
this.link = link;
this.server = server;
clientID = aantalClientHandlers;
aantalClientHandlers++;
//Connection made
try {
//input & output kanalen
ostream = new ObjectOutputStream(link.getOutputStream());
istream = new ObjectInputStream(link.getInputStream());
for(PokerPlayerConnection tmpPlayer : server.getClientHandlers()){
server.frmMain.addGeneralLogEvent(tmpPlayer.getThisPlayer().getPassIdentiteitskaart().getSNickname() + " was contacted");
tmpPlayer.sendObject("LIST");
tmpPlayer.sendObject(server.getActivePlayers());
server.frmMain.addGeneralLogEvent(server.getActivePlayers().toString());
}
} catch (IOException ex){
ex.printStackTrace();
}
}
|
| 05.09.2008 at 07:45AM PDT, ID: 21533353 |
| 05.09.2008 at 08:16AM PDT, ID: 21533700 |
| 05.09.2008 at 08:28AM PDT, ID: 21533853 |
| 05.09.2008 at 03:04PM PDT, ID: 21536650 |