More style fixes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5242 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -291,7 +291,6 @@ public class BureauRegistry
|
||||
|
||||
// transition the agent to a new state and perform the effect of the transition
|
||||
switch (found.state) {
|
||||
|
||||
case Bureau.PENDING:
|
||||
found.bureau.agentStates.remove(found.agent);
|
||||
// !TODO: is the the right place to destroy it?
|
||||
@@ -611,7 +610,7 @@ public class BureauRegistry
|
||||
protected Process _result;
|
||||
}
|
||||
|
||||
// Models the results of searching for an agent
|
||||
/** Models the results of searching for an agent. */
|
||||
protected static class FoundAgent
|
||||
{
|
||||
FoundAgent (
|
||||
@@ -634,7 +633,7 @@ public class BureauRegistry
|
||||
int state;
|
||||
}
|
||||
|
||||
// Models a bureau, including the process handle, all running agents and their states
|
||||
/** Models a bureau, including the process handle, all running agents and their states. */
|
||||
protected static class Bureau
|
||||
{
|
||||
// Agent states {
|
||||
@@ -687,8 +686,7 @@ public class BureauRegistry
|
||||
builder.append("[Bureau id=").append(bureauId).append(", client=");
|
||||
if (clientObj == null) {
|
||||
builder.append("null");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
builder.append(clientObj.getOid());
|
||||
}
|
||||
builder.append(", launcher=").append(launcher);
|
||||
@@ -705,7 +703,7 @@ public class BureauRegistry
|
||||
|
||||
StringBuilder agentSummary (StringBuilder str)
|
||||
{
|
||||
int counts[] = {0, 0, 0, 0, 0};
|
||||
int[] counts = {0, 0, 0, 0, 0};
|
||||
for (Map.Entry<AgentObject, Integer> me : agentStates.entrySet()) {
|
||||
counts[me.getValue()]++;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class ChatDirector extends BasicDirector
|
||||
/**
|
||||
* Called when the list of chatters has been changed.
|
||||
*/
|
||||
public void chattersUpdated (Iterator chatternames);
|
||||
void chattersUpdated (Iterator chatternames);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,13 +92,13 @@ public class ChatDirector extends BasicDirector
|
||||
/**
|
||||
* Returns whether the username may be added to the chatters list.
|
||||
*/
|
||||
public boolean isChatterValid (Name username);
|
||||
boolean isChatterValid (Name username);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to implement a slash command (e.g. <code>/who</code>).
|
||||
*/
|
||||
public static abstract class CommandHandler
|
||||
public abstract static class CommandHandler
|
||||
{
|
||||
/**
|
||||
* Handles the specified chat command.
|
||||
@@ -535,7 +535,8 @@ public class ChatDirector extends BasicDirector
|
||||
}
|
||||
|
||||
protected void success () {
|
||||
dispatchMessage(new TellFeedbackMessage(target, message, false), ChatCodes.PLACE_CHAT_TYPE);
|
||||
dispatchMessage(new TellFeedbackMessage(target, message, false),
|
||||
ChatCodes.PLACE_CHAT_TYPE);
|
||||
addChatter(target);
|
||||
if (rl != null) {
|
||||
rl.requestCompleted(target);
|
||||
@@ -1419,6 +1420,12 @@ public class ChatDirector extends BasicDirector
|
||||
protected ObserverList<ChatterObserver> _chatterObservers =
|
||||
new ObserverList<ChatterObserver>(ObserverList.SAFE_IN_ORDER_NOTIFY);
|
||||
|
||||
/** Operation used to filter chat messages. */
|
||||
protected FilterMessageOp _filterMessageOp = new FilterMessageOp();
|
||||
|
||||
/** Operation used to display chat messages. */
|
||||
protected DisplayMessageOp _displayMessageOp = new DisplayMessageOp();
|
||||
|
||||
/** Registered chat command handlers. */
|
||||
protected static HashMap<String, CommandHandler> _handlers =
|
||||
new HashMap<String, CommandHandler>();
|
||||
@@ -1426,12 +1433,6 @@ public class ChatDirector extends BasicDirector
|
||||
/** A history of chat commands. */
|
||||
protected static ArrayList<String> _history = new ArrayList<String>();
|
||||
|
||||
/** Operation used to filter chat messages. */
|
||||
protected FilterMessageOp _filterMessageOp = new FilterMessageOp();
|
||||
|
||||
/** Operation used to display chat messages. */
|
||||
protected DisplayMessageOp _displayMessageOp = new DisplayMessageOp();
|
||||
|
||||
/** The maximum number of chatter usernames to track. */
|
||||
protected static final int MAX_CHATTERS = 6;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface ChatDisplay
|
||||
/**
|
||||
* Called to clear the chat display.
|
||||
*/
|
||||
public void clear ();
|
||||
void clear ();
|
||||
|
||||
/**
|
||||
* Called to display a chat message.
|
||||
@@ -43,5 +43,5 @@ public interface ChatDisplay
|
||||
*
|
||||
* @return true if the message was displayed, false if not.
|
||||
*/
|
||||
public boolean displayMessage (ChatMessage msg, boolean alreadyDisplayed);
|
||||
boolean displayMessage (ChatMessage msg, boolean alreadyDisplayed);
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@ public interface ChatFilter
|
||||
*
|
||||
* @return the filtered message, or null to block it completely.
|
||||
*/
|
||||
public String filter (String msg, Name otherUser, boolean outgoing);
|
||||
String filter (String msg, Name otherUser, boolean outgoing);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public interface ChatService extends InvocationService
|
||||
* @param awayMessage the away message configured by the told
|
||||
* player or null if they have no away message.
|
||||
*/
|
||||
public void tellSucceeded (long idleTime, String awayMessage);
|
||||
void tellSucceeded (long idleTime, String awayMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,8 +61,7 @@ public interface ChatService extends InvocationService
|
||||
* @param message the contents of the message.
|
||||
* @param listener the reference that will receive the tell response.
|
||||
*/
|
||||
public void tell (Client client, Name target, String message,
|
||||
TellListener listener);
|
||||
void tell (Client client, Name target, String message, TellListener listener);
|
||||
|
||||
/**
|
||||
* Requests that a message be broadcast to all users in the system.
|
||||
@@ -71,12 +70,11 @@ public interface ChatService extends InvocationService
|
||||
* @param message the contents of the message.
|
||||
* @param listener the reference that will receive a failure response.
|
||||
*/
|
||||
public void broadcast (Client client, String message,
|
||||
InvocationListener listener);
|
||||
void broadcast (Client client, String message, InvocationListener listener);
|
||||
|
||||
/**
|
||||
* Sets this client's away message. If the message is null or the
|
||||
* empty string, the away message will be cleared.
|
||||
*/
|
||||
public void away (Client client, String message);
|
||||
void away (Client client, String message);
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public abstract class CurseFilter implements ChatFilter
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a comicy replacement of the specified length;
|
||||
* Return a comicy replacement of the specified length.
|
||||
*/
|
||||
protected String comicChars (int length)
|
||||
{
|
||||
@@ -229,5 +229,5 @@ public abstract class CurseFilter implements ChatFilter
|
||||
protected String[] _vernacular;
|
||||
|
||||
/** Comic replacement characters. */
|
||||
protected String[] COMIC_CHARS = { "!", "@", "#", "%", "&", "*" };
|
||||
protected static final String[] COMIC_CHARS = { "!", "@", "#", "%", "&", "*" };
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class MuteDirector extends BasicDirector
|
||||
/**
|
||||
* The specified player was added or removed from the mutelist.
|
||||
*/
|
||||
public void muteChanged (Name playername, boolean nowMuted);
|
||||
void muteChanged (Name playername, boolean nowMuted);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,8 +122,7 @@ public class MuteDirector extends BasicDirector
|
||||
*/
|
||||
public void setMuted (Name username, boolean mute)
|
||||
{
|
||||
boolean changed = mute ? _mutelist.add(username)
|
||||
: _mutelist.remove(username);
|
||||
boolean changed = mute ? _mutelist.add(username) : _mutelist.remove(username);
|
||||
String feedback;
|
||||
if (mute) {
|
||||
feedback = "m.muted";
|
||||
@@ -132,8 +131,7 @@ public class MuteDirector extends BasicDirector
|
||||
}
|
||||
|
||||
// always give some feedback to the user
|
||||
_chatdir.displayFeedback(null,
|
||||
MessageBundle.tcompose(feedback, username));
|
||||
_chatdir.displayFeedback(null, MessageBundle.tcompose(feedback, username));
|
||||
|
||||
// if the mutelist actually changed, notify observers
|
||||
if (changed) {
|
||||
@@ -144,8 +142,7 @@ public class MuteDirector extends BasicDirector
|
||||
/**
|
||||
* @return a list of the currently muted players.
|
||||
*
|
||||
* This list may be out of date immediately upon returning from this
|
||||
* method.
|
||||
* This list may be out of date immediately upon returning from this method.
|
||||
*/
|
||||
public Name[] getMuted ()
|
||||
{
|
||||
|
||||
@@ -41,5 +41,5 @@ public interface SpeakService extends InvocationService
|
||||
* application specific manner. It's useful for differentiating
|
||||
* between regular speech, emotes, etc.
|
||||
*/
|
||||
public void speak (Client client, String message, byte mode);
|
||||
void speak (Client client, String message, byte mode);
|
||||
}
|
||||
|
||||
@@ -66,10 +66,10 @@ public abstract class ChatMessage
|
||||
* Once this message reaches the client, the information contained within is changed around a
|
||||
* bit.
|
||||
*/
|
||||
public void setClientInfo (String msg, String localtype)
|
||||
public void setClientInfo (String msg, String ltype)
|
||||
{
|
||||
message = msg;
|
||||
this.localtype = localtype;
|
||||
localtype = ltype;
|
||||
bundle = null;
|
||||
timestamp = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@@ -24,9 +24,8 @@ package com.threerings.crowd.chat.data;
|
||||
import com.threerings.util.Name;
|
||||
|
||||
/**
|
||||
* Provides a mechanism by which the speak service can identify chat
|
||||
* listeners so as to maintain a recent history of all chat traffic on the
|
||||
* server.
|
||||
* Provides a mechanism by which the speak service can identify chat listeners so as to maintain a
|
||||
* recent history of all chat traffic on the server.
|
||||
*/
|
||||
public interface SpeakObject
|
||||
{
|
||||
@@ -34,16 +33,15 @@ public interface SpeakObject
|
||||
public static interface ListenerOp
|
||||
{
|
||||
/** Call this method if you only have access to body oids. */
|
||||
public void apply (int bodyOid);
|
||||
void apply (int bodyOid);
|
||||
|
||||
/** Call this method if you can provide usernames directly. */
|
||||
public void apply (Name username);
|
||||
void apply (Name username);
|
||||
}
|
||||
|
||||
/**
|
||||
* The speak service will call this every time a chat message is
|
||||
* delivered on this speak object to note the listeners that
|
||||
* received the message.
|
||||
* The speak service will call this every time a chat message is delivered on this speak object
|
||||
* to note the listeners that received the message.
|
||||
*/
|
||||
public void applyToListeners (ListenerOp op);
|
||||
void applyToListeners (ListenerOp op);
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@ public class UserMessage extends ChatMessage
|
||||
case ChatCodes.EMOTE_MODE: return "m.emote_format";
|
||||
case ChatCodes.SHOUT_MODE: return "m.shout_format";
|
||||
case ChatCodes.BROADCAST_MODE: return "m.broadcast_format";
|
||||
default: // fall through
|
||||
}
|
||||
|
||||
if (ChatCodes.USER_CHAT_TYPE.equals(localtype)) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ChatProvider
|
||||
* Called following the delivery of <code>message</code> from <code>teller</code> to
|
||||
* <code>tellee</code>.
|
||||
*/
|
||||
public void sentTell (BodyObject teller, BodyObject tellee, String message);
|
||||
void sentTell (BodyObject teller, BodyObject tellee, String message);
|
||||
}
|
||||
|
||||
/** Used to forward certain types of chat messages between servers in a multi-server setup. */
|
||||
@@ -76,12 +76,12 @@ public class ChatProvider
|
||||
*
|
||||
* @return true if the tell was delivered, false otherwise.
|
||||
*/
|
||||
public boolean forwardTell (UserMessage message, Name target, TellListener listener);
|
||||
boolean forwardTell (UserMessage message, Name target, TellListener listener);
|
||||
|
||||
/**
|
||||
* Requests that the supplied broadcast message be delivered on other servers.
|
||||
*/
|
||||
public void forwardBroadcast (Name from, String bundle, String msg, boolean attention);
|
||||
void forwardBroadcast (Name from, String bundle, String msg, boolean attention);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,11 +48,10 @@ public class SpeakHandler
|
||||
public static interface SpeakerValidator
|
||||
{
|
||||
/**
|
||||
* Should return true if the supplied speaker is allowed to speak
|
||||
* via the speak provider with which this validator was
|
||||
* registered.
|
||||
* Should return true if the supplied speaker is allowed to speak via the speak provider
|
||||
* with which this validator was registered.
|
||||
*/
|
||||
public boolean isValidSpeaker (DObject speakObj, ClientObject speaker, byte mode);
|
||||
boolean isValidSpeaker (DObject speakObj, ClientObject speaker, byte mode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,7 +57,7 @@ public class SpeakUtil
|
||||
/**
|
||||
* Called for each player that hears a particular chat message.
|
||||
*/
|
||||
public void messageDelivered (Name hearer, UserMessage message);
|
||||
void messageDelivered (Name hearer, UserMessage message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,5 +33,5 @@ public interface BodyService extends InvocationService
|
||||
* Requests to set the idle state of the client to the specified
|
||||
* value.
|
||||
*/
|
||||
public void setIdle (Client client, boolean idle);
|
||||
void setIdle (Client client, boolean idle);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class LocationDirector extends BasicDirector
|
||||
* Should instruct the client to move to the last known working location (as well as clean
|
||||
* up after the failed moveTo request).
|
||||
*/
|
||||
public void recoverFailedMove (int placeId);
|
||||
void recoverFailedMove (int placeId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,7 +44,7 @@ public interface LocationObserver
|
||||
* @return true if it's OK for the location to change, false if the
|
||||
* change request should be aborted.
|
||||
*/
|
||||
public boolean locationMayChange (int placeId);
|
||||
boolean locationMayChange (int placeId);
|
||||
|
||||
/**
|
||||
* Called when we have switched to a new location.
|
||||
@@ -52,7 +52,7 @@ public interface LocationObserver
|
||||
* @param place the place object that represents the new location or
|
||||
* null if we have switched to no location.
|
||||
*/
|
||||
public void locationDidChange (PlaceObject place);
|
||||
void locationDidChange (PlaceObject place);
|
||||
|
||||
/**
|
||||
* This is called on all location observers when a location change
|
||||
@@ -63,5 +63,5 @@ public interface LocationObserver
|
||||
* @param reason the reason code that explains why the location change
|
||||
* request was rejected or otherwise failed.
|
||||
*/
|
||||
public void locationChangeFailed (int placeId, String reason);
|
||||
void locationChangeFailed (int placeId, String reason);
|
||||
}
|
||||
|
||||
@@ -35,5 +35,5 @@ public interface LocationReceiver extends InvocationReceiver
|
||||
* and the client is then responsible for generating a {@link
|
||||
* LocationService#moveTo} request to move to the new location.
|
||||
*/
|
||||
public void forcedMove (int placeId);
|
||||
void forcedMove (int placeId);
|
||||
}
|
||||
|
||||
@@ -27,10 +27,9 @@ import com.threerings.presents.client.InvocationService;
|
||||
import com.threerings.crowd.data.PlaceConfig;
|
||||
|
||||
/**
|
||||
* The location services provide a mechanism by which the client can
|
||||
* request to move from place to place in the server. These services
|
||||
* should not be used directly, but instead should be accessed via the
|
||||
* {@link LocationDirector}.
|
||||
* The location services provide a mechanism by which the client can request to move from place to
|
||||
* place in the server. These services should not be used directly, but instead should be accessed
|
||||
* via the {@link LocationDirector}.
|
||||
*/
|
||||
public interface LocationService extends InvocationService
|
||||
{
|
||||
@@ -42,24 +41,21 @@ public interface LocationService extends InvocationService
|
||||
/**
|
||||
* Called in response to a successful {@link #moveTo} request.
|
||||
*/
|
||||
public void moveSucceeded (PlaceConfig config);
|
||||
void moveSucceeded (PlaceConfig config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests that this client's body be moved to the specified
|
||||
* location.
|
||||
* Requests that this client's body be moved to the specified location.
|
||||
*
|
||||
* @param client a reference to the client object that defines the
|
||||
* context in which this invocation service should be executed.
|
||||
* @param placeId the object id of the place object to which the body
|
||||
* should be moved.
|
||||
* @param listener the listener that will be informed of success or
|
||||
* failure.
|
||||
* @param client a reference to the client object that defines the context in which this
|
||||
* invocation service should be executed.
|
||||
* @param placeId the object id of the place object to which the body should be moved.
|
||||
* @param listener the listener that will be informed of success or failure.
|
||||
*/
|
||||
public void moveTo (Client client, int placeId, MoveListener listener);
|
||||
void moveTo (Client client, int placeId, MoveListener listener);
|
||||
|
||||
/**
|
||||
* Requests that we leave our current place and move to nowhere land.
|
||||
*/
|
||||
public void leavePlace (Client client);
|
||||
void leavePlace (Client client);
|
||||
}
|
||||
|
||||
@@ -33,12 +33,12 @@ public interface OccupantObserver
|
||||
/**
|
||||
* Called when a body enters the place.
|
||||
*/
|
||||
public void occupantEntered (OccupantInfo info);
|
||||
void occupantEntered (OccupantInfo info);
|
||||
|
||||
/**
|
||||
* Called when a body leaves the place.
|
||||
*/
|
||||
public void occupantLeft (OccupantInfo info);
|
||||
void occupantLeft (OccupantInfo info);
|
||||
|
||||
/**
|
||||
* Called when an occupant is updated.
|
||||
@@ -46,5 +46,5 @@ public interface OccupantObserver
|
||||
* @param oldinfo the occupant info prior to the update.
|
||||
* @param newinfo the newly update info record.
|
||||
*/
|
||||
public void occupantUpdated (OccupantInfo oldinfo, OccupantInfo newinfo);
|
||||
void occupantUpdated (OccupantInfo oldinfo, OccupantInfo newinfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user