<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sun Jan 12 12:26:10 UTC 2025

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Mojang Studios Jira</title>
    <link>https://bugs.mojang.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en</language>    <build-info>
        <version>9.12.2</version>
        <build-number>9120002</build-number>
        <build-date>10-01-2024</build-date>
    </build-info>


<item>
            <title>[MC-10984] GS4 query listener fails to send player list when len(players) &gt; 127</title>
                <link>https://bugs.mojang.com/browse/MC-10984</link>
                <project id="10400" key="MC">Minecraft: Java Edition</project>
                    <description>&lt;p&gt;The GS4 Query protocol that minecraft uses is described &lt;a href=&quot;http://wiki.vg/Query&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;, and can be enabled with `enable-query=true` in server.properties. &lt;/p&gt;

&lt;p&gt;In short, in &lt;a href=&quot;http://wiki.vg/Query#Response_3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;full stat mode&lt;/a&gt;, the server sends an empty player list if `count(players) &amp;gt; 127`.&lt;/p&gt;

&lt;p&gt;The exact bug is slightly more subtle. Excerpt from RemoteStatusListener.java:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;            &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.cachedReply.write(&lt;span class=&quot;code-quote&quot;&gt;&quot;player_&quot;&lt;/span&gt;);
            &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.cachedReply.write((&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;) 0);
            &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;[] astring = &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.server.getPlayers();
            &lt;span class=&quot;code-object&quot;&gt;byte&lt;/span&gt; b0 = (&lt;span class=&quot;code-object&quot;&gt;byte&lt;/span&gt;) astring.length;

            &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-object&quot;&gt;byte&lt;/span&gt; b1 = (&lt;span class=&quot;code-object&quot;&gt;byte&lt;/span&gt;) (b0 - 1); b1 &amp;gt;= 0; --b1) {
                &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.cachedReply.write(astring[b1]);
            }

            &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.cachedReply.write((&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;) 0);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The byte cast causes the player list length variable to overflow, and as the loop counts backwards to zero, no players are sent when the count is 128-255. Beyond this the pattern repeats (i.e. with 300 players online, 44 would be listed), so the players list is only reliable for 127 players or fewer.&lt;/p&gt;

&lt;p&gt;By contrast, the &apos;this.server.getPlayers()&apos; method is implemented with an int counter in PlayerList.java:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;        &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;[] astring = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;[&lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.players.size()];

        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; i = 0; i &amp;lt; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.players.size(); ++i) {
            astring[i] = ((EntityPlayer) &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.players.get(i)).getName();
        }

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; astring;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I also can&apos;t think of a reason for the player list to be reversed, as its stored in a largely non-useful order anyway.&lt;/p&gt;</description>
                <environment>&lt;a href=&apos;mailto:barney@invert&apos;&gt;barney@invert&lt;/a&gt;:~$ java -version&lt;br/&gt;
java version &amp;quot;1.7.0_04&amp;quot;&lt;br/&gt;
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)&lt;br/&gt;
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)</environment>
        <key id="25068">MC-10984</key>
            <summary>GS4 query listener fails to send player list when len(players) &gt; 127</summary>
                <type id="1" iconUrl="https://bugs.mojang.com/secure/viewavatar?size=xsmall&amp;avatarId=18903&amp;avatarType=issuetype">Bug</type>
                                    <status id="5" iconUrl="https://bugs.mojang.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="dinnerbone">[Mojang] Nathan Adams</assignee>
                                    <reporter username="barneygale">Barney Gale</reporter>
                        <labels>
                            <label>buffer</label>
                            <label>gs4</label>
                            <label>listener</label>
                            <label>query</label>
                            <label>rcon</label>
                    </labels>
                <created>Mon, 4 Mar 2013 23:01:06 +0100</created>
                <updated>Tue, 1 Oct 2013 18:14:41 +0200</updated>
                            <resolved>Tue, 1 Oct 2013 18:14:41 +0200</resolved>
                                    <version>Minecraft 1.4.7</version>
                    <version>Snapshot 13w10a</version>
                    <version>Minecraft 1.5</version>
                    <version>Snapshot 13w11a</version>
                    <version>Minecraft 1.5.1</version>
                    <version>Minecraft 1.6.1</version>
                    <version>Minecraft 1.6.2</version>
                                    <fixVersion>Minecraft 13w41a</fixVersion>
                                                        <votes>10</votes>
                                    <watches>1</watches>
                                                                            <comments>
                            <comment id="97292" author="barneygale" created="Mon, 5 Aug 2013 23:32:09 +0200"  >&lt;p&gt;Could this bug be reassigned? I think Dan Frisk is busy working on MCPE&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10102">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="28536">MC-13441</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="11663">MC-399</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="11858">MC-587</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                <customfield id="customfield_10701" key="com.atlassian.jira.plugin.system.customfieldtypes:datetime">
                        <customfieldname>CHK</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 28 Mar 2013 20:50:00 +0100</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10500" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Confirmation Status</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10301"><![CDATA[Plausible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11700" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_11100" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Linked</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_11600" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i0n07z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    </customfields>
    </item>
</channel>
</rss>