Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0ff5905
First
hrust1k Nov 11, 2015
a98dd0a
Delete ChatApp.iml
hrust1k Nov 23, 2015
48e18b1
Delete .gitignore
hrust1k Nov 23, 2015
a55a216
Delete HEAD
hrust1k Nov 23, 2015
d50133f
Delete README.md
hrust1k Nov 23, 2015
46a5c49
Delete config
hrust1k Nov 23, 2015
84be924
Delete description
hrust1k Nov 23, 2015
7d1f141
Delete index
hrust1k Nov 23, 2015
ccbce56
Delete packed-refs
hrust1k Nov 23, 2015
f52c1a7
Delete applypatch-msg.sample
hrust1k Nov 23, 2015
d61f09e
Delete commit-msg.sample
hrust1k Nov 23, 2015
79ca26d
Delete post-update.sample
hrust1k Nov 23, 2015
eb21273
Delete pre-applypatch.sample
hrust1k Nov 23, 2015
facc688
Delete pre-commit.sample
hrust1k Nov 23, 2015
380b88f
Delete pre-push.sample
hrust1k Nov 23, 2015
0012d20
Delete pre-rebase.sample
hrust1k Nov 23, 2015
ab3539e
Delete prepare-commit-msg.sample
hrust1k Nov 23, 2015
dd7d5f0
Delete update.sample
hrust1k Nov 23, 2015
366e835
Delete exclude
hrust1k Nov 23, 2015
6991030
Delete master
hrust1k Nov 23, 2015
35375e3
Delete HEAD
hrust1k Nov 23, 2015
9c06b56
Delete HEAD
hrust1k Nov 23, 2015
5a95b96
Delete 8ce8aedf051e8e66f249645c71ab647f8d4815
hrust1k Nov 23, 2015
387cd91
Delete e7cafd3804bb4551def39480d08580057f106c
hrust1k Nov 23, 2015
7434e66
Delete 01ea2fd1113a7a10e9ab6a287c23fc59935ba6
hrust1k Nov 23, 2015
d43a1c3
Delete eaa97fe05f89f7f1290a2d66d812f7f05bcf7e
hrust1k Nov 23, 2015
cb6be0a
Delete a7347372eb216c24eddb652fd4dc58c5885a4e
hrust1k Nov 23, 2015
14a16f4
Delete cf05f4fb15b3673a671ea6b16e38d6a9b791f8
hrust1k Nov 23, 2015
8d905f4
Commits that i try to send on github 3 weeks!
KoshelKB21 Dec 1, 2015
d5174a1
what to do to Gayka
KoshelKB21 Dec 2, 2015
e2a6561
Наконец-то.
decled Dec 9, 2015
8178e34
CallListenerThread.
decled Dec 9, 2015
e430b0a
Перезалив.
decled Dec 9, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions README.md

This file was deleted.

