5429 Commits

Author SHA1 Message Date
UnknownShadow200
d912fe9942 Ensure that plugins are loaded in a consistent order 2022-08-19 19:18:07 +10:00
UnknownShadow200
4e9f9c754a add ImageSharp license 2022-08-18 21:28:27 +10:00
UnknownShadow200
09897986fa Allow changing default login/logout message 2022-08-17 22:22:21 +10:00
UnknownShadow200
522260da58 Use ImageSharp instead for image decoding/resizing in dotnet build 2022-08-16 17:12:23 +10:00
UnknownShadow200
e36b969243 Fix when running on mono with relevant System.Drawing package installed but libgdiplus missing, that doing /imgprint or /gen with heightmap theme would crash the server
An important background note is that finalisers are run even when constructors throw exceptions - https://stackoverflow.com/questions/188693/is-the-destructor-called-if-the-constructor-throws-an-exception

What happened was that
a) new Bitmap() was called to decode the byte array
b)  this would in turn call the static constructor of 'GDIPlus' class
c)  since libgdiplus could not be loaded, a DllNotFoundException would get thrown
d) a TypeInitializationException would get thrown because the 'GDIPlus' class failed to initialise

However, Bitmap implements a finaliser, which meant that a bit later on the background thread
e) ~Image() was called
f)  which in turn called Dispose(false)
g)   which in turn calls 'if (GDIPlus.GdiPlusToken != 0 ..'
h)    which in turn calls the static constructor of 'GDIPlus' class
i)      which in turn throws a DllNotFoundException since libgdiplus was not found
j)    which therefore throws a TypeInitializationException
k) ... which ends up being unhandled
l)   ... and therefore takes down the process due to the exception being unhandled

So, the solution is to switch to using Image.LoadStream instead - the difference here is that
 the first TypeInitializationException is thrown before an Image object is even created,
 therefore no Image object gets finalised, sidestepping the issue altogether
