use of com.code.server.constant.club.RoomModel in project summer by foxsugar.
the class CenterMsgService method genRoomRecord.
private static void genRoomRecord(String msg) {
RoomRecord roomRecord = JsonUtil.readValue(msg, RoomRecord.class);
List<com.code.server.constant.game.UserRecord> lists = roomRecord.getRecords();
for (com.code.server.constant.game.UserRecord userRecord : lists) {
UserRecord addRecord = userRecordService.getUserRecordByUserId(userRecord.getUserId());
if (addRecord != null) {
userRecordService.addRecord(userRecord.getUserId(), roomRecord);
} else {
Record record = new Record();
record.addRoomRecord(roomRecord);
UserRecord newRecord = new UserRecord();
newRecord.setId(userRecord.getUserId());
newRecord.setRecord(record);
userRecordService.save(newRecord);
}
}
// 俱乐部战绩
String clubId = roomRecord.getClubId();
if (clubId != null && !"".equals(clubId)) {
Club club = ClubManager.getInstance().getClubById(clubId);
if (club != null) {
String roomModel = roomRecord.getClubRoomModel();
RoomModel rm = GameClubService.getRoomModel(club, roomModel);
roomRecord.setName(rm.getDesc());
}
clubRecordService.addRecord(clubId, roomRecord);
}
}
use of com.code.server.constant.club.RoomModel in project summer by foxsugar.
the class GameClubService method removeRoomModel.
/**
* 删除房间模式
*
* @param msgKey
* @param userId
* @param clubId
* @param roomModelId
* @return
*/
public int removeRoomModel(KafkaMsgKey msgKey, long userId, String clubId, String roomModelId) {
Club club = ClubManager.getInstance().getClubById(clubId);
if (club == null) {
return ErrorCode.CLUB_NO_THIS;
}
if (club.getPresident() != userId) {
return ErrorCode.CLUB_NOT_PRESIDENT;
}
RoomModel roomModel = getRoomModel(club, roomModelId);
if (roomModel != null) {
club.getClubInfo().getRoomModels().remove(roomModel);
}
// todo 退钱
sendMsg(msgKey, new ResponseVo("clubService", "removeRoomModel", "ok"));
return 0;
}
Aggregations