Binary file added objects/12/a3451cef2e642c9fd9eab7b4b3ad4b17d7b2e7
Binary file not shown.
Binary file added objects/17/443b3e16942feb776754978f8a8485ffbcaf84
Binary file not shown.
3 changes: 3 additions & 0 deletions objects/18/b984a27ded49243f2bc5e2e8aff818e2b14ec0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
x-PMJ�Pv�S�;ԕ�zk�L���I�UZ��WHLB_M�^��ͤ<x!�ߙ<%���>�z���L�~���G��zT� �y�.4G���-
My�r�!jB�Б�^��!��]dz��c ���>�^
������㣫$l5�O�5ʣ3��ڃ��rTnf/���f��Vs:Y��n+g4cѕ�J����Ȏ�@�m���x7�����^�<s�_�r��V7C��޵���G݈~�����ļ֩�%���?H�
Expand Down
Binary file added objects/1a/73a83be11dde2d0003b716ca778fafc6f34ad7
Binary file not shown.
Binary file added objects/21/6817f1b5e33861223e0369e0a7ed110971dec1
Binary file not shown.
Binary file added objects/21/749a44ff45f66f3d15d5818e4dedcd9a05723d
Binary file not shown.
Binary file added objects/21/a2a92472c4438feb095489cdb51cb6f9ef2026
Binary file not shown.
Binary file added objects/22/9a28a334822cb2aa5a92368d5365ba2a9ad33c
Binary file not shown.
Binary file added objects/32/858aad3c383ed1ff0a0f9bdf231d54a00c9e88
Binary file not shown.
Binary file added objects/37/239ef2f5240f9859c72a0b23faa6ec561c6b6f
Binary file not shown.
Binary file added objects/3a/d78d461b2b332860475cd35c9459fbbf4eab0a
Binary file not shown.
Binary file added objects/47/872c0f2e1188acc8a0e02eb593d305874ccf19
Binary file not shown.
Binary file added objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
Binary file not shown.
Binary file added objects/4b/b001d03dda42d886c9d49faf0c8c8756585655
Binary file not shown.
Binary file added objects/4c/47b38c05238e42c18b7919d59d4f671e64b24d
Binary file not shown.
Binary file added objects/4f/b2845126d35a09d5f031965a7f33b37411210f
Binary file not shown.
Binary file added objects/53/5674553e7085138a2a32abd69fb9af1e834dc0
Binary file not shown.
Binary file added objects/59/1df5d6ff8489d26fd7bbb1b6899dca0bf6781f
Binary file not shown.
Binary file added objects/59/e2b75de002fe7b846f5269b35bfe3835abbcbf
Binary file not shown.
Binary file added objects/5b/7eea8d2c4d435b9dfab1ef830e81fa7e4f3fa5
Binary file not shown.
Binary file added objects/5d/1853730f26e5c3fcd64c198986f8725b07a990
Binary file not shown.
4 changes: 4 additions & 0 deletions objects/5e/0fdf65570512fa18c571bacb6e693b855c78ad
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
x�X�o�8�g��٬��>$��ݖpj����UI{�'d�_M����q�@(p���n��b�7��f`$�4��~j���;��=��������M���B�a׼hz���%W<�� �8�̔J/Y�Vު�%ٔ�d��ID�H�E*rڕ�;ׅ���锁��ƀ���wX�3F# ���,��E0ZßtI�d 'K�I45�ܫ�?�.TA��ބZ�ڸh6���P��Ό%ŕ`����#��E̲Қ3E!�s�;�r`�Ċ��w��[�����K��2&|G��`rƘr@�ST�"c)�el�;�G� /��󝁖��=�(�ָ�㌧��N���:m�
��O�D$c�c�i[ק�ON>r�,Ü�*[�������N�\T��4Óy��\?X�lL����BH�ḅwq�y�����60s �t$0I��u��`�%+�2�E4�Z���� «��_ ��Cp�t}�P�59C0TJ�q�t��(���fC�/
��d2�^>��-A�H�cڗ|�tz%j7¦�b� Ϥ�s훪���n��e�k�w��~SA[��BR:~�k���|N���o�Ӿ7��Dp ~utZ��d��樨2����l媌1�0��]me����zb�+�s+����H��yM����0%�Fޖ�ϘH]�7��+.K*�B��0eRʵ\�0t:f��5��������^Ɩp�ރ�t����xe��ƭWMc�s빮_�#��`ύP4�2�S�_2��%��&�/�;,$�'{�Q���P!���p[��p�s�d�ݳ��������4)3��
k�~��VS������Lt���N�x|�i�ONV�d��x� N�U���!���ѐ3B�|�i�;�`B2K�� �I�6r{th � ����i��FV`��zA�0�i�֭�t!lO�`k��bN���L�Պ�����dz����q}Ѱ��QD�"�GgqsQ\ջ�[���(���G�����Z�B��"�O;����P3�� ��{��O1��lj��T�%S�S�i)��)�䘍���s'��G���c�p��[{�"ZW\x��M�U�����M�ʩB���1�g�>Lե�>쏱���CEE�|�|��Zt��<t������u�����5�D�d��_L��$d^��&�;�E����O\F�m���_A��߆���U�(9�C��Δ�Pde�A�|������?��������!���_�����ߚ�v�
Expand Down
Binary file added objects/5f/ffad5a686178c952104523b7bee707a99b4d04
Binary file not shown.
Binary file not shown.
Binary file added objects/64/67a8eb11605d54d815d8742c673ae8bce2510c
Binary file not shown.
1 change: 1 addition & 0 deletions objects/68/2ddd3943a06d3f6ff92ca9e81328dd094acae0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x��MN�0@a�9�쑪Ɍ�8BT��nz����H�\G�� �z��Z 8�{#~����<=?�c�@���) ꄜ0G�{��7N-7��N��WO�”)�^e�����;�P�Y�hۡ��W��9Ay/�ty���S9C9���Y��n4���݋L�Wi���Ӷ��kd���M��O�j���i�9��� ���~�Y��V(pm
Expand Down
Binary file added objects/6a/2605aaaf6deeb9f0aeff5ba1ac61bf8f64c566
Binary file not shown.
1 change: 1 addition & 0 deletions objects/6b/683bd8a611204a0e8db075298c442f2bfa99ba
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x�T�o�0�s����� i�v- m$Z'�i�PM{��Vc:l�濟A R�Ѿ ��}��y���C��w6��_�1�Fw�=|�|�X���)E����v\�J&d��B0N�xJ��J=_S�^����]�K�������h'*!A�;�,��zƖ�� ���OPD�,�����)L`��?lŒ"��+,��׾��ߗ�?�>�+��������\�0�#�;�q�Q109-�[e+���P(�m��@ܜ|��E��u-e�D�J=^�p*S�/�Cș�(=ڔz^-/X�>It�A�r�?4<OP"��T�2ET�ΰ���$�������j�哹!-�֢H6����X>Y��tc��$٪Ed"�3��!����OO�v�X�� 逦s���� 8���A�~��!A��( <�U^�2��b��]UU~@���;�?ɤ��o �rN���PX��}x�x��gQ�9I{��k�FB`l��t��q\2l��]��2O�0�ڵ���m��!w�C)�������Y��~�������׻H�7D}��=m��
Expand Down
Binary file added objects/75/569adbdd8c30271adb87a306c796ccc1ea5fff
Binary file not shown.
Binary file added objects/79/c58c5a1a4056d1b7e9caf1dbea1c89465c0fcc
Binary file not shown.
Binary file added objects/7e/52429665c66b01b70a3bf6688e11b08fba0090
Binary file not shown.
Binary file added objects/82/8f1cb23e3208976f2067bd21161e07ffe984ce
Binary file not shown.
Binary file added objects/82/e3d3d670ac200610d6a161d06a4d8d35c079af
Binary file not shown.
Binary file added objects/88/8661dba991633ad01ec56d6c49db6299705ea1
Binary file not shown.
1 change: 1 addition & 0 deletions objects/8a/1baec4ee6c136f7b0989f54540d5b67da71a48
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x����0��+�@�lAw�\��DAm�=n���&��14S<ͼ�e���ae;�YϨj�.2LLpa�?�p�as>\N[ccy����W��x'�m�º�<07�/��I˔�"�0�>�`���B)��\��� Z/���F�3 �.'G9K�MR�+� ڷ�O�ؙ7�:A
Binary file added objects/8b/137891791fe96927ad78e64b0aad7bded08bdc
Binary file not shown.
Binary file added objects/8c/d8d58841728376773cc0d45f3258325ceedf8b
Binary file not shown.
Binary file added objects/8d/9c02ea6fb05f1cb9f792dece58b373fe9d9662
Binary file not shown.
Binary file added objects/8d/c1618c7881e4eca8d293b0a34508f45542825f
Binary file not shown.
Binary file added objects/91/74500140abb5b2f28b7dfd07561b001ee21c1c
Binary file not shown.
Binary file added objects/99/b9893c46ea56e957dc5d46f48ae61219dd701b
Binary file not shown.
Binary file added objects/9a/3547db180348562569b6b8ed7d497b82b5fd07
Binary file not shown.
Binary file added objects/9b/31df0bda7f10922a5b96250c3dde8df0dac70d
Binary file not shown.
Binary file added objects/a4/9bc19dd03a0f9bcc5f5a1e6b0ea09c416ad4f3
Binary file not shown.
Binary file added objects/a5/06dd3ea15388adad710025216712a57b2dc114
Binary file not shown.
Binary file added objects/a8/db3442c376415ddf591a108e7902f3206f7713
Binary file not shown.
Binary file added objects/ac/a287e2931fbbe99f494685cbddf1042f807683
Binary file not shown.
Binary file added objects/ad/e917b5eacabd770322b0c4db476f97ac0257d2
Binary file not shown.
Binary file added objects/b1/498b4007b0e35a96598ccd23f1af2a94120a3e
Binary file not shown.
Binary file added objects/b6/63b847be2524d8a3292eec29330e66b06f63bf
Binary file not shown.
Binary file added objects/b6/9fa313d6b67464cee7db7dca9e6be19f72932b
Binary file not shown.
Binary file not shown.
Binary file added objects/c6/f8a10b65aab0fa4c097e77cc98d1bee4764c44
Binary file not shown.
Binary file added objects/c7/99f5703780f9370313ca50de1b506838968bd5
Binary file not shown.
2 changes: 2 additions & 0 deletions objects/cc/64e410dc7ff16c9c401939d1ce75f5be4b0dcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x��MN�0@a�9��+!��Hѣ�㱈H��8R�C���誕
gpoD� ,��ӣ<�c���Z�!i6!�h�jɆ!Y�� i�PpB���^*8�R�=�R���$��!JD�,lJ<8E���>���]���~}k�v����v��}�#<�q��X�~���/�#�R�Z�������o��?�m����V�<M!_sy��L�����s!
Binary file not shown.
Binary file added objects/d2/8ebb1df7581f54a2b970199533329a014ee536
Binary file not shown.
Binary file added objects/db/44ec7bbeba1a26719ba6ce42c8048734a2d13c
Binary file not shown.
Binary file added objects/db/77a536ab587d22bb9cc1f20400118dfb0d63ef
Binary file not shown.
Binary file added objects/dc/8f1cd4fb192618fafe519158e2fff81d47033c
Binary file not shown.
Binary file added objects/de/cde6f80bc184fc8997ab617486a227300e8913
Binary file not shown.
Binary file not shown.
Binary file added objects/e2/8c9da82acdc8851b4deb4fab45a7da911ec76c
Binary file not shown.
Binary file added objects/e4/8bad74d2f996b90c1e8e3c67e6025b6b0208e1
Binary file not shown.
Binary file added objects/e4/b084efd0545bc2a3640a37d3cb9f2799bc616c
Binary file not shown.
Binary file added objects/e7/0cb5e90e80a5090fe934e98725322116fd9112
Binary file not shown.
Binary file added objects/e8/1bb42b8f48879c5884782121c47f2fbb5448f2
Binary file not shown.
Binary file added objects/f1/c5e0c8e4447ec10663fc3e060ce3d198f242ce
Binary file not shown.
Binary file added objects/f3/19b00b829bff39b6235eb39938626d17a79aab
Binary file not shown.
Binary file added objects/f4/71940fde2f39ef8943a6af9569bcf986b1579b
Binary file not shown.
Binary file added objects/f4/a1e72eef10b95f86ab82fa4ef356f14646e92c
Binary file not shown.
1 change: 1 addition & 0 deletions objects/f5/e6bfdd7c75eb21c7b9f721ac6ccc54f10ef151
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x+)JMU07e040031Q�K�,�L��/Je�^w�]�p~5g�WW���j�Ky@U�:�����0D׽���u���k��f��_u��K��d
Binary file added objects/f6/eac85f1efead1696a6036c6773be4a5b9c2966
Binary file not shown.
Binary file added objects/ff/29ddc3e420eb97c3cd185b11d122510d227fc2
Binary file not shown.
1 change: 1 addition & 0 deletions refs/heads/master
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9174500140abb5b2f28b7dfd07561b001ee21c1c
1 change: 1 addition & 0 deletions refs/remotes/origin/HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ref: refs/remotes/origin/master
4 changes: 4 additions & 0 deletions src/CallListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

