家园建筑gm,修改1

back_recharge
duhui 2022-01-10 18:21:28 +08:00
parent f0a19957b2
commit 6f35e726a0
1 changed files with 13 additions and 4 deletions

View File

@ -2,7 +2,12 @@ package com.ljsd.jieling.kefu;
import com.ljsd.jieling.logic.dao.ArchitectureInfo;
import com.ljsd.jieling.logic.dao.root.User;
import config.SHomeLandLevel;
import manager.STableManager;
import util.TimeUtils;
import java.util.Map;
/**
* @Author hj
* @Date 2021/10/28 17:11:17
@ -12,13 +17,17 @@ import util.TimeUtils;
public class Cmd_homelevel extends GmRoleAbstract{
@Override
public boolean exec(String[] args) throws Exception {
if (args.length >= 2){
if (args.length >= 1){
User user = getUser();
int id = Integer.parseInt(args[0]);
int level = Integer.parseInt(args[1]);
Map<Integer, SHomeLandLevel> config = STableManager.getConfig(SHomeLandLevel.class);
SHomeLandLevel landLevel = config.get(id);
if (landLevel == null){
return false;
}
int time = args.length > 2?Integer.parseInt(args[2]):TimeUtils.nowInt();
ArchitectureInfo info = new ArchitectureInfo(level, time, 0);
user.getPlayerInfoManager().putArchitectureInfo(id,info);
ArchitectureInfo info = new ArchitectureInfo(landLevel.getId(), time, 0);
user.getPlayerInfoManager().putArchitectureInfo(landLevel.getPoolID(),info);
}
return false;
}