Skip to content

Commit

Permalink
Merge pull request Grasscutters#1 from Akka0/development
Browse files Browse the repository at this point in the history
Updated
  • Loading branch information
Akka0 committed May 6, 2022
2 parents d32d401 + 2dc6a48 commit 7d51e0d
Show file tree
Hide file tree
Showing 29 changed files with 503 additions and 151 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ mongod.exe
/*.sh
language/
languages/
gacha_mappings.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ There is a dummy user named "Server" in every player's friends list that you can
| kick | kick \<player> | server.kick | Both side | Kicks the specified player from the server. (WIP) | k |
| killall | killall [playerUid] [sceneId] | server.killall | Both side | Kills all entities in the current scene or specified scene of the corresponding player. | |
| list | list | | Both side | Lists online players. | |
| permission | permission <add\|remove> \<username> \<permission> | * | Both side | Grants or removes a permission for a user. | |
| permission | permission <add\|remove> \<UID> \<permission> | * | Both side | Grants or removes a permission for a user. | |
| position | position | | Client only | Sends your current coordinates. | pos |
| reload | reload | server.reload | Both side | Reloads the server config | |
| resetconst | resetconst [all] | player.resetconstellation | Client only | Resets the constellation level on your currently selected character, will need to relog after using the command to see any changes. | resetconstellation |
Expand Down
2 changes: 1 addition & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ chmod +x gradlew
| kick | kick \<uid> | server.kick | 均可使用 | 从服务器中踢出指定玩家 (WIP) | k |
| killall | killall [uid] [场景ID] | server.killall | 均可使用 | 杀死指定玩家世界中所在或指定场景的全部生物 | |
| list | list | | 均可使用 | 列出在线玩家 | |
| permission | permission <add\|remove> <用户名> <权限节点> | * | 均可使用 | 添加或移除玩家的权限 | |
| permission | permission <add\|remove> <UID> <权限节点> | * | 均可使用 | 添加或移除玩家的权限 | |
| position | position | | 仅客户端 | 获取当前坐标 | pos |
| reload | reload | server.reload | 均可使用 | 重载服务器配置 | |
| resetconst | resetconst [all] | player.resetconstellation | 仅客户端 | 重置当前角色的命座,重新登录即可生效 | resetconstellation |
Expand Down
2 changes: 1 addition & 1 deletion data/gacha_records.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<!-- This file could be generated automatically using `java -jar grasscutter.jar -gachamap` -->
<!-- You can also modify the file manually to customize it -->
<!-- Otherwise you may onle see number IDs in the gacha record -->
<script type="text/javascript" src="/gcstatic/mappings.js"></script>
<script type="text/javascript" src="/gacha/mappings"></script>
<script>
mappings['default'] = mappings['en-us']; // make en-us as default/fallback option
</script>
Expand Down
19 changes: 19 additions & 0 deletions proto/AvatarExpeditionAllDataRsp.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";
import "AvatarExpeditionInfo.proto";

message AvatarExpeditionAllDataRsp {
enum CmdId {
option allow_alias = true;
NONE = 0;
ENET_CHANNEL_ID = 0;
ENET_IS_RELIABLE = 1;
CMD_ID = 1783;
}

int32 retcode = 1;
map<uint64, AvatarExpeditionInfo> expedition_info_map = 2;
repeated uint32 open_expedition_list = 3;
uint32 expedition_count_limit = 4;
}
16 changes: 16 additions & 0 deletions proto/AvatarExpeditionCallBackReq.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

message AvatarExpeditionCallBackReq {
enum CmdId {
option allow_alias = true;
ENET_CHANNEL_ID = 0;
NONE = 0;
ENET_IS_RELIABLE = 1;
IS_ALLOW_CLIENT = 1;
CMD_ID = 1618;
}

repeated uint64 avatar_guid = 1;
}
17 changes: 17 additions & 0 deletions proto/AvatarExpeditionCallBackRsp.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";
import "AvatarExpeditionInfo.proto";

message AvatarExpeditionCallBackRsp {
enum CmdId {
option allow_alias = true;
NONE = 0;
ENET_CHANNEL_ID = 0;
ENET_IS_RELIABLE = 1;
CMD_ID = 1633;
}

int32 retcode = 1;
map<uint64, AvatarExpeditionInfo> expedition_info_map = 2;
}
16 changes: 16 additions & 0 deletions proto/AvatarExpeditionDataNotify.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";
import "AvatarExpeditionInfo.proto";

message AvatarExpeditionDataNotify {
enum CmdId {
option allow_alias = true;
NONE = 0;
ENET_CHANNEL_ID = 0;
ENET_IS_RELIABLE = 1;
CMD_ID = 1621;
}

map<uint64, AvatarExpeditionInfo> expedition_info_map = 1;
}
16 changes: 16 additions & 0 deletions proto/AvatarExpeditionGetRewardReq.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

message AvatarExpeditionGetRewardReq {
enum CmdId {
option allow_alias = true;
ENET_CHANNEL_ID = 0;
NONE = 0;
ENET_IS_RELIABLE = 1;
IS_ALLOW_CLIENT = 1;
CMD_ID = 1610;
}

uint64 avatar_guid = 1;
}
19 changes: 19 additions & 0 deletions proto/AvatarExpeditionGetRewardRsp.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";
import "AvatarExpeditionInfo.proto";

import "ItemParam.proto";
message AvatarExpeditionGetRewardRsp {
enum CmdId {
option allow_alias = true;
NONE = 0;
ENET_CHANNEL_ID = 0;
ENET_IS_RELIABLE = 1;
CMD_ID = 1670;
}

int32 retcode = 1;
map<uint64, AvatarExpeditionInfo> expedition_info_map = 2;
repeated ItemParam item_list = 3;
}
12 changes: 12 additions & 0 deletions proto/AvatarExpeditionInfo.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";
import "AvatarExpeditionState.proto";

message AvatarExpeditionInfo {
AvatarExpeditionState state = 1;
uint32 exp_id = 2;
uint32 hour_time = 3;
uint32 start_time = 4;
float shorten_ratio = 5;
}
18 changes: 18 additions & 0 deletions proto/AvatarExpeditionStartReq.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";

message AvatarExpeditionStartReq {
enum CmdId {
option allow_alias = true;
ENET_CHANNEL_ID = 0;
NONE = 0;
ENET_IS_RELIABLE = 1;
IS_ALLOW_CLIENT = 1;
CMD_ID = 1609;
}

uint64 avatar_guid = 1;
uint32 exp_id = 2;
uint32 hour_time = 3;
}
17 changes: 17 additions & 0 deletions proto/AvatarExpeditionStartRsp.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";

option java_package = "emu.grasscutter.net.proto";
import "AvatarExpeditionInfo.proto";

message AvatarExpeditionStartRsp {
enum CmdId {
option allow_alias = true;
NONE = 0;
ENET_CHANNEL_ID = 0;
ENET_IS_RELIABLE = 1;
CMD_ID = 1646;
}

int32 retcode = 1;
map<uint64, AvatarExpeditionInfo> expedition_info_map = 2;
}
4 changes: 3 additions & 1 deletion src/main/java/emu/grasscutter/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public static class GameServerOptions {
public int ServerAvatarId = 10000007;
public int[] WelcomeEmotes = {2007, 1002, 4010};
public String WelcomeMotd = "Welcome to Grasscutter emu";
public String WelcomeMailContent = "Hi there!\r\nFirst of all, welcome to Grasscutter. If you have any issues, please let us know so that Lawnmower can help you! \r\n\r\nCheck out our:\r\n<type=\"browser\" text=\"Discord\" href=\"https://discord.gg/T5vZU6UyeG\"/> <type=\"browser\" text=\"GitHub\" href=\"https://github.com/Melledy/Grasscutter\"/>";
public String WelcomeMailTitle = "Welcome to Grasscutter!";
public String WelcomeMailSender = "Lawnmower";
public String WelcomeMailContent = "Hi there!\r\nFirst of all, welcome to Grasscutter. If you have any issues, please let us know so that Lawnmower can help you! \r\n\r\nCheck out our:\r\n<type=\"browser\" text=\"Discord\" href=\"https://discord.gg/T5vZU6UyeG\"/>";
public Mail.MailItem[] WelcomeMailItems = {
new Mail.MailItem(13509, 1, 1),
new Mail.MailItem(201, 10000, 1),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emu/grasscutter/Grasscutter.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static void main(String[] args) throws Exception {
Tools.createGmHandbook(); return;
}
case "-gachamap" -> {
Tools.createGachaMapping(); return;
Tools.createGachaMapping("./gacha_mappings.js"); return;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public final class GiveCommand implements CommandHandler {
Pattern lvlRegex = Pattern.compile("l(?:vl?)?(\\d+)"); // Java is a joke of a proglang that doesn't have raw string literals
Pattern refineRegex = Pattern.compile("r(\\d+)");
Pattern amountRegex = Pattern.compile("((?<=x)\\d+|\\d+(?=x))");
Pattern amountRegex = Pattern.compile("((?<=x)\\d+|\\d+(?=x)(?!x\\d))");

private int matchIntOrNeg(Pattern pattern, String arg) {
Matcher match = pattern.matcher(arg);
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/emu/grasscutter/data/GameData.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ public class GameData {
private static Map<Integer, List<ShopGoodsData>> shopGoods = new HashMap<>();
private static final IntList scenePointIdList = new IntArrayList();

public static char EJWOA = 's';

public static Int2ObjectMap<?> getMapByResourceDef(Class<?> resourceDefinition) {
Int2ObjectMap<?> map = null;

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/emu/grasscutter/database/DatabaseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,4 @@ public static boolean deleteMail(Mail mail) {
DeleteResult result = DatabaseManager.getDatastore().delete(mail);
return result.wasAcknowledged();
}

public static char AWJVN = 'e';
}
Loading

0 comments on commit 7d51e0d

Please sign in to comment.