public class CallListener {

}
88 changes: 88 additions & 0 deletions src/CallListenerThread
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

import java.io.IOException;
import java.net.SocketAddress;
import java.util.Observable;
import java.util.concurrent.TimeUnit;

public class CallListenerThread extends Observable implements Runnable {
private CallListener callListener;
private Caller.CallStatus callStatus;
private Connection connection;
private volatile boolean isOpen;

public CallListenerThread() throws IOException {
callListener = new CallListener();
}

public CallListenerThread(String localNick) throws IOException {
callListener = new CallListener(localNick);
}

public CallListenerThread(String localNick, String localIp) throws IOException {
callListener = new CallListener(localNick, localIp);
}

public Caller.CallStatus getCallStatus() {
return callStatus;
}

public SocketAddress getListenAddress() throws IOException {
return callListener.getListenAddress();
}

public String getLocalNick() {
return callListener.getLocalNick();
}

public SocketAddress getRemoteAddress() throws IOException {
return callListener.getRemoteAddress();
}

public Connection getConnection() {
return connection;
}


public boolean isBusy() {
return callListener.isBusy();
}

@Override
public void run() {
while (true) {
try {
connection = callListener.getConnection();
if (connection == null) {
callStatus = Caller.CallStatus.valueOf("BUSY");
} else {
callStatus = Caller.CallStatus.valueOf("OK");
}
} catch (IOException e) {
System.out.println("SmthWrong");
}
setChanged();
notifyObservers();
}

}

public void setBusy(boolean busy) {
callListener.setBusy(busy);
}


public void setLocalNick(String localNick) {
callListener.setLocalNick(localNick);
}

public void start() {
this.isOpen = true;
Thread t = new Thread(this);
t.start();
};

public void stop() {
this.isOpen = false;
}

}
89 changes: 89 additions & 0 deletions src/CallListenerThread.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@

