We shouldn't be using OidLists to report winners/losers/players knocked out.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3711 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -25,6 +25,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import com.samskivert.util.ArrayIntSet;
|
||||||
import com.samskivert.util.Interval;
|
import com.samskivert.util.Interval;
|
||||||
import com.samskivert.util.IntListUtil;
|
import com.samskivert.util.IntListUtil;
|
||||||
import com.samskivert.util.RepeatCallTracker;
|
import com.samskivert.util.RepeatCallTracker;
|
||||||
@@ -35,7 +36,6 @@ import com.threerings.presents.data.ClientObject;
|
|||||||
import com.threerings.presents.dobj.AttributeChangeListener;
|
import com.threerings.presents.dobj.AttributeChangeListener;
|
||||||
import com.threerings.presents.dobj.AttributeChangedEvent;
|
import com.threerings.presents.dobj.AttributeChangedEvent;
|
||||||
import com.threerings.presents.dobj.DObject;
|
import com.threerings.presents.dobj.DObject;
|
||||||
import com.threerings.presents.dobj.OidList;
|
|
||||||
|
|
||||||
import com.threerings.crowd.chat.server.SpeakProvider;
|
import com.threerings.crowd.chat.server.SpeakProvider;
|
||||||
|
|
||||||
@@ -457,12 +457,10 @@ public class GameManager extends PlaceManager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OidList knocky = new OidList(1);
|
|
||||||
knocky.add(user.getOid());
|
|
||||||
|
|
||||||
DObject place = CrowdServer.omgr.getObject(user.location);
|
DObject place = CrowdServer.omgr.getObject(user.location);
|
||||||
if (place != null) {
|
if (place != null) {
|
||||||
place.postMessage(PLAYER_KNOCKED_OUT, new Object[] { knocky });
|
place.postMessage(PLAYER_KNOCKED_OUT,
|
||||||
|
new Object[] { new int[] { user.getOid() } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -996,13 +994,14 @@ public class GameManager extends PlaceManager
|
|||||||
*/
|
*/
|
||||||
protected void reportWinnersAndLosers ()
|
protected void reportWinnersAndLosers ()
|
||||||
{
|
{
|
||||||
OidList winners = new OidList();
|
int numPlayers = _playerOids.length;
|
||||||
OidList losers = new OidList();
|
|
||||||
OidList places = new OidList();
|
|
||||||
|
|
||||||
Object[] args = new Object[] { winners, losers };
|
// set up 3 sets that will not need internal expanding
|
||||||
|
ArrayIntSet winners = new ArrayIntSet(numPlayers);
|
||||||
|
ArrayIntSet losers = new ArrayIntSet(numPlayers);
|
||||||
|
ArrayIntSet places = new ArrayIntSet(numPlayers);
|
||||||
|
|
||||||
for (int ii=0, nn=_playerOids.length; ii < nn; ii++) {
|
for (int ii=0; ii < numPlayers; ii++) {
|
||||||
BodyObject user = getPlayer(ii);
|
BodyObject user = getPlayer(ii);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
places.add(user.location);
|
places.add(user.location);
|
||||||
@@ -1010,6 +1009,9 @@ public class GameManager extends PlaceManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object[] args =
|
||||||
|
new Object[] { winners.toIntArray(), losers.toIntArray() };
|
||||||
|
|
||||||
// now send a message event to each room
|
// now send a message event to each room
|
||||||
for (int ii=0, nn = places.size(); ii < nn; ii++) {
|
for (int ii=0, nn = places.size(); ii < nn; ii++) {
|
||||||
DObject place = CrowdServer.omgr.getObject(places.get(ii));
|
DObject place = CrowdServer.omgr.getObject(places.get(ii));
|
||||||
|
|||||||
Reference in New Issue
Block a user