2022-08-15 22:50:38 +10:00
UnknownShadow200
13447112b6 Abstract all System.Drawing stuff in ImageUtils.cs, in preparation for #720 2022-08-15 20:07:56 +10:00
UnknownShadow200
36ba055f4d Fix when dotnet MCGalaxy build is started through dotnet process (e.g. 'dotnet MCGalaxyCLI_core.dll'), that /restart would fail to work
Also fix exporting BLOB values via /server backup table, would generate invalid SQL that could not be subsequently imported again with /server import table
2022-08-13 22:07:35 +10:00
UnknownShadow200
009b31734a DB: Simplify date parsing a bit and remove RawGetDateTime 2022-08-13 17:17:28 +10:00
UnknownShadow200
01fc519082 Make /server backup table work with double/blob columns 2022-08-13 15:27:13 +10:00
UnknownShadow200
9922eae316 SQlite: Optimise GetStringValues to simply call GetString
This also means BLOB columns produce meaningful values instead of just 'System.Byte[]'
2022-08-13 14:44:41 +10:00
UnknownShadow200
d316992307 Move RawGetDateTime from IDatabaseBackend to ISqlRecord instead 2022-08-13 12:55:13 +10:00
UnknownShadow200
08a4128bfd
Merge pull request #718 from UnknownShadow200/DBRewrite3v2
Rewrite SQL to avoid directly depending on System.Data
2022-08-10 21:42:28 +10:00
UnknownShadow200
5f16176ff3 Minorly optimise SQLite backend
Allocates less memory now
2022-08-09 19:26:22 +10:00
UnknownShadow200
9f35b57478 Move MySQL backend to new interfaces 2022-08-09 18:47:18 +10:00
UnknownShadow200
bad7d3443e Move SQLite backend to new interfaces 2022-08-09 18:43:42 +10:00
UnknownShadow200
81b1617ba1 Change rest of code to use new interfaces instead of System.Data 2022-08-09 18:21:18 +10:00
UnknownShadow200
ffbd4a0edd Add interfaces for SQL objects 2022-08-09 18:05:10 +10:00
UnknownShadow200
cc600079a7 Disable MySQL support in standalone build, move compiling support to also be behind standalone build define 2022-08-09 11:39:00 +10:00
UnknownShadow200
1fdc08353f Don't try to download sqlite DLLs on non-windows 2022-08-09 11:26:48 +10:00
UnknownShadow200
2f803e1770 CLI: Reset color instead of explicitly setting foreground color to white, to produce better output on terminals using non-dark colour themes 2022-08-08 23:39:26 +10:00
UnknownShadow200
d37eb29460 Fix in standalone build, /restart didn't work 2022-08-08 21:11:36 +10:00
UnknownShadow200
efd7bd0373 Move process restart to IOperatingSystem class 2022-08-08 20:17:10 +10:00
UnknownShadow200
23b3f9709b Fix on NetBSD that doing /sinfo shows IndexOutOfRangeException for all process CPU usage 2022-08-07 14:26:34 +10:00
UnknownShadow200
2541bad9be Move all cpu time methods to dedicated IOperatingSystem class 2022-08-07 13:26:31 +10:00
UnknownShadow200
a75ea460b2 Move OS detection code out of CmdServerInfo.cs and into Server.cs 2022-08-07 10:32:08 +10:00
UnknownShadow200
5a5eb4492b
Merge pull request #717 from UnknownShadow200/DBRewrite2
Simplify database iteration API to avoid object arg/return value
2022-08-06 15:38:42 +10:00
UnknownShadow200
29a1b06301 Fix old database migration bugs
In detail:
1) BlockDB upgrader didn't convert time from local to UTC, which meant that times in /b were e.g. 10 hours off
2) Zone migrator accidentally set minX/maxX to imported minZ/maxZ and left minZ/maxZ as 0. Bug introduced four years ago in f1a8544308094586a3a1b5d61cd96d03391ad448
2022-08-06 15:36:21 +10:00
UnknownShadow200
b776d685a6 Fix errors 2022-08-06 15:02:45 +10:00
UnknownShadow200
b53f02a1d9 minorly tidy up upnp code 2022-08-05 22:34:20 +10:00
UnknownShadow200
31716601fb Fix with server backup .zips, can't add/edit files using Windows built in zip archiver later 2022-08-05 08:04:02 +10:00
UnknownShadow200
559a244b9f Fix wrong license in LICENSE file (it's GPL3 not LGPL3) 2022-08-04 23:28:11 +10:00
UnknownShadow200
63ab7204b2 Try to preserve original file modification date in /server backup ZIPs, fixes #716 2022-08-03 20:08:52 +10:00
UnknownShadow200
52c1b89767 Support custom command categories in /help and /commands, also improve help of /commands (Thanks PlayerZ) 2022-08-02 22:15:05 +10:00
UnknownShadow200
9d50984215 Drop support for old password format, resolves #711
Note: The old password format was deprecated 18 months ago. Also, even if there are still some users/servers that haven't updated, all this will mean is that they have to set a password again, they won't be prevented from being able to verify their password
2022-08-01 22:55:56 +10:00
UnknownShadow200
c463e6751d Fix some https:// heartbeat URLs not working with ProtocolError 2022-07-30 10:36:56 +10:00
UnknownShadow200
21eb0800b8 ZS: Change infect messages to use <zombie>/<human> instead of {0}/{1}, and document that in /store for buying an infect message 2022-07-29 11:59:29 +10:00
UnknownShadow200
676144efc8 Simplify database iteration API to avoid object arg/return value 2022-07-26 12:02:47 +10:00
UnknownShadow200
84958c1563 Allow changing perbuild/pervisit of multiple levels at once by comma separating map names 2022-07-25 22:26:52 +10:00
UnknownShadow200
b8329b04b8 Don't show 'on line 0' in compiler error messages for compiler errors that don't relate to a line in the source code
E.g. trying to //reference a non-existent assembly dll
2022-07-23 17:26:18 +10:00
UnknownShadow200
eecb2d47f2 .NET core build no longer depends on CodeDom at all for compiling 2022-07-23 17:14:41 +10:00
UnknownShadow200
cadde3b0c4 Improve /pcreate C# example, and simplify ICompiler slightly since a full CompilerResults instance is not required 2022-07-23 13:57:07 +10:00
UnknownShadow200
de386a39c5 Simplify Roslyn C# compiler backend 2022-07-23 10:24:17 +10:00
UnknownShadow200
5d8289dd3f Custom commands GUI compiling now generates temp .dll path itself, instead of relying on CodeDomCompiler to generate it through 'GenerateInMemory' 2022-07-23 09:01:45 +10:00
UnknownShadow200
d182a3c496 Show 'Only IRC/Discord controllers are allowed to use in-game commands from IRC/Discord' when a non controller user attempts to run an in-game commands from IRC/Discord
Only shown at most once every minute to avoid spam
2022-07-22 19:46:37 +10:00
UnknownShadow200
b94b0eeace Release 1.9.4.2 1.9.4.2 2022-07-22 08:20:22 +10:00
UnknownShadow200
3cd44c8175 Change custom commands GUI and /compile help to use actual list of ICompilers instead of hardcoding for C#/VB 2022-07-21 23:17:59 +10:00
UnknownShadow200
71f21ef010 Add event for reporting a player (Thanks SpicyCombo) 2022-07-21 19:13:31 +10:00
UnknownShadow200
799cb97b47 Stop using cmdautoload.txt and just autoload all commands in extra/commands/dll folder 2022-07-20 22:25:08 +10:00
UnknownShadow200
15755bf646 Allow /punload ing plugins with spaces in their names 2022-07-20 22:13:39 +10:00
UnknownShadow200
1ba59f88f0 Move /pcreate into /cmdcreate to simplify implementation 2022-07-20 20:54:26 +10:00