import java.io.IOException;
import java.net.SocketAddress;
import java.util.Observable;
import java.util.concurrent.TimeUnit;

public class CallListenerThread extends Observable implements Runnable {
private CallListener callListener;
private Caller.CallStatus callStatus;
private Connection connection;
private volatile boolean isOpen;
// TODO: Add lastEvent;

public CallListenerThread() throws IOException {
callListener = new CallListener();
}

public CallListenerThread(String localNick) throws IOException {
callListener = new CallListener(localNick);
}

public CallListenerThread(String localNick, String localIp) throws IOException {
callListener = new CallListener(localNick, localIp);
}

public Caller.CallStatus getCallStatus() {
return callStatus;
}

public SocketAddress getListenAddress() throws IOException {
return callListener.getListenAddress();
}

public String getLocalNick() {
return callListener.getLocalNick();
}

public SocketAddress getRemoteAddress() throws IOException {
return callListener.getRemoteAddress();
}

public Connection getConnection() {
return connection;
}


public boolean isBusy() {
return callListener.isBusy();
}

@Override
public void run() {
while (true) {
try {
connection = callListener.getConnection();
if (connection == null) {
callStatus = Caller.CallStatus.valueOf("BUSY");
} else {
callStatus = Caller.CallStatus.valueOf("OK");
}
} catch (IOException e) {
System.out.println("SmthWrong");
}
setChanged();
notifyObservers();
}

}

public void setBusy(boolean busy) {
callListener.setBusy(busy);
}


public void setLocalNick(String localNick) {
callListener.setLocalNick(localNick);
}

public void start() {
this.isOpen = true;
Thread t = new Thread(this);
t.start();
};

public void stop() {
this.isOpen = false;
}

}
41 changes: 41 additions & 0 deletions src/Caller.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import java.net.InetAddress;
import java.net.Socket;
import java.net.SocketAddress;
import java.net.UnknownHostException;

