Base Class Updates (see desc)

* Adds a JNI method for making engine WARNING calls
* Adds a JNI method to get the max value of a collection slot
* Adds faction crc hashes as easily accessible constants
* Cleans up planet-related javadoc errors
This commit is contained in:
AconiteGodOfSWG
2020-11-19 22:42:26 -05:00
parent bd3317e806
commit dddd161e92
@@ -1528,6 +1528,22 @@ public class base_class
public static final int HOLOGRAM_TYPE1_QUALITY3 = 2;
public static final int HOLOGRAM_TYPE1_QUALITY4 = 3;
/**
* Faction Codes (as crc hash)
* Used by many methods that check or return the faction of an object
* e.g. pvpGetAlignedFaction() or pvpSetAlignedFaction()
*/
public static final int FACTION_HASH_NEUTRAL = 0;
public static final int FACTION_HASH_IMPERIAL = -615855020;
public static final int FACTION_HASH_REBEL = 370444368;
public static final int FACTION_HASH_BATTLEFIELD = -526735576;
public static final int FACTION_HASH_DUEL = 1183528962;
public static final int FACTION_HASH_BOUNTY_DUEL = -429740311;
public static final int FACTION_HASH_NONAGGRESSIVE = 221551254;
public static final int FACTION_HASH_UNATTACKABLE = -160237431;
public static final int FACTION_HASH_BOUNTY_TARGET = 84709322;
public static final int FACTION_HASH_GUILDWAR_COOLDOWN = -1526926610;
public static final int FACTION_HASH_BUBBLE_COMBAT = -377582139;
/**
* Returns an obj_id for a given id number.
@@ -1560,8 +1576,7 @@ public class base_class
//*********************************************************************
/**
* @defgroup debuggingMethods Debugging methods. These methods are removed
* from scripts that are compiled in release mode.
* @defgroup debuggingMethods Debugging methods.
* @{
*/
// debugging methods
@@ -9723,6 +9738,9 @@ public class base_class
{
warpPlayer(player, sceneName, x_w, y_w, z_w, building, cell, x_p, y_p, z_p, callback, false);
}
public static void warpPlayer(obj_id player, location loc, String callback, boolean forceLoadScreen) {
warpPlayer(player, loc.area, loc.x, loc.y, loc.z, loc.cell, 0f, 0f, 0f, callback, forceLoadScreen);
}
/**
* Disconnects a player. If the safeLogout objvar is set on them, logs them out too.
* @param player the player to disconnect
@@ -15343,6 +15361,16 @@ public class base_class
// null is a valid return value
public static native String[] getAllCollectionSlotCategories();
/**
* getCollectionSlotMaxValue
* Returns the maximum value of a collection slot
* Useful for determining if a collection slot is a bit-type or a count-type or setting count-types
* A bit-type collection slot will return 0, a count type will be > 0.
* @param slotName the name of the slot
* @return the max value of the slot (or -1 if there is an error finding the requested slot)
*/
public static native long getCollectionSlotMaxValue(String slotName);
//*********************************************************************
// base class methods
//*********************************************************************
@@ -19033,8 +19061,8 @@ public class base_class
/**
* Remove a travel point to the specified planet.
*
* @param planet the planet to remove the travel point
* @param name the name of the travel point
* @param planetName the planet to remove the travel point
* @param travelPointName the name of the travel point
* @return true of successful
*/
public static native boolean removePlanetTravelPoint (String planetName, String travelPointName);
@@ -19042,7 +19070,7 @@ public class base_class
/**
* Get a list of all travel points for a planet
*
* @param planet the planet to get the travel points from
* @param planetName the planet to get the travel points from
* @return string array of travel points
*/
public static native String[] getPlanetTravelPoints (String planetName);
@@ -19050,8 +19078,8 @@ public class base_class
/**
* Get the GCW contested region that the travel point is in, if any
*
* @param planet the planet
* @param name the name of the travel point
* @param planetName the planet
* @param travelPointName the name of the travel point
* @return the GCW contested region that the travel point is in, if any
*/
public static native String getPlanetTravelPointGcwContestedRegion (String planetName, String travelPointName);
@@ -19059,8 +19087,8 @@ public class base_class
/**
* Get location of a travel point
*
* @param planet the planet
* @param name the name of the travel point
* @param planetName the planet
* @param travelPointName the name of the travel point
* @return obj_id of the travel point, NULL if invalid
*/
public static native location getPlanetTravelPointLocation (String planetName, String travelPointName);
@@ -19068,8 +19096,8 @@ public class base_class
/**
* Get of cost of a travel point
*
* @param planet the planet
* @param name the name of the travel point
* @param planetName the planet
* @param travelPointName the name of the travel point
* @return int the cost, 0 of unsuccessful
*/
public static native int getPlanetTravelPointCost (String planetName, String travelPointName);
@@ -19077,8 +19105,8 @@ public class base_class
/**
* Get of cost of a travel point
*
* @param planet the planet
* @param name the name of the travel point
* @param planetName the planet
* @param travelPointName the name of the travel point
* @return int the cost, 0 of unsuccessful
*/
public static native boolean getPlanetTravelPointInterplanetary (String planetName, String travelPointName);
@@ -19086,8 +19114,8 @@ public class base_class
/**
* Get of cost of a traveling between planets
*
* @param planet1 the departure planet
* @param planet2 the arrival planet
* @param planetName1 the departure planet
* @param planetName2 the arrival planet
* @return int the cost, 0 of unsuccessful
*/
public static native int getPlanetTravelCost (String planetName1, String planetName2);
@@ -19096,7 +19124,7 @@ public class base_class
* Put the client into ticket purchase mode
*
* @param player the client network id
* @param startingPlanet the departure planet
* @param startingPlanetName the departure planet
* @param startingTravelPointName the departure travel point name
* @param instantTravel whether or not the purchase mode was initiated by an instant travel request
* @return true if successful
@@ -19110,7 +19138,7 @@ public class base_class
/**
* Check whether an area has too many players for travel
*
* @param planet the planet (or space scene)
* @param planetName the planet (or space scene)
* @param x the x-coordinate of the area
* @param z the z-coordinate of the area
* @return true if the area has too many players
@@ -26737,4 +26765,16 @@ public class base_class
{
return _hasObjectEffect(getLongWithNull(obj), label);
}
/**
* WARNING
* Runs a WARNING call on the GameServer processed through the SRC and dumps the message to console and log.
* Does not conform to debug flags, this will always run. For conditional debug messages, use debugServerConsoleMsg();
* Prepends with [dsrc] so you know it came from scripts. If you're thinking about using a system.out.println, use this instead.
* @param message the message for the console
*/
private static native void _triggerServerWarning(String message);
public static void WARNING(String message) {
_triggerServerWarning("[dsrc] "+message);
}
} // class base_class