Commit 9a0a15a4 authored by HotaruYS's avatar HotaruYS Committed by GitHub
Browse files

Merge branch 'development' into patch-3

parents beea95fd 5d1f4957
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.TowerLevelStarCondDataOuterClass.TowerLevelStarCondData;
import emu.grasscutter.net.proto.TowerLevelStarCondNotifyOuterClass.TowerLevelStarCondNotify;
public class PacketTowerLevelStarCondNotify extends BasePacket {
public PacketTowerLevelStarCondNotify(int floorId, int levelIndex) {
super(PacketOpcodes.TowerLevelStarCondNotify);
TowerLevelStarCondNotify proto = TowerLevelStarCondNotify.newBuilder()
.setFloorId(floorId)
.setLevelIndex(levelIndex)
.addCondDataList(TowerLevelStarCondData.newBuilder()
.setCondValue(1)
.build()
)
.addCondDataList(TowerLevelStarCondData.newBuilder()
.setCondValue(2)
.build()
)
.addCondDataList(TowerLevelStarCondData.newBuilder()
.setCondValue(3)
.build()
)
.build();
this.setData(proto);
}
}
package emu.grasscutter.task;
import org.quartz.JobDataMap;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
......
......@@ -67,6 +67,40 @@ public final class TaskMap {
return this;
}
public boolean pauseTask(String taskName) {
try {
Scheduler scheduler = schedulerFactory.getScheduler();
scheduler.pauseJob(new JobKey(taskName));
} catch (SchedulerException e) {
e.printStackTrace();
return false;
}
return true;
}
public boolean resumeTask(String taskName) {
try {
Scheduler scheduler = schedulerFactory.getScheduler();
scheduler.resumeJob(new JobKey(taskName));
} catch (SchedulerException e) {
e.printStackTrace();
return false;
}
return true;
}
public boolean cancelTask(String taskName) {
Task task = this.annotations.get(taskName);
if (task == null) return false;
try {
this.unregisterTask(this.tasks.get(taskName));
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
public TaskMap registerTask(String taskName, TaskHandler task) {
Task annotation = task.getClass().getAnnotation(Task.class);
this.annotations.put(taskName, annotation);
......@@ -116,7 +150,7 @@ public final class TaskMap {
classes.forEach(annotated -> {
try {
Task taskData = annotated.getAnnotation(Task.class);
Object object = annotated.newInstance();
Object object = annotated.getDeclaredConstructor().newInstance();
if (object instanceof TaskHandler) {
this.registerTask(taskData.taskName(), (TaskHandler) object);
if (taskData.executeImmediatelyAfterReset()) {
......
package emu.grasscutter.utils;
import java.util.Date;
import java.util.Calendar;
import java.util.Date;
public final class DateHelper {
public static Date onlyYearMonthDay(Date now) {
......@@ -13,4 +13,8 @@ public final class DateHelper {
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}
public static int getUnixTime(Date localDateTime){
return (int)(localDateTime.getTime() / 1000L);
}
}
......@@ -312,6 +312,9 @@
"success": "Teleported %s to %s, %s, %s in scene %s",
"description": "Change the player's position."
},
"tower": {
"unlock_done": "Abyss Corridor's Floors are all unlocked now."
},
"weather": {
"usage": "Usage: weather <weatherId> [climateId]",
"success": "Changed weather to %s with climate %s",
......
......@@ -95,17 +95,20 @@
"create": "已建立账号,UID 为 %s 。",
"delete": "账号已刪除。",
"no_account": "账号不存在。",
"command_usage": "用法:account <create|delete> <username> [uid]"
"command_usage": "用法:account <create|delete> <username> [uid]",
"description": "创建或删除账号。"
},
"broadcast": {
"command_usage": "用法:broadcast <消息>",
"message_sent": "公告已发送。"
"message_sent": "公告已发送。",
"description": "向所有玩家发送公告。"
},
"changescene": {
"usage": "用法:changescene <scene id>",
"already_in_scene": "你已经在这个秘境中了。",
"success": "已切换至秘境 %s.",
"exists_error": "此秘境不存在。"
"exists_error": "此秘境不存在。",
"description": "切换指定秘境。"
},
"clear": {
"command_usage": "用法: clear <all|wp|art|mat>",
......@@ -115,35 +118,41 @@
"furniture": "已将 %s 的尘歌壶家具清空。",
"displays": "已清除 %s 的显示。",
"virtuals": "已将 %s 的所有货币和经验值清空。",
"everything": "已将 %s 的所有物品清空。"
"everything": "已将 %s 的所有物品清空。",
"description": "从您的背包中删除所有未装备且已解锁的物品,包括稀有物品。"
},
"coop": {
"usage": "用法:coop <playerId> <target playerId>",
"success": "已强制召唤 %s 到 %s的世界"
"success": "已强制召唤 %s 到 %s的世界",
"description": "强制召唤指定用户到他人的世界。"
},
"enter_dungeon": {
"usage": "用法:enterdungeon <dungeon id>",
"changed": "已进入秘境 %s",
"not_found_error": "此秘境不存在。",
"in_dungeon_error": "你已经在秘境中了。"
"in_dungeon_error": "你已经在秘境中了。",
"description": "进入指定秘境。"
},
"giveAll": {
"usage": "用法:giveall [player] [amount]",
"started": "正在给予全部物品...",
"success": "已给予全部物品。",
"invalid_amount_or_playerId": "无效的数量/玩家ID。"
"invalid_amount_or_playerId": "无效的数量/玩家ID。",
"description": "给予所有物品。"
},
"giveArtifact": {
"usage": "用法:giveart|gart [player] <artifactId> <mainPropId> [<appendPropId>[,<times>]]... [level]",
"id_error": "无效的圣遗物ID。",
"success": "已将 %s 给予 %s。"
"success": "已将 %s 给予 %s。",
"description": "给予指定圣遗物。"
},
"giveChar": {
"usage": "用法:givechar <player> <itemId|itemName> [amount]",
"given": "给予角色 %s 等级 %s 向UID %s.",
"invalid_avatar_id": "无效的角色ID。",
"invalid_avatar_level": "无效的角色等級。.",
"invalid_avatar_or_player_id": "无效的角色ID/玩家ID。"
"invalid_avatar_or_player_id": "无效的角色ID/玩家ID。",
"description": "给予指定角色。"
},
"give": {
"usage": "用法:give <player> <itemId|itemName> [amount] [level] [refinement]",
......@@ -151,29 +160,36 @@
"refinement_must_between_1_and_5": "精炼等阶必须在 1 到 5 之间。",
"given": "已将 %s 个 %s 给予 %s。",
"given_with_level_and_refinement": "已将 %s [等級%s, 精炼%s] %s个给予 %s",
"given_level": "已将 %s 等级 %s %s 个给予UID %s"
"given_level": "已将 %s 等级 %s %s 个给予UID %s",
"description": "给予指定物品。"
},
"godmode": {
"success": "上帝模式已被设置为 %s 。 [用户:%s]"
"success": "上帝模式已被设置为 %s 。 [用户:%s]",
"description": "防止你受到伤害。"
},
"heal": {
"success": "所有角色已被治疗。"
"success": "所有角色已被治疗。",
"description": "治疗所选队伍的角色。"
},
"kick": {
"player_kick_player": "玩家 [%s:%s] 已将 [%s:%s] 踢出",
"server_kick_player": "正在踢出玩家 [%s:%s]"
"server_kick_player": "正在踢出玩家 [%s:%s]",
"description": "从服务器内踢出指定玩家。"
},
"kill": {
"usage": "用法:killall [playerUid] [sceneId]",
"scene_not_found_in_player_world": "未在玩家世界中找到此场景",
"kill_monsters_in_scene": "已杀死 %s 个怪物。 [场景ID: %s]"
"kill_monsters_in_scene": "已杀死 %s 个怪物。 [场景ID: %s]",
"description": "杀死所有怪物"
},
"killCharacter": {
"usage": "用法:/killcharacter [playerId]",
"success": "已杀死 %s 目前使用的角色。"
"success": "已杀死 %s 目前使用的角色。",
"description": "杀死目前使用的角色"
},
"list": {
"success": "目前在线人数:%s"
"success": "目前在线人数:%s",
"description": "查看所有玩家"
},
"permission": {
"usage": "用法:permission <add|remove> <username> <permission>",
......@@ -181,21 +197,26 @@
"has_error": "此玩家已拥有此权限!",
"remove": "权限已移除。",
"not_have_error": "此玩家未拥有权限!",
"account_error": "账号不存在!"
"account_error": "账号不存在!",
"description": "给予或移除指定玩家的权限。"
},
"position": {
"success": "坐标:%.3f, %.3f, %.3f\n场景ID:%d"
"success": "坐标:%.3f, %.3f, %.3f\n场景ID:%d",
"description": "获取所在位置。"
},
"reload": {
"reload_start": "正在重载配置文件和数据。",
"reload_done": "重载完毕。"
"reload_done": "重载完毕。",
"description": "重载配置文件和数据。"
},
"resetConst": {
"reset_all": "重置所有角色的命座。",
"success": "已重置 %s 的命座,重新登录后将会生效。"
"success": "已重置 %s 的命座,重新登录后将会生效。",
"description": "重置当前角色的命之座,执行命令后需重新登录以生效。"
},
"resetShopLimit": {
"usage": "用法:/resetshop <player id>"
"usage": "用法:/resetshop <player id>",
"description": "重置所选玩家的商店刷新时间。"
},
"sendMail": {
"usage": "用法:give [player] <itemId|itemName> [amount]",
......@@ -217,17 +238,20 @@
"message": "<正文>",
"sender": "<发件人>",
"arguments": "<itemId|itemName|finish> [数量] [等级]",
"error": "错误:无效的编写阶段 %s。需要 StackTrace 请查看服务器控制台。"
"error": "错误:无效的编写阶段 %s。需要 StackTrace 请查看服务器控制台。",
"description": "向指定用户发送邮件。 此命令的用法可根据附加的参数而变化。"
},
"sendMessage": {
"usage": "用法:sendmessage <player> <message>",
"success": "消息已发送。"
"success": "消息已发送。",
"description": "向指定玩家发送消息"
},
"setFetterLevel": {
"usage": "用法:setfetterlevel <level>",
"range_error": "好感度等级必须在 0 到 10 之间。",
"fetter_set_level": "好感度已设置为 %s 级",
"level_error": "无效的好感度等级。"
"level_error": "无效的好感度等级。",
"description": "设置当前角色的好感度等级。"
},
"setStats": {
"usage_console": "用法:setstats|stats @<UID> <stat> <value>",
......@@ -238,20 +262,24 @@
"player_error": "玩家不存在或已离线。",
"set_self": "%s 已经设置为 %s。",
"set_for_uid": "%s 的使用者 %s 更改为 %s。",
"set_max_hp": "最大生命值更改为 %s。"
"set_max_hp": "最大生命值更改为 %s。",
"description": "设置当前角色的属性。"
},
"setWorldLevel": {
"usage": "用法:setworldlevel <level>",
"value_error": "世界等级必须设置在0-8之间。",
"success": "已将世界等级设为%s。",
"invalid_world_level": "无效的世界等级。"
"invalid_world_level": "无效的世界等级。",
"description": "设置世界等级,执行命令后需重新登录以生效。"
},
"spawn": {
"usage": "用法:spawn <entityId> [amount] [level(仅限怪物]",
"success": "已生成 %s 个 %s。"
"success": "已生成 %s 个 %s。",
"description": "在你附近生成一个生物。"
},
"stop": {
"success": "正在关闭服务器..."
"success": "正在关闭服务器...",
"description": "停止服务器"
},
"talent": {
"usage_1": "设置天赋等级:/talent set <talentID> <value>",
......@@ -267,32 +295,41 @@
"invalid_level": "无效的天赋等级。",
"normal_attack_id": "普通攻击的 ID 为 %s。",
"e_skill_id": "元素战技ID %s。",
"q_skill_id": "元素爆发ID %s。"
"q_skill_id": "元素爆发ID %s。",
"description": "设置当前角色的天赋等级。"
},
"teleportAll": {
"success": "已将全部玩家传送到你的位置",
"error": "命令仅限处于多人游戏状态下使用。"
"error": "命令仅限处于多人游戏状态下使用。",
"description": "将你世界中的所有玩家传送到你所在的位置。"
},
"teleport": {
"usage_server": "用法:/tp @<player id> <x> <y> <z> [scene id]",
"usage": "用法:/tp [@<player id>] <x> <y> <z> [scene id]",
"specify_player_id": "你必须指定一个玩家ID。",
"invalid_position": "无效的位置。",
"success": "传送 %s 到坐标 %s,%s,%s,场景为 %s"
"success": "传送 %s 到坐标 %s,%s,%s,场景为 %s",
"description": "改变指定玩家的位置。"
},
"weather": {
"usage": "用法:weather <weatherId> [climateId]",
"success": "已将当前天气设定为 %s,气候为 %s。",
"invalid_id": "无效的天气ID。"
"invalid_id": "无效的天气ID。",
"description": "改变天气"
},
"drop": {
"command_usage": "用法:drop <itemId|itemName> [amount]",
"success": "已将 %s x %s 丟在附近。"
"success": "已将 %s x %s 丟在附近。",
"description": "在你附近丢一个物品。"
},
"help": {
"usage": "用法:",
"aliases": "別名:",
"available_commands": "可用指令:"
"available_commands": "可用指令:",
"description": "发送帮助信息或显示指定命令的信息。"
},
"restart": {
"description": "重新启动服务器。"
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment