Skip to content

Commit

Permalink
🔖 v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kyechan99 committed Jul 22, 2017
1 parent 8ce20bd commit f6edddd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Shape-Of-You-Server

Shape of You 서버

### 개발자
- [강예찬](https://github.com/kyechan99)
- [김태양](https://github.com/Lazyevilsquid)

## Shape-Of-You-Client
- [Shape-Of-You-Client](https://github.com/Lazyevilsquid/Shape-Of-You-Client)
19 changes: 11 additions & 8 deletions Script/User/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ void ReadCallBack(IAsyncResult result)
}
catch (Exception ex)
{
short len = 0;
Util.GetShort(userData.buf, 0, out len);
Console.WriteLine(Encoding.UTF8.GetString(userData.buf, 2, len));
Console.WriteLine("SOCKECT DISCONNECT");
//Console.WriteLine(ex.ToString());
Console.WriteLine(ex.ToString());
}
}

Expand Down Expand Up @@ -206,12 +209,12 @@ private void ParsePacket(int len)
timeCount = maxPlayTime;
tmr.Stop();
for (int j = 0; j < Server.v_user.Count; j++)
Server.v_user[j].SendMsg(string.Format("DIE:{0}", myIdx, myIdx));
Server.v_user[j].SendMsg(string.Format("DIE:{0}:{1}", myIdx, myIdx));
}
else
{
for (int j = 0; j < Server.v_user.Count; j++)
Server.v_user[j].SendMsg(string.Format("DIE:{0}", myIdx, myIdx));
Server.v_user[j].SendMsg(string.Format("DIE:{0}:{1}", myIdx, myIdx));
}
}
else if (txt[0].Equals("MOVE"))
Expand Down Expand Up @@ -253,7 +256,7 @@ private void ParsePacket(int len)
{
if (Server.v_user[j] != null)
{
Server.v_user[j].SendMsg(string.Format("DIE:{0}", int.Parse(txt[1]), txt[2]));
Server.v_user[j].SendMsg(string.Format("DIE:{0}:{1}", int.Parse(txt[1]), int.Parse(txt[2])));

if (Server.v_user[j].isLive)
{
Expand Down Expand Up @@ -306,7 +309,7 @@ private void ParsePacket(int len)
}

for (int i = 0; i < Server.v_user.Count; i++)
Server.v_user[i].SendMsg(string.Format("DONE:{0}:{1}", (int)PROPER.THIEF));
Server.v_user[i].SendMsg(string.Format("DONE:{0}:{1}", (int)PROPER.THIEF, mvpIdx));
}
}
else if (txt[0].Equals("ATTACK"))
Expand All @@ -327,7 +330,7 @@ private void ParsePacket(int len)
*/
void Login()
{
if (timeCount < maxPlayTime)
if (timeCount < maxPlayTime && Server.v_user.Count > 9)
{
SendMsg(string.Format("WAIT:{0}", mapNum));
return;
Expand Down Expand Up @@ -418,7 +421,7 @@ static void StartGame()

for (int i = 0; i < Server.v_user.Count; i++)
{
int colorT = Server.rand.Next(0, 8);
int colorT = Server.rand.Next(0, 9);

if (Server.v_user[i] != null)
{
Expand Down Expand Up @@ -488,7 +491,7 @@ static void ChangeColor()
void attack(int idx)
{
for (int j = 0; j < Server.v_user.Count; j++)
if (Server.v_user[j] != null && Server.v_user[j].myIdx != idx)
if (Server.v_user[j] != null)
Server.v_user[j].SendMsg(string.Format("ATTACK:{0}", idx));
}

Expand Down

0 comments on commit f6edddd

Please sign in to comment.