Merge pull request #60 from Yazawazi/development

Adding a `Teleport to Waypoint` Function
This commit is contained in:
Melledy 2022-04-20 14:31:14 -07:00 committed by GitHub
commit c1df3d1ed8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 1764 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.utils.Utils;
import emu.grasscutter.data.custom.AbilityEmbryoEntry;
import emu.grasscutter.data.custom.OpenConfigEntry;
import emu.grasscutter.data.custom.ScenePointEntry;
import emu.grasscutter.data.def.*;
import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
@ -18,6 +19,7 @@ public class GenshinData {
private static final Int2ObjectMap<String> abilityHashes = new Int2ObjectOpenHashMap<>();
private static final Map<String, AbilityEmbryoEntry> abilityEmbryos = new HashMap<>();
private static final Map<String, OpenConfigEntry> openConfigEntries = new HashMap<>();
private static final Map<String, ScenePointEntry> scenePointEntries = new HashMap<>();
// ExcelConfigs
private static final Int2ObjectMap<PlayerLevelData> playerLevelDataMap = new Int2ObjectOpenHashMap<>();
@ -82,6 +84,10 @@ public class GenshinData {
return openConfigEntries;
}
public static Map<String, ScenePointEntry> getScenePointEntries() {
return scenePointEntries;
}
public static Int2ObjectMap<AvatarData> getAvatarDataMap() {
return avatarDataMap;
}

View File

@ -10,11 +10,15 @@ import java.util.regex.Pattern;
import emu.grasscutter.utils.Utils;
import org.reflections.Reflections;
import com.google.gson.JsonElement;
import com.google.gson.reflect.TypeToken;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.common.PointData;
import emu.grasscutter.data.common.ScenePointConfig;
import emu.grasscutter.data.custom.AbilityEmbryoEntry;
import emu.grasscutter.data.custom.OpenConfigEntry;
import emu.grasscutter.data.custom.ScenePointEntry;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
public class ResourceLoader {
@ -42,6 +46,7 @@ public class ResourceLoader {
loadOpenConfig();
// Load resources
loadResources();
loadScenePoints();
// Process into depots
GenshinDepot.load();
// Custom - TODO move this somewhere else
@ -121,6 +126,45 @@ public class ResourceLoader {
}
}
private static void loadScenePoints() {
Pattern pattern = Pattern.compile("(?<=scene)(.*?)(?=_point.json)");
File folder = new File(Grasscutter.getConfig().RESOURCE_FOLDER + "BinOutPut/Scene/Point");
List<ScenePointEntry> scenePointList = new ArrayList<>();
for (File file : folder.listFiles()) {
ScenePointConfig config = null;
Integer sceneId = null;
Matcher matcher = pattern.matcher(file.getName());
if (matcher.find()) {
sceneId = Integer.parseInt(matcher.group(1));
} else {
continue;
}
try (FileReader fileReader = new FileReader(file)) {
config = Grasscutter.getGsonFactory().fromJson(fileReader, ScenePointConfig.class);
} catch (Exception e) {
e.printStackTrace();
continue;
}
if (config.points == null) {
continue;
}
for (Map.Entry<String, JsonElement> entry : config.points.entrySet()) {
PointData pointData = Grasscutter.getGsonFactory().fromJson(entry.getValue(), PointData.class);
ScenePointEntry sl = new ScenePointEntry(sceneId + "_" + entry.getKey(), pointData);
scenePointList.add(sl);
}
for (ScenePointEntry entry : scenePointList) {
GenshinData.getScenePointEntries().put(entry.getName(), entry);
}
}
}
private static void loadAbilityEmbryos() {
// Read from cached file if exists
File embryoCache = new File(Grasscutter.getConfig().DATA_FOLDER + "AbilityEmbryos.json");

View File

@ -0,0 +1,43 @@
package emu.grasscutter.data.common;
public class PointData {
private pos tranPos;
public pos getTranPos() {
return tranPos;
}
public void setTranPos(pos tranPos) {
this.tranPos = tranPos;
}
public class pos {
private float x;
private float y;
private float z;
public float getX() {
return x;
}
public void setX(float x) {
this.x = x;
}
public float getY() {
return y;
}
public void setY(float y) {
this.y = y;
}
public float getZ() {
return z;
}
public void setZ(float z) {
this.z = z;
}
}
}

View File

@ -0,0 +1,15 @@
package emu.grasscutter.data.common;
import com.google.gson.JsonObject;
public class ScenePointConfig {
public JsonObject points;
public JsonObject getPoints() {
return points;
}
public void setPoints(JsonObject Points) {
points = Points;
}
}

View File

@ -0,0 +1,21 @@
package emu.grasscutter.data.custom;
import emu.grasscutter.data.common.PointData;
public class ScenePointEntry {
private String name;
private PointData pointData;
public ScenePointEntry(String name, PointData pointData) {
this.name = name;
this.pointData = pointData;
}
public String getName() {
return name;
}
public PointData getPointData() {
return pointData;
}
}

View File

@ -207,6 +207,25 @@ public class World implements Iterable<GenshinPlayer> {
this.getScenes().remove(scene.getId());
}
public boolean forceTransferPlayerToScene(GenshinPlayer player, int sceneId, Position pos) {
// Forces the client to reload the scene map to prevent the player from falling off the map.
if (GenshinData.getSceneDataMap().get(sceneId) == null) {
return false;
}
if (player.getScene() != null) {
player.getScene().removePlayer(player);
}
GenshinScene scene = this.getSceneById(sceneId);
scene.addPlayer(player);
player.getPos().set(pos);
// Teleport packet
player.sendPacket(new PacketPlayerEnterSceneNotify(player, EnterType.EnterSelf, EnterReason.TransPoint, sceneId, pos));
return true;
}
public boolean transferPlayerToScene(GenshinPlayer player, int sceneId, Position pos) {
if (player.getScene().getId() == sceneId || GenshinData.getSceneDataMap().get(sceneId) == null) {
return false;

View File

@ -0,0 +1,750 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: SceneTransToPointReq.proto
package emu.grasscutter.net.proto;
public final class SceneTransToPointReqOuterClass {
private SceneTransToPointReqOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface SceneTransToPointReqOrBuilder extends
// @@protoc_insertion_point(interface_extends:SceneTransToPointReq)
com.google.protobuf.MessageOrBuilder {
/**
* <code>uint32 sceneId = 1;</code>
* @return The sceneId.
*/
int getSceneId();
/**
* <code>uint32 pointId = 2;</code>
* @return The pointId.
*/
int getPointId();
}
/**
* Protobuf type {@code SceneTransToPointReq}
*/
public static final class SceneTransToPointReq extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:SceneTransToPointReq)
SceneTransToPointReqOrBuilder {
private static final long serialVersionUID = 0L;
// Use SceneTransToPointReq.newBuilder() to construct.
private SceneTransToPointReq(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private SceneTransToPointReq() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new SceneTransToPointReq();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private SceneTransToPointReq(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
sceneId_ = input.readUInt32();
break;
}
case 16: {
pointId_ = input.readUInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.internal_static_SceneTransToPointReq_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.internal_static_SceneTransToPointReq_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq.class, emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq.Builder.class);
}
/**
* Protobuf enum {@code SceneTransToPointReq.CmdId}
*/
public enum CmdId
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>NONE = 0;</code>
*/
NONE(0, 0),
/**
* <code>ENET_IS_RELIABLE = 1;</code>
*/
ENET_IS_RELIABLE(2, 1),
/**
* <code>CMD_ID = 219;</code>
*/
CMD_ID(4, 219),
UNRECOGNIZED(-1, -1),
;
/**
* <code>ENET_CHANNEL_ID = 0;</code>
*/
public static final CmdId ENET_CHANNEL_ID = NONE;
/**
* <code>IS_ALLOW_CLIENT = 1;</code>
*/
public static final CmdId IS_ALLOW_CLIENT = ENET_IS_RELIABLE;
/**
* <code>NONE = 0;</code>
*/
public static final int NONE_VALUE = 0;
/**
* <code>ENET_CHANNEL_ID = 0;</code>
*/
public static final int ENET_CHANNEL_ID_VALUE = 0;
/**
* <code>ENET_IS_RELIABLE = 1;</code>
*/
public static final int ENET_IS_RELIABLE_VALUE = 1;
/**
* <code>IS_ALLOW_CLIENT = 1;</code>
*/
public static final int IS_ALLOW_CLIENT_VALUE = 1;
/**
* <code>CMD_ID = 219;</code>
*/
public static final int CMD_ID_VALUE = 219;
public final int getNumber() {
if (index == -1) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static CmdId valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static CmdId forNumber(int value) {
switch (value) {
case 0: return NONE;
case 1: return ENET_IS_RELIABLE;
case 219: return CMD_ID;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<CmdId>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
CmdId> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<CmdId>() {
public CmdId findValueByNumber(int number) {
return CmdId.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (index == -1) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq.getDescriptor().getEnumTypes().get(0);
}
private static final CmdId[] VALUES = getStaticValuesArray();
private static CmdId[] getStaticValuesArray() {
return new CmdId[] {
NONE, ENET_CHANNEL_ID, ENET_IS_RELIABLE, IS_ALLOW_CLIENT, CMD_ID,
};
}
public static CmdId valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private CmdId(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:SceneTransToPointReq.CmdId)
}
public static final int SCENEID_FIELD_NUMBER = 1;
private int sceneId_;
/**
* <code>uint32 sceneId = 1;</code>
* @return The sceneId.
*/
@java.lang.Override
public int getSceneId() {
return sceneId_;
}
public static final int POINTID_FIELD_NUMBER = 2;
private int pointId_;
/**
* <code>uint32 pointId = 2;</code>
* @return The pointId.
*/
@java.lang.Override
public int getPointId() {
return pointId_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (sceneId_ != 0) {
output.writeUInt32(1, sceneId_);
}
if (pointId_ != 0) {
output.writeUInt32(2, pointId_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (sceneId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, sceneId_);
}
if (pointId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, pointId_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq)) {
return super.equals(obj);
}
emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq other = (emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq) obj;
if (getSceneId()
!= other.getSceneId()) return false;
if (getPointId()
!= other.getPointId()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + SCENEID_FIELD_NUMBER;
hash = (53 * hash) + getSceneId();
hash = (37 * hash) + POINTID_FIELD_NUMBER;
hash = (53 * hash) + getPointId();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code SceneTransToPointReq}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:SceneTransToPointReq)
emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReqOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.internal_static_SceneTransToPointReq_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.internal_static_SceneTransToPointReq_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq.class, emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq.Builder.class);
}
// Construct using emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
sceneId_ = 0;
pointId_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.internal_static_SceneTransToPointReq_descriptor;
}
@java.lang.Override
public emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq getDefaultInstanceForType() {
return emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq.getDefaultInstance();
}
@java.lang.Override
public emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq build() {
emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq buildPartial() {
emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq result = new emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq(this);
result.sceneId_ = sceneId_;
result.pointId_ = pointId_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq) {
return mergeFrom((emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq other) {
if (other == emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq.getDefaultInstance()) return this;
if (other.getSceneId() != 0) {
setSceneId(other.getSceneId());
}
if (other.getPointId() != 0) {
setPointId(other.getPointId());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int sceneId_ ;
/**
* <code>uint32 sceneId = 1;</code>
* @return The sceneId.
*/
@java.lang.Override
public int getSceneId() {
return sceneId_;
}
/**
* <code>uint32 sceneId = 1;</code>
* @param value The sceneId to set.
* @return This builder for chaining.
*/
public Builder setSceneId(int value) {
sceneId_ = value;
onChanged();
return this;
}
/**
* <code>uint32 sceneId = 1;</code>
* @return This builder for chaining.
*/
public Builder clearSceneId() {
sceneId_ = 0;
onChanged();
return this;
}
private int pointId_ ;
/**
* <code>uint32 pointId = 2;</code>
* @return The pointId.
*/
@java.lang.Override
public int getPointId() {
return pointId_;
}
/**
* <code>uint32 pointId = 2;</code>
* @param value The pointId to set.
* @return This builder for chaining.
*/
public Builder setPointId(int value) {
pointId_ = value;
onChanged();
return this;
}
/**
* <code>uint32 pointId = 2;</code>
* @return This builder for chaining.
*/
public Builder clearPointId() {
pointId_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:SceneTransToPointReq)
}
// @@protoc_insertion_point(class_scope:SceneTransToPointReq)
private static final emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq();
}
public static emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<SceneTransToPointReq>
PARSER = new com.google.protobuf.AbstractParser<SceneTransToPointReq>() {
@java.lang.Override
public SceneTransToPointReq parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new SceneTransToPointReq(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<SceneTransToPointReq> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<SceneTransToPointReq> getParserForType() {
return PARSER;
}
@java.lang.Override
public emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_SceneTransToPointReq_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_SceneTransToPointReq_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\032SceneTransToPointReq.proto\"\234\001\n\024SceneTr" +
"ansToPointReq\022\017\n\007sceneId\030\001 \001(\r\022\017\n\007pointI" +
"d\030\002 \001(\r\"b\n\005CmdId\022\010\n\004NONE\020\000\022\023\n\017ENET_CHANN" +
"EL_ID\020\000\022\024\n\020ENET_IS_RELIABLE\020\001\022\023\n\017IS_ALLO" +
"W_CLIENT\020\001\022\013\n\006CMD_ID\020\333\001\032\002\020\001B\033\n\031emu.grass" +
"cutter.net.protob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_SceneTransToPointReq_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_SceneTransToPointReq_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_SceneTransToPointReq_descriptor,
new java.lang.String[] { "SceneId", "PointId", });
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@ -0,0 +1,812 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: SceneTransToPointRsp.proto
package emu.grasscutter.net.proto;
public final class SceneTransToPointRspOuterClass {
private SceneTransToPointRspOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface SceneTransToPointRspOrBuilder extends
// @@protoc_insertion_point(interface_extends:SceneTransToPointRsp)
com.google.protobuf.MessageOrBuilder {
/**
* <code>int32 retcode = 1;</code>
* @return The retcode.
*/
int getRetcode();
/**
* <code>uint32 sceneId = 2;</code>
* @return The sceneId.
*/
int getSceneId();
/**
* <code>uint32 pointId = 3;</code>
* @return The pointId.
*/
int getPointId();
}
/**
* Protobuf type {@code SceneTransToPointRsp}
*/
public static final class SceneTransToPointRsp extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:SceneTransToPointRsp)
SceneTransToPointRspOrBuilder {
private static final long serialVersionUID = 0L;
// Use SceneTransToPointRsp.newBuilder() to construct.
private SceneTransToPointRsp(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private SceneTransToPointRsp() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new SceneTransToPointRsp();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private SceneTransToPointRsp(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
retcode_ = input.readInt32();
break;
}
case 16: {
sceneId_ = input.readUInt32();
break;
}
case 24: {
pointId_ = input.readUInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.internal_static_SceneTransToPointRsp_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.internal_static_SceneTransToPointRsp_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp.class, emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp.Builder.class);
}
/**
* Protobuf enum {@code SceneTransToPointRsp.CmdId}
*/
public enum CmdId
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>NONE = 0;</code>
*/
NONE(0, 0),
/**
* <code>ENET_IS_RELIABLE = 1;</code>
*/
ENET_IS_RELIABLE(2, 1),
/**
* <code>CMD_ID = 220;</code>
*/
CMD_ID(3, 220),
UNRECOGNIZED(-1, -1),
;
/**
* <code>ENET_CHANNEL_ID = 0;</code>
*/
public static final CmdId ENET_CHANNEL_ID = NONE;
/**
* <code>NONE = 0;</code>
*/
public static final int NONE_VALUE = 0;
/**
* <code>ENET_CHANNEL_ID = 0;</code>
*/
public static final int ENET_CHANNEL_ID_VALUE = 0;
/**
* <code>ENET_IS_RELIABLE = 1;</code>
*/
public static final int ENET_IS_RELIABLE_VALUE = 1;
/**
* <code>CMD_ID = 220;</code>
*/
public static final int CMD_ID_VALUE = 220;
public final int getNumber() {
if (index == -1) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static CmdId valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static CmdId forNumber(int value) {
switch (value) {
case 0: return NONE;
case 1: return ENET_IS_RELIABLE;
case 220: return CMD_ID;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<CmdId>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
CmdId> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<CmdId>() {
public CmdId findValueByNumber(int number) {
return CmdId.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (index == -1) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp.getDescriptor().getEnumTypes().get(0);
}
private static final CmdId[] VALUES = getStaticValuesArray();
private static CmdId[] getStaticValuesArray() {
return new CmdId[] {
NONE, ENET_CHANNEL_ID, ENET_IS_RELIABLE, CMD_ID,
};
}
public static CmdId valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private CmdId(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:SceneTransToPointRsp.CmdId)
}
public static final int RETCODE_FIELD_NUMBER = 1;
private int retcode_;
/**
* <code>int32 retcode = 1;</code>
* @return The retcode.
*/
@java.lang.Override
public int getRetcode() {
return retcode_;
}
public static final int SCENEID_FIELD_NUMBER = 2;
private int sceneId_;
/**
* <code>uint32 sceneId = 2;</code>
* @return The sceneId.
*/
@java.lang.Override
public int getSceneId() {
return sceneId_;
}
public static final int POINTID_FIELD_NUMBER = 3;
private int pointId_;
/**
* <code>uint32 pointId = 3;</code>
* @return The pointId.
*/
@java.lang.Override
public int getPointId() {
return pointId_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (retcode_ != 0) {
output.writeInt32(1, retcode_);
}
if (sceneId_ != 0) {
output.writeUInt32(2, sceneId_);
}
if (pointId_ != 0) {
output.writeUInt32(3, pointId_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (retcode_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, retcode_);
}
if (sceneId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, sceneId_);
}
if (pointId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, pointId_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp)) {
return super.equals(obj);
}
emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp other = (emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp) obj;
if (getRetcode()
!= other.getRetcode()) return false;
if (getSceneId()
!= other.getSceneId()) return false;
if (getPointId()
!= other.getPointId()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + RETCODE_FIELD_NUMBER;
hash = (53 * hash) + getRetcode();
hash = (37 * hash) + SCENEID_FIELD_NUMBER;
hash = (53 * hash) + getSceneId();
hash = (37 * hash) + POINTID_FIELD_NUMBER;
hash = (53 * hash) + getPointId();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code SceneTransToPointRsp}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:SceneTransToPointRsp)
emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRspOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.internal_static_SceneTransToPointRsp_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.internal_static_SceneTransToPointRsp_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp.class, emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp.Builder.class);
}
// Construct using emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
retcode_ = 0;
sceneId_ = 0;
pointId_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.internal_static_SceneTransToPointRsp_descriptor;
}
@java.lang.Override
public emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp getDefaultInstanceForType() {
return emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp.getDefaultInstance();
}
@java.lang.Override
public emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp build() {
emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp buildPartial() {
emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp result = new emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp(this);
result.retcode_ = retcode_;
result.sceneId_ = sceneId_;
result.pointId_ = pointId_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp) {
return mergeFrom((emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp other) {
if (other == emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp.getDefaultInstance()) return this;
if (other.getRetcode() != 0) {
setRetcode(other.getRetcode());
}
if (other.getSceneId() != 0) {
setSceneId(other.getSceneId());
}
if (other.getPointId() != 0) {
setPointId(other.getPointId());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int retcode_ ;
/**
* <code>int32 retcode = 1;</code>
* @return The retcode.
*/
@java.lang.Override
public int getRetcode() {
return retcode_;
}
/**
* <code>int32 retcode = 1;</code>
* @param value The retcode to set.
* @return This builder for chaining.
*/
public Builder setRetcode(int value) {
retcode_ = value;
onChanged();
return this;
}
/**
* <code>int32 retcode = 1;</code>
* @return This builder for chaining.
*/
public Builder clearRetcode() {
retcode_ = 0;
onChanged();
return this;
}
private int sceneId_ ;
/**
* <code>uint32 sceneId = 2;</code>
* @return The sceneId.
*/
@java.lang.Override
public int getSceneId() {
return sceneId_;
}
/**
* <code>uint32 sceneId = 2;</code>
* @param value The sceneId to set.
* @return This builder for chaining.
*/
public Builder setSceneId(int value) {
sceneId_ = value;
onChanged();
return this;
}
/**
* <code>uint32 sceneId = 2;</code>
* @return This builder for chaining.
*/
public Builder clearSceneId() {
sceneId_ = 0;
onChanged();
return this;
}
private int pointId_ ;
/**
* <code>uint32 pointId = 3;</code>
* @return The pointId.
*/
@java.lang.Override
public int getPointId() {
return pointId_;
}
/**
* <code>uint32 pointId = 3;</code>
* @param value The pointId to set.
* @return This builder for chaining.
*/
public Builder setPointId(int value) {
pointId_ = value;
onChanged();
return this;
}
/**
* <code>uint32 pointId = 3;</code>
* @return This builder for chaining.
*/
public Builder clearPointId() {
pointId_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:SceneTransToPointRsp)
}
// @@protoc_insertion_point(class_scope:SceneTransToPointRsp)
private static final emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp();
}
public static emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<SceneTransToPointRsp>
PARSER = new com.google.protobuf.AbstractParser<SceneTransToPointRsp>() {
@java.lang.Override
public SceneTransToPointRsp parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new SceneTransToPointRsp(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<SceneTransToPointRsp> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<SceneTransToPointRsp> getParserForType() {
return PARSER;
}
@java.lang.Override
public emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_SceneTransToPointRsp_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_SceneTransToPointRsp_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\032SceneTransToPointRsp.proto\"\230\001\n\024SceneTr" +
"ansToPointRsp\022\017\n\007retcode\030\001 \001(\005\022\017\n\007sceneI" +
"d\030\002 \001(\r\022\017\n\007pointId\030\003 \001(\r\"M\n\005CmdId\022\010\n\004NON" +
"E\020\000\022\023\n\017ENET_CHANNEL_ID\020\000\022\024\n\020ENET_IS_RELI" +
"ABLE\020\001\022\013\n\006CMD_ID\020\334\001\032\002\020\001B\033\n\031emu.grasscutt" +
"er.net.protob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_SceneTransToPointRsp_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_SceneTransToPointRsp_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_SceneTransToPointRsp_descriptor,
new java.lang.String[] { "Retcode", "SceneId", "PointId", });
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@ -0,0 +1,19 @@
package emu.grasscutter.server.packet.recv;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneTransToPointReqOuterClass.SceneTransToPointReq;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketSceneTransToPointRsp;
@Opcodes(PacketOpcodes.SceneTransToPointReq)
public class HandlerSceneTransToPointReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
SceneTransToPointReq req = SceneTransToPointReq.parseFrom(payload);
session.send(new PacketSceneTransToPointRsp(session.getPlayer(), req.getPointId(), req.getSceneId()));
}
}

View File

@ -0,0 +1,35 @@
package emu.grasscutter.server.packet.send;
import emu.grasscutter.data.GenshinData;
import emu.grasscutter.data.custom.ScenePointEntry;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneTransToPointRspOuterClass.SceneTransToPointRsp;
import emu.grasscutter.utils.Position;
public class PacketSceneTransToPointRsp extends GenshinPacket {
public PacketSceneTransToPointRsp(GenshinPlayer player, int pointId, int sceneId) {
super(PacketOpcodes.SceneTransToPointRsp);
String code = sceneId + "_" + pointId;
ScenePointEntry scenePointEntry = GenshinData.getScenePointEntries().get(code);
float x = scenePointEntry.getPointData().getTranPos().getX();
float y = scenePointEntry.getPointData().getTranPos().getY();
float z = scenePointEntry.getPointData().getTranPos().getZ();
player.getPos().set(new Position(x, y, z));
player.getWorld().forceTransferPlayerToScene(player, sceneId, player.getPos());
SceneTransToPointRsp proto = SceneTransToPointRsp.newBuilder()
.setRetcode(0)
.setPointId(pointId)
.setSceneId(sceneId)
.build();
this.setData(proto);
}
}