Skip to content

Commit bdb503f

Browse files
committed
fast game start
1 parent 3962936 commit bdb503f

File tree

9 files changed

+23
-2
lines changed

9 files changed

+23
-2
lines changed

.vs/Server/v15/.suo

-1 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
8.05 KB
Binary file not shown.

Server/Script/User/User.cs

+23-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,17 @@ private void ParsePacket(int len)
118118
{
119119
for (int j = 0; j < Server.v_rooms.Count; j++)
120120
if (Server.v_rooms[j].nowUser < Server.v_rooms[j].limitUser)
121-
SendMsg(string.Format("FOUND_ROOM:{0}:{1}:{2}:{3}:{4}",
122-
Server.v_rooms[j].roomIdx, Server.v_rooms[j].roomName, Server.v_rooms[j].roomPW, Server.v_rooms[j].nowUser, Server.v_rooms[j].limitUser));
121+
SendMsg(string.Format("FOUND_ROOM:{0}:{1}:{2}:{3}:{4}", Server.v_rooms[j].roomIdx, Server.v_rooms[j].roomName, Server.v_rooms[j].roomPW, Server.v_rooms[j].nowUser, Server.v_rooms[j].limitUser));
122+
}
123+
else if (txt[0].Equals("FAST_ROOM"))
124+
{
125+
for (int j = 0; j < Server.v_rooms.Count; j++)
126+
if (Server.v_rooms[j].nowUser < Server.v_rooms[j].limitUser && Server.v_rooms[j].roomPW.Equals(""))
127+
{
128+
IntoRoom(Server.v_rooms[j].roomIdx.ToString());
129+
break;
130+
}
131+
123132
}
124133
else if (txt[0].Equals("ROOM_EXIT"))
125134
{
@@ -176,6 +185,18 @@ private void ParsePacket(int len)
176185
{
177186
IntoRoom(txt[1]);
178187
}
188+
else if (txt[0].Equals("GAME_START"))
189+
{
190+
Console.WriteLine("GAME START : " + roomIdx);
191+
for (int i = 0; i < Server.v_user.Count; i++)
192+
{
193+
if (Server.v_user[i].roomIdx.Equals(roomIdx))
194+
{
195+
Server.v_user[i].SendMsg("GAME_START");
196+
Console.WriteLine("SEND GAME START : " + Server.v_user[i].nickName);
197+
}
198+
}
199+
}
179200
else if (txt[0].Equals("CREATE_ROOM"))
180201
{
181202
//Logout();

Server/bin/Debug/Server.exe

512 Bytes
Binary file not shown.

Server/bin/Debug/Server.pdb

0 Bytes
Binary file not shown.

Server/obj/Debug/Server.exe

512 Bytes
Binary file not shown.

Server/obj/Debug/Server.pdb

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)