// Code generated by protocol buffer compiler. Do not edit!
package emu.lunarcore.proto;

import java.io.IOException;
import us.hebi.quickbuf.FieldName;
import us.hebi.quickbuf.InvalidProtocolBufferException;
import us.hebi.quickbuf.JsonSink;
import us.hebi.quickbuf.JsonSource;
import us.hebi.quickbuf.MessageFactory;
import us.hebi.quickbuf.ProtoMessage;
import us.hebi.quickbuf.ProtoSink;
import us.hebi.quickbuf.ProtoSource;
import us.hebi.quickbuf.Utf8String;

public final class GateserverOuterClass {
  /**
   * Protobuf type {@code Gateserver}
   */
  public static final class Gateserver extends ProtoMessage<Gateserver> implements Cloneable {
    private static final long serialVersionUID = 0L;

    /**
     * <code>optional uint32 port = 2;</code>
     */
    private int port;

    /**
     * <code>optional bool unk1 = 8;</code>
     */
    private boolean unk1;

    /**
     * <code>optional bool unk2 = 1159;</code>
     */
    private boolean unk2;

    /**
     * <code>optional bool unk3 = 1624;</code>
     */
    private boolean unk3;

    /**
     * <code>optional string ex_resource_url = 5;</code>
     */
    private final Utf8String exResourceUrl = Utf8String.newEmptyInstance();

    /**
     * <code>optional string asset_bundle_url = 7;</code>
     */
    private final Utf8String assetBundleUrl = Utf8String.newEmptyInstance();

    /**
     * <code>optional string lua_url = 9;</code>
     */
    private final Utf8String luaUrl = Utf8String.newEmptyInstance();

    /**
     * <code>optional string region_name = 12;</code>
     */
    private final Utf8String regionName = Utf8String.newEmptyInstance();

    /**
     * <code>optional string ip = 15;</code>
     */
    private final Utf8String ip = Utf8String.newEmptyInstance();

    /**
     * <code>optional string ifix_url = 762;</code>
     */
    private final Utf8String ifixUrl = Utf8String.newEmptyInstance();

    /**
     * <code>optional string mdk_res_version = 1893;</code>
     */
    private final Utf8String mdkResVersion = Utf8String.newEmptyInstance();

    /**
     * <pre>
     *  Filler
     * </pre>
     *
     * <code>optional string client_secret_key = 2006;</code>
     */
    private final Utf8String clientSecretKey = Utf8String.newEmptyInstance();

    private Gateserver() {
    }

    /**
     * @return a new empty instance of {@code Gateserver}
     */
    public static Gateserver newInstance() {
      return new Gateserver();
    }

    /**
     * <code>optional uint32 port = 2;</code>
     * @return whether the port field is set
     */
    public boolean hasPort() {
      return (bitField0_ & 0x00000001) != 0;
    }

    /**
     * <code>optional uint32 port = 2;</code>
     * @return this
     */
    public Gateserver clearPort() {
      bitField0_ &= ~0x00000001;
      port = 0;
      return this;
    }

    /**
     * <code>optional uint32 port = 2;</code>
     * @return the port
     */
    public int getPort() {
      return port;
    }

    /**
     * <code>optional uint32 port = 2;</code>
     * @param value the port to set
     * @return this
     */
    public Gateserver setPort(final int value) {
      bitField0_ |= 0x00000001;
      port = value;
      return this;
    }

    /**
     * <code>optional bool unk1 = 8;</code>
     * @return whether the unk1 field is set
     */
    public boolean hasUnk1() {
      return (bitField0_ & 0x00000002) != 0;
    }

    /**
     * <code>optional bool unk1 = 8;</code>
     * @return this
     */
    public Gateserver clearUnk1() {
      bitField0_ &= ~0x00000002;
      unk1 = false;
      return this;
    }

    /**
     * <code>optional bool unk1 = 8;</code>
     * @return the unk1
     */
    public boolean getUnk1() {
      return unk1;
    }

    /**
     * <code>optional bool unk1 = 8;</code>
     * @param value the unk1 to set
     * @return this
     */
    public Gateserver setUnk1(final boolean value) {
      bitField0_ |= 0x00000002;
      unk1 = value;
      return this;
    }

    /**
     * <code>optional bool unk2 = 1159;</code>
     * @return whether the unk2 field is set
     */
    public boolean hasUnk2() {
      return (bitField0_ & 0x00000004) != 0;
    }

