|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.SimpleDataRecord<Room>
org.starhope.appius.game.Room
public class Room
A room located in the local zone
The room variables structure is defined to reserve all lower-case named variables for system purposes.
The following room variables are specially used:
These room variables define the general environment. They can contain single filenames or a series of colon-delimited filenames, which will be stacked from bottom to top. (The first name given is the lowest or farthest level of stacking.)
Places are regions of the room defined by polygonal outlines. These are held in Room Variables with names of the form "zone" plus an arbitrary identifier. The contents of the room variable are a key followed by ":" and a series of coördinates.
Each coördinate pair is given as x,y in decimal, literally, like: "100,200". They are separated with "~". To stop one polygon and start on another, give "~~" with no coördinates between.
The key of a Place specifies its purpose. The keys understood by the server include:
WRITEME — there is support for denying vehicles in a room, but there's not database integration.
XXX — there is a concept of swimming in the item effects system, but the walkspace / swim space integration isn't handled at all. This is not enabled at all for anyone to consume at the moment.
TODO: This class needs some internal cleanups. Based upon the
HasVariables
interface, the internal data structures need to
be cleaned up, rather than constantly relying upon strings.
Field Summary | |
---|---|
private Collection<ExistsInWorld> |
contents
WRITEME: Document this brpocock@star-hope.org |
static int |
DEFAULT_USER_LIMIT
WRITEME: Document this brpocock@star-hope.org |
private Map<String,Pair<String,Collection<GeneralPath>>> |
eventPlaces
All spaces that can fire off some kind of event, just not out places |
private Map<String,Pair<String,Polygon>> |
exitPlaces
Places through which one can exit this room into another room |
private static double |
FACING_MIN_EFFECT
Semi-tunable: The minimum number of total x and y pixels of motion before the facing of the object/user will be affected |
private static int |
FIRST_SAFE_ROOM_NUMBER
The lowest room number for use with dynamically-created rooms. |
private HashSet<GameEvent> |
gameEvents
GameEvents attached to this room |
private AbstractUser |
homeOwner
The owner of a room; usually null for public rooms, or non-null for users' houses. |
private boolean |
iAmInLimbo
Determine whether this room is a limbo room |
private int |
id
WRITEME: Document this brpocock@star-hope.org |
private long |
lastLagComputed
The time at which the local lag was last recomputed |
private List<RoomLayer> |
layers
WRITEME: Document this brpocock@star-hope.org |
private Collection<RoomListener> |
listeners
WRITEME: Document this brpocock@star-hope.org |
private long |
localLagMax
The local average lag |
static int |
MAX_X
the right-hand-side of any room… hard-fixed room sized :-( |
static int |
MAX_Y
WRITEME: Document this brpocock@star-hope.org |
private String |
moniker
The moniker / unique identifier for this room. |
protected int |
myID
The unique ID number for this room (room number) |
private ConcurrentSkipListSet<RoomListener> |
observers
Non-Users who are present to pay attention to things happening in the room |
private Map<String,Collection<GeneralPath>> |
obstacles
Individual obstacle spaces |
static double |
octant
The width of one octant (demi-quadrant) of a circle, for facing computations |
static String[] |
octantFacing
the string values of facings in each of the eight octants of a circle (and a repeat of #1 for padding's sake) |
private Collection<AbstractUser> |
owners
WRITEME: Document this brpocock@star-hope.org |
private Collection<RoomRegion> |
regions
WRITEME: Document this brpocock@star-hope.org |
private int |
roomIndex
When the room is a part of an user's house, which room index number is it? |
private ConcurrentHashMap<String,String> |
roomVariables
The set of variables set upon the room |
private static int |
safeRoomNum
The next safe room number for use with dynamically-created rooms. |
private static long |
serialVersionUID
Java serialization unique ID |
private boolean |
skyVisible
Whether the sky is visible in this room. |
private Collection<SoundPlayback> |
sounds
WRITEME: Document this brpocock@star-hope.org |
private static int |
STATIC_ROOM_FENCEPOST
WRITEME: Document this brpocock@star-hope.org |
private boolean |
subjectToWeather
Whether this room is subject to weather (e.g. |
private String |
title
The user-visible title of this room |
private static double |
USER_NEAREST_FUZZ
the distance to an user |
private int |
userLimit
WRITEME |
private ConcurrentSkipListSet<AbstractUser> |
userList
The list of all users in this room. |
protected VehicleStyle |
vehicleStyle
Type of vehicle permissions to apply |
private Volume3D |
volume
WRITEME: Document this brpocock@star-hope.org |
private GeneralPath |
walkableSpace
the area in which a player could walk |
private Map<String,Collection<GeneralPath>> |
walkSpaces
Individual walkable spaces |
private String |
world
WRITEME |
private Coord3D |
worldCoords
WRITEME |
private Zone |
zone
The zone in which this room exists |
Fields inherited from class org.starhope.appius.util.SimpleDataRecord |
---|
myLoader, timeLastChanged, timeLastSaved |
Constructor Summary | |
---|---|
Room(RecordLoader<Room> loader)
WRITEME: Document this constructor brpocock@star-hope.org |
|
Room(RecordLoader<Room> loader,
Object... nada)
WRITEME: Document this constructor brpocock@star-hope.org |
Method Summary | |
---|---|
boolean |
add(ExistsInWorld thing)
WRITEME: Document this method brpocock@star-hope.org |
void |
add(GameEvent game)
WRITEME. |
boolean |
add(RoomLayer newLayer)
WRITEME: Document this method brpocock@star-hope.org |
boolean |
add(RoomListener newListener)
WRITEME: Document this method brpocock@star-hope.org |
boolean |
add(RoomRegion newRegion)
WRITEME: Document this method brpocock@star-hope.org |
boolean |
add(SoundPlayback newSound)
WRITEME: Document this method brpocock@star-hope.org |
boolean |
addOwner(AbstractUser newOwner)
WRITEME: Document this method brpocock@star-hope.org |
(package private) void |
areaEffects(AbstractUser user,
Coord3D position)
|
void |
broadcast(String command,
org.json.JSONObject results)
|
boolean |
canWalk(AbstractUser u,
Coord3D target)
|
boolean |
canWalk(Coord3D p)
|
boolean |
canWalk(Coord3D from,
Coord3D to)
determine whether a line leaves the walkable space at any time |
boolean |
contains(AbstractUser thing)
WRITEME. |
boolean |
contains(ExistsInWorld thing)
WRITEME: Document this method brpocock@star-hope.org |
static Room |
create(String newMoniker,
Zone zone,
boolean mustExist)
Create a room from the database, or (if mustExist == false) create a new anonymous room. |
static Room |
createPublicRoom(String roomName,
Zone zone)
Create a temporary/anonymous room without referring to the database. |
void |
deleteVariable(String string)
WRITEME. |
void |
destroySelf()
Destroy this room. |
private void |
detectSounds()
WRITEME: Document this method brpocock@star-hope.org |
private void |
disableVehiclesIfNecessary(AbstractUser user)
WRITEME: Document this method brpocock@star-hope.org |
boolean |
equals(Object other)
WRITEME. |
boolean |
equals(Room other)
WRITEME. |
Coord3D |
findPointWithin(GeneralPath space)
WRITEME: Document this method brpocock@star-hope.org |
private Coord3D |
findSpawnPointFrom(String oldRoom)
Find a spawn (entry) point in this room for an user joining from the given old room. |
(package private) Coord3D |
findSpawnPointWithin(Collection<GeneralPath> walkableSpaces2)
WRITEME: Document this method brpocock@star-hope.org |
(package private) Coord3D |
findSpawnPointWithin(GeneralPath space)
WRITEME: Document this method brpocock@star-hope.org |
void |
fromJSON(org.json.JSONObject jso)
WRITEME. |
(package private) Collection<InventoryItem> |
getActiveDecorations_private()
get the decorations active (placed) in a room, which is a room from an user's house (therefore drawn from the user's inventory) |
(package private) Collection<InventoryItem> |
getActiveDecorations_public()
Get the decorations active (placed) in a room, which is a public room not owned by a particular user. |
Collection<InventoryItem> |
getActiveDecorations()
get the decorations active (placed) in a room |
Set<RoomListener> |
getAllListeners()
WRITEME. |
static Room[] |
getAllRooms()
|
Collection<AbstractUser> |
getAllUsers()
WRITEME. |
private HashMap<String,String> |
getArbitraryVars()
Load arbitrary room variable values from the database |
static Room |
getByMoniker(String moniker,
Zone zone)
|
int |
getCacheableID()
Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier (
DataRecord.getCacheableIdent() or both. |
String |
getCacheableIdent()
Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier (
DataRecord.getCacheableIdent() or both. |
Collection<ExistsInWorld> |
getContents()
WRITEME: Document this method brpocock@star-hope.org |
String |
getDebugName()
WRITEME. |
Map<String,Collection<GeneralPath>> |
getEventSpaces()
|
private Set<AbstractUser> |
getEverythingInRoom()
Get all users in the room. |
Map<String,Pair<String,Polygon>> |
getExits()
|
Polygon |
getExitTo(String roomToward)
Find a place in the room which exits to a certain other room's moniker |
String |
getFilename()
WRITEME. |
GameEvent |
getGameEvent(String string)
|
Collection<GameEvent> |
getGameEvents()
WRITEME. |
int |
getID()
WRITEME: Document this method brpocock@star-hope.org |
long |
getLag()
WRITEME: Document this method brpocock@star-hope.org |
List<RoomLayer> |
getLayers()
WRITEME: Document this method brpocock@star-hope.org |
Collection<RoomListener> |
getListeners()
WRITEME. |
int |
getMaxUsers()
The maximum number of users permitted in a room is currently a per-Zone setting, see Zone.getRoomMaxUsers() , however it
could be overridden for special-case rooms. |
int |
getMaxX()
|
int |
getMaxY()
|
int |
getMaxZ()
|
int |
getMinX()
|
int |
getMinY()
|
int |
getMinZ()
|
String |
getMoniker()
WRITEME. |
String |
getMusic()
WRITEME. |
String |
getName()
WRITEME. |
protected static int |
getNextID()
Get a room number for a dynamically-generated room, that isn't in use yet |
String |
getOverlay()
WRITEME. |
AbstractUser |
getOwner()
|
Collection<AbstractUser> |
getOwners()
WRITEME: Document this method brpocock@star-hope.org |
String |
getPlaceItemNumber()
|
String |
getPlaceStringByName(String spaceName)
|
Collection<String> |
getPlaceStrings()
WRITEME: Document this method brpocock@star-hope.org |
String |
getPlaceZoneNumber()
|
Collection<RoomRegion> |
getRegions()
WRITEME: Document this method brpocock@star-hope.org |
Collection<RoomRegion> |
getRegionsIncluding(Coord3D point)
WRITEME: Document this method brpocock@star-hope.org |
Collection<RoomRegion> |
getRegionsIncluding(Polygon space)
WRITEME: Document this method brpocock@star-hope.org |
int |
getRoomIndex()
|
org.json.JSONObject |
getRoomJoinJSON(AbstractUser user)
get the JSON sequence to be passed to an user upon successfully joining a room (the “joinOK” message) |
String |
getRoomJoinSFSXML(GeneralUser user)
get the Smart Fox Server XML sequence to be passed to an user upon successfully joining a room (the “joinOK” message) |
private static Collection<Room> |
getRoomsInDB()
WRITEME: Document this method brpocock@star-hope.org |
String |
getSky()
WRITEME. |
Collection<SoundPlayback> |
getSounds()
WRITEME: Document this method brpocock@star-hope.org |
String |
getSubversionRevision()
Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence. |
private void |
getSuperTootBot(PreparedStatement getDetails,
PreparedStatement getSpeech,
org.json.JSONObject bots,
ResultSet botGot)
Deprecated. |
(package private) void |
getSuperTootBotDetails(PreparedStatement getSpeech,
org.json.JSONObject bots,
ResultSet botGot,
ResultSet rs)
Deprecated. |
(package private) org.json.JSONObject |
getSuperTootBots_JSON()
Deprecated. Needs to be moved someplace more appropriate ... not yet determined ... |
org.json.JSONObject |
getSuperTootBots(int padding)
Deprecated. Does not belong in Room ... but will be removed when NPC's work and Super Toot Bots can be removed from the codebase ... don't count on this being around forever, but it won't disappear as long as Super Toot Bots exist. |
String |
getTitle()
WRITEME. |
org.json.JSONObject |
getUserAction_JSON(AbstractUser u)
get a packet describing the user's action state. |
int |
getUserCount()
WRITEME. |
int |
getUserLimit()
|
String |
getVariable(String string)
WRITEME. |
org.json.JSONObject |
getVariables_JSON()
WRITEME: Document this method brpocock@star-hope.org |
HashMap<String,String> |
getVariables()
WRITEME. |
VehicleStyle |
getVehicleRulesForRoom()
|
Volume3D |
getVolume()
|
GeneralPath |
getWalkableSpace()
|
Coord3D |
getWalkLimit(Coord3D from,
Coord3D to)
Get the endpoint of a walk path from the source towards the target — clipped to the walkable space, if necessary. |
String |
getWorld()
|
Coord3D |
getWorldCoords()
|
Zone |
getZone()
WRITEME. |
private Coord3D |
goTo_checkWalkSpace(AbstractUser u,
Coord3D currentPos)
WRITEME: Document this method brpocock@star-hope.org |
Coord3D |
goTo_clipToWalkSpace(AbstractUser u,
Coord3D to)
WRITEME: Document this method brpocock@star-hope.org |
private void |
goTo_core(AbstractUser u,
String facing,
String theVerb,
Coord3D to)
WRITEME: Document this method brpocock@star-hope.org |
(package private) boolean |
goTo_locked(AbstractUser u,
Coord3D goal,
String facing,
String theVerb,
Coord3D knownStartPos)
WRITEME: Document this method brpocock@star-hope.org |
void |
goTo(AbstractUser u,
Coord3D goal,
String facing,
String theVerb)
have a user walk (or dance, or whatever) to another location through walkable spaces |
void |
goTo(AbstractUser u,
double tX,
double tY,
double tZ,
String facing,
String verb)
WRITEME: Document this method brpocock@star-hope.org |
void |
goTo(AbstractUser u,
String placeName,
String verb)
have a user walk (or something) toward a named region; typically for NPC:s |
int |
hashCode()
WRITEME. |
static Room |
initUserRoom(AbstractUser user,
int roomNumber)
Instantiate a Room for a given user's house, for one of the rooms |
boolean |
isLimbo()
WRITEME. |
boolean |
isOwner(AbstractUser guy)
WRITEME: Document this method brpocock@star-hope.org |
boolean |
isSkyVisible()
WRITEME. |
boolean |
isSubjectToWeather()
|
private void |
join_doWardrobeNotifications(String from,
AbstractUser user,
Room oldRoom)
WRITEME: Document this method brpocock@star-hope.org |
private Room |
join_sendPartFromOldRoom(AbstractUser user)
WRITEME: Document this method brpocock@star-hope.org |
void |
join(RoomListener thing)
|
void |
join(RoomListener thing,
String from)
WRITEME. |
private static Room |
loadRoomFromDB(String newRoomMoniker)
|
static Room |
loadRoomFromDB(String newRoomMoniker,
Zone newRoomZone)
|
static Room |
newPublicRoom(Zone homeZone)
|
void |
notifyUserAction(AbstractUser u)
|
void |
part(RoomListener thing)
WRITEME. |
void |
pushToAllZones()
push this room to all zones |
void |
pushToZone(Zone z)
Copy the room's variable set to another room with an identical moniker in a different zone. |
(package private) void |
putHere_locked(AbstractUser user,
Coord3D position)
Version of putHere(AbstractUser, Coord3D) that does
not acquire the location in a locking form (as
AbstractUser.getLocationForUpdate() |
void |
putHere(AbstractUser user,
Coord3D position)
|
(package private) void |
recomputeLag()
Recompute the average local lag by taking all samples within the population distribution of the mean of all lag times for users in the room, and taking the highest lag time of that range |
boolean |
remove(ExistsInWorld thing)
WRITEME: Document this method brpocock@star-hope.org |
void |
remove(GameEvent thatEvent)
Remove a GameEvent from receiving events in this room. |
boolean |
remove(RoomLayer oldLayer)
WRITEME: Document this method brpocock@star-hope.org |
boolean |
remove(RoomListener oldListener)
WRITEME: Document this method brpocock@star-hope.org |
boolean |
remove(RoomRegion oldRegion)
WRITEME: Document this method brpocock@star-hope.org |
boolean |
remove(SoundPlayback oldSound)
WRITEME: Document this method brpocock@star-hope.org |
void |
removeDoneSounds()
WRITEME: Document this method brpocock@star-hope.org |
boolean |
removeOwner(AbstractUser exOwner)
WRITEME: Document this method brpocock@star-hope.org |
protected void |
removeVariable(String varName)
remove a variable |
void |
resetVariables(Map<String,String> vars)
replace the current set of room variables with a different set |
void |
saveRoomVars()
|
void |
sendGameAction(AbstractUser from,
org.json.JSONObject data)
WRITEME. |
void |
sendPublicMessage(AbstractUser from,
String speech)
WRITEME. |
(package private) void |
sendUserServerTime(AbstractUser user)
WRITEME: Document this method brpocock@star-hope.org |
(package private) void |
setFacingFor(AbstractUser u)
Set the appropriate facing string based upon the user's relative motion. |
void |
setFilename(String filename1)
Set the filename for the floor/background of the room |
void |
setID(int newID)
set the room's unique ID (integer) — unique within a Zone |
void |
setLimbo(boolean b)
Set whether the room is a Limbo room. |
void |
setMoniker(String newMoniker)
Set the room's unique (within a Zone) moniker. |
void |
setMusic(String music1)
Set the background music to be played in the room |
void |
setOverlay(String overlay1)
WRITEME. |
void |
setOwner(AbstractUser newHomeOwner)
|
boolean |
setPlace(String placeCode,
String descriptor)
Set (create or change) a Place within the Room based upon a place code and a geometry string |
void |
setRoomIndex(int newRoomIndex)
|
void |
setRoomVars()
WRITEME. |
void |
setSky(String newSky)
WRITEME. |
void |
setSkyVisible(boolean whetherSkyIsVisible)
WRITEME. |
void |
setSubjectToWeather(boolean whetherSubjectToWeather)
|
void |
setTitle(String newTitle)
WRITEME. |
void |
setUserLimit(int roomUserLimit)
|
void |
setVariable(Map.Entry<String,String> var)
WRITEME. |
void |
setVariable(String varName,
String varValue)
WRITEME. |
void |
setVariables(Map<String,String> map)
WRITEME. |
void |
setVehicleRulesForRoom(VehicleStyle newRules)
|
void |
setVolume(Volume3D newVolume)
|
void |
setWorld(String newWorld)
|
void |
setWorldCoords(Coord3D newWorldCoords)
|
void |
setZone(Zone newZone)
|
void |
speak_actually(AbstractUser u,
String speech,
FilterResult carlSays)
WRITEME: document this method (brpocock@star-hope.org, Mar 11, 2010) |
(package private) void |
superbot_fetchBasicInfo(ResultSet rs,
ResultSet botGot,
org.json.JSONObject bot,
org.json.JSONObject speech,
org.json.JSONObject avatar)
Deprecated. |
(package private) void |
superbot_fetchClothing(ResultSet rs,
org.json.JSONObject clothes)
Deprecated. |
(package private) void |
superbot_fetchPattern(ResultSet rs,
org.json.JSONObject clothes)
Deprecated. |
(package private) org.json.JSONObject |
superbot_fetchSpeech(PreparedStatement getSpeech,
ResultSet rs)
Deprecated. use Plebeian |
private void |
tellEveryoneAboutJoin(RoomListener joiner)
|
(package private) void |
tellEveryoneAboutJoin(RoomListener joiner,
AbstractUser joinerAsUser,
Room oldRoom)
Send a notification about the user joining a room to everyone in this room. |
(package private) void |
tellUserAboutRoom(AbstractUser u,
ServerThread t)
Update the user during a room join, giving them information about everyone in the room |
org.json.JSONObject |
toJSON()
WRITEME. |
String |
toString()
|
protected void |
trace(String text)
trace to the server log an event |
AbstractUser |
userNearest(Coord3D target)
|
(package private) void |
validateUserList()
Ensure that everyone who we think is in the room, is actually still here ... |
Methods inherited from class org.starhope.appius.util.SimpleDataRecord |
---|
changed, checkStale, compareTo, finalize, getRecordLoader, getTimeLastChanged, getTimeLastSaved, isBeingLoaded, markAsLoaded, markAsSaved, markForReload, onRemove, onRetrieve, onStore, save, setRecordLoader |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_USER_LIMIT
private static final double FACING_MIN_EFFECT
private static final int FIRST_SAFE_ROOM_NUMBER
public static final int MAX_X
public static final int MAX_Y
protected VehicleStyle vehicleStyle
public static final double octant
private static int safeRoomNum
private static final long serialVersionUID
private static final int STATIC_ROOM_FENCEPOST
private static final double USER_NEAREST_FUZZ
private final transient Collection<ExistsInWorld> contents
private final transient Map<String,Pair<String,Collection<GeneralPath>>> eventPlaces
private final transient Map<String,Pair<String,Polygon>> exitPlaces
private final HashSet<GameEvent> gameEvents
private AbstractUser homeOwner
The owner of a room; usually null for public rooms, or non-null for users' houses.
The special room variable homeOwner reflects
private boolean iAmInLimbo
discussion of Limbo on Room.isLimbo ()
private int id
private long lastLagComputed
private List<RoomLayer> layers
private Collection<RoomListener> listeners
private long localLagMax
private String moniker
protected int myID
private final ConcurrentSkipListSet<RoomListener> observers
private final Map<String,Collection<GeneralPath>> obstacles
public static final String[] octantFacing
private final Collection<AbstractUser> owners
private final Collection<RoomRegion> regions
private int roomIndex
private final ConcurrentHashMap<String,String> roomVariables
private boolean skyVisible
private final Collection<SoundPlayback> sounds
private boolean subjectToWeather
TODO: save to database
private String title
private int userLimit
private final ConcurrentSkipListSet<AbstractUser> userList
private Volume3D volume
private GeneralPath walkableSpace
private final Map<String,Collection<GeneralPath>> walkSpaces
private String world
private Coord3D worldCoords
private Zone zone
Constructor Detail |
---|
public Room(RecordLoader<Room> loader)
loader
- loaderpublic Room(RecordLoader<Room> loader, Object... nada)
loader
- WRITEMEnada
- WRITEMEMethod Detail |
---|
public static Room create(String newMoniker, Zone zone, boolean mustExist) throws NotFoundException
newMoniker
- The name of the room to createzone
- the zone in which the room is to be createdmustExist
- If true, a named room from the database. If
false, an anonymous/temporary room.
NotFoundException
- Room moniker not foundpublic static Room createPublicRoom(String roomName, Zone zone)
Create a temporary/anonymous room without referring to the database.
roomName
- the moniker of the roomzone
- the zone in which the room is to be created
public static Room[] getAllRooms()
public static Room getByMoniker(String moniker, Zone zone)
moniker
- the moniker value for this roomzone
- the zone containing this room
protected static int getNextID()
private static Collection<Room> getRoomsInDB()
public static Room initUserRoom(AbstractUser user, int roomNumber) throws NotReadyException
user
- the owner of the houseroomNumber
- the room number
NotReadyException
- WRITEMEprivate static Room loadRoomFromDB(String newRoomMoniker) throws NotFoundException
newRoomMoniker
- The moniker of the room to be instantiated
NotFoundException
- if there is no room in the database
with the given monikerpublic static Room loadRoomFromDB(String newRoomMoniker, Zone newRoomZone) throws NotFoundException
newRoomMoniker
- The moniker of the room to be instantiatednewRoomZone
- The Zone into which the new room will be
placed
NotFoundException
- if there is no room in the database
with the given monikerpublic static Room newPublicRoom(Zone homeZone)
homeZone
- the zone in which the room is created.
public boolean add(ExistsInWorld thing)
thing
- WRITEME
public void add(GameEvent game)
game
- WRITEMEpublic boolean add(RoomLayer newLayer)
newLayer
- WRITEME
public boolean add(RoomListener newListener)
newListener
- WRITEME
public boolean add(RoomRegion newRegion)
newRegion
- WRITEME
public boolean add(SoundPlayback newSound)
newSound
- WRITEME
public boolean addOwner(AbstractUser newOwner)
newOwner
- WRITEME
void areaEffects(AbstractUser user, Coord3D position)
user
- who is thereposition
- where they arepublic void broadcast(String command, org.json.JSONObject results)
command
- the command to be broadcast "from"results
- the JSON data attachedpublic boolean canWalk(AbstractUser u, Coord3D target)
u
- WRITEMEtarget
- WRITEME
public boolean canWalk(Coord3D p)
p
- coördinates
public boolean canWalk(Coord3D from, Coord3D to)
from
- start pointto
- end point
public boolean contains(AbstractUser thing)
thing
- WRITEME
public boolean contains(ExistsInWorld thing)
thing
- WRITEME
public void deleteVariable(String string)
deleteVariable
in interface HasVariables
string
- WRITEMEdeleteVariable(java.lang.String)
public void destroySelf()
destroySelf()
private void detectSounds()
private void disableVehiclesIfNecessary(AbstractUser user)
user
- the user whose vehicles may need to be disabledpublic boolean equals(Object other)
equals
in class SimpleDataRecord<Room>
equals(java.lang.Object)
public boolean equals(Room other)
other
- the other room to which this one will be compared
Object.equals(Object)
public Coord3D findPointWithin(GeneralPath space)
space
- WRITEME
private Coord3D findSpawnPointFrom(String oldRoom)
Find a spawn (entry) point in this room for an user joining from the given old room. Will fall back to a default out Place or the entire walk space, if necessary.
Now, also ensures that the point is within walkable space.
XXX: handle edge-of-screen vertical/horizontal alignments better someday
oldRoom
- The room from which someone is joining
Coord3D findSpawnPointWithin(Collection<GeneralPath> walkableSpaces2)
walkableSpaces2
- WRITEME
Coord3D findSpawnPointWithin(GeneralPath space)
space
- WRITEME
public void fromJSON(org.json.JSONObject jso) throws org.json.JSONException
jso
- WRITEME
org.json.JSONException
- WRITEMEpublic Collection<InventoryItem> getActiveDecorations()
Collection<InventoryItem> getActiveDecorations_private()
Collection<InventoryItem> getActiveDecorations_public()
public Set<RoomListener> getAllListeners()
public Collection<AbstractUser> getAllUsers()
private HashMap<String,String> getArbitraryVars()
public int getCacheableID() throws NotFoundException
DataRecord
DataRecord.getCacheableID()
or a string identifier (
DataRecord.getCacheableIdent()
or both.
getCacheableID
in interface DataRecord
NotFoundException
- if the item doesn't have a distinct
numeric IDDataRecord.getCacheableID()
public String getCacheableIdent()
DataRecord
DataRecord.getCacheableID()
or a string identifier (
DataRecord.getCacheableIdent()
or both.
getCacheableIdent
in interface DataRecord
DataRecord.getCacheableIdent()
public Collection<ExistsInWorld> getContents()
public String getDebugName()
public Map<String,Collection<GeneralPath>> getEventSpaces()
private Set<AbstractUser> getEverythingInRoom()
public Map<String,Pair<String,Polygon>> getExits()
public Polygon getExitTo(String roomToward) throws NotFoundException
roomToward
- the room name
NotFoundException
- if there's no exit to that destinationpublic String getFilename()
public GameEvent getGameEvent(String string)
string
- WRITEME
public Collection<GameEvent> getGameEvents()
public int getID()
public long getLag()
public List<RoomLayer> getLayers()
public Collection<RoomListener> getListeners()
public int getMaxUsers()
Zone.getRoomMaxUsers()
, however it
could be overridden for special-case rooms.
public int getMaxX()
public int getMaxY()
public int getMaxZ()
public int getMinX()
public int getMinY()
public int getMinZ()
public String getMoniker()
public String getMusic()
public String getName()
public String getOverlay()
public AbstractUser getOwner()
public Collection<AbstractUser> getOwners()
public String getPlaceItemNumber()
public String getPlaceStringByName(String spaceName)
spaceName
- the name of a space, e.g. "evt_$field"
public Collection<String> getPlaceStrings()
public String getPlaceZoneNumber()
public Collection<RoomRegion> getRegions()
public Collection<RoomRegion> getRegionsIncluding(Coord3D point)
point
- WRITEME
public Collection<RoomRegion> getRegionsIncluding(Polygon space)
space
- WRITEME
public int getRoomIndex()
getRoomIndex()
public org.json.JSONObject getRoomJoinJSON(AbstractUser user)
user
- The user to whom the XML will be sent
public String getRoomJoinSFSXML(GeneralUser user)
user
- The user to whom the XML will be sent
public String getSky()
getSky()
public Collection<SoundPlayback> getSounds()
public String getSubversionRevision()
HasSubversionRevision
Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
As an example,the Subversion revision string for this file is "$Rev: 1968 $"
@Override public String getSubversionRevision () { return "$Rev: "; }
getSubversionRevision
in interface HasSubversionRevision
HasSubversionRevision.getSubversionRevision()
@Deprecated private void getSuperTootBot(PreparedStatement getDetails, PreparedStatement getSpeech, org.json.JSONObject bots, ResultSet botGot) throws SQLException, org.json.JSONException
Fetch a SuperTootBot record from the database ...
XXX Tootsville-specific
getDetails
- The query to fetch detailsgetSpeech
- The query to fetch speechbots
- The bots JSON result objectbotGot
- The bot general record fetched
SQLException
- If the input record can't be interpreted
org.json.JSONException
- If the output record can't be written@Deprecated void getSuperTootBotDetails(PreparedStatement getSpeech, org.json.JSONObject bots, ResultSet botGot, ResultSet rs) throws org.json.JSONException, SQLException
getSpeech
- WRITEMEbots
- WRITEMEbotGot
- WRITEMErs
- WRITEME
org.json.JSONException
- WRITEME
SQLException
- WRITEME@Deprecated public org.json.JSONObject getSuperTootBots(int padding) throws SQLException, org.json.JSONException
padding
- how many extra robots we're requesting
{
"from": "bots",
"status": "true",
"bots": {
"botname": name,
"avatar": {
"avatar": "toot.swf",
"clothes": {
0: {
"color": patcol,
"id": patitem
},
1: {
"id": clothes
},
...
},
"colors": {
"0": base,
"1": extra
}
},
"speech": {
0: "blah",
...
},
"x": startx,
"y": starty,
"walkFreq": NN,
"talkFreq": NN,
"facing": S
}
}
SQLException
- database records can't be interpreted
org.json.JSONException
- JSON reply can't be formulated@Deprecated org.json.JSONObject getSuperTootBots_JSON()
public String getTitle()
getTitle()
public org.json.JSONObject getUserAction_JSON(AbstractUser u)
u
- the user
public int getUserCount()
getUserCount()
public int getUserLimit()
public String getVariable(String string)
getVariable
in interface HasVariables
string
- WRITEME.
getVariable(java.lang.String)
public HashMap<String,String> getVariables()
getVariables
in interface HasVariables
getVariables()
public org.json.JSONObject getVariables_JSON()
public VehicleStyle getVehicleRulesForRoom()
public Volume3D getVolume()
public GeneralPath getWalkableSpace()
public Coord3D getWalkLimit(Coord3D from, Coord3D to) throws NotFoundException
from
- sourceto
- target
NotFoundException
- if the source point isn't in a walkable
space, or something.public String getWorld()
public Coord3D getWorldCoords()
public Zone getZone()
public void goTo(AbstractUser u, Coord3D goal, String facing, String theVerb)
u
- the user to movegoal
- the target toward which to movefacing
- force facing (or null to auto face)theVerb
- usually “Walk”public void goTo(AbstractUser u, double tX, double tY, double tZ, String facing, String verb)
u
- WRITEMEtX
- WRITEMEtY
- WRITEMEtZ
- WRITEMEfacing
- WRITEME.verb
- WRITEMEpublic void goTo(AbstractUser u, String placeName, String verb)
u
- whoplaceName
- target place nameverb
- means of locomotion, usually “Walk”private Coord3D goTo_checkWalkSpace(AbstractUser u, Coord3D currentPos)
u
- WRITEMEcurrentPos
- WRITEME
public Coord3D goTo_clipToWalkSpace(AbstractUser u, Coord3D to)
u
- WRITEMEto
- WRITEME
private void goTo_core(AbstractUser u, String facing, String theVerb, Coord3D to)
u
- WRITEMEfacing
- WRITEMEtheVerb
- WRITEMEto
- WRITEMEboolean goTo_locked(AbstractUser u, Coord3D goal, String facing, String theVerb, Coord3D knownStartPos)
u
- WRITEMEgoal
- WRITEMEfacing
- WRITEMEtheVerb
- WRITEMEknownStartPos
- WRITEME
public int hashCode()
hashCode
in class SimpleDataRecord<Room>
hashCode()
public boolean isLimbo()
isLimbo()
public boolean isOwner(AbstractUser guy)
guy
- WRITEME
public boolean isSkyVisible()
isSkyVisible()
public boolean isSubjectToWeather()
public void join(RoomListener thing)
thing
- WRITEMEjoin(RoomListener)
public void join(RoomListener thing, String from)
thing
- who is joining the roomfrom
- the prior room's monikerprivate void join_doWardrobeNotifications(String from, AbstractUser user, Room oldRoom)
from
- WRITEMEuser
- WRITEMEoldRoom
- WRITEMEprivate Room join_sendPartFromOldRoom(AbstractUser user)
user
- WRITEME
public void notifyUserAction(AbstractUser u)
u
- the user of whose action everyone needs to be notifiedpublic void part(RoomListener thing)
thing
- WRITEMEpart(RoomListener)
public void pushToAllZones()
public void pushToZone(Zone z)
Copy the room's variable set to another room with an identical moniker in a different zone. If there is no existing room by the same moniker, then create one.
z
- the zone targetedpublic void putHere(AbstractUser user, Coord3D position)
user
- the user to be put downposition
- the place to be put atvoid putHere_locked(AbstractUser user, Coord3D position)
putHere(AbstractUser, Coord3D)
that does
not acquire the location in a locking form (as
AbstractUser.getLocationForUpdate()
user
- the user to be put downposition
- the place to be put atvoid recomputeLag()
public boolean remove(ExistsInWorld thing)
thing
- WRITEME
public void remove(GameEvent thatEvent)
thatEvent
- the event to be removedpublic boolean remove(RoomLayer oldLayer)
oldLayer
- WRITEME
public boolean remove(RoomListener oldListener)
oldListener
- WRITEME
public boolean remove(RoomRegion oldRegion)
oldRegion
- WRITEME
public boolean remove(SoundPlayback oldSound)
oldSound
- WRITEME
public void removeDoneSounds()
public boolean removeOwner(AbstractUser exOwner)
exOwner
- WRITEME
protected void removeVariable(String varName)
varName
- the variable's namepublic void resetVariables(Map<String,String> vars)
resetVariables
in interface HasVariables
vars
- a new set of variablespublic void saveRoomVars()
saveRoomVars()
public void sendGameAction(AbstractUser from, org.json.JSONObject data) throws org.json.JSONException
from
- WRITEMEdata
- WRITEME
org.json.JSONException
- WRITEMEsendGameAction(AbstractUser,
org.json.JSONObject)
public void sendPublicMessage(AbstractUser from, String speech)
from
- WRITEMEspeech
- WRITEMEsendPublicMessage(org.starhope.appius.user.AbstractUser,
java.lang.String)
void sendUserServerTime(AbstractUser user)
user
- WRITEMEvoid setFacingFor(AbstractUser u)
u
- the userpublic void setFilename(String filename1)
filename1
- the filename of the floor/backgroundpublic void setID(int newID)
newID
- the new ID to be setpublic void setLimbo(boolean b)
b
- Whether or not this room is a Limbo room — true, means
to suppress all broadcast messages.public void setMoniker(String newMoniker)
newMoniker
- the moniker to setpublic void setMusic(String music1)
music1
- the background music to play in the roompublic void setOverlay(String overlay1)
overlay1
- WRITEMEsetOverlay(java.lang.String)
public void setOwner(AbstractUser newHomeOwner)
newHomeOwner
- the new owner of the home containing this
room. May be null.public boolean setPlace(String placeCode, String descriptor)
placeCode
- the room variable name, naming this place
uniquelydescriptor
- the description as to what it is, that this
place does.
public void setRoomIndex(int newRoomIndex)
newRoomIndex
- the new room index within the user's housepublic void setRoomVars()
XXX has Tootsville-specific stuff that can be removed
setRoomVars()
public void setSky(String newSky)
newSky
- WRITEMEsetSky(java.lang.String)
public void setSkyVisible(boolean whetherSkyIsVisible)
whetherSkyIsVisible
- WRITEMEsetSkyVisible(boolean)
public void setSubjectToWeather(boolean whetherSubjectToWeather)
whetherSubjectToWeather
- the subjectToWeather to setpublic void setTitle(String newTitle)
newTitle
- WRITEMEsetTitle(java.lang.String)
public void setUserLimit(int roomUserLimit)
roomUserLimit
- the roomUserLimit to setpublic void setVariable(Map.Entry<String,String> var)
setVariable
in interface HasVariables
var
- WRITEMEsetVariable(java.util.Map.Entry)
public void setVariable(String varName, String varValue)
setVariable
in interface HasVariables
varName
- WRITEMEvarValue
- WRITEMEsetVariable(java.lang.String,
java.lang.String)
public void setVariables(Map<String,String> map)
setVariables
in interface HasVariables
map
- WRITEMEsetVariables(java.util.Map)
public void setVehicleRulesForRoom(VehicleStyle newRules)
newRules
- the new rules for vehicles in this roompublic void setVolume(Volume3D newVolume)
newVolume
- the volume to setpublic void setWorld(String newWorld)
newWorld
- the world to setpublic void setWorldCoords(Coord3D newWorldCoords)
newWorldCoords
- the worldCoords to setpublic void setZone(Zone newZone)
newZone
- the zone to setpublic void speak_actually(AbstractUser u, String speech, FilterResult carlSays)
u
- WRITEMEspeech
- WRITEMEcarlSays
- WRITEME@Deprecated void superbot_fetchBasicInfo(ResultSet rs, ResultSet botGot, org.json.JSONObject bot, org.json.JSONObject speech, org.json.JSONObject avatar) throws org.json.JSONException, SQLException
XXX Tootsville specific
rs
- WRITEMEbotGot
- WRITEMEbot
- WRITEMEspeech
- WRITEMEavatar
- WRITEME
org.json.JSONException
- WRITEME
SQLException
- WRITEME@Deprecated void superbot_fetchClothing(ResultSet rs, org.json.JSONObject clothes) throws org.json.JSONException, SQLException
rs
- WRITEMEclothes
- WRITEME
org.json.JSONException
- WRITEME
SQLException
- WRITEME@Deprecated void superbot_fetchPattern(ResultSet rs, org.json.JSONObject clothes) throws org.json.JSONException, SQLException
rs
- WRITEMEclothes
- WRITEME
org.json.JSONException
- WRITEME
SQLException
- WRITEME@Deprecated org.json.JSONObject superbot_fetchSpeech(PreparedStatement getSpeech, ResultSet rs) throws SQLException, org.json.JSONException
Plebeian
getSpeech
- WRITEMErs
- WRITEME
SQLException
- WRITEME
org.json.JSONException
- WRITEMEprivate void tellEveryoneAboutJoin(RoomListener joiner)
joiner
- the thing joining the roomvoid tellEveryoneAboutJoin(RoomListener joiner, AbstractUser joinerAsUser, Room oldRoom)
joiner
- the thing joining the roomjoinerAsUser
- the same thing cast as a useroldRoom
- the room from which the user is comingvoid tellUserAboutRoom(AbstractUser u, ServerThread t) throws UserDeadException
u
- the user joining the roomt
- the user's server thread
UserDeadException
- if the user goes awaypublic org.json.JSONObject toJSON()
{
"filename": room-filename,
"moniker": room-moniker,
"overlay": weather-overlay-filename,
"sky": sky-background-filename,
"skyVisible": ( "true" | "false" )
"vars": { … }
}
public String toString()
toString
in class SimpleDataRecord<Room>
Object.toString()
protected void trace(String text)
text
- the message to outputpublic AbstractUser userNearest(Coord3D target)
target
- WRITEME
userNearest(org.starhope.appius.geometry.Coord3D)
void validateUserList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |