Skip to content

Commit

Permalink
Merge pull request #43 from KU-Malang/feat/#42
Browse files Browse the repository at this point in the history
feat : 4번 응답 userList로 변경
  • Loading branch information
minseok1015 authored Dec 6, 2024
2 parents 8e2095a + 2c7a197 commit 921a96e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/server/handler/JoinRoomHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package server.handler;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.io.PrintWriter;
import server.manager.RoomManager;
Expand Down Expand Up @@ -69,9 +70,10 @@ public void handleRequest(JsonObject request, PrintWriter writer) {

// 방 입장 성공
JsonObject data = new JsonObject();
data.addProperty("roomId", room.getRoomId());
data.addProperty("currentPlayers", room.getCurrentPlayers());
data.addProperty("maxPlayers", room.getMaxPlayers());
data.addProperty("roomName", room.getRoomName());

JsonArray userList= room.getUserNicknameList();
data.add("userList", userList);

JsonObject successResponse = new ResponseBuilder(4, "success", "방 입장 성공")
.withData(data)
Expand Down

0 comments on commit 921a96e

Please sign in to comment.