From c23d87277db3adecc5c09c9531ee5e4aae8cad15 Mon Sep 17 00:00:00 2001 From: Ambushed91 Date: Thu, 23 Oct 2014 19:59:49 +0200 Subject: [PATCH 001/145] Update WebAdmin All files have been updated to the latest version off the new WebAdmin look. --- MCServer/webadmin/(original).html | 8 +- MCServer/webadmin/files/guest.html | 5 + MCServer/webadmin/files/header.png | Bin 0 -> 221 bytes MCServer/webadmin/files/home.gif | Bin 0 -> 1026 bytes MCServer/webadmin/files/loading.gif | Bin 0 -> 7364 bytes MCServer/webadmin/files/log_out.png | Bin 0 -> 995 bytes MCServer/webadmin/files/login.css | 442 +++++++++ MCServer/webadmin/files/login.gif | Bin 0 -> 586 bytes MCServer/webadmin/files/logo_login.png | Bin 0 -> 18057 bytes MCServer/webadmin/files/pmfolder.gif | Bin 0 -> 995 bytes MCServer/webadmin/files/style.css | 1075 ++++++++++++++++++---- MCServer/webadmin/files/sub_pmfolder.gif | Bin 0 -> 1022 bytes MCServer/webadmin/files/tcat.png | Bin 0 -> 183 bytes MCServer/webadmin/files/thead.png | Bin 0 -> 132 bytes MCServer/webadmin/login_template.html | 78 +- MCServer/webadmin/temp.html | 100 ++ MCServer/webadmin/template.html | 261 +++--- MCServer/webadmin/template.lua | 143 ++- 18 files changed, 1705 insertions(+), 407 deletions(-) create mode 100644 MCServer/webadmin/files/guest.html create mode 100644 MCServer/webadmin/files/header.png create mode 100644 MCServer/webadmin/files/home.gif create mode 100644 MCServer/webadmin/files/loading.gif create mode 100644 MCServer/webadmin/files/log_out.png create mode 100644 MCServer/webadmin/files/login.css create mode 100644 MCServer/webadmin/files/login.gif create mode 100644 MCServer/webadmin/files/logo_login.png create mode 100644 MCServer/webadmin/files/pmfolder.gif create mode 100644 MCServer/webadmin/files/sub_pmfolder.gif create mode 100644 MCServer/webadmin/files/tcat.png create mode 100644 MCServer/webadmin/files/thead.png create mode 100644 MCServer/webadmin/temp.html diff --git a/MCServer/webadmin/(original).html b/MCServer/webadmin/(original).html index 673a93ada..239a255e5 100644 --- a/MCServer/webadmin/(original).html +++ b/MCServer/webadmin/(original).html @@ -1,7 +1,7 @@ - + {TITLE} -
- -

MCServer - WebAdmin

-
- -
-
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + +
+
+ Welcome Guest +
+
+
+ +
+
+
+
+
+ - + \ No newline at end of file diff --git a/MCServer/webadmin/temp.html b/MCServer/webadmin/temp.html new file mode 100644 index 000000000..697bf6276 --- /dev/null +++ b/MCServer/webadmin/temp.html @@ -0,0 +1,100 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Menu
User CP Home
+
[-]
+
Messenger
+
Compose
+ + + + +
Tracking
Edit Folders
+
[-]
+
Your Profile
+
+ + + + + + + + +
Edit Options
+
[-]
+
Miscellaneous
+
Group Memberships
Buddy/Ignore List
Manage Attachments
Saved Drafts
Subscribed Threads
Forum Subscriptions
View Profile
+
+ + + + + + + + + + +
Your Account Summary
ambushed01
+ ambushed01
+ Posts: 25 (4.3 per day | 0.16 percent of total posts)
+ + Reputation: 0 [Details]
+ + Email: arianroeloffzen@gmail.com
+ Registration Date: 10-10-2014, 09:07 PM
+ Primary User Group: Registered
+ + Members Referred: 0
+
To refer a member to this board, direct them to http://forum.mc-server.org/member.php?action=register&referrer=2273 + +
+
\ No newline at end of file diff --git a/MCServer/webadmin/template.html b/MCServer/webadmin/template.html index b0864e35d..822f73857 100644 --- a/MCServer/webadmin/template.html +++ b/MCServer/webadmin/template.html @@ -1,140 +1,129 @@ - - {TITLE} | {PLUGIN_NAME} - - - - - - -
- - Login: {USERNAME} - -
-
- -
- -
- {CONTENT} -
-
-

MCServer is using {MEM}MB of memory, with {NUMCHUNKS} chunks loaded.

-

Web Design by

-
+ + {TITLE} | {PLUGIN_NAME} + + + + + + + +
+ Login: {USERNAME}
+
+ +
+ +
+ {CONTENT}
- +

MCServer is using {MEM}MB of memory, with {NUMCHUNKS} chunks loaded.

Web Design by Tiger

+
+ diff --git a/MCServer/webadmin/template.lua b/MCServer/webadmin/template.lua index 84a50b055..1b2f18246 100644 --- a/MCServer/webadmin/template.lua +++ b/MCServer/webadmin/template.lua @@ -23,30 +23,11 @@ end function GetDefaultPage() local PM = cRoot:Get():GetPluginManager() - local SubTitle = "Current Game" + local SubTitle = "Home" local Content = "" - Content = Content .. "

Server Name:

" - Content = Content .. "

" .. cRoot:Get():GetServer():GetServerID() .. "

" + Content = Content .. "

Home Home Home

    I have no idea what this content should do.
" - Content = Content .. "

Plugins:

    " - local AllPlugins = PM:GetAllPlugins() - for key,value in pairs(AllPlugins) do - if( value ~= nil and value ~= false ) then - Content = Content .. "
  • " .. key .. " V." .. value:GetVersion() .. "
  • " - end - end - - Content = Content .. "
" - Content = Content .. "

Players:

    " - - local AddPlayerToTable = function( Player ) - Content = Content .. "
  • " .. Player:GetName() .. "
  • " - end - cRoot:Get():ForEachPlayer( AddPlayerToTable ) - - Content = Content .. "

"; - return Content, SubTitle end @@ -83,20 +64,47 @@ function ShowPage(WebAdmin, TemplateRequest) Output([[ - - -]] .. Title .. [[ - - + ]] .. Title .. [[ + + + + + -
-
- MCServer -
- + ]]) From 8d941212edaba3635e9d558f6c4a27e603b905ef Mon Sep 17 00:00:00 2001 From: Ambushed91 Date: Thu, 23 Oct 2014 20:55:49 +0200 Subject: [PATCH 002/145] Update guest.html --- MCServer/webadmin/files/guest.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MCServer/webadmin/files/guest.html b/MCServer/webadmin/files/guest.html index 28c3cdbf9..1230a8c01 100644 --- a/MCServer/webadmin/files/guest.html +++ b/MCServer/webadmin/files/guest.html @@ -2,4 +2,4 @@ Hello Admin, this is a welcome message. You will see this because you didn't cha To change the welcome message go to file: files/guest.html and change it!.

-This file is using html, for more information see: http://www.w3schools.com \ No newline at end of file +This file is written in HTML, for more information see: http://www.w3schools.com From 811c10625ab49b84a2e914ab8766bbbb0b303512 Mon Sep 17 00:00:00 2001 From: Ambushed91 Date: Thu, 23 Oct 2014 20:59:00 +0200 Subject: [PATCH 003/145] Update style.css --- MCServer/webadmin/files/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MCServer/webadmin/files/style.css b/MCServer/webadmin/files/style.css index dfdbe4559..12db60a9f 100644 --- a/MCServer/webadmin/files/style.css +++ b/MCServer/webadmin/files/style.css @@ -1021,4 +1021,4 @@ button:disabled, input:disabled{ border:none!important; color:#fff!important; background-color:#ccc!important; -} \ No newline at end of file +} From 1c58137ef0b46eb1ecdbdca6ff68203c7ef3f092 Mon Sep 17 00:00:00 2001 From: Ambushed91 Date: Thu, 23 Oct 2014 21:02:02 +0200 Subject: [PATCH 004/145] Update (original).html --- MCServer/webadmin/(original).html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MCServer/webadmin/(original).html b/MCServer/webadmin/(original).html index 239a255e5..673a93ada 100644 --- a/MCServer/webadmin/(original).html +++ b/MCServer/webadmin/(original).html @@ -1,7 +1,7 @@ - + {TITLE} - - - - - - -
- Login: {USERNAME}
-
- -
- -
- {CONTENT} + + {TITLE} | {PLUGIN_NAME} + + + + + + +
+ + Login: {USERNAME} + +
+
+ +
+ +
+ {CONTENT} +
+
+

MCServer is using {MEM}MB of memory, with {NUMCHUNKS} chunks loaded.

+

Web Design by

+
-

MCServer is using {MEM}MB of memory, with {NUMCHUNKS} chunks loaded.

Web Design by Tiger

