UltraCore Core - API icon

UltraCore Core - API -----

UltraCore API for Spigot Plugins.



Big update for the WebServer! Variables and much more!
WebServer

WebServer {
+ Added MIME (content type) support for:
CSS files;
JavaScript files;
PNG Files;
JPG Files;
GIF Files;
WEBP Files;
SVG Files;
ICO Files;


* Modified the constructor to: #WebServer(int port, File webRoot, String fileNotFound, String methodNotSupported, boolean verbose, boolean debugging).
+ When the url does NOT end with a slash, it now checks if it's a file or a folder, if it's a folder then it treates it a s a folder and searches for the index file.

+ Fixed the Verbose messages on-website not working if there is no #onError(WebServerInfo webServerInfo) method in the WebServer class.
+ Added the comments. If the line (trimmed) starts with "//" the line is going to be ignored
* Fixed ArrayIndexOutOfBounds if there are too many arguments.
+ Added #include(String fileName) and #required(String fileName) - they work with HTML files, UC files etc. The #include(String fileName) method will try to include the file (so copy all the text of the file, and if it is an UC file parse it), and in case of file not found or any other error it's going to verbose (if enabled) and continue. The #required(String fileName) instead, if the file is not found, is going to verbose and die.

+ Added trim to the UC tags (this means you can now put spaces before the opening and closing tags).
+ Added variables!
+ Added PlaceHolders!
+ Added #redirect(String location, int time), which is going to redirect to a specific URL or file, after #time seconds.

Variables {

Declare variable: #variables.set(String variableName, String value, boolean global)
Unset variable: #variables.unset(String variableName, boolean global)

The variable can be used almost everywhere in the UC code, and to call it you must write: G_name (where "name" is the name of the variable) in case the variable is global (which means can be called in the whole project after being declared), or V_name (where "name" is the name of the variable) in case the variable is not global (keep in mind that if it is not global you can NOT call it from other UC files).

}

Placeholders {
PlaceHolders are default "variables" you can use in your code. Since you can not use methods inside of other methods (yet), they have been added and will be replaced with their value.
To call a placeholder this is the syntax: "{placeholder}". A list of the placeholders follows.

coreVersion - returns the version of the Core in use.
fileName - returns the name of the file.
requestedFileName - returns the name of the requested file.
clientAddress - returns the address of the client.
clientPort - returns the port of the client.
localAddress - returns the local address.
localPort - returns the local port.
onlinePlayers - returns the number of the online players.
maxPlayers - returns the number of the max players that can join the server.
serverName - returns the name of the server (the one set in the server.properties).
motd - returns the motd of the server (the one in the server.properties).
serverVersion - returns the Minecraft version of the server.
bukkitVersion - returns the version of Bukkit the server is running.
serverAddress - returns the address of the server (the one in the server.properties).
serverPort - returns the port the server is running on.
}

}


The ConfigsManager class has been renamed to ConfigManager.
----------, Apr 27, 2019
Resource Information
Author:
----------
Total Downloads: 1,918
First Release: Mar 18, 2019
Last Update: Feb 18, 2023
Category: ---------------
All-Time Rating:
1 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings