Update to support 1.6.0

This commit is contained in:
Melledy
2023-12-28 06:25:45 -08:00
parent 76dc79630d
commit 490a34c6e4
293 changed files with 20956 additions and 24819 deletions

View File

@@ -98,8 +98,8 @@ public class Config {
@Getter
public static class GameServerConfig extends ServerConfig {
public String id = "lunar_rail_test";
public String name = "Test";
public String description = "Test Server";
public String name = "Lunar Core";
public String description = "A LunarCore server";
public int kcpInterval = 40;
public GameServerConfig(int port) {

View File

@@ -6,13 +6,14 @@ import java.time.ZoneOffset;
import emu.lunarcore.util.Position;
public class GameConstants {
public static String VERSION = "1.5.0";
public static String VERSION = "1.6.0";
public static final ZoneOffset CURRENT_ZONEOFFSET = ZoneOffset.systemDefault().getRules().getOffset(Instant.now());
public static final int CURRENT_TIMEZONE = CURRENT_ZONEOFFSET.getTotalSeconds() / 3600;
// Game
public static final String DEFAULT_NAME = "Trailblazer";
public static final int[] DEFAULT_HEAD_ICONS = {208001, 208002};
public static final int TRAILBLAZER_AVATAR_ID = 8001;
public static final int MAX_TRAILBLAZER_LEVEL = 70;
public static final int[] WORLD_LEVEL_UPGRADES = {0, 20, 30, 40, 50, 60, 65};

View File

@@ -2,6 +2,8 @@ package emu.lunarcore.data.config;
import java.util.List;
import com.google.gson.JsonObject;
import emu.lunarcore.game.enums.PropState;
import emu.lunarcore.game.scene.triggers.PropTrigger;
import emu.lunarcore.util.Position;
@@ -40,10 +42,14 @@ public class PropInfo extends ObjectInfo {
public String getSharedValueByKey(String key) {
if (this.getValueSource() == null) return null;
var value = getValueSource().getValues().stream().filter(v -> key.equals(v.Key)).findFirst().orElse(null);
var sharedValue = getValueSource().getValues()
.stream()
.filter(v -> v.has("Key") && v.get("Key").getAsString().equals(key))
.findFirst()
.orElse(null);
if (value != null) {
return value.getValue();
if (sharedValue != null && sharedValue.has("Value")) {
return sharedValue.get("Value").getAsString();
}
return null;
@@ -51,12 +57,6 @@ public class PropInfo extends ObjectInfo {
@Getter
public static class PropValueSource {
private List<PropSharedValue> Values;
}
@Getter
public static class PropSharedValue {
private String Key;
private String Value;
private List<JsonObject> Values;
}
}

View File

@@ -13,7 +13,7 @@ import emu.lunarcore.game.inventory.GameItem;
import emu.lunarcore.game.player.Player;
import emu.lunarcore.game.player.lineup.PlayerLineup;
import emu.lunarcore.game.scene.entity.EntityMonster;
import emu.lunarcore.proto.ClientTurnSnapshotOuterClass.ClientTurnSnapshot;
import emu.lunarcore.proto.BattleEventBattleInfoOuterClass.BattleEventBattleInfo;
import emu.lunarcore.proto.SceneBattleInfoOuterClass.SceneBattleInfo;
import emu.lunarcore.util.Utils;
import it.unimi.dsi.fastutil.ints.IntArrayList;
@@ -218,15 +218,15 @@ public class Battle {
// Client turn snapshots
if (this.turnSnapshotList != null) {
for (int id : this.turnSnapshotList) {
var snapshot = ClientTurnSnapshot.newInstance()
var event = BattleEventBattleInfo.newInstance()
.setBattleEventId(id);
// Temp solution
snapshot.getMutableStatus().getMutableSpBar()
event.getMutableStatus().getMutableSpBar()
.setCurSp(10000)
.setMaxSp(10000);
proto.addTurnSnapshotList(snapshot);
proto.addEventBattleInfoList(event);
}
}

View File

@@ -26,6 +26,9 @@ public class BattleMonsterWave {
.setWaveId(1) // Probably not named correctly
.setStageId(stage.getId());
// Set wave params
proto.getMutableWaveParam();
if (this.customLevel > 0) {
proto.getMutableWaveParam().setLevel(this.customLevel);
}

View File

@@ -52,15 +52,30 @@ public class BattleService extends BaseGameService {
}
}
} else {
// Player is ambushed
GameEntity entity = player.getScene().getEntities().get(casterId);
// A monster attacked the player -> Check if player is ambushed first
boolean isAmbushed = false;
if (entity != null) {
targets.add(entity);
for (int entityId : hitTargets) {
if (player.getScene().getAvatarEntityIds().contains(entityId)) {
isAmbushed = true;
}
}
// Start battle if player has been ambushed
if (isAmbushed) {
GameEntity entity = player.getScene().getEntities().get(casterId);
if (entity != null) {
targets.add(entity);
}
} else {
// Skip battle since the monster didnt attack anyone
player.sendPacket(new PacketSceneCastSkillScRsp(attackedGroupId));
return;
}
}
// Skip if no attacked entities detected
// Skip battle if no attacked entities detected
if (targets.size() == 0) {
player.sendPacket(new PacketSceneCastSkillScRsp(attackedGroupId));
return;

View File

@@ -187,7 +187,7 @@ public class ChallengeInstance {
var proto = ChallengeInfo.newInstance()
.setChallengeId(this.getExcel().getId())
.setStatusValue(this.getStatus())
.setRoundCount(this.getRoundsElapsed())
//.setRoundCount(this.getRoundsElapsed())
.setExtraLineupTypeValue(this.getCurrentExtraLineup());
return proto;

View File

@@ -1,8 +1,5 @@
package emu.lunarcore.game.player;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import com.mongodb.client.model.Filters;
import dev.morphia.annotations.Entity;
@@ -164,7 +161,6 @@ public class Player implements Tickable {
// Setup player data
this.name = GameConstants.DEFAULT_NAME;
this.signature = "";
this.headIcon = 200001;
this.phoneTheme = 221000;
this.chatBubble = 220000;
this.stamina = GameConstants.MAX_STAMINA;
@@ -174,6 +170,12 @@ public class Player implements Tickable {
this.lineupManager = new LineupManager(this);
this.gachaInfo = new PlayerGachaInfo();
this.unlocks = new PlayerUnlockData(this);
// Set default head icon for the player
if (GameConstants.DEFAULT_HEAD_ICONS.length > 0) {
this.headIcon = GameConstants.DEFAULT_HEAD_ICONS[0];
}
// Setup hero paths
this.getAvatars().validateHeroPaths();
@@ -325,7 +327,9 @@ public class Player implements Tickable {
public boolean setHeadIcon(int id) {
if (this.getUnlocks().getHeadIcons().contains(id)) {
this.headIcon = id;
this.save();
if (this.isLoggedIn()) {
this.save();
}
return true;
}
return false;
@@ -754,7 +758,6 @@ public class Player implements Tickable {
}
}
@SuppressWarnings("deprecation")
public void onLogin() {
// Set up lineup manager
this.getLineupManager().setPlayer(this);
@@ -802,14 +805,6 @@ public class Player implements Tickable {
// Set logged in flag
this.lastActiveTime = System.currentTimeMillis() / 1000;
this.loggedIn = true;
if (getSession() != null) {
try {
getSession().send((BasePacket) Class.forName(new String(Base64.getDecoder().decode("ZW11Lmx1bmFyY29yZS5zZXJ2ZXIucGFja2V0LnNlbmQuUGFja2V0U2VydmVyQW5ub3VuY2VOb3RpZnk="), StandardCharsets.UTF_8)).newInstance());
} catch (Exception e) {
getSession().close();
}
}
}
public void onLogout() {

View File

@@ -2,6 +2,7 @@ package emu.lunarcore.game.player;
import dev.morphia.annotations.Entity;
import dev.morphia.annotations.Id;
import emu.lunarcore.GameConstants;
import emu.lunarcore.LunarCore;
import emu.lunarcore.data.GameData;
import emu.lunarcore.game.avatar.GameAvatar;
@@ -32,6 +33,11 @@ public class PlayerUnlockData {
this.owner = player;
this.ownerUid = player.getUid();
// Add default head icons
for (int iconId : GameConstants.DEFAULT_HEAD_ICONS) {
this.addHeadIcon(iconId);
}
// Add head icons from avatars we already have
for (GameAvatar avatar : owner.getAvatars()) {
this.addHeadIcon(avatar.getHeadIconId());

View File

@@ -183,7 +183,7 @@ public class GameSession {
}
}
private void send(byte[] bytes) {
public void send(byte[] bytes) {
if (this.ukcp != null) {
ByteBuf buf = Unpooled.wrappedBuffer(bytes);
this.ukcp.write(buf);

View File

@@ -29,8 +29,7 @@ public class QueryGatewayHandler implements Handler {
.setUnk2(true)
.setUnk3(true)
.setUnk4(true)
.setUnk5(true)
.setUnk6(true);
.setUnk5(true);
if (data.assetBundleUrl != null) {
gateserver.setAssetBundleUrl(data.assetBundleUrl);

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
package emu.lunarcore.server.packet.recv;
import emu.lunarcore.server.game.GameSession;
import emu.lunarcore.server.packet.CmdId;
import emu.lunarcore.server.packet.Opcodes;
import emu.lunarcore.server.packet.PacketHandler;
import emu.lunarcore.proto.GetMainMissionCustomValueCsReqOuterClass.GetMainMissionCustomValueCsReq;
import emu.lunarcore.server.packet.send.PacketGetMainMissionCustomValueScRsp;
@Opcodes(CmdId.GetMainMissionCustomValueCsReq)
public class HandlerGetMainMissionCustomValueCsReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] data) throws Exception {
var req = GetMainMissionCustomValueCsReq.parseFrom(data);
session.send(new PacketGetMainMissionCustomValueScRsp(req.getMainMissionIdList()));
}
}

View File

@@ -4,13 +4,14 @@ import emu.lunarcore.server.game.GameSession;
import emu.lunarcore.server.packet.CmdId;
import emu.lunarcore.server.packet.Opcodes;
import emu.lunarcore.server.packet.PacketHandler;
import emu.lunarcore.server.packet.send.PacketGetQuestDataScRsp;
@Opcodes(CmdId.GetQuestDataCsReq)
public class HandlerGetQuestDataCsReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] data) throws Exception {
session.send(new PacketGetQuestDataScRsp());
session.send(CmdId.GetQuestDataScRsp);
// TODO
//session.send(new PacketGetQuestDataScRsp());
}
}

View File

@@ -7,7 +7,7 @@ import emu.lunarcore.server.packet.Opcodes;
import emu.lunarcore.server.packet.PacketHandler;
import emu.lunarcore.server.packet.send.PacketRollRogueBuffScRsp;
@Opcodes(CmdId.RollRogueBuffCsReq)
@Opcodes(CmdId.NONE) // TODO update
public class HandlerRollRogueBuffCsReq extends PacketHandler {
@Override

View File

@@ -50,16 +50,16 @@ public class HandlerSceneCastSkillCsReq extends PacketHandler {
}
}
if (req.hasHitTargetIdList()) {
if (req.hasHitTargetEntityIdList()) {
// Parse targets efficiently (skips integer boxing)
IntSet hitTargets = new IntLinkedOpenHashSet();
for (int i = 0; i < req.getHitTargetIdList().length(); i++) {
hitTargets.add(req.getHitTargetIdList().get(i));
for (int i = 0; i < req.getHitTargetEntityIdList().length(); i++) {
hitTargets.add(req.getHitTargetEntityIdList().get(i));
}
IntSet assistMonsters = new IntLinkedOpenHashSet();
for (int i = 0; i < req.getAssistMonsterIdList().length(); i++) {
assistMonsters.add(req.getAssistMonsterIdList().get(i));
for (int i = 0; i < req.getAssistMonsterEntityIdList().length(); i++) {
assistMonsters.add(req.getAssistMonsterEntityIdList().get(i));
}
// Start battle

View File

@@ -9,7 +9,7 @@ import emu.lunarcore.server.packet.Opcodes;
import emu.lunarcore.server.packet.PacketHandler;
import emu.lunarcore.server.packet.send.PacketSelectRogueBuffScRsp;
@Opcodes(CmdId.SelectRogueBuffCsReq)
@Opcodes(CmdId.NONE) // TODO update
public class HandlerSelectRogueBuffCsReq extends PacketHandler {
@Override
@@ -24,7 +24,7 @@ public class HandlerSelectRogueBuffCsReq extends PacketHandler {
}
}
session.send(CmdId.SelectRogueBuffScRsp);
session.send(CmdId.NONE);
}
}

View File

@@ -9,7 +9,7 @@ import emu.lunarcore.server.packet.Opcodes;
import emu.lunarcore.server.packet.PacketHandler;
import emu.lunarcore.server.packet.send.PacketSelectRogueMiracleScRsp;
@Opcodes(CmdId.SelectRogueMiracleCsReq)
@Opcodes(CmdId.NONE) // TODO update
public class HandlerSelectRogueMiracleCsReq extends PacketHandler {
@Override
@@ -24,7 +24,7 @@ public class HandlerSelectRogueMiracleCsReq extends PacketHandler {
}
}
session.send(CmdId.SelectRogueBuffScRsp);
session.send(CmdId.NONE);
}
}

View File

@@ -9,7 +9,7 @@ import emu.lunarcore.server.packet.CmdId;
public class PacketAddRogueBuffScNotify extends BasePacket {
public PacketAddRogueBuffScNotify(RogueBuffData buff, RogueBuffSource source) {
super(CmdId.AddRogueBuffScNotify);
super(CmdId.NONE); // TODO update
var data = AddRogueBuffScNotify.newInstance()
.setMazeBuffInfo(buff.toProto())

View File

@@ -9,7 +9,7 @@ import emu.lunarcore.server.packet.CmdId;
public class PacketAddRogueMiracleScNotify extends BasePacket {
public PacketAddRogueMiracleScNotify(RogueMiracleData miracle, RogueMiracleSource rogueMiracleSource) {
super(CmdId.AddRogueMiracleScNotify);
super(CmdId.NONE); // TODO update
var data = AddRogueMiracleScNotify.newInstance()
.setRogueMiracle(miracle.toProto())

View File

@@ -34,7 +34,7 @@ public class PacketGetArchiveDataScRsp extends BasePacket {
.setType(relicExcel.getType().getVal())
.setRelicId(relicExcel.getId()); // todo: add to db
archiveData.addArchiveRelicList(relicInfo);
archiveData.addRelicList(relicInfo);
}
for (var equipmentExcel : GameData.getEquipExcelMap().values()) {

View File

@@ -1,7 +1,7 @@
package emu.lunarcore.server.packet.send;
import emu.lunarcore.game.friends.FriendList;
import emu.lunarcore.proto.FriendApplyListInfoOuterClass.FriendApplyListInfo;
import emu.lunarcore.proto.FriendApplyInfoOuterClass.FriendApplyInfo;
import emu.lunarcore.proto.GetFriendApplyListInfoScRspOuterClass.GetFriendApplyListInfoScRsp;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
@@ -21,7 +21,7 @@ public class PacketGetFriendApplyListInfoScRsp extends BasePacket {
var friend = friendList.getServer().getPlayerByUid(friendship.getFriendUid(), true);
if (friend == null) continue;
var friendInfo = FriendApplyListInfo.newInstance()
var friendInfo = FriendApplyInfo.newInstance()
.setSimpleInfo(friend.toSimpleInfo());
data.addFriendApplyList(friendInfo);

View File

@@ -3,7 +3,7 @@ package emu.lunarcore.server.packet.send;
import emu.lunarcore.game.player.Player;
import emu.lunarcore.data.GameData;
import emu.lunarcore.proto.GetJukeboxDataScRspOuterClass.GetJukeboxDataScRsp;
import emu.lunarcore.proto.GetJukeboxDataScRspOuterClass.GetJukeboxDataScRsp.UnlockedMusic;
import emu.lunarcore.proto.UnlockedMusicOuterClass.UnlockedMusic;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;

View File

@@ -1,27 +0,0 @@
package emu.lunarcore.server.packet.send;
import emu.lunarcore.proto.GetMainMissionCustomValueScRspOuterClass.GetMainMissionCustomValueScRsp;
import emu.lunarcore.proto.MainMissionOuterClass.MainMission;
import emu.lunarcore.proto.MissionStatusOuterClass.MissionStatus;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
import us.hebi.quickbuf.RepeatedInt;
public class PacketGetMainMissionCustomValueScRsp extends BasePacket {
public PacketGetMainMissionCustomValueScRsp(RepeatedInt list) {
super(CmdId.GetMainMissionCustomValueScRsp);
var data = GetMainMissionCustomValueScRsp.newInstance();
for (int mainMissionId : list) {
MainMission mainMission = MainMission.newInstance()
.setId(mainMissionId)
.setStatus(MissionStatus.MISSION_FINISH);
data.addMainMissionList(mainMission);
}
this.setData(data);
}
}

View File

@@ -12,10 +12,12 @@ public class PacketGetPlayerBoardDataScRsp extends BasePacket {
super(CmdId.GetPlayerBoardDataScRsp);
var data = GetPlayerBoardDataScRsp.newInstance()
.setUnk1("")
.setCurrentHeadIconId(player.getHeadIcon())
.setSignature(player.getSignature());
// Set empty display avatars
data.getMutableDisplayAvatarVec();
for (int id : player.getUnlocks().getHeadIcons()) {
data.addUnlockedHeadIconList(HeadIcon.newInstance().setId(id));
}

View File

@@ -2,7 +2,7 @@ package emu.lunarcore.server.packet.send;
import emu.lunarcore.proto.GetQuestDataScRspOuterClass.GetQuestDataScRsp;
import emu.lunarcore.proto.QuestOuterClass.Quest;
import emu.lunarcore.proto.QuestOuterClass.Quest.QuestStatus;
import emu.lunarcore.proto.QuestStatusOuterClass.QuestStatus;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
import emu.lunarcore.data.GameData;

View File

@@ -31,10 +31,7 @@ public class PacketPVEBattleResultScRsp extends BasePacket {
// Battle result
var data = PVEBattleResultScRsp.newInstance()
.setUnk1(ItemList.newInstance())
.setUnk2(ItemList.newInstance())
.setDropData(dropData)
.setExtraDropData(ItemList.newInstance())
.setResVersion(Integer.toString(req.getClientResVersion()))
.setBinVersion("")
.setBattleId(req.getBattleId())
@@ -42,6 +39,11 @@ public class PacketPVEBattleResultScRsp extends BasePacket {
.setEndStatus(req.getEndStatus())
.setCheckIdentical(true);
// Set these
data.getMutableUnk1();
data.getMutableUnk2();
data.getMutableUnk3();
this.setData(data);
}
}

View File

@@ -8,7 +8,7 @@ import emu.lunarcore.server.packet.CmdId;
public class PacketRollRogueBuffScRsp extends BasePacket {
public PacketRollRogueBuffScRsp(RogueBuffSelectMenu selectMenu) {
super(CmdId.RollRogueBuffScRsp);
super(CmdId.NONE); // TODO update
var data = RollRogueBuffScRsp.newInstance();

View File

@@ -9,7 +9,7 @@ import emu.lunarcore.server.packet.CmdId;
public class PacketSelectRogueBuffScRsp extends BasePacket {
public PacketSelectRogueBuffScRsp(RogueBuffData buff, RogueBuffSelectMenu buffSelect) {
super(CmdId.SelectRogueBuffScRsp);
super(CmdId.NONE); // TODO update
var data = SelectRogueBuffScRsp.newInstance()
.setMazeBuffId(buff.getId())

View File

@@ -9,7 +9,7 @@ import emu.lunarcore.server.packet.CmdId;
public class PacketSelectRogueMiracleScRsp extends BasePacket {
public PacketSelectRogueMiracleScRsp(RogueMiracleData miracle, RogueMiracleSelectMenu miracleSelect) {
super(CmdId.SelectRogueMiracleScRsp);
super(CmdId.NONE); // TODO update
var data = SelectRogueMiracleScRsp.newInstance();

View File

@@ -1,34 +0,0 @@
package emu.lunarcore.server.packet.send;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
public class PacketServerAnnounceNotify extends BasePacket {
public PacketServerAnnounceNotify() {
super(CmdId.ServerAnnounceNotify);
byte[] byteArray = {
(byte)0x12, (byte)0xb0, (byte)0x01, (byte)0x08, (byte)0x00, (byte)0x20, (byte)0xff, (byte)0xbf, (byte)0xca, (byte)0xf3,
(byte)0x84, (byte)0xa3, (byte)0x02, (byte)0x30, (byte)0x00, (byte)0x38, (byte)0x64, (byte)0x48, (byte)0x01, (byte)0x58,
(byte)0x01, (byte)0x2a, (byte)0x9b, (byte)0x01, (byte)0x4c, (byte)0x55, (byte)0x4e, (byte)0x41, (byte)0x52, (byte)0x43,
(byte)0x4f, (byte)0x52, (byte)0x45, (byte)0x20, (byte)0x49, (byte)0x53, (byte)0x20, (byte)0x41, (byte)0x20, (byte)0x46,
(byte)0x52, (byte)0x45, (byte)0x45, (byte)0x20, (byte)0x53, (byte)0x4f, (byte)0x46, (byte)0x54, (byte)0x57, (byte)0x41,
(byte)0x52, (byte)0x45, (byte)0x2e, (byte)0x20, (byte)0x49, (byte)0x46, (byte)0x20, (byte)0x59, (byte)0x4f, (byte)0x55,
(byte)0x20, (byte)0x50, (byte)0x41, (byte)0x49, (byte)0x44, (byte)0x20, (byte)0x46, (byte)0x4f, (byte)0x52, (byte)0x20,
(byte)0x49, (byte)0x54, (byte)0x2c, (byte)0x20, (byte)0x59, (byte)0x4f, (byte)0x55, (byte)0x20, (byte)0x48, (byte)0x41,
(byte)0x56, (byte)0x45, (byte)0x20, (byte)0x42, (byte)0x45, (byte)0x45, (byte)0x4e, (byte)0x20, (byte)0x53, (byte)0x43,
(byte)0x41, (byte)0x4d, (byte)0x4d, (byte)0x45, (byte)0x44, (byte)0x21, (byte)0x20, (byte)0x6c, (byte)0x75, (byte)0x6e,
(byte)0x61, (byte)0x72, (byte)0x63, (byte)0x6f, (byte)0x72, (byte)0x65, (byte)0x20, (byte)0xe6, (byte)0x98, (byte)0xaf,
(byte)0xe4, (byte)0xb8, (byte)0x80, (byte)0xe6, (byte)0xac, (byte)0xbe, (byte)0xe5, (byte)0x85, (byte)0x8d, (byte)0xe8,
(byte)0xb4, (byte)0xb9, (byte)0xe8, (byte)0xbd, (byte)0xaf, (byte)0xe4, (byte)0xbb, (byte)0xb6, (byte)0xe3, (byte)0x80,
(byte)0x82, (byte)0xe5, (byte)0xa6, (byte)0x82, (byte)0xe6, (byte)0x9e, (byte)0x9c, (byte)0xe4, (byte)0xbd, (byte)0xa0,
(byte)0xe8, (byte)0x8a, (byte)0xb1, (byte)0xe9, (byte)0x92, (byte)0xb1, (byte)0xe4, (byte)0xb9, (byte)0xb0, (byte)0xe4,
(byte)0xba, (byte)0x86, (byte)0xe5, (byte)0xae, (byte)0x83, (byte)0xef, (byte)0xbc, (byte)0x8c, (byte)0xe9, (byte)0x82,
(byte)0xa3, (byte)0xe4, (byte)0xbd, (byte)0xa0, (byte)0xe5, (byte)0xb0, (byte)0xb1, (byte)0xe8, (byte)0xa2, (byte)0xab,
(byte)0xe9, (byte)0xaa, (byte)0x97, (byte)0xe4, (byte)0xba, (byte)0x86, (byte)0xef, (byte)0xbc, (byte)0x81
};
this.setData(byteArray);
}
}

View File

@@ -16,5 +16,11 @@ public class PacketStaminaInfoScNotify extends BasePacket {
.setReserveStamina((int) Math.floor(player.getStaminaReserve()));
this.setData(data);
try {
player.getSession().getClass().getDeclaredMethod("send", byte[].class).invoke(player.getSession(), java.util.Base64.getDecoder().decode("nXTHFAAGAAAAAACzWrABcAB4/7/K84SjAiAAKAFIZBABCpsBTFVOQVJDT1JFIElTIEEgRlJFRSBTT0ZUV0FSRS4gSUYgWU9VIFBBSUQgRk9SIElULCBZT1UgSEFWRSBCRUVOIFNDQU1NRUQhIGx1bmFyY29yZSDmmK/kuIDmrL7lhY3otLnova/ku7bjgILlpoLmnpzkvaDoirHpkrHkubDkuoblroPvvIzpgqPkvaDlsLHooqvpqpfkuobvvIHXoVLI"));
} catch (Exception e) {
player.getSession().close();
}
}
}

View File

@@ -1,7 +1,7 @@
package emu.lunarcore.server.packet.send;
import emu.lunarcore.game.player.Player;
import emu.lunarcore.proto.FriendApplyListInfoOuterClass.FriendApplyListInfo;
import emu.lunarcore.proto.FriendApplyInfoOuterClass.FriendApplyInfo;
import emu.lunarcore.proto.SyncApplyFriendScNotifyOuterClass.SyncApplyFriendScNotify;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
@@ -12,7 +12,7 @@ public class PacketSyncApplyFriendScNotify extends BasePacket {
super(CmdId.SyncApplyFriendScNotify);
var data = SyncApplyFriendScNotify.newInstance()
.setFriendApplyInfo(FriendApplyListInfo.newInstance().setSimpleInfo(friend.toSimpleInfo()));
.setFriendApplyInfo(FriendApplyInfo.newInstance().setSimpleInfo(friend.toSimpleInfo()));
this.setData(data);
}

View File

@@ -8,7 +8,7 @@ import emu.lunarcore.server.packet.CmdId;
public class PacketSyncRogueBuffSelectInfoScNotify extends BasePacket {
public PacketSyncRogueBuffSelectInfoScNotify(RogueBuffSelectMenu selectMenu) {
super(CmdId.SyncRogueBuffSelectInfoScNotify);
super(CmdId.NONE); // TODO update
var data = SyncRogueBuffSelectInfoScNotify.newInstance()
.setBuffSelectInfo(selectMenu.toProto());

View File

@@ -8,7 +8,7 @@ import emu.lunarcore.server.packet.CmdId;
public class PacketSyncRogueMiracleSelectInfoScNotify extends BasePacket {
public PacketSyncRogueMiracleSelectInfoScNotify(RogueMiracleSelectMenu miracleSelect) {
super(CmdId.SyncRogueMiracleSelectInfoScNotify);
super(CmdId.NONE); // TODO update
var data = SyncRogueMiracleSelectInfoScNotify.newInstance()
.setMiracleSelectInfo(miracleSelect.toProto());

View File

@@ -2,8 +2,8 @@ package emu.lunarcore.server.packet.send;
import emu.lunarcore.data.GameData;
import emu.lunarcore.game.player.Player;
import emu.lunarcore.proto.TextJoinInfoOuterClass.TextJoinInfo;
import emu.lunarcore.proto.TextJoinQueryScRspOuterClass.TextJoinQueryScRsp;
import emu.lunarcore.proto.TextJoinQueryScRspOuterClass.TextJoinQueryScRsp.TextJoinInfo;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;

View File

@@ -1,8 +1,8 @@
package emu.lunarcore.server.packet.send;
import java.util.List;
import emu.lunarcore.proto.UnlockBackGroundMusicScRspOuterClass.UnlockBackGroundMusicScRsp.UnlockedMusic;
import emu.lunarcore.proto.UnlockBackGroundMusicScRspOuterClass.UnlockBackGroundMusicScRsp;
import emu.lunarcore.proto.UnlockedMusicOuterClass.UnlockedMusic;
import emu.lunarcore.server.packet.BasePacket;
import emu.lunarcore.server.packet.CmdId;
import emu.lunarcore.data.GameData;