    /**
     * <code>optional bool unk2 = 1159;</code>
     * @return this
     */
    public Gateserver clearUnk2() {
      bitField0_ &= ~0x00000004;
      unk2 = false;
      return this;
    }

    /**
     * <code>optional bool unk2 = 1159;</code>
     * @return the unk2
     */
    public boolean getUnk2() {
      return unk2;
    }

    /**
     * <code>optional bool unk2 = 1159;</code>
     * @param value the unk2 to set
     * @return this
     */
    public Gateserver setUnk2(final boolean value) {
      bitField0_ |= 0x00000004;
      unk2 = value;
      return this;
    }

    /**
     * <code>optional bool unk3 = 1624;</code>
     * @return whether the unk3 field is set
     */
    public boolean hasUnk3() {
      return (bitField0_ & 0x00000008) != 0;
    }

    /**
     * <code>optional bool unk3 = 1624;</code>
     * @return this
     */
    public Gateserver clearUnk3() {
      bitField0_ &= ~0x00000008;
      unk3 = false;
      return this;
    }

    /**
     * <code>optional bool unk3 = 1624;</code>
     * @return the unk3
     */
    public boolean getUnk3() {
      return unk3;
    }

    /**
     * <code>optional bool unk3 = 1624;</code>
     * @param value the unk3 to set
     * @return this
     */
    public Gateserver setUnk3(final boolean value) {
      bitField0_ |= 0x00000008;
      unk3 = value;
      return this;
    }

    /**
     * <code>optional string ex_resource_url = 5;</code>
     * @return whether the exResourceUrl field is set
     */
    public boolean hasExResourceUrl() {
      return (bitField0_ & 0x00000010) != 0;
    }

    /**
     * <code>optional string ex_resource_url = 5;</code>
     * @return this
     */
    public Gateserver clearExResourceUrl() {
      bitField0_ &= ~0x00000010;
      exResourceUrl.clear();
      return this;
    }

    /**
     * <code>optional string ex_resource_url = 5;</code>
     * @return the exResourceUrl
     */
    public String getExResourceUrl() {
      return exResourceUrl.getString();
    }

    /**
     * <code>optional string ex_resource_url = 5;</code>
     * @return internal {@code Utf8String} representation of exResourceUrl for reading
     */
    public Utf8String getExResourceUrlBytes() {
      return this.exResourceUrl;
    }

    /**
     * <code>optional string ex_resource_url = 5;</code>
     * @return internal {@code Utf8String} representation of exResourceUrl for modifications
     */
    public Utf8String getMutableExResourceUrlBytes() {
      bitField0_ |= 0x00000010;
      return this.exResourceUrl;
    }