-
- + From bc1a98b2db6de29826ab8bd0282671fbc9eb13b8 Mon Sep 17 00:00:00 2001 From: Ambushed91 Date: Mon, 27 Oct 2014 18:45:41 +0100 Subject: [PATCH 033/145] Update template.lua Removed FusionCare link, change position for "Current time JS", Compression Ratio: 31% (HTML) --- MCServer/webadmin/template.lua | 165 +++++++++++++++------------------ 1 file changed, 75 insertions(+), 90 deletions(-) diff --git a/MCServer/webadmin/template.lua b/MCServer/webadmin/template.lua index fe04c00ca..baca461b0 100644 --- a/MCServer/webadmin/template.lua +++ b/MCServer/webadmin/template.lua @@ -64,47 +64,44 @@ function ShowPage(WebAdmin, TemplateRequest) Output([[ - ]] .. Title .. [[ - - - - +]] .. Title .. [[ + + + + - -
-
-
-
- -
-
-
-
-
- -
Welcome back, ]] .. TemplateRequest.Request.Username .. [[
-
-
-
-
-
-
- - - - + + +
- - - - - - - - -
Menu
Home
Server Management
+
+
+
+
+ +
+
+
+
+
+ +
Welcome back, ]] .. TemplateRequest.Request.Username .. [[
+
+
+
+
+
+
+ + + - - - -
+ + + + + + + + -
Menu
Home
Server Management
]]) @@ -125,57 +122,45 @@ function ShowPage(WebAdmin, TemplateRequest) Output([[
-
- - - - - - - -
]] .. SubTitle .. [[
- ]] .. PageContent .. [[ -
-
-
-
-
- - - - +
+
+ + + + + + + +
]] .. SubTitle .. [[
+]] .. PageContent .. [[ +
+
+
+
+
+ + ]]) return table.concat(SiteContent) From c0a9a83abfb7c161b3d5ed994d6b5bb7bb7a1fb8 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 27 Oct 2014 18:09:34 +0000 Subject: [PATCH 034/145] Actually fixed the warning. --- src/Generating/DistortedHeightmap.cpp | 29 +++++++++------------------ 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/Generating/DistortedHeightmap.cpp b/src/Generating/DistortedHeightmap.cpp index d6474b3ca..5ece4dce5 100644 --- a/src/Generating/DistortedHeightmap.cpp +++ b/src/Generating/DistortedHeightmap.cpp @@ -227,15 +227,15 @@ const cDistortedHeightmap::sGenParam cDistortedHeightmap::m_GenParam[256] = /* biMesaPlateau */ { 2.0f, 2.0f}, // 39 // biomes 40 .. 128 are unused, 89 empty placeholders here: - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 40 .. 49 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 50 .. 59 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 60 .. 69 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 70 .. 79 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 80 .. 89 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 90 .. 99 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 100 .. 109 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 110 .. 119 - {}, {}, {}, {}, {}, {}, {}, {}, {}, // 120 .. 128 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 40 .. 49 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 50 .. 59 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 60 .. 69 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 70 .. 79 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 80 .. 89 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 90 .. 99 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 100 .. 109 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 110 .. 119 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 120 .. 128 // Release 1.7 /* biome variants: /* biSunflowerPlains */ { 1.0f, 1.0f}, // 129 @@ -270,17 +270,6 @@ const cDistortedHeightmap::sGenParam cDistortedHeightmap::m_GenParam[256] = /* biMesaBryce */ { 0.5f, 0.5f}, // 165 /* biMesaPlateauFM */ { 2.0f, 2.0f}, // 166 /* biMesaPlateauM */ { 2.0f, 2.0f}, // 167 - - // biomes 168 .. 255 are unused, 88 empty placeholders here: - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 168 .. 177 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 178 .. 187 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 188 .. 197 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 198 .. 207 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 208 .. 217 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 218 .. 227 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 228 .. 237 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 238 .. 247 - {}, {}, {}, {}, {}, {}, {}, {}, // 248 .. 255 } ; From d0a47d9273d7254c82fb5c780ef28c58c1d1e306 Mon Sep 17 00:00:00 2001 From: Ambushed91 Date: Mon, 27 Oct 2014 19:13:25 +0100 Subject: [PATCH 035/145] Update template.lua --- MCServer/webadmin/template.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/MCServer/webadmin/template.lua b/MCServer/webadmin/template.lua index baca461b0..d6ac2e94c 100644 --- a/MCServer/webadmin/template.lua +++ b/MCServer/webadmin/template.lua @@ -82,9 +82,11 @@ function ShowPage(WebAdmin, TemplateRequest)
-
Welcome back, ]] .. TemplateRequest.Request.Username .. [[
+
Welcome back, ]] .. TemplateRequest.Request.Username .. [[    Log Out
@@ -101,7 +103,7 @@ function ShowPage(WebAdmin, TemplateRequest) Home -
Server Management
+
Server Management
]]) @@ -145,9 +147,11 @@ function ShowPage(WebAdmin, TemplateRequest) From 1aef54e79339adb7bf7aa0d607cf7c8ab6639c41 Mon Sep 17 00:00:00 2001 From: Arian Date: Mon, 27 Oct 2014 19:30:37 +0100 Subject: [PATCH 036/145] Update login.css Added licence --- MCServer/webadmin/files/login.css | 1 + 1 file changed, 1 insertion(+) diff --git a/MCServer/webadmin/files/login.css b/MCServer/webadmin/files/login.css index e3c7add74..3a766e1b6 100644 --- a/MCServer/webadmin/files/login.css +++ b/MCServer/webadmin/files/login.css @@ -1 +1,2 @@ +/* Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 */ *{margin:0}body{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;-webkit-font-smoothing:antialiased;background:#fff url(header.png) repeat-x top left;width:100%;min-width:100%;overflow:hidden}a:link{color:#555;text-decoration:none}a:visited{color:#444;text-decoration:none}a:hover,a:active{color:#000;text-decoration:underline}img{border:none}h1{color:#069}.row1{border-bottom:1px solid #000;height:100px;max-height:100px}.row2{margin:0 auto;text-align:center;vertical-align:middle}.contention{color:#000;text-align:left;line-height:1.4;margin:0;font-family:Tahoma,Verdana,Arial,Sans-Serif;font-size:13px}button{background:#fff;color:#000;border:1px solid #ccc;padding:3px;font-family:Tahoma,Verdana,Arial,Sans-Serif;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;margin:-3px 0}button:hover{border-top-color:#28597a;background:#28597a;color:#ccc}button:active{border-top-color:#1b435e;background:#1b435e}.push10{padding-bottom:75px}#panel .upper{background:#dcdbdc url(tcat.png) repeat-x;border-top:1px solid #fff;border-bottom:1px solid #bbb;padding:7px}#footer{z-index:99999}#footer ul.menu{margin:0;padding:0;list-style:none}#footer ul.menu li{margin:0 5px;display:inline}#footer .upper{background:#dcdbdc url(tcat.png) repeat-x;border-top:1px solid #bbb;padding:6px;overflow:hidden;font-size:12px}#footer .upper ul.bottom_links{float:left;margin:3px 0 0 -5px}#footer .lower{background:#a1a2a2 url(thead.png) top left repeat-x;color:#fff;border-top:1px solid #ccc;border-bottom:1px solid #ddd;overflow:hidden;padding:8px;font-size:11px}#footer .lower a:link,#footer .lower a:visited{color:#fff;font-weight:700}#footer .lower a:hover,#footer .lower a:active{color:#fff;font-weight:700}#footer .lower #current_time{float:right;padding-right:6px}.wrapper{width:85%;min-width:970px;max-width:1500px;margin:auto}#footer{position:fixed;left:0;bottom:0;height:60px;width:100%;background:#999;border-top:1px #000 solid}* html #footer{position:absolute;top:expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px')}tr td.trow2:first-child{border-left:0}tr td.trow2:last-child{border-right:0}.tborder{-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px}.thead,.rounded_top{-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;-webkit-border-top-left-radius:6px;-webkit-border-top-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}table{color:#000;font-size:13px}.tborder{background:#fff;width:100%;margin:auto;border:1px solid #ccc;padding:1px}.thead{background:#a1a2a2 url(thead.png) top left repeat-x;color:#fff;border-bottom:1px solid #8e8f8f;padding:8px}.trow2{background:#efefef;border:1px solid;border-color:#fff #ddd #ddd #fff}.padtopp{padding-top:25px} From 9c002dc0c896005bf7713ccc7a68a8fa585ad8d9 Mon Sep 17 00:00:00 2001 From: Arian Date: Mon, 27 Oct 2014 19:31:06 +0100 Subject: [PATCH 037/145] Update style.css Added licence --- MCServer/webadmin/files/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/MCServer/webadmin/files/style.css b/MCServer/webadmin/files/style.css index fad1a5df4..4c38af695 100644 --- a/MCServer/webadmin/files/style.css +++ b/MCServer/webadmin/files/style.css @@ -1 +1,2 @@ +/* Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 */ *{margin:0}body{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;-webkit-font-smoothing:antialiased;background:#fff;width:100%;min-width:100%;overflow-y:scroll;overflow-x:hidden}a:link{color:#555;text-decoration:none}a:visited{color:#444;text-decoration:none}a:hover,a:active{color:#000;text-decoration:underline}img{border:none}h1{color:#069;text-shadow:2px 2px #000}.row1{border-bottom:1px #000 solid;height:100px;max-height:100px;background:#fff url(header.png) repeat-x top left}.row2{margin:0 auto;text-align:center;vertical-align:middle;margin-top:125px}.contention{color:#000;text-align:left;line-height:1.4;margin:0;font-family:Tahoma,Verdana,Arial,Sans-Serif;font-size:13px}.push10{padding-bottom:75px}#panel ul.menu{margin:0;padding:0;list-style:none}#panel ul.menu li{margin:0 5px;display:inline}#panel ul.menu li a{padding-left:20px;background-repeat:no-repeat;background-position:left center}#panel .upper ul.top_links{float:right;font-weight:700}#panel .upper{background:#dcdbdc url(tcat.png) repeat-x;border-top:1px solid #fff;border-bottom:1px solid #bbb;padding:7px}#footer{z-index:99999}#footer ul.menu{margin:0;padding:0;list-style:none}#footer ul.menu li{margin:0 5px;display:inline}#footer .upper{background:#dcdbdc url(tcat.png) repeat-x;border-top:1px solid #bbb;padding:6px;overflow:hidden;font-size:12px}#footer .upper ul.bottom_links{float:left;margin:3px 0 0 -5px}#footer .lower{background:#a1a2a2 url(thead.png) top left repeat-x;color:#fff;border-top:1px solid #ccc;border-bottom:1px solid #ddd;overflow:hidden;padding:8px;font-size:11px}#footer .lower a:link,#footer .lower a:visited{color:#fff;font-weight:700}#footer .lower a:hover,#footer .lower a:active{color:#fff;font-weight:700}#footer .lower #current_time{float:right;padding-right:6px}.wrapper{width:85%;min-width:970px;max-width:1500px;margin:auto}#footer{position:fixed;left:0;bottom:0;height:60px;width:100%;background:#999;border-top:1px #000 solid}* html #footer{position:absolute;top:expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px')}tr td.trow1:first-child,tr td.trow2:first-child{border-left:0}tr td.trow1:last-child,tr td.trow2:last-child{border-right:0}.tborder{-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px}.thead{-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;-webkit-border-top-left-radius:6px;-webkit-border-top-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}table{color:#000;font-size:13px}.tborder{background:#fff;width:100%;margin:auto;border:1px solid #ccc;padding:1px}.thead{background:#a1a2a2 url(thead.png) top left repeat-x;color:#fff;border-bottom:1px solid #8e8f8f;padding:8px}.tcat{background:#dcdbdc url(tcat.png) repeat-x;color:#fff;border-bottom:1px solid #bbb;padding:6px;font-size:12px}.trow1{background:#f5f5f5;border:1px solid;border-color:#fff #ddd #ddd #fff}.trow2{background:#efefef;border:1px solid;border-color:#fff #ddd #ddd #fff;padding:15px;box-sizing:border-box;-moz-box-sizing:border-box}.padtopp{padding-top:25px}table{color:#000;font-size:13px;text-align:left}.tborder{background:#fff;width:100%;margin:auto;border:1px solid #ccc;padding:1px}.thead{background:#a1a2a2 url(thead.png) top left repeat-x;color:#fff;border-bottom:1px solid #8e8f8f;padding:8px}.tcat{background:#dcdbdc url(tcat.png) repeat-x;color:#fff;border-bottom:1px solid #bbb;padding:6px;font-size:12px}.trow1{background:#f5f5f5;border:1px solid;border-color:#fff #ddd #ddd #fff}.trow2{background:#efefef;border:1px solid;border-color:#fff #ddd #ddd #fff}.smalltext{font-size:11px}textarea{background:#fff;color:#000;border:1px solid #ccc;padding:2px;line-height:1.4;font-family:Tahoma,Verdana,Arial,Sans-Serif;font-size:13px}select{background:#fff;padding:3px;border:1px solid #ccc;font-family:Tahoma,Verdana,Arial,Sans-Serif}.usercp_nav_item{display:block;padding:1px 0 1px 23px}.usercp_nav_pmfolder{background:url(pmfolder.gif) no-repeat left center}.usercp_nav_sub_pmfolder{padding-left:40px;background:url(sub_pmfolder.gif) no-repeat left center}.usercp_nav_home{background:url(home.gif) no-repeat left center}.pagehead{position:fixed;z-index:99999;top:0;left:0;width:100%}table{width:100%}table th{border-bottom:1px solid rgba(0,0,0,0.12);padding:5px;text-align:left}table tr:nth-child(odd){background-color:rgba(0,0,0,0.015)}p{margin:4px 0;padding:4px 3px}a{text-decoration:none;color:#000;-webkit-transition:color .1s linear;-moz-transition:color .1s linear;transition:color .1s linear}a:hover{color:#888}input[type="text"]{background:#fff;color:#000;border:1px solid #ccc;padding:2px;line-height:1.4;font-family:Tahoma,Verdana,Arial,Sans-Serif;font-size:13px;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}input[type="text"]:hover{background-color:#E5E4E2}input[type="text"]:focus{background-color:#E5E4E2}hr{border:none;height:1px;background-color:rgba(0,0,0,0.12)}h4{padding-bottom:10px;margin-bottom:12px;border-bottom:1px solid rgba(0,0,0,0.12)}#ChatDiv{margin-bottom:10px}#ChatMessage{width:92%;margin-right:5px;box-sizing:border-box;-moz-box-sizing:border-box}input[type="submit"]{padding:3px;padding-left:5px;padding-right:5px;cursor:pointer;font-family:Tahoma,Verdana,Arial,Sans-Serif;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;background:#f5f5f5;border:1px solid #ccc}input[type="submit"]:hover{background-color:#E5E4E2}button:disabled,input:disabled{padding:3px;padding-left:5px;padding-right:5px;cursor:pointer;font-family:Tahoma,Verdana,Arial,Sans-Serif;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;border:none!important;color:#fff!important;background-color:#ccc!important} From 7590d5facf5f7e8945bbfe555552b774f5e31857 Mon Sep 17 00:00:00 2001 From: Arian Date: Mon, 27 Oct 2014 19:31:25 +0100 Subject: [PATCH 038/145] Update login_template.html Added licence --- MCServer/webadmin/login_template.html | 1 + 1 file changed, 1 insertion(+) diff --git a/MCServer/webadmin/login_template.html b/MCServer/webadmin/login_template.html index b305e030f..af80470e8 100644 --- a/MCServer/webadmin/login_template.html +++ b/MCServer/webadmin/login_template.html @@ -1,3 +1,4 @@ +/* Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 */ MCServer WebAdmin - Login From 738905c84d30072a8801ef6819f858926bab99e0 Mon Sep 17 00:00:00 2001 From: Arian Date: Mon, 27 Oct 2014 19:31:51 +0100 Subject: [PATCH 039/145] Update template.lua Added licence --- MCServer/webadmin/template.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/MCServer/webadmin/template.lua b/MCServer/webadmin/template.lua index d6ac2e94c..fc0d8837a 100644 --- a/MCServer/webadmin/template.lua +++ b/MCServer/webadmin/template.lua @@ -62,6 +62,7 @@ function ShowPage(WebAdmin, TemplateRequest) end Output([[ +/* Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 */ ]] .. Title .. [[ From 6e21897bc6404f8e95ab61ea4203e5b2d73b19a3 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 27 Oct 2014 19:49:52 +0000 Subject: [PATCH 040/145] Fixed remaining warnings. --- src/Generating/DistortedHeightmap.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Generating/DistortedHeightmap.cpp b/src/Generating/DistortedHeightmap.cpp index 5ece4dce5..974aabccd 100644 --- a/src/Generating/DistortedHeightmap.cpp +++ b/src/Generating/DistortedHeightmap.cpp @@ -246,22 +246,22 @@ const cDistortedHeightmap::sGenParam cDistortedHeightmap::m_GenParam[256] = /* biSwamplandM */ { 0.0f, 0.0f}, // 134 // Biomes 135 .. 139 unused, 5 empty placeholders here: - {}, {}, {}, {}, {}, // 135 .. 139 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 135 .. 139 /* biIcePlainsSpikes */ { 1.0f, 1.0f}, // 140 // Biomes 141 .. 148 unused, 8 empty placeholders here: - {}, {}, {}, {}, {}, {}, {}, {}, // 141 .. 148 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 141 .. 148 /* biJungleM */ { 4.0f, 4.0f}, // 149 - {}, // 150 + {0.0f,0.0f}, // 150 /* biJungleEdgeM */ { 3.0f, 3.0f}, // 151 - {}, {}, {}, // 152 .. 154 + {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 152 .. 154 /* biBirchForestM */ { 3.0f, 3.0f}, // 155 /* biBirchForestHillsM */ { 5.0f, 5.0f}, // 156 /* biRoofedForestM */ { 2.0f, 2.0f}, // 157 /* biColdTaigaM */ { 1.0f, 1.0f}, // 158 - {}, // 159 + {0.0f,0.0f}, // 159 /* biMegaSpruceTaiga */ { 3.0f, 3.0f}, // 160 /* biMegaSpruceTaigaHills */ { 3.0f, 3.0f}, // 161 /* biExtremeHillsPlusM */ {32.0f, 32.0f}, // 162 From 0cdf262053129cf75c9158f269efa52b29d5b7df Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 27 Oct 2014 19:52:04 +0000 Subject: [PATCH 041/145] Fix missing biomes in enum. --- src/Generating/FinishGen.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp index 0564789dc..6b0bd686c 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -414,6 +414,11 @@ void cFinishGenSnow::GenFinish(cChunkDesc & a_ChunkDesc) } break; } + default: + { + // There's no snow in the other biomes. + break; + } } } } // for z From 59ca542c28edefc9454dd2be06ca66f5c7a0c18f Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 27 Oct 2014 19:53:16 +0000 Subject: [PATCH 042/145] Another switch. --- src/Generating/FinishGen.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp index 6b0bd686c..18f8ee2bc 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -459,6 +459,11 @@ void cFinishGenIce::GenFinish(cChunkDesc & a_ChunkDesc) } break; } + default: + { + // No icy water in other biomes. + break; + } } } } // for z From 7de8757ac98cff40a5da575d58e40425f2130057 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 27 Oct 2014 20:05:34 +0000 Subject: [PATCH 043/145] Fixed more warnings. It's ugly though. --- src/Generating/HeiGen.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Generating/HeiGen.cpp b/src/Generating/HeiGen.cpp index a0b8770f5..0f883f156 100644 --- a/src/Generating/HeiGen.cpp +++ b/src/Generating/HeiGen.cpp @@ -430,15 +430,15 @@ const cHeiGenBiomal::sGenParam cHeiGenBiomal::m_GenParam[256] = /* biMesaPlateau */ { 0.1f, 1.0f, 0.05f, 1.5f, 0.01f, 4.0f, 80}, // biomes 40 .. 128 are unused, 89 empty placeholders here: - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 40 .. 49 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 50 .. 59 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 60 .. 69 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 70 .. 79 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 80 .. 89 - {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, // 90 .. 99 - {}, {}, {}, {}, {}, {}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.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 120 .. 128 /* biSunflowerPlains */ { 0.1f, 2.0f, 0.05f, 12.0f, 0.01f, 10.0f, 40}, // 129 /* biDesertM */ { 0.1f, 2.0f, 0.05f, 12.0f, 0.01f, 10.0f, 40}, // 130 @@ -448,22 +448,22 @@ const cHeiGenBiomal::sGenParam cHeiGenBiomal::m_GenParam[256] = /* biSwamplandM */ { 1.0f, 3.0f, 1.10f, 7.0f, 0.01f, 0.01f, 60}, // 134 // Biomes 135 .. 139 unused, 5 empty placeholders here: - {}, {}, {}, {}, {}, // 135 .. 139 + {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 135 .. 139 /* biIcePlainsSpikes */ { 0.1f, 2.0f, 0.05f, 12.0f, 0.01f, 10.0f, 40}, // 140 // Biomes 141 .. 148 unused, 8 empty placeholders here: - {}, {}, {}, {}, {}, {}, {}, {}, // 141 .. 148 + {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 141 .. 148 /* biJungleM */ { 0.1f, 3.0f, 0.05f, 6.0f, 0.01f, 6.0f, 70}, // 149 - {}, // 150 + {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 150 /* biJungleEdgeM */ { 0.1f, 3.0f, 0.05f, 6.0f, 0.01f, 6.0f, 70}, // 151 - {}, {}, {}, // 152 .. 154 + {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 152 .. 154 /* biBirchForestM */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 155 /* biBirchForestHillsM */ { 0.2f, 2.0f, 0.05f, 10.0f, 0.01f, 8.0f, 80}, // 156 /* biRoofedForestM */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 157 /* biColdTaigaM */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 158 - {}, // 159 + {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 159 /* biMegaSpruceTaiga */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 160 /* biMegaSpruceTaigaHills */ { 0.2f, 2.0f, 0.05f, 10.0f, 0.01f, 8.0f, 80}, // 161 /* biExtremeHillsPlusM */ { 0.2f, 4.0f, 0.05f, 20.0f, 0.01f, 16.0f, 120}, // 162 From b67eb2169eba24b767163d882dbf667a429bfbd6 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 27 Oct 2014 20:16:51 +0000 Subject: [PATCH 044/145] Another one.# --- src/WorldStorage/NBTChunkSerializer.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index d85a5c329..1ecdcb5fd 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -604,6 +604,28 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster) m_Writer.AddByte("IsConverting", (((const cZombie *)a_Monster)->IsConverting() ? 1 : 0)); break; } + case mtInvalidType: + case mtBlaze: + case mtCaveSpider: + case mtChicken: + case mtCow: + case mtEnderDragon: + case mtGhast: + case mtGiant: + case mtIronGolem + case mtMooshroom: + case mtOcelot: + case mtPig: + case mtSilverfish: + case mtSnowGolem: + case meSpider: + case mtSquid: + case mtWitch: + case mtZombiePigman: + { + // Other mobs have no special tags. + break; + } } m_Writer.EndCompound(); } From a4932bbd8b08ed2f5d6de94fcfcc4d10484c45a2 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 27 Oct 2014 21:34:02 +0000 Subject: [PATCH 045/145] CheckBasicStyle'd --- src/Generating/DistortedHeightmap.cpp | 28 +++++++++++++-------------- src/Generating/HeiGen.cpp | 28 +++++++++++++-------------- src/IniFile.cpp | 6 +++--- src/IniFile.h | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/Generating/DistortedHeightmap.cpp b/src/Generating/DistortedHeightmap.cpp index 974aabccd..7c1ab9997 100644 --- a/src/Generating/DistortedHeightmap.cpp +++ b/src/Generating/DistortedHeightmap.cpp @@ -227,15 +227,15 @@ const cDistortedHeightmap::sGenParam cDistortedHeightmap::m_GenParam[256] = /* biMesaPlateau */ { 2.0f, 2.0f}, // 39 // biomes 40 .. 128 are unused, 89 empty placeholders here: - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 40 .. 49 - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 50 .. 59 - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 60 .. 69 - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 70 .. 79 - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 80 .. 89 - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 90 .. 99 - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 100 .. 109 - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 110 .. 119 - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 120 .. 128 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 40 .. 49 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 50 .. 59 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 60 .. 69 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 70 .. 79 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 80 .. 89 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 90 .. 99 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 100 .. 109 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 110 .. 119 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 120 .. 128 // Release 1.7 /* biome variants: /* biSunflowerPlains */ { 1.0f, 1.0f}, // 129 @@ -246,22 +246,22 @@ const cDistortedHeightmap::sGenParam cDistortedHeightmap::m_GenParam[256] = /* biSwamplandM */ { 0.0f, 0.0f}, // 134 // Biomes 135 .. 139 unused, 5 empty placeholders here: - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 135 .. 139 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 135 .. 139 /* biIcePlainsSpikes */ { 1.0f, 1.0f}, // 140 // Biomes 141 .. 148 unused, 8 empty placeholders here: - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 141 .. 148 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 141 .. 148 /* biJungleM */ { 4.0f, 4.0f}, // 149 - {0.0f,0.0f}, // 150 + {0.0f, 0.0f}, // 150 /* biJungleEdgeM */ { 3.0f, 3.0f}, // 151 - {0.0f,0.0f}, {0.0f,0.0f}, {0.0f,0.0f}, // 152 .. 154 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 152 .. 154 /* biBirchForestM */ { 3.0f, 3.0f}, // 155 /* biBirchForestHillsM */ { 5.0f, 5.0f}, // 156 /* biRoofedForestM */ { 2.0f, 2.0f}, // 157 /* biColdTaigaM */ { 1.0f, 1.0f}, // 158 - {0.0f,0.0f}, // 159 + {0.0f, 0.0f}, // 159 /* biMegaSpruceTaiga */ { 3.0f, 3.0f}, // 160 /* biMegaSpruceTaigaHills */ { 3.0f, 3.0f}, // 161 /* biExtremeHillsPlusM */ {32.0f, 32.0f}, // 162 diff --git a/src/Generating/HeiGen.cpp b/src/Generating/HeiGen.cpp index 0f883f156..04154dfec 100644 --- a/src/Generating/HeiGen.cpp +++ b/src/Generating/HeiGen.cpp @@ -430,15 +430,15 @@ const cHeiGenBiomal::sGenParam cHeiGenBiomal::m_GenParam[256] = /* biMesaPlateau */ { 0.1f, 1.0f, 0.05f, 1.5f, 0.01f, 4.0f, 80}, // biomes 40 .. 128 are unused, 89 empty placeholders here: - {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 40 .. 49 - {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 50 .. 59 - {0.0f,0.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12.0f, 0.01f, 10.0f, 40}, // 130 @@ -448,22 +448,22 @@ const cHeiGenBiomal::sGenParam cHeiGenBiomal::m_GenParam[256] = /* biSwamplandM */ { 1.0f, 3.0f, 1.10f, 7.0f, 0.01f, 0.01f, 60}, // 134 // Biomes 135 .. 139 unused, 5 empty placeholders here: - {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 135 .. 139 + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 135 .. 139 /* biIcePlainsSpikes */ { 0.1f, 2.0f, 0.05f, 12.0f, 0.01f, 10.0f, 40}, // 140 // Biomes 141 .. 148 unused, 8 empty placeholders here: - {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 141 .. 148 + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 141 .. 148 /* biJungleM */ { 0.1f, 3.0f, 0.05f, 6.0f, 0.01f, 6.0f, 70}, // 149 - {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 150 + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 150 /* biJungleEdgeM */ { 0.1f, 3.0f, 0.05f, 6.0f, 0.01f, 6.0f, 70}, // 151 - {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 152 .. 154 + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 152 .. 154 /* biBirchForestM */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 155 /* biBirchForestHillsM */ { 0.2f, 2.0f, 0.05f, 10.0f, 0.01f, 8.0f, 80}, // 156 /* biRoofedForestM */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 157 /* biColdTaigaM */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 158 - {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0}, // 159 + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 159 /* biMegaSpruceTaiga */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 160 /* biMegaSpruceTaigaHills */ { 0.2f, 2.0f, 0.05f, 10.0f, 0.01f, 8.0f, 80}, // 161 /* biExtremeHillsPlusM */ { 0.2f, 4.0f, 0.05f, 20.0f, 0.01f, 16.0f, 120}, // 162 diff --git a/src/IniFile.cpp b/src/IniFile.cpp index a666a4ff8..ded7e4199 100644 --- a/src/IniFile.cpp +++ b/src/IniFile.cpp @@ -9,7 +9,7 @@ // Email: Shane.Hill@dsto.defence.gov.au // Reason: Remove dependancy on MFC. Code should compile on any // platform. -////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// /* !! MODIFIED BY FAKETRUTH and xoft !! @@ -79,7 +79,7 @@ bool cIniFile::ReadFile(const AString & a_FileName, bool a_AllowExampleRedirect) } } - bool IsFirstLine = true; + bool IsFirstLine = true; while (getline(f, line)) { @@ -866,7 +866,7 @@ AString cIniFile::CheckCase(const AString & s) const void cIniFile::RemoveBom(AString & a_line) const { - // The BOM sequence for UTF-8 is 0xEF,0xBB,0xBF + // The BOM sequence for UTF-8 is 0xEF, 0xBB, 0xBF static unsigned const char BOM[] = { 0xEF, 0xBB, 0xBF }; // The BOM sequence, if present, is always th e first three characters of the input. diff --git a/src/IniFile.h b/src/IniFile.h index 3f704551f..e5879f46c 100644 --- a/src/IniFile.h +++ b/src/IniFile.h @@ -9,7 +9,7 @@ // Email: Shane.Hill@dsto.defence.gov.au // Reason: Remove dependancy on MFC. Code should compile on any // platform. Tested on Windows/Linux/Irix -////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// /* !! MODIFIED BY FAKETRUTH and madmaxoft!! From dbe7c8b1702d4141ae0f9d11b74b3d763b8a08c7 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 27 Oct 2014 21:38:00 +0000 Subject: [PATCH 046/145] Comment alignment. --- src/Generating/DistortedHeightmap.cpp | 8 ++++---- src/Generating/HeiGen.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Generating/DistortedHeightmap.cpp b/src/Generating/DistortedHeightmap.cpp index 7c1ab9997..d5bc6ab55 100644 --- a/src/Generating/DistortedHeightmap.cpp +++ b/src/Generating/DistortedHeightmap.cpp @@ -235,7 +235,7 @@ const cDistortedHeightmap::sGenParam cDistortedHeightmap::m_GenParam[256] = {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 90 .. 99 {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 100 .. 109 {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 110 .. 119 - {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 120 .. 128 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 120 .. 128 // Release 1.7 /* biome variants: /* biSunflowerPlains */ { 1.0f, 1.0f}, // 129 @@ -254,14 +254,14 @@ const cDistortedHeightmap::sGenParam cDistortedHeightmap::m_GenParam[256] = {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 141 .. 148 /* biJungleM */ { 4.0f, 4.0f}, // 149 - {0.0f, 0.0f}, // 150 + {0.0f, 0.0f}, // 150 /* biJungleEdgeM */ { 3.0f, 3.0f}, // 151 - {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 152 .. 154 + {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f}, // 152 .. 154 /* biBirchForestM */ { 3.0f, 3.0f}, // 155 /* biBirchForestHillsM */ { 5.0f, 5.0f}, // 156 /* biRoofedForestM */ { 2.0f, 2.0f}, // 157 /* biColdTaigaM */ { 1.0f, 1.0f}, // 158 - {0.0f, 0.0f}, // 159 + {0.0f, 0.0f}, // 159 /* biMegaSpruceTaiga */ { 3.0f, 3.0f}, // 160 /* biMegaSpruceTaigaHills */ { 3.0f, 3.0f}, // 161 /* biExtremeHillsPlusM */ {32.0f, 32.0f}, // 162 diff --git a/src/Generating/HeiGen.cpp b/src/Generating/HeiGen.cpp index 04154dfec..f4e231470 100644 --- a/src/Generating/HeiGen.cpp +++ b/src/Generating/HeiGen.cpp @@ -438,7 +438,7 @@ const cHeiGenBiomal::sGenParam cHeiGenBiomal::m_GenParam[256] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0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0f, 0.0f, 0.0f, 0}, // 141 .. 148 /* biJungleM */ { 0.1f, 3.0f, 0.05f, 6.0f, 0.01f, 6.0f, 70}, // 149 - {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 150 + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 150 /* biJungleEdgeM */ { 0.1f, 3.0f, 0.05f, 6.0f, 0.01f, 6.0f, 70}, // 151 - {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 152 .. 154 + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 152 .. 154 /* biBirchForestM */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 155 /* biBirchForestHillsM */ { 0.2f, 2.0f, 0.05f, 10.0f, 0.01f, 8.0f, 80}, // 156 /* biRoofedForestM */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 157 /* biColdTaigaM */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 158 - {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 159 + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0}, // 159 /* biMegaSpruceTaiga */ { 0.1f, 1.0f, 0.05f, 2.0f, 0.01f, 4.0f, 70}, // 160 /* biMegaSpruceTaigaHills */ { 0.2f, 2.0f, 0.05f, 10.0f, 0.01f, 8.0f, 80}, // 161 /* biExtremeHillsPlusM */ { 0.2f, 4.0f, 0.05f, 20.0f, 0.01f, 16.0f, 120}, // 162 From 232343065f508c3ec32a612d15c6cab7a1553721 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Mon, 27 Oct 2014 22:03:11 +0000 Subject: [PATCH 047/145] Fixed compile (typos). --- src/WorldStorage/NBTChunkSerializer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index 1ecdcb5fd..4daa8cc7b 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -612,13 +612,13 @@ void cNBTChunkSerializer::AddMonsterEntity(cMonster * a_Monster) case mtEnderDragon: case mtGhast: case mtGiant: - case mtIronGolem + case mtIronGolem: case mtMooshroom: case mtOcelot: case mtPig: case mtSilverfish: case mtSnowGolem: - case meSpider: + case mtSpider: case mtSquid: case mtWitch: case mtZombiePigman: From 6d306b9c4e8778afdd2763f2b273509cedca62af Mon Sep 17 00:00:00 2001 From: Arian Date: Mon, 27 Oct 2014 23:46:46 +0100 Subject: [PATCH 048/145] Update style.css --- MCServer/webadmin/files/style.css | 433 +++++++++++++++++++++++++++++- 1 file changed, 432 insertions(+), 1 deletion(-) diff --git a/MCServer/webadmin/files/style.css b/MCServer/webadmin/files/style.css index 4c38af695..c3f6849df 100644 --- a/MCServer/webadmin/files/style.css +++ b/MCServer/webadmin/files/style.css @@ -1,2 +1,433 @@ /* Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 */ -*{margin:0}body{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;-webkit-font-smoothing:antialiased;background:#fff;width:100%;min-width:100%;overflow-y:scroll;overflow-x:hidden}a:link{color:#555;text-decoration:none}a:visited{color:#444;text-decoration:none}a:hover,a:active{color:#000;text-decoration:underline}img{border:none}h1{color:#069;text-shadow:2px 2px #000}.row1{border-bottom:1px #000 solid;height:100px;max-height:100px;background:#fff url(header.png) repeat-x top left}.row2{margin:0 auto;text-align:center;vertical-align:middle;margin-top:125px}.contention{color:#000;text-align:left;line-height:1.4;margin:0;font-family:Tahoma,Verdana,Arial,Sans-Serif;font-size:13px}.push10{padding-bottom:75px}#panel ul.menu{margin:0;padding:0;list-style:none}#panel ul.menu li{margin:0 5px;display:inline}#panel ul.menu li a{padding-left:20px;background-repeat:no-repeat;background-position:left center}#panel .upper ul.top_links{float:right;font-weight:700}#panel .upper{background:#dcdbdc url(tcat.png) repeat-x;border-top:1px solid #fff;border-bottom:1px solid #bbb;padding:7px}#footer{z-index:99999}#footer ul.menu{margin:0;padding:0;list-style:none}#footer ul.menu li{margin:0 5px;display:inline}#footer .upper{background:#dcdbdc url(tcat.png) repeat-x;border-top:1px solid #bbb;padding:6px;overflow:hidden;font-size:12px}#footer .upper ul.bottom_links{float:left;margin:3px 0 0 -5px}#footer .lower{background:#a1a2a2 url(thead.png) top left repeat-x;color:#fff;border-top:1px solid #ccc;border-bottom:1px solid #ddd;overflow:hidden;padding:8px;font-size:11px}#footer .lower a:link,#footer .lower a:visited{color:#fff;font-weight:700}#footer .lower a:hover,#footer .lower a:active{color:#fff;font-weight:700}#footer .lower #current_time{float:right;padding-right:6px}.wrapper{width:85%;min-width:970px;max-width:1500px;margin:auto}#footer{position:fixed;left:0;bottom:0;height:60px;width:100%;background:#999;border-top:1px #000 solid}* html #footer{position:absolute;top:expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px')}tr td.trow1:first-child,tr td.trow2:first-child{border-left:0}tr td.trow1:last-child,tr td.trow2:last-child{border-right:0}.tborder{-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px}.thead{-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;-webkit-border-top-left-radius:6px;-webkit-border-top-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}table{color:#000;font-size:13px}.tborder{background:#fff;width:100%;margin:auto;border:1px solid #ccc;padding:1px}.thead{background:#a1a2a2 url(thead.png) top left repeat-x;color:#fff;border-bottom:1px solid #8e8f8f;padding:8px}.tcat{background:#dcdbdc url(tcat.png) repeat-x;color:#fff;border-bottom:1px solid #bbb;padding:6px;font-size:12px}.trow1{background:#f5f5f5;border:1px solid;border-color:#fff #ddd #ddd #fff}.trow2{background:#efefef;border:1px solid;border-color:#fff #ddd #ddd #fff;padding:15px;box-sizing:border-box;-moz-box-sizing:border-box}.padtopp{padding-top:25px}table{color:#000;font-size:13px;text-align:left}.tborder{background:#fff;width:100%;margin:auto;border:1px solid #ccc;padding:1px}.thead{background:#a1a2a2 url(thead.png) top left repeat-x;color:#fff;border-bottom:1px solid #8e8f8f;padding:8px}.tcat{background:#dcdbdc url(tcat.png) repeat-x;color:#fff;border-bottom:1px solid #bbb;padding:6px;font-size:12px}.trow1{background:#f5f5f5;border:1px solid;border-color:#fff #ddd #ddd #fff}.trow2{background:#efefef;border:1px solid;border-color:#fff #ddd #ddd #fff}.smalltext{font-size:11px}textarea{background:#fff;color:#000;border:1px solid #ccc;padding:2px;line-height:1.4;font-family:Tahoma,Verdana,Arial,Sans-Serif;font-size:13px}select{background:#fff;padding:3px;border:1px solid #ccc;font-family:Tahoma,Verdana,Arial,Sans-Serif}.usercp_nav_item{display:block;padding:1px 0 1px 23px}.usercp_nav_pmfolder{background:url(pmfolder.gif) no-repeat left center}.usercp_nav_sub_pmfolder{padding-left:40px;background:url(sub_pmfolder.gif) no-repeat left center}.usercp_nav_home{background:url(home.gif) no-repeat left center}.pagehead{position:fixed;z-index:99999;top:0;left:0;width:100%}table{width:100%}table th{border-bottom:1px solid rgba(0,0,0,0.12);padding:5px;text-align:left}table tr:nth-child(odd){background-color:rgba(0,0,0,0.015)}p{margin:4px 0;padding:4px 3px}a{text-decoration:none;color:#000;-webkit-transition:color .1s linear;-moz-transition:color .1s linear;transition:color .1s linear}a:hover{color:#888}input[type="text"]{background:#fff;color:#000;border:1px solid #ccc;padding:2px;line-height:1.4;font-family:Tahoma,Verdana,Arial,Sans-Serif;font-size:13px;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}input[type="text"]:hover{background-color:#E5E4E2}input[type="text"]:focus{background-color:#E5E4E2}hr{border:none;height:1px;background-color:rgba(0,0,0,0.12)}h4{padding-bottom:10px;margin-bottom:12px;border-bottom:1px solid rgba(0,0,0,0.12)}#ChatDiv{margin-bottom:10px}#ChatMessage{width:92%;margin-right:5px;box-sizing:border-box;-moz-box-sizing:border-box}input[type="submit"]{padding:3px;padding-left:5px;padding-right:5px;cursor:pointer;font-family:Tahoma,Verdana,Arial,Sans-Serif;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;background:#f5f5f5;border:1px solid #ccc}input[type="submit"]:hover{background-color:#E5E4E2}button:disabled,input:disabled{padding:3px;padding-left:5px;padding-right:5px;cursor:pointer;font-family:Tahoma,Verdana,Arial,Sans-Serif;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;border:none!important;color:#fff!important;background-color:#ccc!important} +* { + margin: 0; +} + +body { + font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; + -webkit-font-smoothing: antialiased; + background: #fff; + width: 100%; + min-width: 100%; + overflow-y: scroll; + overflow-x: hidden; +} + +a:link { + color: #555; + text-decoration: none; +} + +a:visited { + color: #444; + text-decoration: none; +} + +a:hover,a:active { + color: #000; + text-decoration: underline; +} + +img { + border: none; +} + +h1 { + color: #069; + text-shadow: 2px 2px #000; +} + +.row1 { + border-bottom: 1px #000 solid; + height: 100px; + max-height: 100px; + background: #fff url(header.png) repeat-x top left; +} + +.row2 { + margin: 0 auto; + text-align: center; + vertical-align: middle; + margin-top: 125px; +} + +.contention { + color: #000; + text-align: left; + line-height: 1.4; + margin: 0; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + font-size: 13px; +} + +.push10 { + padding-bottom: 75px; +} + +#panel ul.menu { + margin: 0; + padding: 0; + list-style: none; +} + +#panel ul.menu li { + margin: 0 5px; + display: inline; +} + +#panel ul.menu li a { + padding-left: 20px; + background-repeat: no-repeat; + background-position: left center; +} + +#panel .upper ul.top_links { + float: right; + font-weight: 700; +} + +#panel .upper { + background: #dcdbdc url(tcat.png) repeat-x; + border-top: 1px solid #fff; + border-bottom: 1px solid #bbb; + padding: 7px; +} + +#footer { + z-index: 99999; +} + +#footer ul.menu { + margin: 0; + padding: 0; + list-style: none; +} + +#footer ul.menu li { + margin: 0 5px; + display: inline; +} + +#footer .upper { + background: #dcdbdc url(tcat.png) repeat-x; + border-top: 1px solid #bbb; + padding: 6px; + overflow: hidden; + font-size: 12px; +} + +#footer .upper ul.bottom_links { + float: left; + margin: 3px 0 0 -5px; +} + +#footer .lower { + background: #a1a2a2 url(thead.png) top left repeat-x; + color: #fff; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ddd; + overflow: hidden; + padding: 8px; + font-size: 11px; +} + +#footer .lower a:link,#footer .lower a:visited { + color: #fff; + font-weight: 700; +} + +#footer .lower a:hover,#footer .lower a:active { + color: #fff; + font-weight: 700; +} + +#footer .lower #current_time { + float: right; + padding-right: 6px; +} + +.wrapper { + width: 85%; + min-width: 970px; + max-width: 1500px; + margin: auto; +} + +#footer { + position: fixed; + left: 0; + bottom: 0; + height: 60px; + width: 100%; + background: #999; + border-top: 1px #000 solid; +} + +* html #footer { + position: absolute; + top: expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px'); +} + +tr td.trow1:first-child,tr td.trow2:first-child { + border-left: 0; +} + +tr td.trow1:last-child,tr td.trow2:last-child { + border-right: 0; +} + +.tborder { + -moz-border-radius: 7px; + -webkit-border-radius: 7px; + border-radius: 7px; +} + +.thead { + -moz-border-radius-topleft: 6px; + -moz-border-radius-topright: 6px; + -webkit-border-top-left-radius: 6px; + -webkit-border-top-right-radius: 6px; + border-top-left-radius: 6px; + border-top-right-radius: 6px; +} + +table { + color: #000; + font-size: 13px; +} + +.tborder { + background: #fff; + width: 100%; + margin: auto; + border: 1px solid #ccc; + padding: 1px; +} + +.thead { + background: #a1a2a2 url(thead.png) top left repeat-x; + color: #fff; + border-bottom: 1px solid #8e8f8f; + padding: 8px; +} + +.tcat { + background: #dcdbdc url(tcat.png) repeat-x; + color: #fff; + border-bottom: 1px solid #bbb; + padding: 6px; + font-size: 12px; +} + +.trow1 { + background: #f5f5f5; + border: 1px solid; + border-color: #fff #ddd #ddd #fff; +} + +.trow2 { + background: #efefef; + border: 1px solid; + border-color: #fff #ddd #ddd #fff; + padding: 15px; + box-sizing: border-box; + -moz-box-sizing: border-box; +} + +.padtopp { + padding-top: 25px; +} + +table { + color: #000; + font-size: 13px; + text-align: left; +} + +.tborder { + background: #fff; + width: 100%; + margin: auto; + border: 1px solid #ccc; + padding: 1px; +} + +.thead { + background: #a1a2a2 url(thead.png) top left repeat-x; + color: #fff; + border-bottom: 1px solid #8e8f8f; + padding: 8px; +} + +.tcat { + background: #dcdbdc url(tcat.png) repeat-x; + color: #fff; + border-bottom: 1px solid #bbb; + padding: 6px; + font-size: 12px; +} + +.trow1 { + background: #f5f5f5; + border: 1px solid; + border-color: #fff #ddd #ddd #fff; +} + +.trow2 { + background: #efefef; + border: 1px solid; + border-color: #fff #ddd #ddd #fff; +} + +.smalltext { + font-size: 11px; +} + +textarea { + background: #fff; + color: #000; + border: 1px solid #ccc; + padding: 2px; + line-height: 1.4; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + font-size: 13px; +} + +select { + background: #fff; + padding: 3px; + border: 1px solid #ccc; + font-family: Tahoma,Verdana,Arial,Sans-Serif; +} + +.usercp_nav_item { + display: block; + padding: 1px 0 1px 23px; +} + +.usercp_nav_pmfolder { + background: url(pmfolder.gif) no-repeat left center; +} + +.usercp_nav_sub_pmfolder { + padding-left: 40px; + background: url(sub_pmfolder.gif) no-repeat left center; +} + +.usercp_nav_home { + background: url(home.gif) no-repeat left center; +} + +.pagehead { + position: fixed; + z-index: 99999; + top: 0; + left: 0; + width: 100%; +} + +table { + width: 100%; +} + +table th { + border-bottom: 1px solid rgba(0,0,0,0.12); + padding: 5px; + text-align: left; +} + +table tr:nth-child(odd) { + background-color: rgba(0,0,0,0.015); +} + +p { + margin: 4px 0; + padding: 4px 3px; +} + +a { + text-decoration: none; + color: #000; + -webkit-transition: color .1s linear; + -moz-transition: color .1s linear; + transition: color .1s linear; +} + +a:hover { + color: #888; +} + +input[type="text"] { + background: #fff; + color: #000; + border: 1px solid #ccc; + padding: 2px; + line-height: 1.4; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + font-size: 13px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +input[type="text"]:hover { + background-color: #E5E4E2; +} + +input[type="text"]:focus { + background-color: #E5E4E2; +} + +hr { + border: none; + height: 1px; + background-color: rgba(0,0,0,0.12); +} + +h4 { + padding-bottom: 10px; + margin-bottom: 12px; + border-bottom: 1px solid rgba(0,0,0,0.12); +} + +#ChatDiv { + margin-bottom: 10px; +} + +#ChatMessage { + width: 92%; + margin-right: 5px; + box-sizing: border-box; + -moz-box-sizing: border-box; +} + +input[type="submit"] { + padding: 3px; + padding-left: 5px; + padding-right: 5px; + cursor: pointer; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + background: #f5f5f5; + border: 1px solid #ccc; +} + +input[type="submit"]:hover { + background-color: #E5E4E2; +} + +button:disabled,input:disabled { + padding: 3px; + padding-left: 5px; + padding-right: 5px; + cursor: pointer; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + border: none!important; + color: #fff!important; + background-color: #ccc!important; +} From 22165559ea3797a3892d6910133af078ec55c8de Mon Sep 17 00:00:00 2001 From: Arian Date: Mon, 27 Oct 2014 23:48:02 +0100 Subject: [PATCH 049/145] Update login.css --- MCServer/webadmin/files/login.css | 219 +++++++++++++++++++++++++++++- 1 file changed, 218 insertions(+), 1 deletion(-) diff --git a/MCServer/webadmin/files/login.css b/MCServer/webadmin/files/login.css index 3a766e1b6..659837598 100644 --- a/MCServer/webadmin/files/login.css +++ b/MCServer/webadmin/files/login.css @@ -1,2 +1,219 @@ /* Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 */ -*{margin:0}body{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;-webkit-font-smoothing:antialiased;background:#fff url(header.png) repeat-x top left;width:100%;min-width:100%;overflow:hidden}a:link{color:#555;text-decoration:none}a:visited{color:#444;text-decoration:none}a:hover,a:active{color:#000;text-decoration:underline}img{border:none}h1{color:#069}.row1{border-bottom:1px solid #000;height:100px;max-height:100px}.row2{margin:0 auto;text-align:center;vertical-align:middle}.contention{color:#000;text-align:left;line-height:1.4;margin:0;font-family:Tahoma,Verdana,Arial,Sans-Serif;font-size:13px}button{background:#fff;color:#000;border:1px solid #ccc;padding:3px;font-family:Tahoma,Verdana,Arial,Sans-Serif;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;margin:-3px 0}button:hover{border-top-color:#28597a;background:#28597a;color:#ccc}button:active{border-top-color:#1b435e;background:#1b435e}.push10{padding-bottom:75px}#panel .upper{background:#dcdbdc url(tcat.png) repeat-x;border-top:1px solid #fff;border-bottom:1px solid #bbb;padding:7px}#footer{z-index:99999}#footer ul.menu{margin:0;padding:0;list-style:none}#footer ul.menu li{margin:0 5px;display:inline}#footer .upper{background:#dcdbdc url(tcat.png) repeat-x;border-top:1px solid #bbb;padding:6px;overflow:hidden;font-size:12px}#footer .upper ul.bottom_links{float:left;margin:3px 0 0 -5px}#footer .lower{background:#a1a2a2 url(thead.png) top left repeat-x;color:#fff;border-top:1px solid #ccc;border-bottom:1px solid #ddd;overflow:hidden;padding:8px;font-size:11px}#footer .lower a:link,#footer .lower a:visited{color:#fff;font-weight:700}#footer .lower a:hover,#footer .lower a:active{color:#fff;font-weight:700}#footer .lower #current_time{float:right;padding-right:6px}.wrapper{width:85%;min-width:970px;max-width:1500px;margin:auto}#footer{position:fixed;left:0;bottom:0;height:60px;width:100%;background:#999;border-top:1px #000 solid}* html #footer{position:absolute;top:expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px')}tr td.trow2:first-child{border-left:0}tr td.trow2:last-child{border-right:0}.tborder{-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px}.thead,.rounded_top{-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;-webkit-border-top-left-radius:6px;-webkit-border-top-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px}table{color:#000;font-size:13px}.tborder{background:#fff;width:100%;margin:auto;border:1px solid #ccc;padding:1px}.thead{background:#a1a2a2 url(thead.png) top left repeat-x;color:#fff;border-bottom:1px solid #8e8f8f;padding:8px}.trow2{background:#efefef;border:1px solid;border-color:#fff #ddd #ddd #fff}.padtopp{padding-top:25px} +* { + margin: 0; +} + +body { + font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; + -webkit-font-smoothing: antialiased; + background: #fff url(header.png) repeat-x top left; + width: 100%; + min-width: 100%; + overflow: hidden; +} + +a:link { + color: #555; + text-decoration: none; +} + +a:visited { + color: #444; + text-decoration: none; +} + +a:hover,a:active { + color: #000; + text-decoration: underline; +} + +img { + border: none; +} + +h1 { + color: #069; +} + +.row1 { + border-bottom: 1px solid #000; + height: 100px; + max-height: 100px; +} + +.row2 { + margin: 0 auto; + text-align: center; + vertical-align: middle; +} + +.contention { + color: #000; + text-align: left; + line-height: 1.4; + margin: 0; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + font-size: 13px; +} + +button { + background: #fff; + color: #000; + border: 1px solid #ccc; + padding: 3px; + font-family: Tahoma,Verdana,Arial,Sans-Serif; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + margin: -3px 0; +} + +button:hover { + border-top-color: #28597a; + background: #28597a; + color: #ccc; +} + +button:active { + border-top-color: #1b435e; + background: #1b435e; +} + +.push10 { + padding-bottom: 75px; +} + +#panel .upper { + background: #dcdbdc url(tcat.png) repeat-x; + border-top: 1px solid #fff; + border-bottom: 1px solid #bbb; + padding: 7px; +} + +#footer { + z-index: 99999; +} + +#footer ul.menu { + margin: 0; + padding: 0; + list-style: none; +} + +#footer ul.menu li { + margin: 0 5px; + display: inline; +} + +#footer .upper { + background: #dcdbdc url(tcat.png) repeat-x; + border-top: 1px solid #bbb; + padding: 6px; + overflow: hidden; + font-size: 12px; +} + +#footer .upper ul.bottom_links { + float: left; + margin: 3px 0 0 -5px; +} + +#footer .lower { + background: #a1a2a2 url(thead.png) top left repeat-x; + color: #fff; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ddd; + overflow: hidden; + padding: 8px; + font-size: 11px; +} + +#footer .lower a:link,#footer .lower a:visited { + color: #fff; + font-weight: 700; +} + +#footer .lower a:hover,#footer .lower a:active { + color: #fff; + font-weight: 700; +} + +#footer .lower #current_time { + float: right; + padding-right: 6px; +} + +.wrapper { + width: 85%; + min-width: 970px; + max-width: 1500px; + margin: auto; +} + +#footer { + position: fixed; + left: 0; + bottom: 0; + height: 60px; + width: 100%; + background: #999; + border-top: 1px #000 solid; +} + +* html #footer { + position: absolute; + top: expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px'); +} + +tr td.trow2:first-child { + border-left: 0; +} + +tr td.trow2:last-child { + border-right: 0; +} + +.tborder { + -moz-border-radius: 7px; + -webkit-border-radius: 7px; + border-radius: 7px; +} + +.thead,.rounded_top { + -moz-border-radius-topleft: 6px; + -moz-border-radius-topright: 6px; + -webkit-border-top-left-radius: 6px; + -webkit-border-top-right-radius: 6px; + border-top-left-radius: 6px; + border-top-right-radius: 6px; +} + +table { + color: #000; + font-size: 13px; +} + +.tborder { + background: #fff; + width: 100%; + margin: auto; + border: 1px solid #ccc; + padding: 1px; +} + +.thead { + background: #a1a2a2 url(thead.png) top left repeat-x; + color: #fff; + border-bottom: 1px solid #8e8f8f; + padding: 8px; +} + +.trow2 { + background: #efefef; + border: 1px solid; + border-color: #fff #ddd #ddd #fff; +} + +.padtopp { + padding-top: 25px; +} From 292d13ad9a42342dc79d3f1ea794f8877264e931 Mon Sep 17 00:00:00 2001 From: Arian Date: Mon, 27 Oct 2014 23:49:26 +0100 Subject: [PATCH 050/145] Update login_template.html --- MCServer/webadmin/login_template.html | 166 +++++++++++++++++--------- 1 file changed, 108 insertions(+), 58 deletions(-) diff --git a/MCServer/webadmin/login_template.html b/MCServer/webadmin/login_template.html index af80470e8..4ab76b36b 100644 --- a/MCServer/webadmin/login_template.html +++ b/MCServer/webadmin/login_template.html @@ -1,68 +1,118 @@ /* Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 */ -MCServer WebAdmin - Login - - - + + MCServer WebAdmin - Login + + + + -
-
-
- -
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - -
-
-MCServer WebAdmin -
-
-
- -
-
-
-
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ + + + + + + + + +
+
+ + MCServer WebAdmin + +
+
+
+ +
+
+
+
From c53b7e5d38c24bce7ba55abf3060ffd012783086 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 27 Oct 2014 23:58:09 +0100 Subject: [PATCH 051/145] QtBiomeVisualiser: Switched caching to entire regions. This speeds up the rendering preparation for small zooms. --- Tools/QtBiomeVisualiser/BiomeView.cpp | 42 ++++-- Tools/QtBiomeVisualiser/BiomeView.h | 8 +- Tools/QtBiomeVisualiser/ChunkCache.cpp | 126 ---------------- Tools/QtBiomeVisualiser/ChunkLoader.cpp | 29 ---- Tools/QtBiomeVisualiser/ChunkLoader.h | 45 ------ Tools/QtBiomeVisualiser/ChunkSource.cpp | 10 +- Tools/QtBiomeVisualiser/ChunkSource.h | 6 +- Tools/QtBiomeVisualiser/MainWindow.cpp | 2 +- Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro | 18 ++- Tools/QtBiomeVisualiser/Region.cpp | 72 +++++++++ Tools/QtBiomeVisualiser/Region.h | 44 ++++++ Tools/QtBiomeVisualiser/RegionCache.cpp | 138 ++++++++++++++++++ .../{ChunkCache.h => RegionCache.h} | 31 ++-- Tools/QtBiomeVisualiser/RegionLoader.cpp | 37 +++++ Tools/QtBiomeVisualiser/RegionLoader.h | 50 +++++++ 15 files changed, 409 insertions(+), 249 deletions(-) delete mode 100644 Tools/QtBiomeVisualiser/ChunkCache.cpp delete mode 100644 Tools/QtBiomeVisualiser/ChunkLoader.cpp delete mode 100644 Tools/QtBiomeVisualiser/ChunkLoader.h create mode 100644 Tools/QtBiomeVisualiser/Region.cpp create mode 100644 Tools/QtBiomeVisualiser/Region.h create mode 100644 Tools/QtBiomeVisualiser/RegionCache.cpp rename Tools/QtBiomeVisualiser/{ChunkCache.h => RegionCache.h} (50%) create mode 100644 Tools/QtBiomeVisualiser/RegionLoader.cpp create mode 100644 Tools/QtBiomeVisualiser/RegionLoader.h diff --git a/Tools/QtBiomeVisualiser/BiomeView.cpp b/Tools/QtBiomeVisualiser/BiomeView.cpp index b44b935d7..fef2b0afd 100644 --- a/Tools/QtBiomeVisualiser/BiomeView.cpp +++ b/Tools/QtBiomeVisualiser/BiomeView.cpp @@ -1,8 +1,8 @@ #include "Globals.h" #include "BiomeView.h" -#include "QtChunk.h" #include #include +#include "Region.h" @@ -40,7 +40,7 @@ BiomeView::BiomeView(QWidget * parent) : redraw(); // Add a chunk-update callback mechanism: - connect(&m_Cache, SIGNAL(chunkAvailable(int, int)), this, SLOT(chunkAvailable(int, int))); + connect(&m_Cache, SIGNAL(regionAvailable(int, int)), this, SLOT(regionAvailable(int, int))); // Allow mouse and keyboard interaction: setFocusPolicy(Qt::StrongFocus); @@ -143,9 +143,15 @@ void BiomeView::redraw() -void BiomeView::chunkAvailable(int a_ChunkX, int a_ChunkZ) +void BiomeView::regionAvailable(int a_RegionX, int a_RegionZ) { - drawChunk(a_ChunkX, a_ChunkZ); + for (int z = 0; z < 32; z++) + { + for (int x = 0; x < 32; x++) + { + drawChunk(a_RegionX * 32 + x, a_RegionZ * 32 + z); + } + } update(); } @@ -175,8 +181,11 @@ void BiomeView::drawChunk(int a_ChunkX, int a_ChunkZ) return; } - //fetch the chunk: - ChunkPtr chunk = m_Cache.fetch(a_ChunkX, a_ChunkZ); + // Fetch the region: + int regionX; + int regionZ; + Region::chunkToRegion(a_ChunkX, a_ChunkZ, regionX, regionZ); + RegionPtr region = m_Cache.fetch(regionX, regionZ); // Figure out where on the screen this chunk should be drawn: // first find the center chunk @@ -228,9 +237,15 @@ void BiomeView::drawChunk(int a_ChunkX, int a_ChunkZ) // If the chunk is valid, use its data; otherwise use the empty placeholder: const uchar * src = m_EmptyChunkImage; - if (chunk.get() != nullptr) + if (region.get() != nullptr) { - src = chunk->getImage(); + int relChunkX = a_ChunkX - regionX * 32; + int relChunkZ = a_ChunkZ - regionZ * 32; + Chunk & chunk = region->getRelChunk(relChunkX, relChunkZ); + if (chunk.isValid()) + { + src = chunk.getImage(); + } } // Blit or scale-blit the image: @@ -317,11 +332,12 @@ void BiomeView::mouseMoveEvent(QMouseEvent * a_Event) // Update the status bar info text: int blockX = floor((a_Event->x() - width() / 2) / m_Zoom + m_X); int blockZ = floor((a_Event->y() - height() / 2) / m_Zoom + m_Z); - int chunkX, chunkZ; - int relX = blockX, relY, relZ = blockZ; - cChunkDef::AbsoluteToRelative(relX, relY, relZ, chunkX, chunkZ); - auto chunk = m_Cache.fetch(chunkX, chunkZ); - int biome = (chunk.get() != nullptr) ? chunk->getBiome(relX, relZ) : biInvalidBiome; + int regionX, regionZ; + Region::blockToRegion(blockX, blockZ, regionX, regionZ); + int relX = blockX - regionX * 512; + int relZ = blockZ - regionZ * 512; + auto region = m_Cache.fetch(regionX, regionZ); + int biome = (region.get() != nullptr) ? region->getRelBiome(relX, relZ) : biInvalidBiome; emit hoverChanged(blockX, blockZ, biome); } diff --git a/Tools/QtBiomeVisualiser/BiomeView.h b/Tools/QtBiomeVisualiser/BiomeView.h index 40d8b96ae..9901b8f24 100644 --- a/Tools/QtBiomeVisualiser/BiomeView.h +++ b/Tools/QtBiomeVisualiser/BiomeView.h @@ -2,7 +2,7 @@ #include #include -#include "ChunkCache.h" +#include "RegionCache.h" #include "ChunkSource.h" @@ -51,8 +51,8 @@ public slots: /** Redraw the entire widget area. */ void redraw(); - /** A specified chunk has become available, redraw it. */ - void chunkAvailable(int a_ChunkX, int a_ChunkZ); + /** A specified region has become available, redraw it. */ + void regionAvailable(int a_RegionX, int a_RegionZ); /** Reloads the current chunk source and redraws the entire workspace. */ void reload(); @@ -62,7 +62,7 @@ protected: double m_Zoom; /** Cache for the loaded chunk data. */ - ChunkCache m_Cache; + RegionCache m_Cache; /** The entire view's contents in an offscreen image. */ QImage m_Image; diff --git a/Tools/QtBiomeVisualiser/ChunkCache.cpp b/Tools/QtBiomeVisualiser/ChunkCache.cpp deleted file mode 100644 index 05c267d30..000000000 --- a/Tools/QtBiomeVisualiser/ChunkCache.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include "Globals.h" -#include "ChunkCache.h" -#include -#include -#include "ChunkSource.h" -#include "ChunkLoader.h" - - - - - -ChunkCache::ChunkCache(QObject * parent) : - super(parent) -{ - m_Cache.setMaxCost(1024 * 1024 * 1024); // 1 GiB of memory for the cache -} - - - - - -ChunkPtr ChunkCache::fetch(int a_ChunkX, int a_ChunkZ) -{ - // Retrieve from the cache: - quint32 hash = getChunkHash(a_ChunkX, a_ChunkZ); - ChunkPtr * res; - { - QMutexLocker lock(&m_Mtx); - res = m_Cache[hash]; - // If succesful and chunk loaded, return the retrieved value: - if ((res != nullptr) && (*res)->isValid()) - { - return *res; - } - } - - // If the chunk is in cache but not valid, it means it has been already queued for rendering, do nothing now: - if (res != nullptr) - { - return ChunkPtr(nullptr); - } - - // There's no such item in the cache, create it now: - res = new ChunkPtr(new Chunk); - if (res == nullptr) - { - return ChunkPtr(nullptr); - } - { - QMutexLocker lock(&m_Mtx); - m_Cache.insert(hash, res, sizeof(Chunk)); - } - - // Queue the chunk for rendering: - queueChunkRender(a_ChunkX, a_ChunkZ, *res); - - // Return failure, the chunk is not yet rendered: - return ChunkPtr(nullptr); -} - - - - - -void ChunkCache::setChunkSource(std::shared_ptr a_ChunkSource) -{ - // Replace the chunk source: - m_ChunkSource = a_ChunkSource; - - // Clear the cache: - QMutexLocker lock(&m_Mtx); - m_Cache.clear(); -} - - - - - -void ChunkCache::reload() -{ - assert(m_ChunkSource.get() != nullptr); - - // Reload the chunk source: - m_ChunkSource->reload(); - - // Clear the cache: - QMutexLocker lock(&m_Mtx); - m_Cache.clear(); -} - - - - - -void ChunkCache::gotChunk(int a_ChunkX, int a_ChunkZ) -{ - emit chunkAvailable(a_ChunkX, a_ChunkZ); -} - - - - - -quint32 ChunkCache::getChunkHash(int a_ChunkX, int a_ChunkZ) -{ - // Simply join the two coords into a single int - // The coords will never be larger than 16-bits, so we can do this safely - return (((static_cast(a_ChunkX) & 0xffff) << 16) | (static_cast(a_ChunkZ) & 0xffff)); -} - - - - - -void ChunkCache::queueChunkRender(int a_ChunkX, int a_ChunkZ, ChunkPtr & a_Chunk) -{ - // Create a new loader task: - ChunkLoader * loader = new ChunkLoader(a_ChunkX, a_ChunkZ, a_Chunk, m_ChunkSource); - connect(loader, SIGNAL(loaded(int, int)), this, SLOT(gotChunk(int, int))); - - QThreadPool::globalInstance()->start(loader); -} - - - - diff --git a/Tools/QtBiomeVisualiser/ChunkLoader.cpp b/Tools/QtBiomeVisualiser/ChunkLoader.cpp deleted file mode 100644 index 3d0123b23..000000000 --- a/Tools/QtBiomeVisualiser/ChunkLoader.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "Globals.h" -#include "ChunkLoader.h" -#include "ChunkSource.h" - - - - - -ChunkLoader::ChunkLoader(int a_ChunkX, int a_ChunkZ, ChunkPtr a_Chunk, ChunkSourcePtr a_ChunkSource) : - m_ChunkX(a_ChunkX), - m_ChunkZ(a_ChunkZ), - m_Chunk(a_Chunk), - m_ChunkSource(a_ChunkSource) -{ -} - - - - - -void ChunkLoader::run() -{ - m_ChunkSource->getChunkBiomes(m_ChunkX, m_ChunkZ, m_Chunk); - emit loaded(m_ChunkX, m_ChunkZ); -} - - - - diff --git a/Tools/QtBiomeVisualiser/ChunkLoader.h b/Tools/QtBiomeVisualiser/ChunkLoader.h deleted file mode 100644 index 4d026a45e..000000000 --- a/Tools/QtBiomeVisualiser/ChunkLoader.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once - -#include -#include -#include - - - - -// fwd: -class Chunk; -typedef std::shared_ptr ChunkPtr; - -class ChunkSource; -typedef std::shared_ptr ChunkSourcePtr; - - - - - -class ChunkLoader : - public QObject, - public QRunnable -{ - Q_OBJECT - -public: - ChunkLoader(int a_ChunkX, int a_ChunkZ, ChunkPtr a_Chunk, ChunkSourcePtr a_ChunkSource); - virtual ~ChunkLoader() {} - -signals: - void loaded(int a_ChunkX, int a_ChunkZ); - -protected: - virtual void run() override; - -private: - int m_ChunkX, m_ChunkZ; - ChunkPtr m_Chunk; - ChunkSourcePtr m_ChunkSource; -}; - - - - diff --git a/Tools/QtBiomeVisualiser/ChunkSource.cpp b/Tools/QtBiomeVisualiser/ChunkSource.cpp index c5cde1c3b..c6d50b2e0 100644 --- a/Tools/QtBiomeVisualiser/ChunkSource.cpp +++ b/Tools/QtBiomeVisualiser/ChunkSource.cpp @@ -24,14 +24,14 @@ BioGenSource::BioGenSource(cIniFilePtr a_IniFile) : -void BioGenSource::getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChunk) +void BioGenSource::getChunkBiomes(int a_ChunkX, int a_ChunkZ, Chunk & a_DestChunk) { cChunkDef::BiomeMap biomes; { QMutexLocker lock(&m_Mtx); m_BiomeGen->GenBiomes(a_ChunkX, a_ChunkZ, biomes); } - a_DestChunk->setBiomes(biomes); + a_DestChunk.setBiomes(biomes); } @@ -160,7 +160,7 @@ AnvilSource::AnvilSource(QString a_WorldRegionFolder) : -void AnvilSource::getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChunk) +void AnvilSource::getChunkBiomes(int a_ChunkX, int a_ChunkZ, Chunk & a_DestChunk) { // Load the compressed data: AString compressedChunkData = getCompressedChunkData(a_ChunkX, a_ChunkZ); @@ -200,7 +200,7 @@ void AnvilSource::getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChun { biomeMap[i] = (EMCSBiome)GetBEInt(beBiomes + 4 * i); } - a_DestChunk->setBiomes(biomeMap); + a_DestChunk.setBiomes(biomeMap); return; } @@ -216,7 +216,7 @@ void AnvilSource::getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChun { biomeMap[i] = EMCSBiome(vanillaBiomes[i]); } - a_DestChunk->setBiomes(biomeMap); + a_DestChunk.setBiomes(biomeMap); } diff --git a/Tools/QtBiomeVisualiser/ChunkSource.h b/Tools/QtBiomeVisualiser/ChunkSource.h index 5332c5d3f..ed2f457e9 100644 --- a/Tools/QtBiomeVisualiser/ChunkSource.h +++ b/Tools/QtBiomeVisualiser/ChunkSource.h @@ -26,7 +26,7 @@ public: /** Fills the a_DestChunk with the biomes for the specified coords. It is expected to be thread-safe and re-entrant. Usually QThread::idealThreadCount() threads are used. */ - virtual void getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChunk) = 0; + virtual void getChunkBiomes(int a_ChunkX, int a_ChunkZ, Chunk & a_DestChunk) = 0; /** Forces a fresh reload of the source. Useful mainly for the generator, whose underlying definition file may have been changed. */ virtual void reload() = 0; @@ -45,7 +45,7 @@ public: BioGenSource(cIniFilePtr a_IniFile); // ChunkSource overrides: - virtual void getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChunk) override; + virtual void getChunkBiomes(int a_ChunkX, int a_ChunkZ, Chunk & a_DestChunk) override; virtual void reload(void) override; protected: @@ -70,7 +70,7 @@ public: AnvilSource(QString a_WorldRegionFolder); // ChunkSource overrides: - virtual void getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChunk) override; + virtual void getChunkBiomes(int a_ChunkX, int a_ChunkZ, Chunk & a_DestChunk) override; virtual void reload() override; protected: diff --git a/Tools/QtBiomeVisualiser/MainWindow.cpp b/Tools/QtBiomeVisualiser/MainWindow.cpp index 7853d768e..dc26a32c7 100644 --- a/Tools/QtBiomeVisualiser/MainWindow.cpp +++ b/Tools/QtBiomeVisualiser/MainWindow.cpp @@ -8,8 +8,8 @@ #include #include #include -#include "src/IniFile.h" #include "ChunkSource.h" +#include "src/IniFile.h" #include "src/Generating/BioGen.h" #include "src/StringCompression.h" #include "src/WorldStorage/FastNBT.h" diff --git a/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro b/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro index f3a5255fb..4cff9c90f 100644 --- a/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro +++ b/Tools/QtBiomeVisualiser/QtBiomeVisualiser.pro @@ -26,9 +26,6 @@ SOURCES +=\ ../../src/OSSupport/CriticalSection.cpp \ ../../src/OSSupport/IsThread.cpp \ ../../src/BiomeDef.cpp \ - ChunkCache.cpp \ - ChunkSource.cpp \ - ChunkLoader.cpp \ ../../src/StringCompression.cpp \ ../../src/WorldStorage/FastNBT.cpp \ ../../lib/zlib/adler32.c \ @@ -48,7 +45,11 @@ SOURCES +=\ ../../lib/zlib/zutil.c \ GeneratorSetup.cpp \ QtBiomeVisualiser.cpp \ - QtChunk.cpp + QtChunk.cpp \ + RegionCache.cpp \ + Region.cpp \ + ChunkSource.cpp \ + RegionLoader.cpp HEADERS += MainWindow.h \ Globals.h \ @@ -64,9 +65,6 @@ HEADERS += MainWindow.h \ ../../src/OSSupport/CriticalSection.h \ ../../src/OSSupport/IsThread.h \ ../../src/BiomeDef.h \ - ChunkCache.h \ - ChunkSource.h \ - ChunkLoader.h \ ../../src/StringCompression.h \ ../../src/WorldStorage/FastNBT.h \ ../../lib/zlib/crc32.h \ @@ -81,7 +79,11 @@ HEADERS += MainWindow.h \ ../../lib/zlib/zlib.h \ ../../lib/zlib/zutil.h \ GeneratorSetup.h \ - QtChunk.h + QtChunk.h \ + RegionCache.h \ + Region.h \ + ChunkSource.h \ + RegionLoader.h INCLUDEPATH += $$_PRO_FILE_PWD_ \ $$_PRO_FILE_PWD_/../../lib \ diff --git a/Tools/QtBiomeVisualiser/Region.cpp b/Tools/QtBiomeVisualiser/Region.cpp new file mode 100644 index 000000000..d8a0a2f76 --- /dev/null +++ b/Tools/QtBiomeVisualiser/Region.cpp @@ -0,0 +1,72 @@ + +#include "Globals.h" +#include "Region.h" + + + + + +Region::Region() +{ +} + + + + + +Chunk & Region::getRelChunk(int a_RelChunkX, int a_RelChunkZ) +{ + ASSERT(a_RelChunkX >= 0); + ASSERT(a_RelChunkZ >= 0); + ASSERT(a_RelChunkX < 32); + ASSERT(a_RelChunkZ < 32); + + return m_Chunks[a_RelChunkX + a_RelChunkZ * 32]; +} + + + + + +int Region::getRelBiome(int a_RelBlockX, int a_RelBlockZ) +{ + ASSERT(a_RelBlockX >= 0); + ASSERT(a_RelBlockZ >= 0); + ASSERT(a_RelBlockX < 512); + ASSERT(a_RelBlockZ < 512); + + int chunkX = a_RelBlockX / 16; + int chunkZ = a_RelBlockZ / 16; + Chunk & chunk = m_Chunks[chunkX + 32 * chunkZ]; + if (chunk.isValid()) + { + return chunk.getBiome(a_RelBlockX - 16 * chunkX, a_RelBlockZ - 16 * chunkZ); + } + else + { + return biInvalidBiome; + } +} + + + + +void Region::blockToRegion(int a_BlockX, int a_BlockZ, int & a_RegionX, int & a_RegionZ) +{ + a_RegionX = static_cast(std::floor(static_cast(a_BlockX) / 512)); + a_RegionZ = static_cast(std::floor(static_cast(a_BlockZ) / 512)); +} + + + + + +void Region::chunkToRegion(int a_ChunkX, int a_ChunkZ, int & a_RegionX, int & a_RegionZ) +{ + a_RegionX = static_cast(std::floor(static_cast(a_ChunkX) / 32)); + a_RegionZ = static_cast(std::floor(static_cast(a_ChunkZ) / 32)); +} + + + + diff --git a/Tools/QtBiomeVisualiser/Region.h b/Tools/QtBiomeVisualiser/Region.h new file mode 100644 index 000000000..f1bef0c2d --- /dev/null +++ b/Tools/QtBiomeVisualiser/Region.h @@ -0,0 +1,44 @@ +#pragma once + +#include "QtChunk.h" + + + + + +class Region +{ +public: + Region(); + + /** Retrieves the chunk with the specified relative coords. */ + Chunk & getRelChunk(int a_RelChunkX, int a_RelChunkZ); + + /** Returns true iff the chunk data for all chunks has been loaded. + This doesn't mean that all the chunks are valid, only that the entire region has been processed and should + be displayed. */ + bool isValid(void) const { return m_IsValid; } + + /** Returns the biome in the block coords relative to this region. + Returns biInvalidBiome if the underlying chunk is not valid. */ + int getRelBiome(int a_RelBlockX, int a_RelBlockZ); + + /** Converts block coordinates into region coordinates. */ + static void blockToRegion(int a_BlockX, int a_BlockZ, int & a_RegionX, int & a_RegionZ); + + /** Converts chunk coordinates into region coordinates. */ + static void chunkToRegion(int a_ChunkX, int a_ChunkZ, int & a_RegionX, int & a_RegionZ); + +protected: + + Chunk m_Chunks[32 * 32]; + + /** True iff the data for all the chunks has been loaded. + This doesn't mean that all the chunks are valid, only that the entire region has been processed and should + be displayed. */ + bool m_IsValid; +}; + + + + diff --git a/Tools/QtBiomeVisualiser/RegionCache.cpp b/Tools/QtBiomeVisualiser/RegionCache.cpp new file mode 100644 index 000000000..e46fd222a --- /dev/null +++ b/Tools/QtBiomeVisualiser/RegionCache.cpp @@ -0,0 +1,138 @@ +#include "Globals.h" +#include "RegionCache.h" +#include +#include +#include "ChunkSource.h" +#include "RegionLoader.h" +#include "Region.h" + + + + + +RegionCache::RegionCache(QObject * parent) : + super(parent) +{ + m_Cache.setMaxCost(1024 * 1024 * 1024); // 1 GiB of memory for the cache +} + + + + + +RegionPtr RegionCache::fetch(int a_RegionX, int a_RegionZ) +{ + // Retrieve from the cache: + quint32 hash = getRegionHash(a_RegionX, a_RegionZ); + RegionPtr * res; + { + QMutexLocker lock(&m_Mtx); + res = m_Cache[hash]; + // If succesful and region loaded, return the retrieved value: + if ((res != nullptr) && (*res)->isValid()) + { + return *res; + } + } + + // If the region is in cache but not valid, it means it has been already queued for rendering, do nothing now: + if (res != nullptr) + { + return RegionPtr(nullptr); + } + + // There's no such item in the cache, create it now: + try + { + res = new RegionPtr(new Region); + } + catch (const std::bad_alloc &) + { + /* Allocation failed (32-bit process hit the 2 GiB barrier?) + This may happen even with the cache set to 1 GiB, because it contains shared ptrs and so they may be + held by another place in the code even when they are removed from cache. + */ + return RegionPtr(nullptr); + } + if (res == nullptr) + { + return RegionPtr(nullptr); + } + { + QMutexLocker lock(&m_Mtx); + m_Cache.insert(hash, res, sizeof(Region)); + } + + // Queue the region for rendering: + queueRegionRender(a_RegionX, a_RegionZ, *res); + + // Return failure, the region is not yet rendered: + return RegionPtr(nullptr); +} + + + + + +void RegionCache::setChunkSource(std::shared_ptr a_ChunkSource) +{ + // Replace the chunk source: + m_ChunkSource = a_ChunkSource; + + // Clear the cache: + QMutexLocker lock(&m_Mtx); + m_Cache.clear(); +} + + + + + +void RegionCache::reload() +{ + assert(m_ChunkSource.get() != nullptr); + + // Reload the chunk source: + m_ChunkSource->reload(); + + // Clear the cache: + QMutexLocker lock(&m_Mtx); + m_Cache.clear(); +} + + + + + +void RegionCache::gotRegion(int a_RegionX, int a_RegionZ) +{ + emit regionAvailable(a_RegionX, a_RegionZ); +} + + + + + +quint32 RegionCache::getRegionHash(int a_RegionX, int a_RegionZ) +{ + // Simply join the two coords into a single int + // The coords will never be larger than 16-bits, so we can do this safely + return (((static_cast(a_RegionX) & 0xffff) << 16) | (static_cast(a_RegionZ) & 0xffff)); +} + + + + + +void RegionCache::queueRegionRender(int a_RegionX, int a_RegionZ, RegionPtr & a_Region) +{ + // Create a new loader task: + RegionLoader * loader = new RegionLoader(a_RegionX, a_RegionZ, a_Region, m_ChunkSource); + connect(loader, SIGNAL(loaded(int, int)), this, SLOT(gotRegion(int, int))); + + QThreadPool::globalInstance()->start(loader); +} + + + + diff --git a/Tools/QtBiomeVisualiser/ChunkCache.h b/Tools/QtBiomeVisualiser/RegionCache.h similarity index 50% rename from Tools/QtBiomeVisualiser/ChunkCache.h rename to Tools/QtBiomeVisualiser/RegionCache.h index 8d198f02f..c343e4ba9 100644 --- a/Tools/QtBiomeVisualiser/ChunkCache.h +++ b/Tools/QtBiomeVisualiser/RegionCache.h @@ -9,8 +9,9 @@ -class Chunk; -typedef std::shared_ptr ChunkPtr; +// fwd: +class Region; +typedef std::shared_ptr RegionPtr; class ChunkSource; @@ -18,19 +19,19 @@ class ChunkSource; -/** Caches chunk data for reuse */ -class ChunkCache : +/** Caches regions' chunk data for reuse */ +class RegionCache : public QObject { typedef QObject super; Q_OBJECT public: - explicit ChunkCache(QObject * parent = NULL); + explicit RegionCache(QObject * parent = NULL); - /** Retrieves the specified chunk from the cache. - Only returns valid chunks; if the chunk is invalid, queues it for rendering and returns an empty ptr. */ - ChunkPtr fetch(int a_ChunkX, int a_ChunkZ); + /** Retrieves the specified region from the cache. + Only returns valid regions; if the region is invalid, queues it for rendering and returns an empty ptr. */ + RegionPtr fetch(int a_RegionX, int a_RegionZ); /** Replaces the chunk source used by the biome view to get the chunk biome data. The cache is then invalidated. */ @@ -43,16 +44,16 @@ public: void reload(); signals: - void chunkAvailable(int a_ChunkX, int a_ChunkZ); + void regionAvailable(int a_RegionX, int a_RegionZ); protected slots: - void gotChunk(int a_ChunkX, int a_ChunkZ); + void gotRegion(int a_RegionX, int a_RegionZ); protected: /** The cache of the chunks */ - QCache m_Cache; + QCache m_Cache; - /** Locks te cache against multithreaded access */ + /** Locks the cache against multithreaded access */ QMutex m_Mtx; /** The source used to get the biome data. */ @@ -60,10 +61,10 @@ protected: /** Returns the hash used by the chunk in the cache */ - quint32 getChunkHash(int a_ChunkX, int a_ChunkZ); + quint32 getRegionHash(int a_RegionX, int a_RegionZ); - /** Queues the specified chunk for rendering by m_ChunkSource. */ - void queueChunkRender(int a_ChunkX, int a_ChunkZ, ChunkPtr & a_Chunk); + /** Queues the specified region for rendering by m_RegionSource. */ + void queueRegionRender(int a_RegionX, int a_RegionZ, RegionPtr & a_Region); }; diff --git a/Tools/QtBiomeVisualiser/RegionLoader.cpp b/Tools/QtBiomeVisualiser/RegionLoader.cpp new file mode 100644 index 000000000..8c298da1e --- /dev/null +++ b/Tools/QtBiomeVisualiser/RegionLoader.cpp @@ -0,0 +1,37 @@ +#include "Globals.h" +#include "RegionLoader.h" +#include "ChunkSource.h" +#include "Region.h" + + + + + +RegionLoader::RegionLoader(int a_RegionX, int a_RegionZ, RegionPtr a_Region, ChunkSourcePtr a_ChunkSource) : + m_RegionX(a_RegionX), + m_RegionZ(a_RegionZ), + m_Region(a_Region), + m_ChunkSource(a_ChunkSource) +{ +} + + + + + +void RegionLoader::run() +{ + // Load all the chunks in this region: + for (int z = 0; z < 32; z++) + { + for (int x = 0; x < 32; x++) + { + m_ChunkSource->getChunkBiomes(m_RegionX * 32 + x, m_RegionZ * 32 + z, m_Region->getRelChunk(x, z)); + } + } + emit loaded(m_RegionX, m_RegionZ); +} + + + + diff --git a/Tools/QtBiomeVisualiser/RegionLoader.h b/Tools/QtBiomeVisualiser/RegionLoader.h new file mode 100644 index 000000000..5a993f5ca --- /dev/null +++ b/Tools/QtBiomeVisualiser/RegionLoader.h @@ -0,0 +1,50 @@ +#pragma once + +#include +#include +#include + + + + +// fwd: +class Region; +typedef std::shared_ptr RegionPtr; + +class ChunkSource; +typedef std::shared_ptr ChunkSourcePtr; + + + + + +class RegionLoader : + public QObject, + public QRunnable +{ + Q_OBJECT + +public: + RegionLoader(int a_RegionX, int a_RegionZ, RegionPtr a_Region, ChunkSourcePtr a_ChunkSource); + virtual ~RegionLoader() {} + +signals: + void loaded(int a_RegionX, int a_RegionZ); + +protected: + virtual void run() override; + +private: + /** Coords of the region to be loaded. */ + int m_RegionX, m_RegionZ; + + /** The region to be loaded. */ + RegionPtr m_Region; + + /** The chunk source to be used for individual chunks within the region. */ + ChunkSourcePtr m_ChunkSource; +}; + + + + From c0c1a9ceea0a2231f7365c47cda933dcc18a44ed Mon Sep 17 00:00:00 2001 From: Arian Date: Tue, 28 Oct 2014 00:08:29 +0100 Subject: [PATCH 052/145] Update template.lua --- MCServer/webadmin/template.lua | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/MCServer/webadmin/template.lua b/MCServer/webadmin/template.lua index fc0d8837a..b3c84dee2 100644 --- a/MCServer/webadmin/template.lua +++ b/MCServer/webadmin/template.lua @@ -23,11 +23,30 @@ end function GetDefaultPage() local PM = cRoot:Get():GetPluginManager() - local SubTitle = "Home" + local SubTitle = "Current Game" local Content = "" - Content = Content .. "

Home Home Home

    I have no idea what this content should do.
" + Content = Content .. "

Server Name:

" + Content = Content .. "

" .. cRoot:Get():GetServer():GetServerID() .. "

" + Content = Content .. "

Plugins:

    " + local AllPlugins = PM:GetAllPlugins() + for key,value in pairs(AllPlugins) do + if( value ~= nil and value ~= false ) then + Content = Content .. "
  • " .. key .. " (version " .. value:GetVersion() .. ")
  • " + end + end + + Content = Content .. "
" + Content = Content .. "

Players:

    " + + local AddPlayerToTable = function( Player ) + Content = Content .. "
  • " .. Player:GetName() .. "
  • " + end + cRoot:Get():ForEachPlayer( AddPlayerToTable ) + + Content = Content .. "

"; + return Content, SubTitle end From 53ff5c527c154348608f9ab9559bf67064c8ed2a Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 28 Oct 2014 11:23:54 +0100 Subject: [PATCH 053/145] QtBiomeVisualiser: Attempt at fixing Linux compilation. --- Tools/QtBiomeVisualiser/ChunkSource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/QtBiomeVisualiser/ChunkSource.cpp b/Tools/QtBiomeVisualiser/ChunkSource.cpp index c6d50b2e0..d9660b886 100644 --- a/Tools/QtBiomeVisualiser/ChunkSource.cpp +++ b/Tools/QtBiomeVisualiser/ChunkSource.cpp @@ -260,7 +260,7 @@ AnvilSource::AnvilFilePtr AnvilSource::getAnvilFile(int a_ChunkX, int a_ChunkZ) // Search the cache for the file: QMutexLocker lock(&m_Mtx); - for (auto itr = m_Files.cbegin(), end = m_Files.cend(); itr != end; ++itr) + for (auto itr = m_Files.begin(), end = m_Files.end(); itr != end; ++itr) { if (((*itr)->m_RegionX == RegionX) && ((*itr)->m_RegionZ == RegionZ)) { From d6c663cbc508859b36543797a7ebbee52a27dc6a Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 28 Oct 2014 15:44:58 +0100 Subject: [PATCH 054/145] QtBiomeVisualiser: Fixed compilation on Linux. --- Tools/QtBiomeVisualiser/ChunkCache.cpp | 6 +++--- Tools/QtBiomeVisualiser/ChunkLoader.h | 9 +++++++++ Tools/QtBiomeVisualiser/ChunkSource.cpp | 2 +- Tools/QtBiomeVisualiser/ChunkSource.h | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Tools/QtBiomeVisualiser/ChunkCache.cpp b/Tools/QtBiomeVisualiser/ChunkCache.cpp index 05c267d30..bd8ade304 100644 --- a/Tools/QtBiomeVisualiser/ChunkCache.cpp +++ b/Tools/QtBiomeVisualiser/ChunkCache.cpp @@ -37,14 +37,14 @@ ChunkPtr ChunkCache::fetch(int a_ChunkX, int a_ChunkZ) // If the chunk is in cache but not valid, it means it has been already queued for rendering, do nothing now: if (res != nullptr) { - return ChunkPtr(nullptr); + return ChunkPtr(); } // There's no such item in the cache, create it now: res = new ChunkPtr(new Chunk); if (res == nullptr) { - return ChunkPtr(nullptr); + return ChunkPtr(); } { QMutexLocker lock(&m_Mtx); @@ -55,7 +55,7 @@ ChunkPtr ChunkCache::fetch(int a_ChunkX, int a_ChunkZ) queueChunkRender(a_ChunkX, a_ChunkZ, *res); // Return failure, the chunk is not yet rendered: - return ChunkPtr(nullptr); + return ChunkPtr(); } diff --git a/Tools/QtBiomeVisualiser/ChunkLoader.h b/Tools/QtBiomeVisualiser/ChunkLoader.h index 4d026a45e..e6eb80cbf 100644 --- a/Tools/QtBiomeVisualiser/ChunkLoader.h +++ b/Tools/QtBiomeVisualiser/ChunkLoader.h @@ -7,6 +7,15 @@ +#if (!defined(_MSC_VER) && (__cplusplus < 201103L)) + // GCC in non-c++11 mode doesn't have the "override" keyword + #define override +#endif + + + + + // fwd: class Chunk; typedef std::shared_ptr ChunkPtr; diff --git a/Tools/QtBiomeVisualiser/ChunkSource.cpp b/Tools/QtBiomeVisualiser/ChunkSource.cpp index c5cde1c3b..c3e29c0a2 100644 --- a/Tools/QtBiomeVisualiser/ChunkSource.cpp +++ b/Tools/QtBiomeVisualiser/ChunkSource.cpp @@ -260,7 +260,7 @@ AnvilSource::AnvilFilePtr AnvilSource::getAnvilFile(int a_ChunkX, int a_ChunkZ) // Search the cache for the file: QMutexLocker lock(&m_Mtx); - for (auto itr = m_Files.cbegin(), end = m_Files.cend(); itr != end; ++itr) + for (auto itr = m_Files.begin(), end = m_Files.end(); itr != end; ++itr) { if (((*itr)->m_RegionX == RegionX) && ((*itr)->m_RegionZ == RegionZ)) { diff --git a/Tools/QtBiomeVisualiser/ChunkSource.h b/Tools/QtBiomeVisualiser/ChunkSource.h index 5332c5d3f..65b2c3449 100644 --- a/Tools/QtBiomeVisualiser/ChunkSource.h +++ b/Tools/QtBiomeVisualiser/ChunkSource.h @@ -10,7 +10,7 @@ // fwd: class cBiomeGen; -typedef std::shared_ptr cBiomeGenPtr; +typedef SharedPtr cBiomeGenPtr; class cIniFile; typedef std::shared_ptr cIniFilePtr; From 3f3a2a6755460e4f0d976deee9f067969edbfdd2 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 28 Oct 2014 20:49:29 +0100 Subject: [PATCH 055/145] QtBiomeVisualiser: Fixed random regions not rendered. --- Tools/QtBiomeVisualiser/Region.h | 2 ++ Tools/QtBiomeVisualiser/RegionLoader.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Tools/QtBiomeVisualiser/Region.h b/Tools/QtBiomeVisualiser/Region.h index f1bef0c2d..863c0ac02 100644 --- a/Tools/QtBiomeVisualiser/Region.h +++ b/Tools/QtBiomeVisualiser/Region.h @@ -30,6 +30,8 @@ public: static void chunkToRegion(int a_ChunkX, int a_ChunkZ, int & a_RegionX, int & a_RegionZ); protected: + friend class RegionLoader; + Chunk m_Chunks[32 * 32]; diff --git a/Tools/QtBiomeVisualiser/RegionLoader.cpp b/Tools/QtBiomeVisualiser/RegionLoader.cpp index 8c298da1e..771c1bbac 100644 --- a/Tools/QtBiomeVisualiser/RegionLoader.cpp +++ b/Tools/QtBiomeVisualiser/RegionLoader.cpp @@ -29,6 +29,8 @@ void RegionLoader::run() m_ChunkSource->getChunkBiomes(m_RegionX * 32 + x, m_RegionZ * 32 + z, m_Region->getRelChunk(x, z)); } } + m_Region->m_IsValid = true; + emit loaded(m_RegionX, m_RegionZ); } From bea2edb2a9b3b3db6fd734f4e53a4d60eebc3272 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 28 Oct 2014 20:52:04 +0100 Subject: [PATCH 056/145] QtBiomeVisualiser: Reduced memory usage. --- Tools/QtBiomeVisualiser/BiomeView.cpp | 158 ++++++++++++++++++++++--- Tools/QtBiomeVisualiser/BiomeView.h | 3 + Tools/QtBiomeVisualiser/QtChunk.cpp | 159 +------------------------- Tools/QtBiomeVisualiser/QtChunk.h | 18 +-- 4 files changed, 156 insertions(+), 182 deletions(-) diff --git a/Tools/QtBiomeVisualiser/BiomeView.cpp b/Tools/QtBiomeVisualiser/BiomeView.cpp index fef2b0afd..c77b39482 100644 --- a/Tools/QtBiomeVisualiser/BiomeView.cpp +++ b/Tools/QtBiomeVisualiser/BiomeView.cpp @@ -14,6 +14,116 @@ static const int DELTA_STEP = 120; // The normal per-notch wheel delta +/** Map for converting biome values to colors. Initialized from biomeColors[]. */ +static uchar biomeToColor[256 * 4]; + +/** Map for converting biome values to colors. Used to initialize biomeToColor[].*/ +static struct +{ + EMCSBiome m_Biome; + uchar m_Color[3]; +} biomeColors[] = +{ + { biOcean, { 0x00, 0x00, 0x70 }, }, + { biPlains, { 0x8d, 0xb3, 0x60 }, }, + { biDesert, { 0xfa, 0x94, 0x18 }, }, + { biExtremeHills, { 0x60, 0x60, 0x60 }, }, + { biForest, { 0x05, 0x66, 0x21 }, }, + { biTaiga, { 0x0b, 0x66, 0x59 }, }, + { biSwampland, { 0x2f, 0xff, 0xda }, }, + { biRiver, { 0x30, 0x30, 0xaf }, }, + { biHell, { 0x7f, 0x00, 0x00 }, }, + { biSky, { 0x00, 0x7f, 0xff }, }, + { biFrozenOcean, { 0xa0, 0xa0, 0xdf }, }, + { biFrozenRiver, { 0xa0, 0xa0, 0xff }, }, + { biIcePlains, { 0xff, 0xff, 0xff }, }, + { biIceMountains, { 0xa0, 0xa0, 0xa0 }, }, + { biMushroomIsland, { 0xff, 0x00, 0xff }, }, + { biMushroomShore, { 0xa0, 0x00, 0xff }, }, + { biBeach, { 0xfa, 0xde, 0x55 }, }, + { biDesertHills, { 0xd2, 0x5f, 0x12 }, }, + { biForestHills, { 0x22, 0x55, 0x1c }, }, + { biTaigaHills, { 0x16, 0x39, 0x33 }, }, + { biExtremeHillsEdge, { 0x7f, 0x8f, 0x7f }, }, + { biJungle, { 0x53, 0x7b, 0x09 }, }, + { biJungleHills, { 0x2c, 0x42, 0x05 }, }, + + { biJungleEdge, { 0x62, 0x8b, 0x17 }, }, + { biDeepOcean, { 0x00, 0x00, 0x30 }, }, + { biStoneBeach, { 0xa2, 0xa2, 0x84 }, }, + { biColdBeach, { 0xfa, 0xf0, 0xc0 }, }, + { biBirchForest, { 0x30, 0x74, 0x44 }, }, + { biBirchForestHills, { 0x1f, 0x5f, 0x32 }, }, + { biRoofedForest, { 0x40, 0x51, 0x1a }, }, + { biColdTaiga, { 0x31, 0x55, 0x4a }, }, + { biColdTaigaHills, { 0x59, 0x7d, 0x72 }, }, + { biMegaTaiga, { 0x59, 0x66, 0x51 }, }, + { biMegaTaigaHills, { 0x59, 0x66, 0x59 }, }, + { biExtremeHillsPlus, { 0x50, 0x70, 0x50 }, }, + { biSavanna, { 0xbd, 0xb2, 0x5f }, }, + { biSavannaPlateau, { 0xa7, 0x9d, 0x64 }, }, + { biMesa, { 0xd9, 0x45, 0x15 }, }, + { biMesaPlateauF, { 0xb0, 0x97, 0x65 }, }, + { biMesaPlateau, { 0xca, 0x8c, 0x65 }, }, + + // M variants: + { biSunflowerPlains, { 0xb5, 0xdb, 0x88 }, }, + { biDesertM, { 0xff, 0xbc, 0x40 }, }, + { biExtremeHillsM, { 0x88, 0x88, 0x88 }, }, + { biFlowerForest, { 0x2d, 0x8e, 0x49 }, }, + { biTaigaM, { 0x33, 0x8e, 0x81 }, }, + { biSwamplandM, { 0x07, 0xf9, 0xb2 }, }, + { biIcePlainsSpikes, { 0xb4, 0xdc, 0xdc }, }, + { biJungleM, { 0x7b, 0xa3, 0x31 }, }, + { biJungleEdgeM, { 0x62, 0x8b, 0x17 }, }, + { biBirchForestM, { 0x58, 0x9c, 0x6c }, }, + { biBirchForestHillsM, { 0x47, 0x87, 0x5a }, }, + { biRoofedForestM, { 0x68, 0x79, 0x42 }, }, + { biColdTaigaM, { 0x24, 0x3f, 0x36 }, }, + { biMegaSpruceTaiga, { 0x45, 0x4f, 0x3e }, }, + { biMegaSpruceTaigaHills, { 0x45, 0x4f, 0x4e }, }, + { biExtremeHillsPlusM, { 0x78, 0x98, 0x78 }, }, + { biSavannaM, { 0xe5, 0xda, 0x87 }, }, + { biSavannaPlateauM, { 0xa7, 0x9d, 0x74 }, }, + { biMesaBryce, { 0xff, 0x6d, 0x3d }, }, + { biMesaPlateauFM, { 0xd8, 0xbf, 0x8d }, }, + { biMesaPlateauM, { 0xf2, 0xb4, 0x8d }, }, +} ; + + + + + +static class BiomeColorsInitializer +{ +public: + BiomeColorsInitializer(void) + { + // Reset all colors to gray: + for (size_t i = 0; i < ARRAYCOUNT(biomeToColor); i++) + { + biomeToColor[i] = 0x7f; + } + + // Set known biomes to their colors: + for (size_t i = 0; i < ARRAYCOUNT(biomeColors); i++) + { + uchar * color = &biomeToColor[4 * biomeColors[i].m_Biome]; + color[0] = biomeColors[i].m_Color[2]; + color[1] = biomeColors[i].m_Color[1]; + color[2] = biomeColors[i].m_Color[0]; + color[3] = 0xff; + } + } +} biomeColorInitializer; + + + + + +//////////////////////////////////////////////////////////////////////////////// +// BiomeView: + BiomeView::BiomeView(QWidget * parent) : super(parent), m_X(0), @@ -203,11 +313,10 @@ void BiomeView::drawChunk(int a_ChunkX, int a_ChunkZ) centerx += (a_ChunkX - centerchunkx) * chunksize; centery += (a_ChunkZ - centerchunkz) * chunksize; - int srcoffset = 0; uchar * bits = m_Image.bits(); int imgstride = m_Image.bytesPerLine(); - int skipx = 0,skipy = 0; + int skipx = 0, skipy = 0; int blockwidth = chunksize, blockheight = chunksize; // now if we're off the screen we need to crop if (centerx < 0) @@ -236,7 +345,7 @@ void BiomeView::drawChunk(int a_ChunkX, int a_ChunkZ) int imgoffset = centerx * 4 + centery * imgstride; // If the chunk is valid, use its data; otherwise use the empty placeholder: - const uchar * src = m_EmptyChunkImage; + const short * src = m_EmptyChunkBiomes; if (region.get() != nullptr) { int relChunkX = a_ChunkX - regionX * 32; @@ -244,27 +353,44 @@ void BiomeView::drawChunk(int a_ChunkX, int a_ChunkZ) Chunk & chunk = region->getRelChunk(relChunkX, relChunkZ); if (chunk.isValid()) { - src = chunk.getImage(); + src = chunk.getBiomes(); } } - // Blit or scale-blit the image: + // Scale-blit the image: for (int z = skipy; z < blockheight; z++, imgoffset += imgstride) { - srcoffset = floor((double)z / m_Zoom) * 16 * 4; - if (m_Zoom == 1.0) + size_t srcoffset = static_cast(std::floor((double)z / m_Zoom)) * 16; + int imgxoffset = imgoffset; + for (int x = skipx; x < blockwidth; x++) { - memcpy(bits + imgoffset, src + srcoffset + skipx * 4, (blockwidth - skipx) * 4); - } - else - { - int xofs = 0; - for (int x = skipx; x < blockwidth; x++, xofs +=4) + short biome = src[srcoffset + static_cast(std::floor((double)x / m_Zoom))]; + const uchar * color; + if (biome < 0) { - memcpy(bits + imgoffset + xofs, src + srcoffset + (int)floor((double)x / m_Zoom) * 4, 4); + static const uchar emptyBiome1[] = { 0x44, 0x44, 0x44, 0xff }; + static const uchar emptyBiome2[] = { 0x88, 0x88, 0x88, 0xff }; + color = ((x & 8) ^ (z & 8)) ? emptyBiome1 : emptyBiome2; } - } - } + else + { + if (biome * 4 >= ARRAYCOUNT(biomeToColor)) + { + static const uchar errorImage[] = { 0xff, 0x00, 0x00, 0xff }; + color = errorImage; + } + else + { + color = biomeToColor + biome * 4; + } + } + bits[imgxoffset] = color[0]; + bits[imgxoffset + 1] = color[1]; + bits[imgxoffset + 2] = color[2]; + bits[imgxoffset + 3] = color[3]; + imgxoffset += 4; + } // for x + } // for z } diff --git a/Tools/QtBiomeVisualiser/BiomeView.h b/Tools/QtBiomeVisualiser/BiomeView.h index 9901b8f24..cd9c7ead9 100644 --- a/Tools/QtBiomeVisualiser/BiomeView.h +++ b/Tools/QtBiomeVisualiser/BiomeView.h @@ -79,6 +79,9 @@ protected: /** Data used for rendering a chunk that hasn't been loaded yet */ uchar m_EmptyChunkImage[16 * 16 * 4]; + /** Data placeholder for chunks that aren't valid. */ + short m_EmptyChunkBiomes[16 * 16]; + /** Draws the specified chunk into m_Image */ void drawChunk(int a_ChunkX, int a_ChunkZ); diff --git a/Tools/QtBiomeVisualiser/QtChunk.cpp b/Tools/QtBiomeVisualiser/QtChunk.cpp index 031aa3654..f201ef220 100644 --- a/Tools/QtBiomeVisualiser/QtChunk.cpp +++ b/Tools/QtBiomeVisualiser/QtChunk.cpp @@ -5,138 +5,6 @@ -/** Map for converting biome values to colors. Initialized from biomeColors[]. */ -static uchar biomeToColor[256 * 4]; - -/** Map for converting biome values to colors. Used to initialize biomeToColor[].*/ -static struct -{ - EMCSBiome m_Biome; - uchar m_Color[3]; -} biomeColors[] = -{ - { biOcean, { 0x00, 0x00, 0x70 }, }, - { biPlains, { 0x8d, 0xb3, 0x60 }, }, - { biDesert, { 0xfa, 0x94, 0x18 }, }, - { biExtremeHills, { 0x60, 0x60, 0x60 }, }, - { biForest, { 0x05, 0x66, 0x21 }, }, - { biTaiga, { 0x0b, 0x66, 0x59 }, }, - { biSwampland, { 0x2f, 0xff, 0xda }, }, - { biRiver, { 0x30, 0x30, 0xaf }, }, - { biHell, { 0x7f, 0x00, 0x00 }, }, - { biSky, { 0x00, 0x7f, 0xff }, }, - { biFrozenOcean, { 0xa0, 0xa0, 0xdf }, }, - { biFrozenRiver, { 0xa0, 0xa0, 0xff }, }, - { biIcePlains, { 0xff, 0xff, 0xff }, }, - { biIceMountains, { 0xa0, 0xa0, 0xa0 }, }, - { biMushroomIsland, { 0xff, 0x00, 0xff }, }, - { biMushroomShore, { 0xa0, 0x00, 0xff }, }, - { biBeach, { 0xfa, 0xde, 0x55 }, }, - { biDesertHills, { 0xd2, 0x5f, 0x12 }, }, - { biForestHills, { 0x22, 0x55, 0x1c }, }, - { biTaigaHills, { 0x16, 0x39, 0x33 }, }, - { biExtremeHillsEdge, { 0x7f, 0x8f, 0x7f }, }, - { biJungle, { 0x53, 0x7b, 0x09 }, }, - { biJungleHills, { 0x2c, 0x42, 0x05 }, }, - - { biJungleEdge, { 0x62, 0x8b, 0x17 }, }, - { biDeepOcean, { 0x00, 0x00, 0x30 }, }, - { biStoneBeach, { 0xa2, 0xa2, 0x84 }, }, - { biColdBeach, { 0xfa, 0xf0, 0xc0 }, }, - { biBirchForest, { 0x30, 0x74, 0x44 }, }, - { biBirchForestHills, { 0x1f, 0x5f, 0x32 }, }, - { biRoofedForest, { 0x40, 0x51, 0x1a }, }, - { biColdTaiga, { 0x31, 0x55, 0x4a }, }, - { biColdTaigaHills, { 0x59, 0x7d, 0x72 }, }, - { biMegaTaiga, { 0x59, 0x66, 0x51 }, }, - { biMegaTaigaHills, { 0x59, 0x66, 0x59 }, }, - { biExtremeHillsPlus, { 0x50, 0x70, 0x50 }, }, - { biSavanna, { 0xbd, 0xb2, 0x5f }, }, - { biSavannaPlateau, { 0xa7, 0x9d, 0x64 }, }, - { biMesa, { 0xd9, 0x45, 0x15 }, }, - { biMesaPlateauF, { 0xb0, 0x97, 0x65 }, }, - { biMesaPlateau, { 0xca, 0x8c, 0x65 }, }, - - // M variants: - { biSunflowerPlains, { 0xb5, 0xdb, 0x88 }, }, - { biDesertM, { 0xff, 0xbc, 0x40 }, }, - { biExtremeHillsM, { 0x88, 0x88, 0x88 }, }, - { biFlowerForest, { 0x2d, 0x8e, 0x49 }, }, - { biTaigaM, { 0x33, 0x8e, 0x81 }, }, - { biSwamplandM, { 0x07, 0xf9, 0xb2 }, }, - { biIcePlainsSpikes, { 0xb4, 0xdc, 0xdc }, }, - { biJungleM, { 0x7b, 0xa3, 0x31 }, }, - { biJungleEdgeM, { 0x62, 0x8b, 0x17 }, }, - { biBirchForestM, { 0x58, 0x9c, 0x6c }, }, - { biBirchForestHillsM, { 0x47, 0x87, 0x5a }, }, - { biRoofedForestM, { 0x68, 0x79, 0x42 }, }, - { biColdTaigaM, { 0x24, 0x3f, 0x36 }, }, - { biMegaSpruceTaiga, { 0x45, 0x4f, 0x3e }, }, - { biMegaSpruceTaigaHills, { 0x45, 0x4f, 0x4e }, }, - { biExtremeHillsPlusM, { 0x78, 0x98, 0x78 }, }, - { biSavannaM, { 0xe5, 0xda, 0x87 }, }, - { biSavannaPlateauM, { 0xa7, 0x9d, 0x74 }, }, - { biMesaBryce, { 0xff, 0x6d, 0x3d }, }, - { biMesaPlateauFM, { 0xd8, 0xbf, 0x8d }, }, - { biMesaPlateauM, { 0xf2, 0xb4, 0x8d }, }, -} ; - - - - - -static class BiomeColorsInitializer -{ -public: - BiomeColorsInitializer(void) - { - // Reset all colors to gray: - for (size_t i = 0; i < ARRAYCOUNT(biomeToColor); i++) - { - biomeToColor[i] = 0x7f; - } - - // Set known biomes to their colors: - for (size_t i = 0; i < ARRAYCOUNT(biomeColors); i++) - { - uchar * color = &biomeToColor[4 * biomeColors[i].m_Biome]; - color[0] = biomeColors[i].m_Color[2]; - color[1] = biomeColors[i].m_Color[1]; - color[2] = biomeColors[i].m_Color[0]; - color[3] = 0xff; - } - } -} biomeColorInitializer; - - - - - -/** Converts biomes in an array into the chunk image data. */ -static void biomesToImage(const cChunkDef::BiomeMap & a_Biomes, Chunk::Image & a_Image) -{ - // Make sure the two arrays are of the same size, compile-time. - // Note that a_Image is actually 4 items per pixel, so the array is 4 times bigger: - static const char Check1[4 * ARRAYCOUNT(a_Biomes) - ARRAYCOUNT(a_Image) + 1] = {}; - static const char Check2[ARRAYCOUNT(a_Image) - 4 * ARRAYCOUNT(a_Biomes) + 1] = {}; - - // Convert the biomes into color: - for (size_t i = 0; i < ARRAYCOUNT(a_Biomes); i++) - { - a_Image[4 * i + 0] = biomeToColor[4 * a_Biomes[i] + 0]; - a_Image[4 * i + 1] = biomeToColor[4 * a_Biomes[i] + 1]; - a_Image[4 * i + 2] = biomeToColor[4 * a_Biomes[i] + 2]; - a_Image[4 * i + 3] = biomeToColor[4 * a_Biomes[i] + 3]; - } -} - - - - - -//////////////////////////////////////////////////////////////////////////////// -// Chunk: - Chunk::Chunk() : m_IsValid(false) { @@ -146,20 +14,12 @@ Chunk::Chunk() : -const uchar * Chunk::getImage(void) const -{ - ASSERT(m_IsValid); - return m_Image; -} - - - - - void Chunk::setBiomes(const cChunkDef::BiomeMap & a_Biomes) { - memcpy(m_Biomes, a_Biomes, sizeof(m_Biomes)); - renderBiomes(); + for (size_t idx = 0; idx < ARRAYCOUNT(a_Biomes); ++idx) + { + m_Biomes[idx] = static_cast(a_Biomes[idx]); + } m_IsValid = true; } @@ -173,16 +33,7 @@ EMCSBiome Chunk::getBiome(int a_RelX, int a_RelZ) { return biInvalidBiome; } - return cChunkDef::GetBiome(m_Biomes, a_RelX, a_RelZ); -} - - - - - -void Chunk::renderBiomes() -{ - biomesToImage(m_Biomes, m_Image); + return static_cast(m_Biomes[a_RelX + 16 * a_RelZ]); } diff --git a/Tools/QtBiomeVisualiser/QtChunk.h b/Tools/QtBiomeVisualiser/QtChunk.h index 74321577a..d806d18bb 100644 --- a/Tools/QtBiomeVisualiser/QtChunk.h +++ b/Tools/QtBiomeVisualiser/QtChunk.h @@ -18,9 +18,6 @@ public: /** Returns true iff the chunk data is valid - loaded or generated. */ bool isValid(void) const { return m_IsValid; } - /** Returns the image of the chunk's biomes. Assumes that the chunk is valid. */ - const uchar * getImage(void) const; - /** Sets the biomes to m_Biomes and renders them into m_Image. */ void setBiomes(const cChunkDef::BiomeMap & a_Biomes); @@ -28,19 +25,16 @@ public: Coords must be valid inside this chunk. */ EMCSBiome getBiome(int a_RelX, int a_RelZ); + /** Returns the raw biome data for this chunk. */ + const short * getBiomes(void) const { return m_Biomes; } + protected: /** Flag that specifies if the chunk data is valid - loaded or generated. */ bool m_IsValid; - /** Cached rendered image of this chunk's biomes. Updated in render(). */ - Image m_Image; - - /** Biomes comprising the chunk, in the X + 16 * Z ordering. */ - cChunkDef::BiomeMap m_Biomes; - - - /** Renders biomes from m_Biomes into m_Image. */ - void renderBiomes(); + /** Biomes comprising the chunk, in the X + 16 * Z ordering. + Typed as short to save on memory, converted automatically when needed. */ + short m_Biomes[16 * 16]; }; typedef std::shared_ptr ChunkPtr; From 373b139ed63bd8ed28962d0836ee6b6ababb3045 Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 28 Oct 2014 21:32:01 +0100 Subject: [PATCH 057/145] Forgotten m_SendChunksMediumPriority.empty() check. --- src/ChunkSender.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChunkSender.cpp b/src/ChunkSender.cpp index ef2be167b..83d82884e 100644 --- a/src/ChunkSender.cpp +++ b/src/ChunkSender.cpp @@ -184,7 +184,7 @@ void cChunkSender::Execute(void) while (!m_ShouldTerminate) { cCSLock Lock(m_CS); - while (m_ChunksReady.empty() && m_SendChunksLowPriority.empty() && m_SendChunksHighPriority.empty()) + while (m_ChunksReady.empty() && m_SendChunksLowPriority.empty() && m_SendChunksMediumPriority.empty() && m_SendChunksHighPriority.empty()) { int RemoveCount = m_RemoveCount; m_RemoveCount = 0; From 9b93cb647d763eaf76c679ba0c5061210c7b1c4d Mon Sep 17 00:00:00 2001 From: Arian Date: Tue, 28 Oct 2014 21:40:50 +0100 Subject: [PATCH 058/145] Update guest.html --- MCServer/webadmin/files/guest.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MCServer/webadmin/files/guest.html b/MCServer/webadmin/files/guest.html index 9a9fabfcb..7ae78a3f0 100644 --- a/MCServer/webadmin/files/guest.html +++ b/MCServer/webadmin/files/guest.html @@ -1,3 +1,2 @@ -Hello Admin, this is a welcome message.
-You will see this because you didn't change the guest welcome message.
-To change the welcome message go to file: files/guest.html and change it!. +Hello! Welcome to the MCServer WebAdmin.
+This is a default message, edit files/guest.html to add your own custom message. From 3f21c8bb24d106fa157ddc7af721b854e962d5f2 Mon Sep 17 00:00:00 2001 From: Arian Date: Tue, 28 Oct 2014 21:41:16 +0100 Subject: [PATCH 059/145] Update login.css --- MCServer/webadmin/files/login.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MCServer/webadmin/files/login.css b/MCServer/webadmin/files/login.css index 659837598..2d2a8e9e9 100644 --- a/MCServer/webadmin/files/login.css +++ b/MCServer/webadmin/files/login.css @@ -4,7 +4,7 @@ } body { - font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; + font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; -webkit-font-smoothing: antialiased; background: #fff url(header.png) repeat-x top left; width: 100%; From a9f2f2e6344c71b13a7292b9c9303b635fc2b848 Mon Sep 17 00:00:00 2001 From: Arian Date: Tue, 28 Oct 2014 21:41:56 +0100 Subject: [PATCH 060/145] Update login.css --- MCServer/webadmin/files/login.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MCServer/webadmin/files/login.css b/MCServer/webadmin/files/login.css index 2d2a8e9e9..5d87da4c5 100644 --- a/MCServer/webadmin/files/login.css +++ b/MCServer/webadmin/files/login.css @@ -22,7 +22,7 @@ a:visited { text-decoration: none; } -a:hover,a:active { +a:hover, a:active { color: #000; text-decoration: underline; } @@ -128,12 +128,12 @@ button:active { font-size: 11px; } -#footer .lower a:link,#footer .lower a:visited { +#footer .lower a:link, #footer .lower a:visited { color: #fff; font-weight: 700; } -#footer .lower a:hover,#footer .lower a:active { +#footer .lower a:hover, #footer .lower a:active { color: #fff; font-weight: 700; } @@ -179,7 +179,7 @@ tr td.trow2:last-child { border-radius: 7px; } -.thead,.rounded_top { +.thead, .rounded_top { -moz-border-radius-topleft: 6px; -moz-border-radius-topright: 6px; -webkit-border-top-left-radius: 6px; From a9b152956e9435889a6d9251c89f06274f9389a0 Mon Sep 17 00:00:00 2001 From: Arian Date: Tue, 28 Oct 2014 21:51:42 +0100 Subject: [PATCH 061/145] Update style.css --- MCServer/webadmin/files/style.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MCServer/webadmin/files/style.css b/MCServer/webadmin/files/style.css index c3f6849df..541cd389a 100644 --- a/MCServer/webadmin/files/style.css +++ b/MCServer/webadmin/files/style.css @@ -4,7 +4,7 @@ } body { - font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; + font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; -webkit-font-smoothing: antialiased; background: #fff; width: 100%; @@ -23,7 +23,7 @@ a:visited { text-decoration: none; } -a:hover,a:active { +a:hover, a:active { color: #000; text-decoration: underline; } @@ -168,11 +168,11 @@ h1 { top: expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px'); } -tr td.trow1:first-child,tr td.trow2:first-child { +tr td.trow1:first-child, tr td.trow2:first-child { border-left: 0; } -tr td.trow1:last-child,tr td.trow2:last-child { +tr td.trow1:last-child, tr td.trow2:last-child { border-right: 0; } From c105e6fa03e73d5f6684b6f5659f611c46278bac Mon Sep 17 00:00:00 2001 From: Arian Date: Tue, 28 Oct 2014 22:09:11 +0100 Subject: [PATCH 062/145] Update login_template.html --- MCServer/webadmin/login_template.html | 172 ++++++++++---------------- 1 file changed, 62 insertions(+), 110 deletions(-) diff --git a/MCServer/webadmin/login_template.html b/MCServer/webadmin/login_template.html index 4ab76b36b..a6a8dea44 100644 --- a/MCServer/webadmin/login_template.html +++ b/MCServer/webadmin/login_template.html @@ -1,118 +1,70 @@ /* Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 */ - + - - MCServer WebAdmin - Login - - - - + MCServer WebAdmin - Login + + + -
-
-
- -
-
-
-
-
-
-
- -
-
-
-
-
-
-
- - - - - - - - - -
-
- - MCServer WebAdmin - -
-
-
- -
-
-
-
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ + + + + + + + + +
+
MCServer WebAdmin
+
+
+ +
+
+
+
-