summaryrefslogtreecommitdiffstats
path: root/MCServer
diff options
context:
space:
mode:
Diffstat (limited to 'MCServer')
-rw-r--r--MCServer/Plugins/APIDump/APIDesc.lua29
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnServerPing.lua4
m---------MCServer/Plugins/Core0
-rw-r--r--MCServer/webadmin/files/style.css497
-rw-r--r--MCServer/webadmin/template.lua63
-rw-r--r--MCServer/webadmin/template_orig.lua137
6 files changed, 457 insertions, 273 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 2f1c766cb..6a151b5ef 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -529,6 +529,7 @@ end
GetLocale = { Params = "", Return = "Locale", Notes = "Returns the locale string that the client sends as part of the protocol handshake. Can be used to provide localized strings." },
GetPing = { Params = "", Return = "number", Notes = "Returns the ping time, in ms" },
GetPlayer = { Params = "", Return = "{{cPlayer|cPlayer}}", Notes = "Returns the player object connected to this client. Note that this may be nil, for example if the player object is not yet spawned." },
+ GetProtocolVersion = { Params = "", Return = "number", Notes = "Returns the protocol version number of the protocol that the client is talking. Returns zero if the protocol version is not (yet) known." },
GetUniqueID = { Params = "", Return = "number", Notes = "Returns the UniqueID of the client used to identify the client in the server" },
GetUUID = { Params = "", Return = "string", Notes = "Returns the authentication-based UUID of the client. This UUID should be used to identify the player when persisting any player-related data. Returns a 32-char UUID (no dashes)" },
GetUsername = { Params = "", Return = "string", Notes = "Returns the username that the client has provided" },
@@ -785,7 +786,9 @@ end</pre>
AddSpeedX = { Params = "AddX", Return = "", Notes = "Adds the specified amount of speed in the X axis direction." },
AddSpeedY = { Params = "AddY", Return = "", Notes = "Adds the specified amount of speed in the Y axis direction." },
AddSpeedZ = { Params = "AddZ", Return = "", Notes = "Adds the specified amount of speed in the Z axis direction." },
+ ArmorCoversAgainst = { Params = "{{cEntity|AttackerEntity}}, DamageType, RawDamage", Return = "number", Notes = "Returns the points out of a_RawDamage that the currently equipped armor would cover." },
Destroy = { Params = "", Return = "", Notes = "Schedules the entity to be destroyed" },
+ GetAirLevel = { Params = "", Return = "number", Notes = "Returns the air level (number of ticks of air left). Note, this function is only updated with mobs or players." },
GetArmorCoverAgainst = { Params = "AttackerEntity, DamageType, RawDamage", Return = "number", Notes = "Returns the number of hitpoints out of RawDamage that the currently equipped armor would cover. See {{TakeDamageInfo}} for more information on attack damage." },
GetChunkX = { Params = "", Return = "number", Notes = "Returns the X-coord of the chunk in which the entity is placed" },
GetChunkZ = { Params = "", Return = "number", Notes = "Returns the Z-coord of the chunk in which the entity is placed" },
@@ -801,6 +804,7 @@ end</pre>
GetHeadYaw = { Params = "", Return = "number", Notes = "Returns the pitch of the entity's head (FIXME: Rename to GetHeadPitch() )." },
GetHealth = { Params = "", Return = "number", Notes = "Returns the current health of the entity." },
GetHeight = { Params = "", Return = "number", Notes = "Returns the height (Y size) of the entity" },
+ GetInvulnerableTicks = { Params = "", Return = "number", Notes = "Returns the number of ticks that this entity will be invulnerable for. This is used for after-hit recovery - the entities are invulnerable for half a second after being hit." },
GetKnockbackAmountAgainst = { Params = "ReceiverEntity", Return = "number", Notes = "Returns the amount of knockback that the currently equipped items would cause when attacking the ReceiverEntity." },
GetLookVector = { Params = "", Return = "{{Vector3f}}", Notes = "Returns the vector that defines the direction in which the entity is looking" },
GetMass = { Params = "", Return = "number", Notes = "Returns the mass of the entity. Currently unused." },
@@ -818,23 +822,29 @@ end</pre>
GetSpeedX = { Params = "", Return = "number", Notes = "Returns the X-part of the speed vector" },
GetSpeedY = { Params = "", Return = "number", Notes = "Returns the Y-part of the speed vector" },
GetSpeedZ = { Params = "", Return = "number", Notes = "Returns the Z-part of the speed vector" },
+ GetTicksAlive = { Params = "", Return = "number", Notes = "Returns the number of ticks that this entity has been alive for." },
GetUniqueID = { Params = "", Return = "number", Notes = "Returns the ID that uniquely identifies the entity within the running server. Note that this ID is not persisted to the data files." },
GetWidth = { Params = "", Return = "number", Notes = "Returns the width (X and Z size) of the entity." },
GetWorld = { Params = "", Return = "{{cWorld}}", Notes = "Returns the world where the entity resides" },
GetYaw = { Params = "", Return = "number", Notes = "Returns the yaw (direction) of the entity. Measured in degrees, values range from -180 to +180. 0 means ZP, 90 means XM, -180 means ZM, -90 means XP." },
+ HandleSpeedFromAttachee = { Params = "ForwardAmount, SidewaysAmount", Return = "", Notes = "Updates the entity's speed based on the attachee exerting the specified force forward and sideways. Used for entities being driven by other entities attached to them - usually players driving minecarts and boats." },
Heal = { Params = "Hitpoints", Return = "", Notes = "Heals the specified number of hitpoints. Hitpoints is expected to be a positive number." },
IsA = { Params = "ClassName", Return = "bool", Notes = "Returns true if the entity class is a descendant of the specified class name, or the specified class itself" },
IsBoat = { Params = "", Return = "bool", Notes = "Returns true if the entity is a {{cBoat|boat}}." },
IsCrouched = { Params = "", Return = "bool", Notes = "Returns true if the entity is crouched. Always false for entities that don't support crouching." },
IsDestroyed = { Params = "", Return = "bool", Notes = "Returns true if the entity has been destroyed and is awaiting removal from the internal structures." },
+ IsEnderCrystal = { Params = "", Return = "bool", Notes = "Returns true if the entity is an ender crystal." },
IsExpOrb = { Params = "", Return = "bool", Notes = "Returns true if the entity represents an experience orb" },
IsFallingBlock = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cFallingBlock}} entity." },
+ IsFireproof = { Params = "", Return = "bool", Notes = "Returns true if the entity takes no damage from being on fire." },
IsFloater = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a fishing rod floater" },
IsInvisible = { Params = "", Return = "bool", Notes = "Returns true if the entity is invisible" },
+ IsItemFrame = { Params = "", Return = "bool", Notes = "Returns true if the entity is an item frame." },
IsMinecart = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cMinecart|minecart}}" },
IsMob = { Params = "", Return = "bool", Notes = "Returns true if the entity represents any {{cMonster|mob}}." },
IsOnFire = { Params = "", Return = "bool", Notes = "Returns true if the entity is on fire" },
IsPainting = { Params = "", Return = "bool", Notes = "Returns if this entity is a painting." },
+ IsPawn = { Params = "", Return = "bool", Notes = "Returns true if the entity is a {{cPawn}} descendant." },
IsPickup = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cPickup|pickup}}." },
IsPlayer = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cPlayer|player}}" },
IsProjectile = { Params = "", Return = "bool", Notes = "Returns true if the entity is a {{cProjectileEntity}} descendant." },
@@ -844,12 +854,19 @@ end</pre>
IsSubmerged = { Params = "", Return = "bool", Notes = "Returns true if the mob or player is submerged in water (head is in a water block). Note, this function is only updated with mobs or players." },
IsSwimming = { Params = "", Return = "bool", Notes = "Returns true if the mob or player is swimming in water (feet are in a water block). Note, this function is only updated with mobs or players." },
IsTNT = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cTNTEntity|TNT entity}}" },
+ Killed = { Params = "{{cEntity|Victim}}", Return = "", Notes = "This entity has killed another entity (the Victim). For players, adds the scoreboard statistics about the kill." },
KilledBy = { Notes = "FIXME: Remove this from API" },
- GetAirLevel = { Params = "", Return = "number", Notes = "Returns the air level (number of ticks of air left). Note, this function is only updated with mobs or players." },
+ MoveToWorld =
+ {
+ { Params = "{{cWorld|World}}, [ShouldSendRespawn]", Return = "bool", Notes = "Removes the entity from this world and starts moving it to the specified world. Note that to avoid deadlocks, the move is asynchronous - the entity is moved into a queue and will be moved from that queue into the destination world at some (unpredictable) time in the future. ShouldSendRespawn is used only for players, it specifies whether the player should be sent a Repawn packet upon leaving the world (The client handles respawns only between different dimensions)." },
+ { Params = "WorldName, [ShouldSendRespawn]", Return = "bool", Notes = "Removes the entity from this world and starts moving it to the specified world. Note that to avoid deadlocks, the move is asynchronous - the entity is moved into a queue and will be moved from that queue into the destination world at some (unpredictable) time in the future. ShouldSendRespawn is used only for players, it specifies whether the player should be sent a Repawn packet upon leaving the world (The client handles respawns only between different dimensions)." },
+ },
SetGravity = { Params = "Gravity", Return = "", Notes = "Sets the number that is used as the gravity for physics simulation. 1G (9.78) by default." },
SetHeadYaw = { Params = "HeadPitch", Return = "", Notes = "Sets the head pitch (FIXME: Rename to SetHeadPitch() )." },
SetHealth = { Params = "Hitpoints", Return = "", Notes = "Sets the entity's health to the specified amount of hitpoints. Doesn't broadcast any hurt animation. Doesn't kill the entity if health drops below zero. Use the TakeDamage() function instead for taking damage." },
SetHeight = { Params = "", Return = "", Notes = "FIXME: Remove this from API" },
+ SetInvulnerableTicks = { Params = "NumTicks", Return = "", Notes = "Sets the amount of ticks for which the entity will not receive any damage from other entities." },
+ SetIsFireproof = { Params = "IsFireproof", Return = "", Notes = "Sets whether the entity receives damage from being on fire." },
SetMass = { Params = "Mass", Return = "", Notes = "Sets the mass of the entity. Currently unused." },
SetMaxHealth = { Params = "MaxHitpoints", Return = "", Notes = "Sets the maximum hitpoints of the entity. If current health is above MaxHitpoints, it is capped to MaxHitpoints." },
SetPitch = { Params = "number", Return = "", Notes = "Sets the pitch (nose-down rotation) of the entity" },
@@ -864,7 +881,7 @@ end</pre>
SetPosZ = { Params = "number", Return = "", Notes = "Sets the Z-coord of the entity's pivot" },
SetRoll = { Params = "number", Return = "", Notes = "Sets the roll (sideways rotation) of the entity. Currently unused." },
SetRot = { Params = "{{Vector3f|Rotation}}", Return = "", Notes = "Sets the entire rotation vector (Yaw, Pitch, Roll)" },
- SetYawFromSpeed = { Params = "", Return = "", Notes = "Sets the entity's yaw to match its current speed (entity looking forwards as it moves). (FIXME: Rename to SetYawFromSpeed)" },
+ SetYawFromSpeed = { Params = "", Return = "", Notes = "Sets the entity's yaw to match its current speed (entity looking forwards as it moves)." },
SetSpeed =
{
{ Params = "SpeedX, SpeedY, SpeedZ", Return = "", Notes = "Sets the current speed of the entity" },
@@ -890,18 +907,20 @@ end</pre>
Constants =
{
etBoat = { Notes = "The entity is a {{cBoat}}" },
+ etEnderCrystal = { Notes = "" },
etEntity = { Notes = "No further specialization available" },
etExpOrb = { Notes = "The entity is a {{cExpOrb}}" },
etFallingBlock = { Notes = "The entity is a {{cFallingBlock}}" },
etFloater = { Notes = "The entity is a fishing rod floater" },
+ etItemFrame = { Notes = "" },
+ etMinecart = { Notes = "The entity is a {{cMinecart}} descendant" },
etMob = { Notes = "The entity is a {{cMonster}} descendant" },
etMonster = { Notes = "The entity is a {{cMonster}} descendant" },
- etMinecart = { Notes = "The entity is a {{cMinecart}} descendant" },
- etPlayer = { Notes = "The entity is a {{cPlayer}}" },
+ etPainting = { Notes = "The entity is a {{cPainting}}" },
etPickup = { Notes = "The entity is a {{cPickup}}" },
+ etPlayer = { Notes = "The entity is a {{cPlayer}}" },
etProjectile = { Notes = "The entity is a {{cProjectileEntity}} descendant" },
etTNT = { Notes = "The entity is a {{cTNTEntity}}" },
- etPainting = { Notes = "The entity is a {{cPainting}}" },
},
ConstantGroups =
{
diff --git a/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua b/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua
index 6d2325fe6..76b6d1517 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnServerPing.lua
@@ -34,9 +34,9 @@ function OnServerPing(ClientHandle, ServerDescription, OnlinePlayers, MaxPlayers
MaxPlayers = 0
-- Change favicon
- if (cFile:IsFile("my-favicon.png")) then
+ if cFile:IsFile("my-favicon.png") then
local FaviconData = cFile:ReadWholeFile("my-favicon.png")
- if (FaviconData != "") then
+ if (FaviconData ~= "") and (FaviconData ~= nil) then
Favicon = Base64Encode(FaviconData)
end
end
diff --git a/MCServer/Plugins/Core b/MCServer/Plugins/Core
-Subproject 3a0e0597b7a24c44bf87ec90beb9be48d0b9970
+Subproject f8c2531fbef9bfd0b6f024d4d3319384a70a083
diff --git a/MCServer/webadmin/files/style.css b/MCServer/webadmin/files/style.css
index e7ffe3999..7f01b34b2 100644
--- a/MCServer/webadmin/files/style.css
+++ b/MCServer/webadmin/files/style.css
@@ -1,326 +1,353 @@
-/* reset CSS */
-
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, font, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-b, u, i, center,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td {
- margin: 0;
+body, html
+{
+ font-family: "Open Sans", Tahoma, sans-serif;
padding: 0;
- border: 0;
- outline: 0;
- font-size: 100%;
- vertical-align: baseline;
- background: transparent;
+ margin: 0;
+ font-weight: 400;
+ background-color: #fbe9e7;
+ color: rgba(0, 0, 0, 0.87);
+}
+
+.light { font-weight: 300; }
+.bold { font-weight: 600; }
+
+#wrapper
+{
+ background-color: #ff5722;
+ margin: 40px auto;
+ width: 99%;
+ max-width: 1200px;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.15);
+ color: rgba(0, 0, 0, 0.87);
+}
+
+.title
+{
+ font-size: 30pt;
+ padding: 10px 40px;
+ text-decoration: none;
+ color: white;
+ text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
+ display: block;
}
-body {
- line-height: 1;
+
+#sidebar
+{
+ float: left;
+ width: 20%;
}
-ol, ul {
+
+.sideNav
+{
list-style: none;
-}
-blockquote, q {
- quotes: none;
+ background-color: #fafafa;
+ margin: 20px 0;
+ padding: 5px 0;
+ width: 100%;
+ box-shadow: 1px 0px 10px rgba(0, 0, 0, 0.2);
}
-/* remember to define focus styles! */
-:focus {
- outline: 0;
+.sideNav li
+{
+ padding: 10px;
+ color: rgba(0, 0, 0, 0.54);
}
-/* remove textarea resize at Safari */
-textarea {
- resize: none;
+.sideNav li.link
+{
+ padding-left: 30px;
}
-/* remember to highlight inserts somehow! */
-ins {
+.sideNav li.link a
+{
text-decoration: none;
+ color: rgba(0, 0, 0, 0.87);
}
-del {
- text-decoration: line-through;
-}
-
-/* tables still need 'cellspacing="0"' in the markup */
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-
-/*
- Origional from http://www.perspectived.com/
- Modified by Ben Phelps
- Made for FakeTruth - MCServer
-*/
-
-/* Basic ---------------------------------------- */
-
-.clear { clear: both; }
-
-body {
- background: white;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 12px;
- color: #646464;
- text-align: center;
+#container
+{
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ background-color: #f5f5f5;
}
-#wrapper {
- text-align: left;
- width: 930px;
- margin: 0 auto;
+#main
+{
+ float: right;
+ width: 80%;
+ padding: 0 15px 20px 15px;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
}
-/* Logo ---------------------------------------- */
-
-h1 {
- margin: 15px 0 10px 5px;
- width: 180px;
- height: 36px;
- background: url(logo.png) no-repeat left top;
+.clear
+{
+ clear: both;
}
-h1 a {
- display: block;
- width: 225px;
- height: 28px;
+table
+{
+ width: 100%;
+ border-collapse: collapse;
}
-h1 span { display: none; }
-
-a {
- color: #646464;
+table td
+{
+ padding: 5px;
}
-/* Container ---------------------------------------- */
-
-#containerHolder {
- background: #eee;
+table th
+{
+ border-bottom: 1px solid rgba(0, 0, 0, 0.12);
padding: 5px;
+ text-align: center;
}
-
-#container {
- background: #fff url(background.gif) repeat-y left top;
- border: 1px solid #ddd;
- width: 918px;
-
+table tr:nth-child(odd)
+{
+ background-color: rgba(0, 0, 0, 0.015);
}
-#connectHolder {
- background: #eee;
- padding: 5px;
- margin-bottom:8px;
+p
+{
+ margin: 8px 0;
+ padding: 8px 3px;
}
-
-#connect {
- border: 1px solid #ddd;
- background-color: #fff;
- padding:5px;
- width: 908px;
+a
+{
+ text-decoration: none;
+ color: #0277bd;
+ -webkit-transition: color 0.1s linear;
+ -moz-transition: color 0.1s linear;
+ transition: color 0.1s linear;
}
-.pics {
- height: 375px;
- width: 600px;
-}
-
-.pics img {
- padding: 5px;
- border: 1px solid #ddd;
- background-color: #eee;
- width: 600px;
- height: 375px;
- margin-left: 15px;
+a:hover
+{
+ color: #01579b;
}
-/* Login -------------------------------------- */
-
-#loginLogo {
- margin: 0 auto;
- margin-top:100px;
- width: 180px;
- height: 36px;
- background-image: url(logo.png);
+.welcome-msg
+{
+ color: rgba(0, 0, 0, 0.54);
}
-#loginHolder {
- background: #eee;
- padding: 5px;
- width: 310px;
- margin: 0 auto;
- height: 90px;
- margin-top:20px;
+.username
+{
+ text-transform: capitalize;
+ color: rgba(0, 0, 0, 0.87);
}
-#login {
- padding:10px;
- width: 288px;
- height: 68px;
- border: 1px solid #ddd;
- background:#fff;
- text-align: left;
+a:hover
+{
+ color: black;
}
-
-/* Sidebar ---------------------------------------- */
-
-#sidebar {
- width: 179px;
- float: left;
+input, select
+{
+ padding: 8px;
}
-#sidebar .sideNav { width: 179px; }
+form
+{
+ padding: 4px;
+}
-#sidebar .sideNav li { border-bottom: 1px solid #ddd; width: 179px; }
+.info input[type="submit"], .info button, .info input[type="button"],
+.warn input[type="submit"], .warn button, .warn input[type="button"],
+.err input[type="submit"], .err button, .err input[type="button"]
+{
+ float: right;
+}
-#sidebar .sideNav li a {
+.err
+{
+ color: white;
display: block;
- color: #646464;
- background: #f6f6f6;
- text-decoration: none;
- height: 29px;
- line-height: 29px;
- padding: 0 19px;
- width: 141px;
+ background-color: #e51c23 !important;
+ padding: 15px;
+ line-height: 30px;
+ min-height: 30px;
}
-#sidebar .sideNav li a:hover { background: #fdfcf6; }
-
-#sidebar .sideNav li a.active, #sidebar .sideNav li a.active:hover {
- background: #f0f7fa;
- color: #c66653;
+.err:before
+{
+ content: "ERROR: ";
}
-/* Breadcrumb ---------------------------------------- */
-
-h2 {
- width: 718px;
- float: right;
- color: #646464;
- font-size: 16px;
- line-height: 16px;
- font-weight: bold;
- margin: 20px 0 0 0;
- padding: 0 0 10px 0;
- border-bottom: 1px solid #ddd;
+.warn
+{
+ color: white;
+ display: block;
+ background-color: #ff5722 !important;
+ padding: 15px;
+ line-height: 30px;
+ min-height: 30px;
}
-h2 a {
- color: #646464;
- text-decoration: none;
+.warn:before
+{
+ content: "WARNING: ";
}
-h2 a.active { color: #c66653; }
+.info
+{
+ color: white;
+ display: block;
+ background-color: #5677fc !important;
+ padding: 15px;
+ line-height: 30px;
+ min-height: 30px;
+}
-h2 a:hover { text-decoration: underline; }
+.info:before
+{
+ content: "INFORMATION: ";
+}
-/* Content ---------------------------------------- */
+#footer .fleft
+{
+ float: left;
+}
-#main {
- width: 700px;
+#footer .fright
+{
float: right;
- padding: 0 19px 0 0;
+ text-align: right;
}
-#main p {
-
+#footer
+{
+ margin: 0;
padding: 10px;
+ font-size: 9pt;
+ color: rgba(255, 255, 255, 0.8);
+ box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.2) inset;
+}
+#footer a
+{
+ text-transform: none;
+ color: white;
}
-h3 {
- font-size: 14px;
- line-height: 14px;
- font-weight: bold;
- color: #5494af;
- padding: 0 0 0 10px;
- margin: 20px 0 10px;
+input[type="submit"], button, input[type="button"]
+{
+ background-color: #ffc107;
+ padding: 8px 15px 8px 15px;
+ margin: 0 2px;
+ display: inline-block;
+ text-align: center;
+ color: black;
+ box-shadow: 0px 2px 3px rgba(0,0,0,0.2);
+ border: none;
+ outline: none;
+ cursor: pointer;
}
-h4 {
- padding: 0 0 0 10px;
- margin: 20px 0 10px;
+input[type="submit"]:hover, button:hover, input[type="button"]:hover
+{
+ background-color: #ffca28;
}
-#main ul {
- padding: 0 0 0 10px;
- list-style-type: circle;
- list-style-position: inside;
+input[type="submit"]:active, button:active, input[type="button"]:active
+{
+ background-color: #ffd54f;
+ -webkit-transform: translateY(1px);
+ -moz-transform: translateY(1px);
+ transform: translateY(1px);
}
-#main table {
- border-top: 1px solid #ddd;
- width: 700px;
+hr
+{
+ border: none;
+ height: 1px;
+ background-color: rgba(0, 0, 0, 0.12);
}
-#main table tr th {
- text-align: left;
- background: #f6f6f6;
- padding: 0px 20px;
- height: 20px;
- line-height: 20px;
- border-bottom: 1px solid #ddd;
+h4
+{
+ padding-bottom: 10px;
+ margin-bottom: 12px;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
-#main table tr td {
- background: #f6f6f6;
- padding: 0px 20px;
- height: 29px;
- line-height: 29px;
- border-bottom: 1px solid #ddd;
+
+/**** PAGE SPECIFIC CSS ****/
+
+/* remove the * for disabling: */
+
+.page-core-server-settings table td
+{
+ text-align: center;
+ width: 25%;
}
-#main table tr.odd td {
- background: #fbfbfb;
+.page-core-server-settings.no-param table td:nth-child(1) a,
+.page-core-server-settings.param-tab-general table td:nth-child(1) a
+{
+ font-weight: 600;
+ color: rgba(0, 0, 0, 0.87);
}
-#main table tr:hover td { background: #fdfcf6; }
+.page-core-server-settings.param-tab-monsters table td:nth-child(2) a
+{
+ font-weight: 600;
+ color: rgba(0, 0, 0, 0.87);
+}
-#main table .action {
- text-align: right;
- padding: 0 20px 0 10px;
+.page-core-server-settings.param-tab-worlds table td:nth-child(3) a
+{
+ font-weight: 600;
+ color: rgba(0, 0, 0, 0.87);
}
-#main table tr .action a { margin: 0 0 0 10px; text-decoration: none; color: #9b9b9b; }
-#main table tr:hover .action .edit { color: #c5a059; }
-#main table tr:hover .action .delete { color: #a02b2b; }
-#main table tr:hover .action .view { color: #55a34a; }
+.page-core-server-settings.param-tab-world table td:nth-child(4) a
+{
+ font-weight: 600;
+ color: rgba(0, 0, 0, 0.87);
+}
-#main table tr:hover .action a:hover { text-decoration: underline; }
+.page-core-permissions form table tr,
+.page-core-permissions form table td,
+.page-core-permissions form table th
+{
+ border: none;
+ background-color: transparent;
+}
-fieldset {
- border: 1px solid #ddd;
- padding: 19px;
- margin: 0 0 20px 0;
- background: #fbfbfb;
+.page-core-permissions form table tr:nth-child(1) th
+{
+ width: 35%;
}
-form p { margin: 0 0 14px 0; float: left; width: 100%; }
+.page-core-permissions form table tr:nth-child(1) td
+{
+ width: 65%;
+}
-label {
- display: block;
+.page-core-permissions form table td input
+{
width: 100%;
- margin: 0 0 7px 0;
- line-height: 12px;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ margin: 0;
}
-/* Footer ---------------------------------------- */
-
-#footer {
- margin: 10px 0 30px 0;
- font-size: 11px;
- line-height: 11px;
- color: #9B9B9B;
- padding: 0 0 0 5px;
+#ChatDiv
+{
+ margin-bottom: 10px;
}
-#footer a { color: #9B9B9B; }
+#ChatMessage
+{
+ width: 100%;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+}
-#footer a:hover { text-decoration: none; }
+/**/
diff --git a/MCServer/webadmin/template.lua b/MCServer/webadmin/template.lua
index a7480f83e..84a50b055 100644
--- a/MCServer/webadmin/template.lua
+++ b/MCServer/webadmin/template.lua
@@ -70,25 +70,33 @@ function ShowPage(WebAdmin, TemplateRequest)
PageContent, SubTitle = GetDefaultPage()
end
+ local reqParamsClass = ""
+
+ for key,value in pairs(TemplateRequest.Request.Params) do
+ reqParamsClass = reqParamsClass .. " param-" .. string.lower(string.gsub(key, "[^a-zA-Z0-9]+", "-") .. "-" .. string.gsub(value, "[^a-zA-Z0-9]+", "-"))
+ end
+
+ if (string.gsub(reqParamsClass, "%s", "") == "") then
+ reqParamsClass = " no-param"
+ end
+
Output([[
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="/favicon.ico">
<title>]] .. Title .. [[</title>
-<link rel="stylesheet" type="text/css" media="screen" href="/style.css">
+<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,300' rel='stylesheet' type='text/css'>
+<link rel="stylesheet" type="text/css" href="/style.css">
</head>
-
<body>
- <div id="wrapper">
- <!-- h1 tag stays for the logo, you can use the a tag for linking the index page -->
- <h1>
- <a href="]] .. BaseURL .. [["><span>MCServer</span></a>
- </h1>
- <div id="containerHolder">
- <div id="container">
- <div id="sidebar">
- <ul class="sideNav">
+<div id="wrapper">
+ <div id="containerHolder">
+ <a href="./" class="title light">MCServer</a>
+ <div id="container">
+ <div id="sidebar">
+ <ul class="sideNav">
+ <li class='link'><a href=']] .. BaseURL .. [['>Home</a></li>
]])
@@ -100,7 +108,7 @@ function ShowPage(WebAdmin, TemplateRequest)
Output("<li>"..PluginWebTitle.."</li>\n");
for webname,prettyname in pairs(TabNames) do
- Output("<li><a href='" .. BaseURL .. PluginWebTitle .. "/" .. webname .. "'>" .. prettyname .. "</a></li>\n")
+ Output("<li class='link'><a href='" .. BaseURL .. PluginWebTitle .. "/" .. webname .. "'>" .. prettyname .. "</a></li>\n")
end
end
end
@@ -108,30 +116,23 @@ function ShowPage(WebAdmin, TemplateRequest)
Output([[
</ul>
- <!-- // .sideNav -->
- </div>
- <!-- // #sidebar -->
- <!-- h2 stays for breadcrumbs -->
- <h2>Welcome ]] .. TemplateRequest.Request.Username .. [[</h2>
- <div id="main">
- <h3>]] .. SubTitle .. [[</h3>
- ]] .. PageContent .. [[
- </div>
- <!-- // #main -->
+ </div>
+
+ <div id="main" class="page-]] .. string.lower(PluginPage.PluginName .. "-" .. string.gsub(PluginPage.TabName, "[^a-zA-Z0-9]+", "-")) .. reqParamsClass .. [[">
+ <h2 class="welcome-msg">Welcome <span class="username">]] .. TemplateRequest.Request.Username .. [[</span></h2>
- <div class="clear"></div>
+ <hr/>
- </div>
- <!-- // #container -->
- </div>
- <!-- // #containerHolder -->
-
- <p id="footer">MCServer is using: ]] .. MemoryUsageKiB / 1024 .. [[ MiB of memory; Current chunk count: ]] .. NumChunks .. [[ </p>
+ <h3>]] .. SubTitle .. [[</h3>
+ ]] .. PageContent .. [[</div>
+ <div class="clear"></div>
+ </div>
</div>
- <!-- // #wrapper -->
+ <div id="footer"><div class="fleft">running MCServer using <span class="bold">]] .. MemoryUsageKiB / 1024 .. [[MB</span> of memory; <span class="bold">]] .. NumChunks .. [[</span> chunks</div><div class="fright">design by <a href="//www.github.com/WebFreak001">WebFreak001</a></div><div class="clear"></div></div>
+</div>
</body>
</html>
- ]])
+]])
return table.concat(SiteContent)
end
diff --git a/MCServer/webadmin/template_orig.lua b/MCServer/webadmin/template_orig.lua
new file mode 100644
index 000000000..a7480f83e
--- /dev/null
+++ b/MCServer/webadmin/template_orig.lua
@@ -0,0 +1,137 @@
+-- Use a table for fast concatenation of strings
+local SiteContent = {}
+function Output(String)
+ table.insert(SiteContent, String)
+end
+
+
+
+
+
+function GetTableSize(Table)
+ local Size = 0
+ for key,value in pairs(Table) do
+ Size = Size + 1
+ end
+ return Size
+end
+
+
+
+
+
+function GetDefaultPage()
+ local PM = cRoot:Get():GetPluginManager()
+
+ local SubTitle = "Current Game"
+ local Content = ""
+
+ Content = Content .. "<h4>Server Name:</h4>"
+ Content = Content .. "<p>" .. cRoot:Get():GetServer():GetServerID() .. "</p>"
+
+ Content = Content .. "<h4>Plugins:</h4><ul>"
+ local AllPlugins = PM:GetAllPlugins()
+ for key,value in pairs(AllPlugins) do
+ if( value ~= nil and value ~= false ) then
+ Content = Content .. "<li>" .. key .. " V." .. value:GetVersion() .. "</li>"
+ end
+ end
+
+ Content = Content .. "</ul>"
+ Content = Content .. "<h4>Players:</h4><ul>"
+
+ local AddPlayerToTable = function( Player )
+ Content = Content .. "<li>" .. Player:GetName() .. "</li>"
+ end
+ cRoot:Get():ForEachPlayer( AddPlayerToTable )
+
+ Content = Content .. "</ul><br>";
+
+ return Content, SubTitle
+end
+
+
+
+
+
+function ShowPage(WebAdmin, TemplateRequest)
+ SiteContent = {}
+ local BaseURL = WebAdmin:GetBaseURL(TemplateRequest.Request.Path)
+ local Title = "MCServer WebAdmin"
+ local MemoryUsageKiB = cRoot:GetPhysicalRAMUsage()
+ local NumChunks = cRoot:Get():GetTotalChunkCount()
+ local PluginPage = WebAdmin:GetPage(TemplateRequest.Request)
+ local PageContent = PluginPage.Content
+ local SubTitle = PluginPage.PluginName
+ if (PluginPage.TabName ~= "") then
+ SubTitle = PluginPage.PluginName .. " - " .. PluginPage.TabName
+ end
+ if (PageContent == "") then
+ PageContent, SubTitle = GetDefaultPage()
+ end
+
+ Output([[
+<!DOCTYPE html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link rel="icon" href="/favicon.ico">
+<title>]] .. Title .. [[</title>
+<link rel="stylesheet" type="text/css" media="screen" href="/style.css">
+</head>
+
+<body>
+ <div id="wrapper">
+ <!-- h1 tag stays for the logo, you can use the a tag for linking the index page -->
+ <h1>
+ <a href="]] .. BaseURL .. [["><span>MCServer</span></a>
+ </h1>
+ <div id="containerHolder">
+ <div id="container">
+ <div id="sidebar">
+ <ul class="sideNav">
+ ]])
+
+
+ local AllPlugins = WebAdmin:GetPlugins()
+ for key,value in pairs(AllPlugins) do
+ local PluginWebTitle = value:GetWebTitle()
+ local TabNames = value:GetTabNames()
+ if (GetTableSize(TabNames) > 0) then
+ Output("<li>"..PluginWebTitle.."</li>\n");
+
+ for webname,prettyname in pairs(TabNames) do
+ Output("<li><a href='" .. BaseURL .. PluginWebTitle .. "/" .. webname .. "'>" .. prettyname .. "</a></li>\n")
+ end
+ end
+ end
+
+
+ Output([[
+ </ul>
+ <!-- // .sideNav -->
+ </div>
+ <!-- // #sidebar -->
+ <!-- h2 stays for breadcrumbs -->
+ <h2>Welcome ]] .. TemplateRequest.Request.Username .. [[</h2>
+ <div id="main">
+ <h3>]] .. SubTitle .. [[</h3>
+ ]] .. PageContent .. [[
+ </div>
+ <!-- // #main -->
+
+ <div class="clear"></div>
+
+ </div>
+ <!-- // #container -->
+ </div>
+ <!-- // #containerHolder -->
+
+ <p id="footer">MCServer is using: ]] .. MemoryUsageKiB / 1024 .. [[ MiB of memory; Current chunk count: ]] .. NumChunks .. [[ </p>
+ </div>
+ <!-- // #wrapper -->
+</body>
+</html>
+ ]])
+
+ return table.concat(SiteContent)
+end