Skip to content

Commit

Permalink
Write final report and fix reconnecting when disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
geoje committed Jun 6, 2021
1 parent a9e4f28 commit 9816cf7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
4 changes: 3 additions & 1 deletion Client/Forms/ControlChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

namespace Client.Forms
Expand Down Expand Up @@ -117,6 +116,9 @@ public ControlChat(Chat chat, bool continuous)
lblTime.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
lblTime.Left = Math.Min(dataControl.Left, Width - Padding.Right - lblTime.Width);
}

// μ±„νŒ… ν•˜λ‚˜ν•˜λ‚˜κ°€ 뢄리 되게 보일수 μžˆλŠ” μ½”λ“œ
//BackColor = Color.FromArgb(new Random(DateTime.Now.Millisecond).Next());
}

public void SetContinuous()
Expand Down
4 changes: 2 additions & 2 deletions Client/Panels/PanelRegister.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ void ReceiveChat(Packet p)
{
if ((p as RegisterPacket).success)
{
MetroMessageBox.Show(this, "성곡", "νšŒμ›κ°€μž…", MessageBoxButtons.OK, MessageBoxIcon.Information);
MetroMessageBox.Show(this, "성곡", "사원 등둝", MessageBoxButtons.OK, MessageBoxIcon.Information);
Swipe(false);
}
else
MetroMessageBox.Show(this, "μ‹€νŒ¨", "νšŒμ›κ°€μž…", MessageBoxButtons.OK, MessageBoxIcon.Error);
MetroMessageBox.Show(this, "μ‹€νŒ¨", "사원 등둝", MessageBoxButtons.OK, MessageBoxIcon.Error);
}));
}
}
Expand Down
17 changes: 8 additions & 9 deletions Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void Main()
static void Recieve()
{
byte[] readBuffer = null, lengthBuffer = new byte[4];
while (true)
while (client.Connected)
{
// νŒ¨ν‚· 읽기
try
Expand Down Expand Up @@ -88,12 +88,7 @@ static void Recieve()

// νŒ¨ν‚· λ°›λŠ” 도쀑 μ˜ˆμ™Έκ°€ λ°œμƒν–ˆμ„ λ•Œ
// μ„œλ²„μ™€ 연결이 μ’…λ£Œλ˜μ—ˆλ‹€λ©΄ μž¬μ‹œμž‘ ν›„ 접속 μ‹œλ„
if (!client.Connected)
{
Application.Exit();
Process.Start(Application.ExecutablePath);
return;
}
break;
}

// νŒ¨ν‚· λ²ˆμ—­
Expand All @@ -108,8 +103,9 @@ static void Recieve()
MessageBox.Show(formMain, ex.ToString(), "Deserialize",
MessageBoxButtons.OK, MessageBoxIcon.Error)));

// μˆ˜μ‹  버퍼 리셋
while (ns.ReadByte() != -1) ;
// νŒ¨ν‚· λ°›λŠ” 도쀑 μ˜ˆμ™Έκ°€ λ°œμƒν–ˆμ„ λ•Œ
// μ„œλ²„μ™€ 연결이 μ’…λ£Œλ˜μ—ˆλ‹€λ©΄ μž¬μ‹œμž‘ ν›„ 접속 μ‹œλ„
break;
}
if (pakcetObj == null) continue;

Expand All @@ -119,6 +115,9 @@ static void Recieve()
if (callback.ContainsKey(packet.type))
callback[packet.type].Invoke(packet);
}

Application.Exit();
Process.Start(Application.ExecutablePath);
}
public static void Send(Packet packet)
{
Expand Down
Binary file modified Document/OSS_Team5_Project_Final.pptx
Binary file not shown.
Binary file added Document/free-powerpoint-ppt-template-1012.pptx
Binary file not shown.

0 comments on commit 9816cf7

Please sign in to comment.