📄 playerimpl.java
字号:
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the player name ( short name )
*
* @return player name
*/
public String getPlayerName() {
return playerName;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the player's full name
*/
public String getFullPlayerName(String otherPlayerKey) {
return lieManager.getCurrentFakeName();
}
/** To get the player's full name
*/
public String getFullPlayerName() {
return lieManager.getCurrentFakeName();
}
/** To get the player's full name or fake name
*
* @return player full name
*/
public String getFullPlayerName(PlayerImpl otherPlayer) {
if (otherPlayer==null)
return lieManager.getCurrentFakeName();
if (otherPlayer.getPrimaryKey().equals(primaryKey)) {
return lieManager.getCurrentFakeName();
} else {
//return lieManager.getFakeName(otherPlayer);
return otherPlayer.getLieManager().getFakeName(this);
}
}
public String getFullPlayerName(Player otherPlayer) {
return getFullPlayerName((PlayerImpl) otherPlayer);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the player primary Key ( account name )
*
* @return player primary key
*/
public String getPrimaryKey() {
return primaryKey;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the player character past.
*
* @return player past
*/
public String getPlayerPast() {
return playerPast;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the player's name ( short name )
*
* @param player name
*/
public void setPlayerName( String playerName ) {
this.playerName = playerName;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the player's primary key.
*
* @param primary key
*/
public void setPrimaryKey( String primaryKey ) {
this.primaryKey = primaryKey;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the player's past.
*
* @param playerPast past
*/
public void setPlayerPast( String playerPast ) {
this.playerPast = playerPast;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the player's full name.
*
* @param player full name ( should contain the player name )
*/
public void setFullPlayerName( String fullPlayerName ) {
lieManager.setFullPlayerName(fullPlayerName);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the player's character.
*
* @return player character
*/
public BasicChar getBasicChar() {
return wotCharacter;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the player's character.
*
* @param wotCharacter new player character
*/
public void setBasicChar( BasicChar wotCharacter ) {
this.wotCharacter = wotCharacter;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the player's object manager
*
* @return player object manager
*/
public ObjectManager getObjectManager()
{
return objectManager;
}
/** To set the player's object manager.
*
* @param objectManager player object manager
*/
public void setObjectManager( ObjectManager objectManager )
{
this.objectManager=(ServerObjectManager)objectManager;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the player's movement Composer.
*
* @return player MovementComposer
*/
public MovementComposer getMovementComposer() {
return movementComposer;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the player's movement Composer.
*
* @param movement MovementComposer.
*/
public void setMovementComposer( MovementComposer movementComposer ) {
this.movementComposer = movementComposer;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the Lie Manager.
*/
public LieManager getLieManager() {
return lieManager;
}
/** To set the Lie Manager.
*/
public void setLieManager(LieManager lieManager) {
this.lieManager = lieManager;
}
/** To get lastDisconnectedTime.
*/
public long getLastDisconnectedTime() {
return lastDisconnectedTime;
}
/** To set lastDisconnectedTime.
*/
public void setLastDisconnectedTime(long lastTime) {
this.lastDisconnectedTime = lastTime;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the player's current Room ( if we are in a Room ).
* @return current Room, null if we are not in a room.
*/
public Room getMyRoom() {
return myRoom;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the player's current TileMap ( if we are in a TileMap ).
* @return current TileMap, null if we are not in a tileMap.
*/
public TileMap getMyTileMap() {
return myTileMap;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get our Message router.
*/
public MessageRouter getMessageRouter() {
if(myRoom!=null)
return myRoom.getMessageRouter();
if(myTileMap!=null)
return myTileMap.getMessageRouter();
if( location.isWorld() ) {
WorldMap world = ServerDirector.getDataManager().getWorldManager().getWorldMap(location);
if(world!=null)
return world.getMessageRouter();
}
else if( location.isTown() ) {
TownMap town = ServerDirector.getDataManager().getWorldManager().getTownMap(location);
if(town!=null)
return town.getMessageRouter();
}
else if( location.isRoom() ) {
Room room = ServerDirector.getDataManager().getWorldManager().getRoom(location);
if(room!=null)
return room.getMessageRouter();
}
else if( location.isTileMap() ) {
TileMap tileMap = ServerDirector.getDataManager().getWorldManager().getTileMap(location);
if(tileMap!=null)
return tileMap.getMessageRouter();
}
Debug.signal(Debug.ERROR, this, "MessageRouter not found ! bad location :"+location+" player: "+primaryKey);
return null; // not found
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the player away message.
*
* @return player away Message
*/
public String getPlayerAwayMessage() {
return playerAwayMessage;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the player's away message.
*
* @param playerAwayMessage msg
*/
public void setPlayerAwayMessage( String playerAwayMessage ){
this.playerAwayMessage = playerAwayMessage;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the synchronization ID. This ID is used to synchronize this player on the
* client & server side. The ID is incremented only when the player changes its map.
* Movement messages that have a bad syncID are discarded.
* @return sync ID
*/
public byte getSyncID(){
synchronized( syncID ) {
return syncID[0];
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To update the synchronization ID. See the getter for an explanation on this ID.
* The new updated syncID is (syncID+1)%100.
*/
public void updateSyncID(){
synchronized( syncID ) {
syncID[0] = (byte) ( (syncID[0]+1)%100 );
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the synchronization ID. See the getter for an explanation on this ID.
* @param syncID new syncID
*/
public void setSyncID(byte syncID){
synchronized( this.syncID ) {
this.syncID[0] = syncID;
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the player's chatList.
*/
public void setChatList( ChatList chatList ) {
synchronized( chatListLock ) {
this.chatList = chatList;
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the player's chatList.
*/
public ChatList getChatList() {
synchronized( chatListLock ) {
return chatList;
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the primary key of the chat the player is now using.
* @return currentChatPrimaryKey
*/
public String getCurrentChatPrimaryKey() {
return currentChatPrimaryKey;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the current chat used
* @param currentChatPrimaryKey
*/
public void setCurrentChatPrimaryKey( String currentChatPrimaryKey ) {
this.currentChatPrimaryKey = currentChatPrimaryKey;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -