ygopro-msg-encode 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1651,7 +1651,8 @@ var YGOProCtosTimeConfirm = class extends YGOProCtosBase {
1651
1651
  YGOProCtosTimeConfirm.identifier = 21;
1652
1652
 
1653
1653
  // src/protos/ctos/proto/chat.ts
1654
- var _YGOProCtosChat = class _YGOProCtosChat extends YGOProCtosBase {
1654
+ var CTOS_CHAT_MAX_LENGTH = 256;
1655
+ var YGOProCtosChat = class extends YGOProCtosBase {
1655
1656
  constructor() {
1656
1657
  super();
1657
1658
  this.msg = "";
@@ -1662,7 +1663,7 @@ var _YGOProCtosChat = class _YGOProCtosChat extends YGOProCtosBase {
1662
1663
  return this;
1663
1664
  }
1664
1665
  toPayload() {
1665
- const text = this.msg.length > _YGOProCtosChat.MAX_LENGTH ? this.msg.substring(0, _YGOProCtosChat.MAX_LENGTH) : this.msg;
1666
+ const text = this.msg.length > CTOS_CHAT_MAX_LENGTH ? this.msg.substring(0, CTOS_CHAT_MAX_LENGTH) : this.msg;
1666
1667
  const utf16 = new Uint16Array(text.length + 1);
1667
1668
  for (let i = 0; i < text.length; i++) {
1668
1669
  utf16[i] = text.charCodeAt(i);
@@ -1678,12 +1679,12 @@ var _YGOProCtosChat = class _YGOProCtosChat extends YGOProCtosBase {
1678
1679
  return this;
1679
1680
  }
1680
1681
  };
1681
- _YGOProCtosChat.identifier = 22;
1682
- _YGOProCtosChat.MAX_LENGTH = 256;
1683
- var YGOProCtosChat = _YGOProCtosChat;
1682
+ YGOProCtosChat.identifier = 22;
1683
+ YGOProCtosChat.MAX_LENGTH = CTOS_CHAT_MAX_LENGTH;
1684
1684
 
1685
1685
  // src/protos/ctos/proto/external-address.ts
1686
- var _YGOProCtosExternalAddress = class _YGOProCtosExternalAddress extends YGOProCtosBase {
1686
+ var CTOS_EXTERNAL_ADDRESS_MAX_HOSTNAME_LENGTH = 256;
1687
+ var YGOProCtosExternalAddress = class extends YGOProCtosBase {
1687
1688
  constructor() {
1688
1689
  super();
1689
1690
  this.real_ip = "0.0.0.0";
@@ -1728,9 +1729,9 @@ var _YGOProCtosExternalAddress = class _YGOProCtosExternalAddress extends YGOPro
1728
1729
  return this;
1729
1730
  }
1730
1731
  toPayload() {
1731
- const text = this.hostname.length > _YGOProCtosExternalAddress.MAX_HOSTNAME_LENGTH ? this.hostname.substring(
1732
+ const text = this.hostname.length > CTOS_EXTERNAL_ADDRESS_MAX_HOSTNAME_LENGTH ? this.hostname.substring(
1732
1733
  0,
1733
- _YGOProCtosExternalAddress.MAX_HOSTNAME_LENGTH
1734
+ CTOS_EXTERNAL_ADDRESS_MAX_HOSTNAME_LENGTH
1734
1735
  ) : this.hostname;
1735
1736
  const utf16 = new Uint16Array(text.length + 1);
1736
1737
  for (let i = 0; i < text.length; i++) {
@@ -1756,9 +1757,9 @@ var _YGOProCtosExternalAddress = class _YGOProCtosExternalAddress extends YGOPro
1756
1757
  return this;
1757
1758
  }
1758
1759
  };
1759
- _YGOProCtosExternalAddress.identifier = 23;
1760
- _YGOProCtosExternalAddress.MAX_HOSTNAME_LENGTH = 256;
1761
- var YGOProCtosExternalAddress = _YGOProCtosExternalAddress;
1760
+ YGOProCtosExternalAddress.identifier = 23;
1761
+ YGOProCtosExternalAddress.MAX_LENGTH = CTOS_EXTERNAL_ADDRESS_MAX_HOSTNAME_LENGTH;
1762
+ YGOProCtosExternalAddress.MAX_HOSTNAME_LENGTH = CTOS_EXTERNAL_ADDRESS_MAX_HOSTNAME_LENGTH;
1762
1763
 
1763
1764
  // src/protos/ctos/proto/hs-toduelist.ts
1764
1765
  var YGOProCtosHsToDuelist = class extends YGOProCtosBase {
@@ -5784,7 +5785,8 @@ __decorateClass([
5784
5785
  ], YGOProStocTimeLimit.prototype, "left_time", 2);
5785
5786
 
5786
5787
  // src/protos/stoc/proto/chat.ts
5787
- var _YGOProStocChat = class _YGOProStocChat extends YGOProStocBase {
5788
+ var STOC_CHAT_MAX_LENGTH = 256;
5789
+ var YGOProStocChat = class extends YGOProStocBase {
5788
5790
  constructor() {
5789
5791
  super();
5790
5792
  this.player_type = 0;
@@ -5804,7 +5806,7 @@ var _YGOProStocChat = class _YGOProStocChat extends YGOProStocBase {
5804
5806
  return this;
5805
5807
  }
5806
5808
  toPayload() {
5807
- const text = this.msg.length > _YGOProStocChat.MAX_LENGTH ? this.msg.substring(0, _YGOProStocChat.MAX_LENGTH) : this.msg;
5809
+ const text = this.msg.length > STOC_CHAT_MAX_LENGTH ? this.msg.substring(0, STOC_CHAT_MAX_LENGTH) : this.msg;
5808
5810
  const utf16 = new Uint16Array(text.length + 1);
5809
5811
  for (let i = 0; i < text.length; i++) {
5810
5812
  utf16[i] = text.charCodeAt(i);
@@ -5826,9 +5828,8 @@ var _YGOProStocChat = class _YGOProStocChat extends YGOProStocBase {
5826
5828
  return this;
5827
5829
  }
5828
5830
  };
5829
- _YGOProStocChat.identifier = 25;
5830
- _YGOProStocChat.MAX_LENGTH = 256;
5831
- var YGOProStocChat = _YGOProStocChat;
5831
+ YGOProStocChat.identifier = 25;
5832
+ YGOProStocChat.MAX_LENGTH = STOC_CHAT_MAX_LENGTH;
5832
5833
 
5833
5834
  // src/protos/stoc/proto/hs-player-enter.ts
5834
5835
  var YGOProStocHsPlayerEnter = class extends YGOProStocBase {