public class Caller {
private final int port = 28411;
private String ip;

private String localNick;
private SocketAddress remoteAddress;

private String remoteNick;
private CallStatus status;

public Caller(){
this.localNick = "unnamed";
this.remoteAddress = getRemoteAddress();
}
public String getLocalNick(){
return localNick;
}
private SocketAddress getRemoteAddress() {
// TODO Auto-generated method stub
return remoteAddress;
}
public Caller(String localNick,SocketAddress remoteAddress){
this.localNick = localNick;
this.remoteAddress = remoteAddress;
}
public Caller(String localNick,String ip){
this.localNick = localNick;
this.ip = ip;
}

public Connection call() throws Exception{
Connection connection = new Connection(new Socket(InetAddress.getByName(ip),port));
return connection;

}
}
22 changes: 22 additions & 0 deletions src/Command.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Created by user on 03.11.2015.
*/
public class Command {
CommandType commandType;

static enum CommandType{
ACCEPT , DISCONNECT , MESSAGE , NICK , REJECT;


}

public Command(CommandType commandType) {
this.commandType = commandType;
}

public String toString() {
return commandType.toString();
}

}

34 changes: 34 additions & 0 deletions src/CommandListenerThread.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import java.io.IOException;
import java.util.Observable;

public class CommandListenerThread extends Observable implements Runnable {
private Connection connection;
private Command lastCommand;
private boolean falseConnection;

public CommandListenerThread(Connection conection) {
this.connection = cnonnection;
private Command lastCommand;
}

public CommandListenerThread(Connection connection) {
this.connection = connection;
this.lastCommand = new Command();
}

public void setFalseConnection(boolean falseConnection) {
this.falseConnection = falseConnection;
}

public Command getlastCommand() {
return this.lastCommand;
}

public void start() {
this.falseConnection = false;
Thread thr = Thread(this);
thr.start();
}
public void stop(){
falseConnection = true;
}
44 changes: 44 additions & 0 deletions src/Connection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.Socket;
import java.util.Scanner;


public class Connection {
private PrintWriter printer;
private Scanner scanner;
private Socket socket;

public Connection(Socket socket) throws UnsupportedEncodingException, IOException{
this.socket = socket;
this.printer = new PrintWriter(
new OutputStreamWriter(socket.getOutputStream(), "UTF-8"));
this.scanner = new Scanner(socket.getInputStream());
}

public Command receive(){
return new Command(Command.commandType.valueOf(this.scanner.nextLine()));

}
// <HelloMsg> format : ChatApp 2015 user <nick> (busy)
public void sendNickHello(String ver, String nick){
StringBuilder str = new StringBuilder();
str.append(ver + " user " + nick + "\n");
printer.print(str.toString());
printer.flush();
}
public void sendNickBusy(String ver, String nick){
StringBuilder str = new StringBuilder();
str.append(ver + " user " + nick + " busy" + "\n");
printer.print(str.toString());
printer.flush();
}
public void send(String message){
printer.print("Message");
printer.flush();
printer.print(message);
printer.flush();
}
}
5 changes: 5 additions & 0 deletions src/Const.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

public class Const {
public static final String VER = "ChatApp 2015";
public static final String NICK = "unnamed";
}
Loading