diff options
author | Dor Bivas <dor1_b@walla.com> | 2014-02-22 19:59:47 +0200 |
---|---|---|
committer | Dor Bivas <dor1_b@walla.com> | 2014-02-22 19:59:47 +0200 |
commit | bbd72aeabf72df8add3c098b8d0c3db673469fa5 (patch) | |
tree | 4c97bcdd9efa1c8f10d888633f4e9d452f7137a7 /src/Client/ChatClient.java | |
parent | baa4b01821a4c49b9edda1ff1b1193da0c8a7465 (diff) |
Client start-up sequence
* fixing connection prob
Diffstat (limited to 'src/Client/ChatClient.java')
-rw-r--r-- | src/Client/ChatClient.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Client/ChatClient.java b/src/Client/ChatClient.java index 679d51c..6499b75 100644 --- a/src/Client/ChatClient.java +++ b/src/Client/ChatClient.java @@ -71,6 +71,11 @@ public class ChatClient writer.sendLine(line); } + private void earlySendline(String line) + { + writer.sendLine(line); + } + /** */ public void PRIVMSG (String line) { @@ -95,14 +100,18 @@ public class ChatClient public void fixNickCollision() { String newNick = getNick() + new Integer((int) (Math.random()*1000)).toString(); - runSendline("NICK " + newNick); + earlySendline("NICK " + newNick); + } + + public void startup() { + earlySendline("NICK " + this.getNick()); + earlySendline("USER " + this.getNick() + " 0 * :" + this.getRealname()); } /** Initial setup with the server once the nick was set up*/ - public void startup() + public void joinChannel() { // 0: mode (nothing special). *: unused in RFC 2812, server name in RFC 1459 - runSendline("USER " + this.getNick() + " 0 * :" + this.getRealname()); runSendline("JOIN " + this.CHANNEL); this.setConnected(); // FIXME: Not sure yet if client is connected. } |