|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.server.Server
public class Server
| Nested Class Summary | |
|---|---|
(package private) class |
Server.ConnectionWatchdog
|
static class |
Server.DamageType
The DamageType enumeration is used for the damageEntity function. |
| Field Summary | |
|---|---|
(package private) java.util.Hashtable<java.lang.Integer,IConnection> |
connectionIds
|
(package private) java.util.Vector<IConnection> |
connections
|
(package private) java.util.Vector<IConnection> |
connectionsPending
|
static java.lang.String |
DEFAULT_BOARD
|
(package private) IGame |
game
|
| Constructor Summary | |
|---|---|
Server(java.lang.String password,
int port)
Construct a new GameHost and begin listening for incoming clients. |
|
| Method Summary | |
|---|---|
java.util.Vector<Report> |
abandonEntity(Entity entity)
Abandon an Entity. |
void |
addMovementHeat()
Add heat from the movement phase |
void |
addScheduledNuke(int[] nuke)
add a nuke to be exploded in the next weapons attack phase |
void |
addSmoke(java.util.ArrayList<Coords> coords,
int windDir,
boolean bInferno)
Called when a fire is burning. |
void |
applyBoardSettings()
Applies board settings. |
java.util.Vector<Report> |
applyCriticalHit(Entity en,
int loc,
CriticalSlot cs,
boolean secondaryEffects)
Apply a single critical hit. |
java.util.Vector<Report> |
applyCriticalHit(Entity en,
int loc,
CriticalSlot cs,
boolean secondaryEffects,
int damageCaused,
boolean isCapital)
Apply a single critical hit. |
void |
applySecondaryNuclearEffects(Entity entity,
Coords position,
java.util.Vector<Report> vDesc)
Handles secondary effects from nuclear blasts against all units in range. |
void |
artilleryDamageArea(Coords centre,
Coords attackSource,
AmmoType ammo,
int subjectId,
Entity killer,
boolean flak,
int altitude,
boolean mineClear,
java.util.Vector<Report> vPhaseReport,
boolean asfFlak)
deal area saturation damage to the map, used for artillery |
void |
artilleryDamageArea(Coords centre,
Coords attackSource,
AmmoType ammo,
int subjectId,
Entity killer,
int damage,
int falloff,
boolean flak,
int altitude,
java.util.Vector<Report> vPhaseReport,
boolean asfFlak)
Deals area-saturation damage to an area of the board. |
(package private) void |
artilleryDamageHex(Coords coords,
Coords attackSource,
int damage,
AmmoType ammo,
int subjectId,
Entity killer,
Entity exclude,
boolean flak,
int altitude,
java.util.Vector<Report> vPhaseReport,
boolean asfFlak)
deal area saturation damage to an individual hex |
void |
autoSave()
automatically save the game |
void |
calculatePlayerBVs()
Calculates all players initial BV, should only be called at start of game |
void |
cancelVictory()
Cancels the force victory |
boolean |
canShelter(Coords entityPosition,
Coords position,
int entityAbsHeight)
Check if an Entity of the passed height can find shelter from a nukeblast |
void |
checkEntityExchange()
loop through entitis in the exchange phase (i.e. after leaving chatlounge) and do any actions that need to be done |
void |
checkExplodeIndustrialZone(Coords c,
java.util.Vector<Report> vDesc)
checks for unintended exposion of heavy industrial zone hex and applies damage to entities occupying the hex |
boolean |
checkForCollapse(Building bldg,
java.util.Hashtable<Coords,java.util.Vector<Entity>> positionMap,
Coords coords,
boolean checkBecauseOfDamage)
Determine if the given building should collapse. |
void |
checkForFlamingDamage()
Checks to see if any non-mech units are standing in fire. |
void |
checkForObservers()
Checks each player to see if he has no entities, and if true, sets the observer flag for that player. |
java.util.Vector<Report> |
checkForVehicleFire(Tank tank,
boolean inferno)
check for vehicle fire, according to the MaxTech rules |
(package private) void |
checkForWashedInfernos(Entity entity,
Coords coords)
Checks to see if we may have just washed off infernos. |
boolean |
checkIgnition(Coords c,
TargetRoll roll)
Returns true if the hex is set on fire with the specified roll. |
boolean |
checkIgnition(Coords c,
TargetRoll roll,
boolean bInferno)
Returns true if the hex is set on fire with the specified roll. |
boolean |
checkIgnition(Coords c,
TargetRoll roll,
boolean bInferno,
int entityId,
java.util.Vector<Report> vPhaseReport)
Checks for fire ignition based on a given target roll. |
boolean |
clearMinefield(Minefield mf,
Entity en,
int target,
int botch,
java.util.Vector<Report> vClearReport)
attempt to clear a minefield We don't actually remove the minefield here, because if this is called up from within a loop, that will cause problems |
boolean |
clearMinefield(Minefield mf,
Entity en,
int target,
java.util.Vector<Report> vClearReport)
attempt to clear a minefield |
void |
collapseBuilding(Building bldg,
java.util.Hashtable<Coords,java.util.Vector<Entity>> positionMap,
Coords coords)
|
void |
collapseBuilding(Building bldg,
java.util.Hashtable<Coords,java.util.Vector<Entity>> positionMap,
Coords coords,
boolean collapseAll)
Collapse a building hex. |
void |
createSmoke(java.util.ArrayList<Coords> coords,
int level,
int duration)
create a SmokeCloud object and add it to the server list |
void |
createSmoke(Coords coords)
create a SmokeCloud object and add it to the server list |
void |
createSmoke(Coords coords,
int level)
create a SmokeCloud object and add it to the server list |
void |
createSmoke(Coords coords,
int level,
int duration)
create a SmokeCloud object and add it to the server list |
void |
creditKill(Entity target,
Entity attacker)
Credits a Kill for an entity, if the target got killed. |
java.util.Vector<Report> |
criticalEntity(Entity en,
int loc,
int critMod)
Rolls and resolves critical hits with a die roll modifier. |
java.util.Vector<Report> |
criticalEntity(Entity en,
int loc,
int critMod,
boolean rollNumber,
boolean isCapital)
Rolls and resolves critical hits on mechs or vehicles. if rollNumber is false, a single hit is applied - needed for MaxTech Heat Scale rule. |
java.util.Vector<Report> |
damageBuilding(Building bldg,
int damage,
Coords coords)
Apply the given amount of damage to the building. |
java.util.Vector<Report> |
damageBuilding(Building bldg,
int damage,
java.lang.String why,
Coords coords)
Apply the given amount of damage to the building. |
java.util.Vector<Report> |
damageEntity(Entity te,
HitData hit,
int damage)
Deals the listed damage to an entity. |
java.util.Vector<Report> |
damageEntity(Entity te,
HitData hit,
int damage,
boolean ammoExplosion,
Server.DamageType bFrag,
boolean damageIS)
Deals the listed damage to an entity. |
java.util.Vector<Report> |
damageEntity(Entity te,
HitData hit,
int damage,
boolean ammoExplosion,
Server.DamageType bFrag,
boolean damageIS,
boolean areaSatArty,
boolean throughFront)
Deals the listed damage to an entity. |
java.util.Vector<Report> |
damageEntity(Entity te,
HitData hit,
int damage,
boolean ammoExplosion,
Server.DamageType bFrag,
boolean damageIS,
boolean areaSatArty,
boolean throughFront,
boolean underWater)
Deals the listed damage to an entity. |
java.util.Vector<Report> |
damageEntity(Entity te,
HitData hit,
int damage,
boolean ammoExplosion,
Server.DamageType bFrag,
boolean damageIS,
boolean areaSatArty,
boolean throughFront,
boolean underWater,
boolean nukeS2S)
Deals the listed damage to an entity. |
void |
damageInfantryIn(Building bldg,
int damage,
Coords hexCoords)
Apply the correct amount of damage that passes on to any infantry unit in the given building, based upon the amount of damage the building just sustained. |
void |
deliverArtilleryFlare(Coords coords,
int radius)
Creates an artillery flare of the given radius above the target |
void |
deliverArtilleryInferno(Coords coords,
Entity ae,
int subjectId,
java.util.Vector<Report> vPhaseReport)
deliver artillery inferno |
void |
deliverArtillerySmoke(Coords coords,
java.util.Vector<Report> vPhaseReport)
deliver artillery smoke |
void |
deliverBombDamage(Coords centre,
int type,
int subjectId,
Entity killer,
java.util.Vector<Report> vPhaseReport)
|
void |
deliverBombInferno(Coords coords,
Entity ae,
int subjectId,
java.util.Vector<Report> vPhaseReport)
deliver inferno bomb |
void |
deliverFASCAMMinefield(Coords coords,
int playerId,
int damage,
int entityId)
Delivers a Arrow IV FASCAM shot to the targetted hex area. |
java.util.Vector<Report> |
deliverInfernoMissiles(Entity ae,
Targetable t,
int missiles)
deliver inferno missiles |
java.util.Vector<Report> |
deliverInfernoMissiles(Entity ae,
Targetable t,
int missiles,
int called)
deliver inferno missiles |
void |
deliverScreen(Coords coords,
java.util.Vector<Report> vPhaseReport)
|
void |
deliverThunderActiveMinefield(Coords coords,
int playerId,
int damage,
int entityId)
Adds a Thunder-Active minefield to the hex. |
void |
deliverThunderAugMinefield(Coords coords,
int playerId,
int damage,
int entityId)
Delivers a thunder-aug shot to the targetted hex area. |
void |
deliverThunderInfernoMinefield(Coords coords,
int playerId,
int damage,
int entityId)
Adds a Thunder Inferno minefield to the hex. |
void |
deliverThunderMinefield(Coords coords,
int playerId,
int damage,
int entityId)
Adds a Thunder minefield to the hex. |
void |
deliverThunderVibraMinefield(Coords coords,
int playerId,
int damage,
int sensitivity,
int entityId)
Adds a Thunder-Vibrabomb minefield to the hex. |
void |
deployTeleMissile(Entity ae,
AmmoType atype,
int wId,
int capMisMod,
java.util.Vector<Report> vPhaseReport)
deploys a new tele-missile entity onto the map |
void |
die()
Shuts down the server. |
(package private) void |
disconnected(Player player)
Called when it's been determined that an actual player disconnected. |
(package private) void |
doAllAssaultDrops()
resolve assault drops for all entities |
void |
doAssaultDrop(Entity entity)
resolve the landing of an assault drop |
void |
doExplosion(int[] damages,
boolean autoDestroyInSameHex,
Coords position,
boolean allowShelter,
java.util.Vector<Report> vDesc,
java.util.Vector<java.lang.Integer> vUnits,
int clusterAmt)
General function to cause explosions in areas. |
void |
doExplosion(int damage,
int degredation,
boolean autoDestroyInSameHex,
Coords position,
boolean allowShelter,
java.util.Vector<Report> vDesc,
java.util.Vector<java.lang.Integer> vUnits)
General function to cause explosions in areas. |
void |
doFusionEngineExplosion(int engineRating,
Coords position,
java.util.Vector<Report> vDesc,
java.util.Vector<java.lang.Integer> vUnits)
Extract explosion functionality for generalized explosions in areas. |
(package private) void |
doMagmaDamage(Entity en,
boolean eruption)
do damage from magma |
void |
doNuclearExplosion(Coords position,
int baseDamage,
int degredation,
int secondaryRadius,
int craterDepth,
java.util.Vector<Report> vDesc)
explode a nuke |
void |
doNuclearExplosion(Coords position,
int nukeType,
java.util.Vector<Report> vDesc)
do a nuclear explosion |
java.util.Vector<Report> |
doSetLocationsExposure(Entity entity,
IHex hex,
boolean isJump,
int elevation)
Set the locationsexposure of an entity |
void |
doSinkEntity(Entity en)
sink any entities in quicksand in the current hex |
void |
dropUnit(Entity drop,
Entity entity,
Coords curPos,
int altitude)
|
java.util.Vector<Report> |
ejectEntity(Entity entity,
boolean autoEject)
Eject an Entity. |
void |
entityUpdate(int nEntityID)
In a double-blind game, update only visible entities. |
void |
entityUpdate(int nEntityID,
java.util.Vector<UnitLocation> movePath)
In a double-blind game, update only visible entities. |
void |
forceVictory(Player victor)
Forces victory for the specified player, or his/her team at the end of the round. |
java.util.Enumeration<java.lang.String> |
getAllCommandNames()
Returns an enumeration of all the command names |
ServerCommand |
getCommand(java.lang.String name)
Returns the command associated with the specified name |
IConnection |
getConnection(int connId)
Returns a connection, indexed by id |
java.util.Enumeration<IConnection> |
getConnections()
Returns a connection, indexed by id |
int |
getFreeConnectionId()
Returns a free connection id. |
int |
getFreeEntityId()
Returns a free entity id. |
IGame |
getGame()
Returns the current game object |
java.lang.String |
getHost()
|
(package private) IConnection |
getPendingConnection(int connId)
Returns a pending connection |
Player |
getPlayer(int id)
Shortcut to game.getPlayer(id) |
int |
getPort()
|
static Server |
getServerInstance()
|
java.util.List<SmokeCloud> |
getSmokeCloudList()
|
(package private) void |
greeting(int cn)
Sent when a client attempts to connect. |
protected void |
handle(int connId,
Packet packet)
Process a packet from a connection. |
void |
ignite(Coords c,
boolean bInferno,
java.util.Vector<Report> vReport)
add fire to a hex |
boolean |
isPassword(java.lang.Object guess)
|
boolean |
isPassworded()
|
boolean |
isTurnSkippable()
Returns true if the current turn may be skipped. |
boolean |
loadGame(java.io.File f)
load the game |
void |
removeFire(Coords fireCoords,
java.lang.String reason)
remove fire from a hex |
void |
removeMinefield(Minefield mf)
Removes the minefield from the game. |
void |
removeSmokeTerrain(SmokeCloud cloud)
remove a cloud from the map |
void |
reportRoll(Roll roll)
|
void |
resetConnections()
Resets all the connections. |
void |
resetGame()
Reset the game back to the lounge. |
(package private) void |
resolveFortify()
Resolve any Infantry units which are fortifying hexes |
void |
run()
Listen for incoming clients. |
void |
saveGame(java.lang.String sFile)
save the game |
void |
saveGame(java.lang.String sFile,
boolean sendChat)
save the game |
void |
sendChangedCFBuildings(java.util.Vector<Building> buildings)
|
void |
sendChangedHex(Coords coords)
Sends notification to clients that the specified hex has changed. |
void |
sendChangedMines(Coords coords)
Sends notification to clients that the specified hex has changed. |
void |
sendChat(int connId,
java.lang.String origin,
java.lang.String message)
Transmits a chat message to all players |
void |
sendEntities(int connId)
Resend entities to the player called by seeall command |
void |
sendLoadGame(int connId,
java.lang.String sFile)
send a packet to the connection tells it load a locally saved game |
void |
sendSaveGame(int connId,
java.lang.String sFile)
save the game and send it to the sepecified connection |
void |
sendServerChat(int connId,
java.lang.String message)
|
void |
sendServerChat(java.lang.String message)
|
void |
sendVisibilityIndicator(Entity e)
|
void |
setGame(IGame g)
Sets the game for this server. |
void |
skipCurrentTurn()
Skips the current turn. |
java.util.Vector<Report> |
tryClearHex(Coords c,
int nDamage,
int entityId)
|
boolean |
tryIgniteHex(Coords c,
int entityId,
boolean bHotGun,
boolean bInferno,
TargetRoll nTargetRoll,
boolean bReportAttempt,
int accidentTarget,
java.util.Vector<Report> vPhaseReport)
Try to ignite the hex, taking into account exisiting fires and the effects of Inferno rounds. |
boolean |
tryIgniteHex(Coords c,
int entityId,
boolean bHotGun,
boolean bInferno,
TargetRoll nTargetRoll,
int accidentTarget,
java.util.Vector<Report> vPhaseReport)
Try to ignite the hex, taking into account exisiting fires and the effects of Inferno rounds. |
void |
updateSmoke(SmokeCloud cloud,
java.util.ArrayList<Coords> newCoords)
Update the map with a new set of coords. |
void |
validatePlayerInfo(int playerId)
Validates the player info. |
boolean |
victory()
Returns true if victory conditions have been met. |
(package private) void |
washInferno(Entity entity,
Coords coords)
Washes off an inferno from a mech and adds it to the (water) hex. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_BOARD
java.util.Vector<IConnection> connections
java.util.Vector<IConnection> connectionsPending
java.util.Hashtable<java.lang.Integer,IConnection> connectionIds
IGame game
| Constructor Detail |
|---|
public Server(java.lang.String password,
int port)
throws java.io.IOException
password - the String that is set as a passwordport - the int value that specifies the port that is
used
java.io.IOException| Method Detail |
|---|
public void setGame(IGame g)
public void resetConnections()
public IGame getGame()
public boolean isPassworded()
public boolean isPassword(java.lang.Object guess)
public ServerCommand getCommand(java.lang.String name)
public void die()
public java.util.Enumeration<java.lang.String> getAllCommandNames()
void greeting(int cn)
public int getFreeConnectionId()
public int getFreeEntityId()
public void sendEntities(int connId)
public void validatePlayerInfo(int playerId)
void disconnected(Player player)
public void checkForObservers()
public void resetGame()
public void autoSave()
public void sendSaveGame(int connId,
java.lang.String sFile)
connId - The int connection id to send tosFile - The String filename to use
public void saveGame(java.lang.String sFile,
boolean sendChat)
sFile - The String filename to usesendChat - A boolean value wether or not to announce the
saving to the server chat.public void saveGame(java.lang.String sFile)
sFile - The String filename to use
public void sendLoadGame(int connId,
java.lang.String sFile)
connId - The int connection id to send tosFile - The String filename to usepublic boolean loadGame(java.io.File f)
f - The File to load
boolean value wether or not the loading was
successfullpublic Player getPlayer(int id)
public java.util.Enumeration<IConnection> getConnections()
public IConnection getConnection(int connId)
IConnection getPendingConnection(int connId)
public void forceVictory(Player victor)
public void cancelVictory()
public void calculatePlayerBVs()
public void checkEntityExchange()
public void skipCurrentTurn()
public boolean isTurnSkippable()
public boolean victory()
public void applyBoardSettings()
public void dropUnit(Entity drop,
Entity entity,
Coords curPos,
int altitude)
public void deliverThunderAugMinefield(Coords coords,
int playerId,
int damage,
int entityId)
public void deliverThunderMinefield(Coords coords,
int playerId,
int damage,
int entityId)
coords - playerId - damage -
public void deliverThunderInfernoMinefield(Coords coords,
int playerId,
int damage,
int entityId)
coords - playerId - damage -
public void deliverFASCAMMinefield(Coords coords,
int playerId,
int damage,
int entityId)
public void deliverThunderActiveMinefield(Coords coords,
int playerId,
int damage,
int entityId)
public void deliverThunderVibraMinefield(Coords coords,
int playerId,
int damage,
int sensitivity,
int entityId)
public void deliverArtilleryFlare(Coords coords,
int radius)
public void deliverArtillerySmoke(Coords coords,
java.util.Vector<Report> vPhaseReport)
coords - the Coords where to deliver
public void deliverArtilleryInferno(Coords coords,
Entity ae,
int subjectId,
java.util.Vector<Report> vPhaseReport)
coords - the Coords where to deliverae - the attacking entitysubjectId - the int id of the target
public void deliverScreen(Coords coords,
java.util.Vector<Report> vPhaseReport)
public void deployTeleMissile(Entity ae,
AmmoType atype,
int wId,
int capMisMod,
java.util.Vector<Report> vPhaseReport)
public java.util.Vector<Report> deliverInfernoMissiles(Entity ae,
Targetable t,
int missiles)
ae - the Entity that fired the missilest - the Targetable that is the targetmissiles - the int amount of missiles
public java.util.Vector<Report> deliverInfernoMissiles(Entity ae,
Targetable t,
int missiles,
int called)
ae - the Entity that fired the missilest - the Targetable that is the targetmissiles - the int amount of missilesaimingMode - an int indicated the aiming mode used to fire the
inferno missiles (for called shots)aimAt - an int indicating the location being aimed at
(for called shots)
public boolean clearMinefield(Minefield mf,
Entity en,
int target,
java.util.Vector<Report> vClearReport)
mf - - a Minefield to clearen - - entity doing the clearingtarget - - int needed to roll for a successful clearance
true if clearance successful
public boolean clearMinefield(Minefield mf,
Entity en,
int target,
int botch,
java.util.Vector<Report> vClearReport)
mf - - a Minefield to clearen - - entity doing the clearingtarget - - int needed to roll for a successful clearancebotch - - int that indicates an accidental detonation
true if clearance successfulpublic void removeMinefield(Minefield mf)
mf - The Minefield to remove
void checkForWashedInfernos(Entity entity,
Coords coords)
entity - The Entity that is being checkedcoords - The Coords the entity is at
void washInferno(Entity entity,
Coords coords)
entity - The Entity that is taking a bathcoords - The Coords the entity is atpublic void addMovementHeat()
public java.util.Vector<Report> doSetLocationsExposure(Entity entity,
IHex hex,
boolean isJump,
int elevation)
entity - The Entity who's exposure is being sethex - The IHex the entity is inisJump - a boolean value wether the entity is jumpingelevation - the elevation the entity should be at.
public boolean tryIgniteHex(Coords c,
int entityId,
boolean bHotGun,
boolean bInferno,
TargetRoll nTargetRoll,
boolean bReportAttempt,
int accidentTarget,
java.util.Vector<Report> vPhaseReport)
c - - the Coords of the hex being lit.entityId - - the int id of the entity involved.bInferno - - true if the weapon igniting the hex is an
Inferno round. If some other weapon or ammo is causing the
roll, this should be false.bHotGun - - true if the weapon is plasma/flamer/incendiary
LRM/etcnTargetRoll - - the TargetRoll for the ignition roll.bReportAttempt - - true if the attempt roll should be added to the
report.accidentTarget - - int the target number below which a roll has to
be made in order to try igniting a hex accidently. -1 for
intentional
public boolean tryIgniteHex(Coords c,
int entityId,
boolean bHotGun,
boolean bInferno,
TargetRoll nTargetRoll,
int accidentTarget,
java.util.Vector<Report> vPhaseReport)
c - - the Coords of the hex being lit.entityId - - the int id of the entity involved.bInferno - - true if the weapon igniting the hex is an
Inferno round. If some other weapon or ammo is causing the
roll, this should be false.nTargetRoll - - the int roll target for the attempt.
public java.util.Vector<Report> tryClearHex(Coords c,
int nDamage,
int entityId)
public void checkForFlamingDamage()
public java.util.Vector<Report> damageEntity(Entity te,
HitData hit,
int damage)
te - the target entityhit - the hit data for the location hitdamage - the damage to apply
Vector of Reports
public java.util.Vector<Report> damageEntity(Entity te,
HitData hit,
int damage,
boolean ammoExplosion,
Server.DamageType bFrag,
boolean damageIS)
te - the target entityhit - the hit data for the location hitdamage - the damage to applyammoExplosion - ammo explosion type damage is applied directly to the IS,
hurts the pilot, causes auto-ejects, and can blow the unit to
smithereensbFrag - The DamageType of the attack.damageIS - Should the target location's internal structure be damaged
directly?
Vector of Reports
public java.util.Vector<Report> damageEntity(Entity te,
HitData hit,
int damage,
boolean ammoExplosion,
Server.DamageType bFrag,
boolean damageIS,
boolean areaSatArty,
boolean throughFront)
te - the target entityhit - the hit data for the location hitdamage - the damage to applyammoExplosion - ammo explosion type damage is applied directly to the IS,
hurts the pilot, causes auto-ejects, and can blow the unit to
smithereensbFrag - The DamageType of the attack.damageIS - Should the target location's internal structure be damaged
directly?areaSatArty - Is the damage from an area saturating artillery attack?throughFront - Is the damage coming through the hex the unit is facing?
Vector of Reports
public java.util.Vector<Report> damageEntity(Entity te,
HitData hit,
int damage,
boolean ammoExplosion,
Server.DamageType bFrag,
boolean damageIS,
boolean areaSatArty,
boolean throughFront,
boolean underWater)
te - the target entityhit - the hit data for the location hitdamage - the damage to applyammoExplosion - ammo explosion type damage is applied directly to the IS,
hurts the pilot, causes auto-ejects, and can blow the unit to
smithereensbFrag - The DamageType of the attack.damageIS - Should the target location's internal structure be damaged
directly?areaSatArty - Is the damage from an area saturating artillery attack?throughFront - Is the damage coming through the hex the unit is facing?underWater - Is the damage coming from an underwater attack
Vector of Reports
public java.util.Vector<Report> damageEntity(Entity te,
HitData hit,
int damage,
boolean ammoExplosion,
Server.DamageType bFrag,
boolean damageIS,
boolean areaSatArty,
boolean throughFront,
boolean underWater,
boolean nukeS2S)
te - the target entityhit - the hit data for the location hitdamage - the damage to applyammoExplosion - ammo explosion type damage is applied directly to the IS,
hurts the pilot, causes auto-ejects, and can blow the unit to
smithereensbFrag - The DamageType of the attack.damageIS - Should the target location's internal structure be damaged
directly?areaSatArty - Is the damage from an area saturating artillery attack?throughFront - Is the damage coming through the hex the unit is facing?underWater - Is the damage coming from an underwater attack?nukeS2s - is this a ship-to-ship nuke?
Vector of Reports
public void doFusionEngineExplosion(int engineRating,
Coords position,
java.util.Vector<Report> vDesc,
java.util.Vector<java.lang.Integer> vUnits)
public void doExplosion(int damage,
int degredation,
boolean autoDestroyInSameHex,
Coords position,
boolean allowShelter,
java.util.Vector<Report> vDesc,
java.util.Vector<java.lang.Integer> vUnits)
public void doExplosion(int[] damages,
boolean autoDestroyInSameHex,
Coords position,
boolean allowShelter,
java.util.Vector<Report> vDesc,
java.util.Vector<java.lang.Integer> vUnits,
int clusterAmt)
public boolean canShelter(Coords entityPosition,
Coords position,
int entityAbsHeight)
entityPosition - the Coords the Entity is atposition - the Coords of the explosionentityAbsHeight - the int height of the entity
boolean value indicating if the entity of the
given height can find shelterpublic void addScheduledNuke(int[] nuke)
nuke - the nuke paramater either 3 or 6 ints 0 and 1 being X and Y
when 3 ints: third is nuketype (from HS:3070) if 6 ints: third
is damage fourth is degradation fifth is secondary radius
sixth is crater depth
public void doNuclearExplosion(Coords position,
int nukeType,
java.util.Vector<Report> vDesc)
position - nukeType - vDesc -
public void doNuclearExplosion(Coords position,
int baseDamage,
int degredation,
int secondaryRadius,
int craterDepth,
java.util.Vector<Report> vDesc)
position - baseDamage - degredation - secondaryRadius - craterDepth - vDesc -
public void applySecondaryNuclearEffects(Entity entity,
Coords position,
java.util.Vector<Report> vDesc)
entity - The entity to affect.position - The coordinates of the nuclear blast, for to-hit directions.vDesc - a description vector to use for reports.
public java.util.Vector<Report> applyCriticalHit(Entity en,
int loc,
CriticalSlot cs,
boolean secondaryEffects)
en - the Entity that is being damaged. This value may
not be null.loc - the int location of critical hit. This value may
be Entity.NONE for hits to Tanks and
for hits to a Protomech torso weapon.cs - the CriticalSlot being damaged. This value may
not be null. For critical hits on a
Tank, the index of the slot should be the index
of the critical hit table.secondaryEffects - the boolean flag that indicates whether to allow
critical hits to cause secondary effects (such as triggering
an ammo explosion, sending hovercraft to watery graves, or
damaging Protomech torso weapons). This value is normally
true, but it will be false when the
hit is being applied from a saved game or scenario.
public java.util.Vector<Report> applyCriticalHit(Entity en,
int loc,
CriticalSlot cs,
boolean secondaryEffects,
int damageCaused,
boolean isCapital)
en - the Entity that is being damaged. This value may
not be null.loc - the int location of critical hit. This value may
be Entity.NONE for hits to Tanks and
for hits to a Protomech torso weapon.cs - the CriticalSlot being damaged. This value may
not be null. For critical hits on a
Tank, the index of the slot should be the index
of the critical hit table.secondaryEffects - the boolean flag that indicates whether to allow
critical hits to cause secondary effects (such as triggering
an ammo explosion, sending hovercraft to watery graves, or
damaging Protomech torso weapons). This value is normally
true, but it will be false when the
hit is being applied from a saved game or scenario.damageCaused - the amount of damage causing this critical. Necessary for
Aeros, but may be -1 for other units.isCapital - whether it was capital scale damage that caused critical
public java.util.Vector<Report> criticalEntity(Entity en,
int loc,
int critMod)
public java.util.Vector<Report> criticalEntity(Entity en,
int loc,
int critMod,
boolean rollNumber,
boolean isCapital)
public boolean checkIgnition(Coords c,
TargetRoll roll,
boolean bInferno,
int entityId,
java.util.Vector<Report> vPhaseReport)
hex - - the IHex to be lit.roll - - the TargetRoll for the ignition rollbInferno - - true if the fire is an inferno fire. If this
value is false the hex will be lit only if it
contains Woods,jungle or a Building.entityId - - the entityId responsible for the ignite attempt. If the
value is Entity.NONE, then the roll attempt will not be
included in the report.
public boolean checkIgnition(Coords c,
TargetRoll roll,
boolean bInferno)
hex - - the IHex to be lit.roll - - the int target number for the ignition rollbAnyTerrain - - true if the fire can be lit in any terrain. If
this value is false the hex will be lit only if
it contains Woods, jungle or a Building.
public boolean checkIgnition(Coords c,
TargetRoll roll)
hex - - the IHex to be lit.roll - - the int target number for the ignition roll
public void ignite(Coords c,
boolean bInferno,
java.util.Vector<Report> vReport)
c - - the Coords of the hex to be set on firebInferno - - true if the fire to be set is an inferno
public void removeFire(Coords fireCoords,
java.lang.String reason)
x - y - hex -
public void addSmoke(java.util.ArrayList<Coords> coords,
int windDir,
boolean bInferno)
x - The int x-coordinate of the hexy - The int y-coordinate of the hexpublic void entityUpdate(int nEntityID)
public void entityUpdate(int nEntityID,
java.util.Vector<UnitLocation> movePath)
public void sendChat(int connId,
java.lang.String origin,
java.lang.String message)
public void sendServerChat(int connId,
java.lang.String message)
public void sendServerChat(java.lang.String message)
public void sendChangedHex(Coords coords)
public void sendChangedMines(Coords coords)
public void sendVisibilityIndicator(Entity e)
protected void handle(int connId,
Packet packet)
connId - - the int ID the connection that received the
packet.packet - - the Packet to be processed.public void run()
run in interface java.lang.Runnable
public void checkExplodeIndustrialZone(Coords c,
java.util.Vector<Report> vDesc)
public void damageInfantryIn(Building bldg,
int damage,
Coords hexCoords)
bldg - - the Building that sustained the damage.damage - - the int amount of damage.
public boolean checkForCollapse(Building bldg,
java.util.Hashtable<Coords,java.util.Vector<Entity>> positionMap,
Coords coords,
boolean checkBecauseOfDamage)
bldg - - the Building being checked. This value should
not be null.positionMap - - a Hashtable that maps the Coords
positions or each unit in the game to a Vector of
Entitys at that position. This value should not
be null.coords - - the Coords of the building hex to be checked
true if the building collapsed.
public void collapseBuilding(Building bldg,
java.util.Hashtable<Coords,java.util.Vector<Entity>> positionMap,
Coords coords)
public void collapseBuilding(Building bldg,
java.util.Hashtable<Coords,java.util.Vector<Entity>> positionMap,
Coords coords,
boolean collapseAll)
bldg - - the Building that has collapsed.positionMap - - a Hashtable that maps the Coords
positions or each unit in the game to a Vector of
Entitys at that position. This value should not
be null.coords - - The Coords> of the building hex that has
collapsedcollapseAll - - A boolean indicating wether or not this
collapse of a hex should be able to collapse the whole
building
public java.util.Vector<Report> damageBuilding(Building bldg,
int damage,
Coords coords)
bldg - - the Building that has been damaged. This value
should not be null, but no exception will occur.damage - - the int amount of damage.coords - - the Coords of the building hex to be damaged
Report to be shown to the players.
public java.util.Vector<Report> damageBuilding(Building bldg,
int damage,
java.lang.String why,
Coords coords)
bldg - - the Building that has been damaged. This value
should not be null, but no exception will occur.damage - - the int amount of damage.why - - the String message that describes why the
building took the damage.coords - - the Coords of the building hex to be damaged
Report to be shown to the players.public void sendChangedCFBuildings(java.util.Vector<Building> buildings)
public void creditKill(Entity target,
Entity attacker)
target - The Entity that got killed.attacker - The Entity that did the killing.
public java.util.Vector<Report> ejectEntity(Entity entity,
boolean autoEject)
entity - The Entity to eject.autoEject - The boolean state of the entity's auto- ejection
system
Vector of report objects for the gamelog.public java.util.Vector<Report> abandonEntity(Entity entity)
entity - The Entity to abandon.
Vector of report objects for the gamelog.
public java.util.Vector<Report> checkForVehicleFire(Tank tank,
boolean inferno)
tank - the Tank to be checkedinferno - a boolean parameter wether or not this check is
because of inferno firepublic void doAssaultDrop(Entity entity)
entity - the Entity for which to resolve itvoid doAllAssaultDrops()
void doMagmaDamage(Entity en,
boolean eruption)
en - the affected Entityeruption - boolean indicating wether or not this is because
of an eruptionpublic void doSinkEntity(Entity en)
void artilleryDamageHex(Coords coords,
Coords attackSource,
int damage,
AmmoType ammo,
int subjectId,
Entity killer,
Entity exclude,
boolean flak,
int altitude,
java.util.Vector<Report> vPhaseReport,
boolean asfFlak)
coords - The hex being hitattackSource - The location the attack came from. For hit table resolutiondamage - Amount of damage to deal to each entityammo - The ammo type being usedsubjectId - Subject for reportskiller - Who should be credited with killsexclude - Entity that should take no damage (used for homing splash)flak - Flak, hits flying units only, instead of flyers being immunealtitude - Absolute altitude for flak attackvPhaseReport - The Vector of Reports for the phasereportasfFlak - Is this flak against ASF?
public void artilleryDamageArea(Coords centre,
Coords attackSource,
AmmoType ammo,
int subjectId,
Entity killer,
boolean flak,
int altitude,
boolean mineClear,
java.util.Vector<Report> vPhaseReport,
boolean asfFlak)
centre - The hex on which damage is centredattackSource - The position the attack came fromammo - The ammo type doing the damagesubjectId - Subject for reportskiller - Who should be credited with killsflak - Flak, hits flying units only, instead of flyers being immunealtitude - Absolute altitude for flak attackmineclear - Does this clear mines?vPhaseReport - The Vector of Reports for the phasereportasfFlak - Is this flak against ASF?
public void artilleryDamageArea(Coords centre,
Coords attackSource,
AmmoType ammo,
int subjectId,
Entity killer,
int damage,
int falloff,
boolean flak,
int altitude,
java.util.Vector<Report> vPhaseReport,
boolean asfFlak)
centre - The hex on which damage is centredattackSource - The position the attack came fromammo - The ammo type doing the damagesubjectId - Subject for reportskiller - Who should be credited with killsdamage - Damage at ground zerofalloff - Reduction in damage for each hex of distanceflak - Flak, hits flying units only, instead of flyers being immunealtitude - Absolute altitude for flak attackvPhaseReport - The Vector of Reports for the phasereportasfFlak - Is this flak against ASF?
public void deliverBombDamage(Coords centre,
int type,
int subjectId,
Entity killer,
java.util.Vector<Report> vPhaseReport)
public void deliverBombInferno(Coords coords,
Entity ae,
int subjectId,
java.util.Vector<Report> vPhaseReport)
coords - the Coords where to deliverae - the attacking entitysubjectId - the int id of the targetvoid resolveFortify()
public java.lang.String getHost()
String representing the hostnamepublic int getPort()
int this server is listening onpublic static Server getServerInstance()
public void createSmoke(Coords coords)
SmokeCloud object and add it to the server list
coords -
public void createSmoke(Coords coords,
int level)
SmokeCloud object and add it to the server list
coords - level - 1=Light 2=Heavy Smoke
public void createSmoke(Coords coords,
int level,
int duration)
SmokeCloud object and add it to the server list
coords - level - 1=Light 2=Heavy Smokeduration - How long the smoke will last.
public void createSmoke(java.util.ArrayList<Coords> coords,
int level,
int duration)
SmokeCloud object and add it to the server list
coords - level - 1=Light 2=Heavy Smokeduration - duration How long the smoke will last.
public void updateSmoke(SmokeCloud cloud,
java.util.ArrayList<Coords> newCoords)
newCoords - public void removeSmokeTerrain(SmokeCloud cloud)
cloud - public java.util.List<SmokeCloud> getSmokeCloudList()
public void reportRoll(Roll roll)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||