    /**
     * <code>optional string ex_resource_url = 5;</code>
     * @param value the exResourceUrl to set
     * @return this
     */
    public Gateserver setExResourceUrl(final CharSequence value) {
      bitField0_ |= 0x00000010;
      exResourceUrl.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string ex_resource_url = 5;</code>
     * @param value the exResourceUrl to set
     * @return this
     */
    public Gateserver setExResourceUrl(final Utf8String value) {
      bitField0_ |= 0x00000010;
      exResourceUrl.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string asset_bundle_url = 7;</code>
     * @return whether the assetBundleUrl field is set
     */
    public boolean hasAssetBundleUrl() {
      return (bitField0_ & 0x00000020) != 0;
    }

    /**
     * <code>optional string asset_bundle_url = 7;</code>
     * @return this
     */
    public Gateserver clearAssetBundleUrl() {
      bitField0_ &= ~0x00000020;
      assetBundleUrl.clear();
      return this;
    }

    /**
     * <code>optional string asset_bundle_url = 7;</code>
     * @return the assetBundleUrl
     */
    public String getAssetBundleUrl() {
      return assetBundleUrl.getString();
    }

    /**
     * <code>optional string asset_bundle_url = 7;</code>
     * @return internal {@code Utf8String} representation of assetBundleUrl for reading
     */
    public Utf8String getAssetBundleUrlBytes() {
      return this.assetBundleUrl;
    }

    /**
     * <code>optional string asset_bundle_url = 7;</code>
     * @return internal {@code Utf8String} representation of assetBundleUrl for modifications
     */
    public Utf8String getMutableAssetBundleUrlBytes() {
      bitField0_ |= 0x00000020;
      return this.assetBundleUrl;
    }

    /**
     * <code>optional string asset_bundle_url = 7;</code>
     * @param value the assetBundleUrl to set
     * @return this
     */
    public Gateserver setAssetBundleUrl(final CharSequence value) {
      bitField0_ |= 0x00000020;
      assetBundleUrl.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string asset_bundle_url = 7;</code>
     * @param value the assetBundleUrl to set
     * @return this
     */
    public Gateserver setAssetBundleUrl(final Utf8String value) {
      bitField0_ |= 0x00000020;
      assetBundleUrl.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string lua_url = 9;</code>
     * @return whether the luaUrl field is set
     */
    public boolean hasLuaUrl() {
      return (bitField0_ & 0x00000040) != 0;
    }

    /**
     * <code>optional string lua_url = 9;</code>
     * @return this
     */
    public Gateserver clearLuaUrl() {
      bitField0_ &= ~0x00000040;
      luaUrl.clear();
      return this;
    }

    /**
     * <code>optional string lua_url = 9;</code>
     * @return the luaUrl
     */
    public String getLuaUrl() {
      return luaUrl.getString();
    }

    /**
     * <code>optional string lua_url = 9;</code>
     * @return internal {@code Utf8String} representation of luaUrl for reading
     */
    public Utf8String getLuaUrlBytes() {
      return this.luaUrl;
    }

    /**
     * <code>optional string lua_url = 9;</code>
     * @return internal {@code Utf8String} representation of luaUrl for modifications
     */
    public Utf8String getMutableLuaUrlBytes() {
      bitField0_ |= 0x00000040;
      return this.luaUrl;
    }

    /**
     * <code>optional string lua_url = 9;</code>
     * @param value the luaUrl to set
     * @return this
     */
    public Gateserver setLuaUrl(final CharSequence value) {
      bitField0_ |= 0x00000040;
      luaUrl.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string lua_url = 9;</code>
     * @param value the luaUrl to set
     * @return this
     */
    public Gateserver setLuaUrl(final Utf8String value) {
      bitField0_ |= 0x00000040;
      luaUrl.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string region_name = 12;</code>
     * @return whether the regionName field is set
     */
    public boolean hasRegionName() {
      return (bitField0_ & 0x00000080) != 0;
    }

    /**
     * <code>optional string region_name = 12;</code>
     * @return this
     */
    public Gateserver clearRegionName() {
      bitField0_ &= ~0x00000080;
      regionName.clear();
      return this;
    }

    /**
     * <code>optional string region_name = 12;</code>
     * @return the regionName
     */
    public String getRegionName() {
      return regionName.getString();
    }

    /**
     * <code>optional string region_name = 12;</code>
     * @return internal {@code Utf8String} representation of regionName for reading
     */
    public Utf8String getRegionNameBytes() {
      return this.regionName;
    }

    /**
     * <code>optional string region_name = 12;</code>
     * @return internal {@code Utf8String} representation of regionName for modifications
     */
    public Utf8String getMutableRegionNameBytes() {
      bitField0_ |= 0x00000080;
      return this.regionName;
    }

    /**
     * <code>optional string region_name = 12;</code>
     * @param value the regionName to set
     * @return this
     */
    public Gateserver setRegionName(final CharSequence value) {
      bitField0_ |= 0x00000080;
      regionName.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string region_name = 12;</code>
     * @param value the regionName to set
     * @return this
     */
    public Gateserver setRegionName(final Utf8String value) {
      bitField0_ |= 0x00000080;
      regionName.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string ip = 15;</code>
     * @return whether the ip field is set
     */
    public boolean hasIp() {
      return (bitField0_ & 0x00000100) != 0;
    }

    /**
     * <code>optional string ip = 15;</code>
     * @return this
     */
    public Gateserver clearIp() {
      bitField0_ &= ~0x00000100;
      ip.clear();
      return this;
    }

    /**
     * <code>optional string ip = 15;</code>
     * @return the ip
     */
    public String getIp() {
      return ip.getString();
    }

    /**
     * <code>optional string ip = 15;</code>
     * @return internal {@code Utf8String} representation of ip for reading
     */
    public Utf8String getIpBytes() {
      return this.ip;
    }

    /**
     * <code>optional string ip = 15;</code>
     * @return internal {@code Utf8String} representation of ip for modifications
     */
    public Utf8String getMutableIpBytes() {
      bitField0_ |= 0x00000100;
      return this.ip;
    }

    /**
     * <code>optional string ip = 15;</code>
     * @param value the ip to set
     * @return this
     */
    public Gateserver setIp(final CharSequence value) {
      bitField0_ |= 0x00000100;
      ip.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string ip = 15;</code>
     * @param value the ip to set
     * @return this
     */
    public Gateserver setIp(final Utf8String value) {
      bitField0_ |= 0x00000100;
      ip.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string ifix_url = 762;</code>
     * @return whether the ifixUrl field is set
     */
    public boolean hasIfixUrl() {
      return (bitField0_ & 0x00000200) != 0;
    }

    /**
     * <code>optional string ifix_url = 762;</code>
     * @return this
     */
    public Gateserver clearIfixUrl() {
      bitField0_ &= ~0x00000200;
      ifixUrl.clear();
      return this;
    }

    /**
     * <code>optional string ifix_url = 762;</code>
     * @return the ifixUrl
     */
    public String getIfixUrl() {
      return ifixUrl.getString();
    }

    /**
     * <code>optional string ifix_url = 762;</code>
     * @return internal {@code Utf8String} representation of ifixUrl for reading
     */
    public Utf8String getIfixUrlBytes() {
      return this.ifixUrl;
    }

    /**
     * <code>optional string ifix_url = 762;</code>
     * @return internal {@code Utf8String} representation of ifixUrl for modifications
     */
    public Utf8String getMutableIfixUrlBytes() {
      bitField0_ |= 0x00000200;
      return this.ifixUrl;
    }

    /**
     * <code>optional string ifix_url = 762;</code>
     * @param value the ifixUrl to set
     * @return this
     */
    public Gateserver setIfixUrl(final CharSequence value) {
      bitField0_ |= 0x00000200;
      ifixUrl.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string ifix_url = 762;</code>
     * @param value the ifixUrl to set
     * @return this
     */
    public Gateserver setIfixUrl(final Utf8String value) {
      bitField0_ |= 0x00000200;
      ifixUrl.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string mdk_res_version = 1893;</code>
     * @return whether the mdkResVersion field is set
     */
    public boolean hasMdkResVersion() {
      return (bitField0_ & 0x00000400) != 0;
    }

    /**
     * <code>optional string mdk_res_version = 1893;</code>
     * @return this
     */
    public Gateserver clearMdkResVersion() {
      bitField0_ &= ~0x00000400;
      mdkResVersion.clear();
      return this;
    }

    /**
     * <code>optional string mdk_res_version = 1893;</code>
     * @return the mdkResVersion
     */
    public String getMdkResVersion() {
      return mdkResVersion.getString();
    }

    /**
     * <code>optional string mdk_res_version = 1893;</code>
     * @return internal {@code Utf8String} representation of mdkResVersion for reading
     */
    public Utf8String getMdkResVersionBytes() {
      return this.mdkResVersion;
    }

    /**
     * <code>optional string mdk_res_version = 1893;</code>
     * @return internal {@code Utf8String} representation of mdkResVersion for modifications
     */
    public Utf8String getMutableMdkResVersionBytes() {
      bitField0_ |= 0x00000400;
      return this.mdkResVersion;
    }

    /**
     * <code>optional string mdk_res_version = 1893;</code>
     * @param value the mdkResVersion to set
     * @return this
     */
    public Gateserver setMdkResVersion(final CharSequence value) {
      bitField0_ |= 0x00000400;
      mdkResVersion.copyFrom(value);
      return this;
    }

    /**
     * <code>optional string mdk_res_version = 1893;</code>
     * @param value the mdkResVersion to set
     * @return this
     */
    public Gateserver setMdkResVersion(final Utf8String value) {
      bitField0_ |= 0x00000400;
      mdkResVersion.copyFrom(value);
      return this;
    }

    /**
     * <pre>
     *  Filler
     * </pre>
     *
     * <code>optional string client_secret_key = 2006;</code>
     * @return whether the clientSecretKey field is set
     */
    public boolean hasClientSecretKey() {
      return (bitField0_ & 0x00000800) != 0;
    }

    /**
     * <pre>
     *  Filler
     * </pre>
     *
     * <code>optional string client_secret_key = 2006;</code>
     * @return this
     */
    public Gateserver clearClientSecretKey() {
      bitField0_ &= ~0x00000800;
      clientSecretKey.clear();
      return this;
    }

    /**
     * <pre>
     *  Filler
     * </pre>
     *
     * <code>optional string client_secret_key = 2006;</code>
     * @return the clientSecretKey
     */
    public String getClientSecretKey() {
      return clientSecretKey.getString();
    }

    /**
     * <pre>
     *  Filler
     * </pre>
     *
     * <code>optional string client_secret_key = 2006;</code>
     * @return internal {@code Utf8String} representation of clientSecretKey for reading
     */
    public Utf8String getClientSecretKeyBytes() {
      return this.clientSecretKey;
    }

    /**
     * <pre>
     *  Filler
     * </pre>
     *
     * <code>optional string client_secret_key = 2006;</code>
     * @return internal {@code Utf8String} representation of clientSecretKey for modifications
     */
    public Utf8String getMutableClientSecretKeyBytes() {
      bitField0_ |= 0x00000800;
      return this.clientSecretKey;
    }

    /**
     * <pre>
     *  Filler
     * </pre>
     *
     * <code>optional string client_secret_key = 2006;</code>
     * @param value the clientSecretKey to set
     * @return this
     */
    public Gateserver setClientSecretKey(final CharSequence value) {
      bitField0_ |= 0x00000800;
      clientSecretKey.copyFrom(value);
      return this;
    }

    /**
     * <pre>
     *  Filler
     * </pre>
     *
     * <code>optional string client_secret_key = 2006;</code>
     * @param value the clientSecretKey to set
     * @return this
     */
    public Gateserver setClientSecretKey(final Utf8String value) {
      bitField0_ |= 0x00000800;
      clientSecretKey.copyFrom(value);
      return this;
    }

    @Override
    public Gateserver copyFrom(final Gateserver other) {
      cachedSize = other.cachedSize;
      if ((bitField0_ | other.bitField0_) != 0) {
        bitField0_ = other.bitField0_;
        port = other.port;
        unk1 = other.unk1;
        unk2 = other.unk2;
        unk3 = other.unk3;
        exResourceUrl.copyFrom(other.exResourceUrl);
        assetBundleUrl.copyFrom(other.assetBundleUrl);
        luaUrl.copyFrom(other.luaUrl);
        regionName.copyFrom(other.regionName);
        ip.copyFrom(other.ip);
        ifixUrl.copyFrom(other.ifixUrl);
        mdkResVersion.copyFrom(other.mdkResVersion);
        clientSecretKey.copyFrom(other.clientSecretKey);
      }
      return this;
    }

    @Override
    public Gateserver mergeFrom(final Gateserver other) {
      if (other.isEmpty()) {
        return this;
      }
      cachedSize = -1;
      if (other.hasPort()) {
        setPort(other.port);
      }
      if (other.hasUnk1()) {
        setUnk1(other.unk1);
      }
      if (other.hasUnk2()) {
        setUnk2(other.unk2);
      }
      if (other.hasUnk3()) {
        setUnk3(other.unk3);
      }
      if (other.hasExResourceUrl()) {
        getMutableExResourceUrlBytes().copyFrom(other.exResourceUrl);
      }
      if (other.hasAssetBundleUrl()) {
        getMutableAssetBundleUrlBytes().copyFrom(other.assetBundleUrl);
      }
      if (other.hasLuaUrl()) {
        getMutableLuaUrlBytes().copyFrom(other.luaUrl);
      }
      if (other.hasRegionName()) {
        getMutableRegionNameBytes().copyFrom(other.regionName);
      }
      if (other.hasIp()) {
        getMutableIpBytes().copyFrom(other.ip);
      }
      if (other.hasIfixUrl()) {
        getMutableIfixUrlBytes().copyFrom(other.ifixUrl);
      }
      if (other.hasMdkResVersion()) {
        getMutableMdkResVersionBytes().copyFrom(other.mdkResVersion);
      }
      if (other.hasClientSecretKey()) {
        getMutableClientSecretKeyBytes().copyFrom(other.clientSecretKey);
      }
      return this;
    }

    @Override
    public Gateserver clear() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      port = 0;
      unk1 = false;
      unk2 = false;
      unk3 = false;
      exResourceUrl.clear();
      assetBundleUrl.clear();
      luaUrl.clear();
      regionName.clear();
      ip.clear();
      ifixUrl.clear();
      mdkResVersion.clear();
      clientSecretKey.clear();
      return this;
    }

    @Override
    public Gateserver clearQuick() {
      if (isEmpty()) {
        return this;
      }
      cachedSize = -1;
      bitField0_ = 0;
      exResourceUrl.clear();
      assetBundleUrl.clear();
      luaUrl.clear();
      regionName.clear();
      ip.clear();
      ifixUrl.clear();
      mdkResVersion.clear();
      clientSecretKey.clear();
      return this;
    }

    @Override
    public boolean equals(Object o) {
      if (o == this) {
        return true;
      }
      if (!(o instanceof Gateserver)) {
        return false;
      }
      Gateserver other = (Gateserver) o;
      return bitField0_ == other.bitField0_
        && (!hasPort() || port == other.port)
        && (!hasUnk1() || unk1 == other.unk1)
        && (!hasUnk2() || unk2 == other.unk2)
        && (!hasUnk3() || unk3 == other.unk3)
        && (!hasExResourceUrl() || exResourceUrl.equals(other.exResourceUrl))
        && (!hasAssetBundleUrl() || assetBundleUrl.equals(other.assetBundleUrl))
        && (!hasLuaUrl() || luaUrl.equals(other.luaUrl))
        && (!hasRegionName() || regionName.equals(other.regionName))
        && (!hasIp() || ip.equals(other.ip))
        && (!hasIfixUrl() || ifixUrl.equals(other.ifixUrl))
        && (!hasMdkResVersion() || mdkResVersion.equals(other.mdkResVersion))
        && (!hasClientSecretKey() || clientSecretKey.equals(other.clientSecretKey));
    }

    @Override
    public void writeTo(final ProtoSink output) throws IOException {
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeRawByte((byte) 16);
        output.writeUInt32NoTag(port);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeRawByte((byte) 64);
        output.writeBoolNoTag(unk1);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeRawLittleEndian16((short) 18616);
        output.writeBoolNoTag(unk2);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeRawLittleEndian16((short) 26048);
        output.writeBoolNoTag(unk3);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeRawByte((byte) 42);
        output.writeStringNoTag(exResourceUrl);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeRawByte((byte) 58);
        output.writeStringNoTag(assetBundleUrl);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeRawByte((byte) 74);
        output.writeStringNoTag(luaUrl);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeRawByte((byte) 98);
        output.writeStringNoTag(regionName);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeRawByte((byte) 122);
        output.writeStringNoTag(ip);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeRawLittleEndian16((short) 12242);
        output.writeStringNoTag(ifixUrl);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        output.writeRawLittleEndian16((short) 30378);
        output.writeStringNoTag(mdkResVersion);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        output.writeRawLittleEndian16((short) 32178);
        output.writeStringNoTag(clientSecretKey);
      }
    }

    @Override
    protected int computeSerializedSize() {
      int size = 0;
      if ((bitField0_ & 0x00000001) != 0) {
        size += 1 + ProtoSink.computeUInt32SizeNoTag(port);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        size += 2;
      }
      if ((bitField0_ & 0x00000004) != 0) {
        size += 3;
      }
      if ((bitField0_ & 0x00000008) != 0) {
        size += 3;
      }
      if ((bitField0_ & 0x00000010) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(exResourceUrl);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(assetBundleUrl);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(luaUrl);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(regionName);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        size += 1 + ProtoSink.computeStringSizeNoTag(ip);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        size += 2 + ProtoSink.computeStringSizeNoTag(ifixUrl);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        size += 2 + ProtoSink.computeStringSizeNoTag(mdkResVersion);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        size += 2 + ProtoSink.computeStringSizeNoTag(clientSecretKey);
      }
      return size;
    }

    @Override
    @SuppressWarnings("fallthrough")
    public Gateserver mergeFrom(final ProtoSource input) throws IOException {
      // Enabled Fall-Through Optimization (QuickBuffers)
      int tag = input.readTag();
      while (true) {
        switch (tag) {
          case 16: {
            // port
            port = input.readUInt32();
            bitField0_ |= 0x00000001;
            tag = input.readTag();
            if (tag != 64) {
              break;
            }
          }
          case 64: {
            // unk1
            unk1 = input.readBool();
            bitField0_ |= 0x00000002;
            tag = input.readTag();
            if (tag != 9272) {
              break;
            }
          }
          case 9272: {
            // unk2
            unk2 = input.readBool();
            bitField0_ |= 0x00000004;
            tag = input.readTag();
            if (tag != 12992) {
              break;
            }
          }
          case 12992: {
            // unk3
            unk3 = input.readBool();
            bitField0_ |= 0x00000008;
            tag = input.readTag();
            if (tag != 42) {
              break;
            }
          }
          case 42: {
            // exResourceUrl
            input.readString(exResourceUrl);
            bitField0_ |= 0x00000010;
            tag = input.readTag();
            if (tag != 58) {
              break;
            }
          }
          case 58: {
            // assetBundleUrl
            input.readString(assetBundleUrl);
            bitField0_ |= 0x00000020;
            tag = input.readTag();
            if (tag != 74) {
              break;
            }
          }
          case 74: {
            // luaUrl
            input.readString(luaUrl);
            bitField0_ |= 0x00000040;
            tag = input.readTag();
            if (tag != 98) {
              break;
            }
          }
          case 98: {
            // regionName
            input.readString(regionName);
            bitField0_ |= 0x00000080;
            tag = input.readTag();
            if (tag != 122) {
              break;
            }
          }
          case 122: {
            // ip
            input.readString(ip);
            bitField0_ |= 0x00000100;
            tag = input.readTag();
            if (tag != 6098) {
              break;
            }
          }
          case 6098: {
            // ifixUrl
            input.readString(ifixUrl);
            bitField0_ |= 0x00000200;
            tag = input.readTag();
            if (tag != 15146) {
              break;
            }
          }
          case 15146: {
            // mdkResVersion
            input.readString(mdkResVersion);
            bitField0_ |= 0x00000400;
            tag = input.readTag();
            if (tag != 16050) {
              break;
            }
          }
          case 16050: {
            // clientSecretKey
            input.readString(clientSecretKey);
            bitField0_ |= 0x00000800;
            tag = input.readTag();
            if (tag != 0) {
              break;
            }
          }
          case 0: {
            return this;
          }
          default: {
            if (!input.skipField(tag)) {
              return this;
            }
            tag = input.readTag();
            break;
          }
        }
      }
    }

    @Override
    public void writeTo(final JsonSink output) throws IOException {
      output.beginObject();
      if ((bitField0_ & 0x00000001) != 0) {
        output.writeUInt32(FieldNames.port, port);
      }
      if ((bitField0_ & 0x00000002) != 0) {
        output.writeBool(FieldNames.unk1, unk1);
      }
      if ((bitField0_ & 0x00000004) != 0) {
        output.writeBool(FieldNames.unk2, unk2);
      }
      if ((bitField0_ & 0x00000008) != 0) {
        output.writeBool(FieldNames.unk3, unk3);
      }
      if ((bitField0_ & 0x00000010) != 0) {
        output.writeString(FieldNames.exResourceUrl, exResourceUrl);
      }
      if ((bitField0_ & 0x00000020) != 0) {
        output.writeString(FieldNames.assetBundleUrl, assetBundleUrl);
      }
      if ((bitField0_ & 0x00000040) != 0) {
        output.writeString(FieldNames.luaUrl, luaUrl);
      }
      if ((bitField0_ & 0x00000080) != 0) {
        output.writeString(FieldNames.regionName, regionName);
      }
      if ((bitField0_ & 0x00000100) != 0) {
        output.writeString(FieldNames.ip, ip);
      }
      if ((bitField0_ & 0x00000200) != 0) {
        output.writeString(FieldNames.ifixUrl, ifixUrl);
      }
      if ((bitField0_ & 0x00000400) != 0) {
        output.writeString(FieldNames.mdkResVersion, mdkResVersion);
      }
      if ((bitField0_ & 0x00000800) != 0) {
        output.writeString(FieldNames.clientSecretKey, clientSecretKey);
      }
      output.endObject();
    }

    @Override
    public Gateserver mergeFrom(final JsonSource input) throws IOException {
      if (!input.beginObject()) {
        return this;
      }
      while (!input.isAtEnd()) {
        switch (input.readFieldHash()) {
          case 3446913: {
            if (input.isAtField(FieldNames.port)) {
              if (!input.trySkipNullValue()) {
                port = input.readUInt32();
                bitField0_ |= 0x00000001;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3594623: {
            if (input.isAtField(FieldNames.unk1)) {
              if (!input.trySkipNullValue()) {
                unk1 = input.readBool();
                bitField0_ |= 0x00000002;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3594624: {
            if (input.isAtField(FieldNames.unk2)) {
              if (!input.trySkipNullValue()) {
                unk2 = input.readBool();
                bitField0_ |= 0x00000004;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3594625: {
            if (input.isAtField(FieldNames.unk3)) {
              if (!input.trySkipNullValue()) {
                unk3 = input.readBool();
                bitField0_ |= 0x00000008;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1643520974:
          case -1086137910: {
            if (input.isAtField(FieldNames.exResourceUrl)) {
              if (!input.trySkipNullValue()) {
                input.readString(exResourceUrl);
                bitField0_ |= 0x00000010;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1116358531:
          case 1973569761: {
            if (input.isAtField(FieldNames.assetBundleUrl)) {
              if (!input.trySkipNullValue()) {
                input.readString(assetBundleUrl);
                bitField0_ |= 0x00000020;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1091991977:
          case 508288168: {
            if (input.isAtField(FieldNames.luaUrl)) {
              if (!input.trySkipNullValue()) {
                input.readString(luaUrl);
                bitField0_ |= 0x00000040;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1990689889:
          case -1565768458: {
            if (input.isAtField(FieldNames.regionName)) {
              if (!input.trySkipNullValue()) {
                input.readString(regionName);
                bitField0_ |= 0x00000080;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 3367: {
            if (input.isAtField(FieldNames.ip)) {
              if (!input.trySkipNullValue()) {
                input.readString(ip);
                bitField0_ |= 0x00000100;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case 1719409347:
          case 1762383292: {
            if (input.isAtField(FieldNames.ifixUrl)) {
              if (!input.trySkipNullValue()) {
                input.readString(ifixUrl);
                bitField0_ |= 0x00000200;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -1415579412:
          case -204279250: {
            if (input.isAtField(FieldNames.mdkResVersion)) {
              if (!input.trySkipNullValue()) {
                input.readString(mdkResVersion);
                bitField0_ |= 0x00000400;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          case -584558076:
          case 904194372: {
            if (input.isAtField(FieldNames.clientSecretKey)) {
              if (!input.trySkipNullValue()) {
                input.readString(clientSecretKey);
                bitField0_ |= 0x00000800;
              }
            } else {
              input.skipUnknownField();
            }
            break;
          }
          default: {
            input.skipUnknownField();
            break;
          }
        }
      }
      input.endObject();
      return this;
    }

    @Override
    public Gateserver clone() {
      return new Gateserver().copyFrom(this);
    }

    @Override
    public boolean isEmpty() {
      return ((bitField0_) == 0);
    }

    public static Gateserver parseFrom(final byte[] data) throws InvalidProtocolBufferException {
      return ProtoMessage.mergeFrom(new Gateserver(), data).checkInitialized();
    }

    public static Gateserver parseFrom(final ProtoSource input) throws IOException {
      return ProtoMessage.mergeFrom(new Gateserver(), input).checkInitialized();
    }

    public static Gateserver parseFrom(final JsonSource input) throws IOException {
      return ProtoMessage.mergeFrom(new Gateserver(), input).checkInitialized();
    }

    /**
     * @return factory for creating Gateserver messages
     */
    public static MessageFactory<Gateserver> getFactory() {
      return GateserverFactory.INSTANCE;
    }

    private enum GateserverFactory implements MessageFactory<Gateserver> {
      INSTANCE;

      @Override
      public Gateserver create() {
        return Gateserver.newInstance();
      }
    }

    /**
     * Contains name constants used for serializing JSON
     */
    static class FieldNames {
      static final FieldName port = FieldName.forField("port");

      static final FieldName unk1 = FieldName.forField("unk1");

      static final FieldName unk2 = FieldName.forField("unk2");

      static final FieldName unk3 = FieldName.forField("unk3");

      static final FieldName exResourceUrl = FieldName.forField("exResourceUrl", "ex_resource_url");

      static final FieldName assetBundleUrl = FieldName.forField("assetBundleUrl", "asset_bundle_url");

      static final FieldName luaUrl = FieldName.forField("luaUrl", "lua_url");

      static final FieldName regionName = FieldName.forField("regionName", "region_name");

      static final FieldName ip = FieldName.forField("ip");

      static final FieldName ifixUrl = FieldName.forField("ifixUrl", "ifix_url");

      static final FieldName mdkResVersion = FieldName.forField("mdkResVersion", "mdk_res_version");

      static final FieldName clientSecretKey = FieldName.forField("clientSecretKey", "client_secret_key");
    }
  }
}
