Skip to content

Commit

Permalink
v92.9 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jgunishka committed Aug 22, 2021
1 parent d2b6373 commit a097681
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public String getMessage()
public int getBodyLength()
{
//return (charset.encode(userName).remaining() + charset.encode(message).remaining() + 2);
return (userName.length() + message.length() + 2);
return (getNumBytes(userName) + getNumBytes(message) + 2);
}

public void writeBodyTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public String toString()
public int getBodyLength()
{
//return (charset.encode(userName).remaining() + charset.encode(message).remaining() + 4);
return (userName.length() + message.length() + 4);
return (getNumBytes(userName) + getNumBytes(message) + 4);
}

public void writeBodyTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public int getVal1()
public int getBodyLength()
{
//return (charset.encode(userName).remaining() + charset.encode(romName).remaining() + charset.encode(clientType).remaining() + 7);
return (userName.length() + romName.length() + clientType.length() + 7);
return (getNumBytes(userName) + getNumBytes(romName) + getNumBytes(clientType) + 7);
}

public void writeBodyTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public String getMessage()
public int getBodyLength()
{
//return (charset.encode(userName).remaining() + charset.encode(message).remaining() + 2);
return (userName.length() + message.length() + 2);
return (getNumBytes(userName) + getNumBytes(message) + 2);
}

public void writeBodyTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public String toString()
public int getBodyLength()
{
//return (charset.encode(source).remaining() + charset.encode(message).remaining() + 2);
return (source.length() + message.length() + 2);
return (getNumBytes(source) + getNumBytes(message) + 2);
}

public void writeBodyTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public byte getConnectionType()
public int getBodyLength()
{
//return (charset.encode(userName).remaining() + 13);
return (userName.length() + 13);
return (getNumBytes(userName) + 13);
}

public void writeBodyTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public String toString()
public int getBodyLength()
{
//return (charset.encode(userName).remaining() + 2);
return (userName.length() + 2);
return (getNumBytes(userName) + 2);
}

public void writeBodyTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public String toString()
public int getLength()
{
//return (charset.encode(userName).remaining() + 2);
return (userName.length() + 8);
return (getNumBytes(userName) + 8);
}

public void writeTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public String getMessage()
public int getBodyLength()
{
//return (charset.encode(userName).remaining() + charset.encode(message).remaining() + 4);
return (userName.length() + message.length() + 4);
return (getNumBytes(userName) + getNumBytes(message) + 4);
}

public void writeBodyTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public int getUserID()
public int getBodyLength()
{
//return (charset.encode(userName).remaining() + 3);
return (userName.length() + 3);
return (getNumBytes(userName) + 3);
}

public void writeBodyTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public String toString()
public int getLength()
{
//return (charset.encode(userName).remaining() + 9);
return (userName.length() + 9);
return (getNumBytes(userName) + 9);
}

public void writeTo(ByteBuffer buffer)
Expand Down Expand Up @@ -318,7 +318,7 @@ public String toString()
public int getLength()
{
//return (charset.encode(romName).remaining() + 1 + 4 + charset.encode(clientType).remaining() + 1 + charset.encode(userName).remaining() + 1 + charset.encode(players).remaining() + 1 + 1);
return (romName.length() + 1 + 4 + clientType.length() + 1 + userName.length() + 1 + players.length() + 1 + 1);
return (getNumBytes(romName) + 1 + 4 + getNumBytes(clientType) + 1 + getNumBytes(userName) + 1 + getNumBytes(players) + 1 + 1);
}

public void writeTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public String getDescription()
public int getBodyLength()
{
//return (charset.encode(userName).remaining() + charset.encode(clientType).remaining() + 3);
return (userName.length() + clientType.length() + 3);
return (getNumBytes(userName) + getNumBytes(clientType) + 3);
}

public String getUserName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public String toString()
public int getBodyLength()
{
//return (charset.encode(userName).remaining() + 8);
return (userName.length() + 8);
return (getNumBytes(userName) + 8);
}

public void writeBodyTo(ByteBuffer buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public int getLength()
return (getBodyLength() + 1);
//return (getBodyLength() + 5);
}

/** Gets the number of bytes to represent the string in the charset defined in emulinker.cfg **/
protected static int getNumBytes(String s)
{
return s.getBytes(charset).length;
}

public abstract int getBodyLength();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public final class KailleraServerReleaseInfo implements ReleaseInfo

private final int majorVersion = 0;
private final int minorVersion = 92;
private final int buildNumber = 7;
private final int buildNumber = 9;

private final String releaseDate = "08-21-2021";
private final String releaseDate = "08-22-2021";
private final String licenseInfo = "Usage of this sofware is subject to the terms found in the included license";
private final String website = "https://www.EmuLinker.org";

Expand Down

0 comments on commit a097681

Please sign in to comment.