summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-04-30Fix: GetPhysicalRamUsage on FreeBSD (UNIX) - webadmin display (#5213)Morritz1-0/+36
* Fix: GetPhysicalRamUsage on FreeBSD (UNIX) - webadmin display * fixed cast type * Fix: GetPhysicalRamUsage on FreeBSD - webadmin display / style and failing build fixes * added myself to contributors Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
2021-03-28Fix Windows XP to 7 compatibility (#5167)Tiger Wang1-1/+0
* Partially reverts 01a4e696b * Unify thread names - Remove use of GetThreadId API
2021-02-06Adds playerlist header and footer broadcasting (1.8-1.13)dImrich1-0/+12
2021-01-12Clarify cClientHandle, cPlayer ownership semanticsTiger Wang1-1/+1
+ A cPlayer, once created, has a strong pointer to the cClientHandle. The player ticks the clienthandle. If he finds the handle destroyed, he destroys himself in turn. Nothing else can kill the player. * The client handle has a pointer to the player. Once a player is created, the client handle never outlasts the player, nor does it manage the player's lifetime. The pointer is always safe to use after FinishAuthenticate, which is also the point where cProtocol is put into the Game state that allows player manipulation. + Entities are once again never lost by constructing a chunk when they try to move into one that doesn't exist. * Fixed a forgotten Super invocation in cPlayer::OnRemoveFromWorld. * Fix SaveToDisk usage in destructor by only saving things cPlayer owns, instead of accessing cWorld.
2020-12-18Warnings improvementsTiger Wang1-10/+21
* Turn off global-constructors warning. These are needed to implement cRoot signal handler functionality * Add Clang flags based on version lookup instead of a compile test. The CMake config process is single threaded and slow enough already * Reduced GetStackValue verbosity + Clarify EnchantmentLevel, StayCount, AlwaysTicked, ViewDistance signedness + Give SettingsRepositoryInterface a move constructor to simplify main.cpp code - Remove do {} while (false) construction in redstone handler
2020-10-09Include sys/select.h on non-glibc Linux platforms (#4977)Bart Ribbers1-0/+4
Otherwise fd_set will be unknown for example on Musl libc systems
2020-10-05Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963)peterbell101-12/+10
* Fix cmake not adding Werror on clang, and _lots_ of warnings * WIP: Build fixes * Cannot make intermediate blockhandler instance * Tiger's changes * Fix BitIndex check * Handle invalid NextState values in cMultiVersionProtocol Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-25Remove unused Temporary namespaceTiger Wang1-2/+0
2020-09-21Synchronously save chunks on server shutdown (#4900)Alexander Harkness1-0/+12
+ Synchronously save chunks on server shutdown. Fixes #4884
2020-09-05WriteConsoleInput can return FALSE when running as servicTiger Wang1-6/+2
2020-09-05Streamline startup sequenceTiger Wang1-200/+170
* Clean up cRoot & main * Move some OS-specifics into OSSupport
2020-08-01Replaced cpp14::make_unique<> with std::make_unique<>.Mattes D1-2/+2
2020-07-19Remove ProtocolPalettesTiger Wang1-43/+0
2020-07-18Delete duplicated status request handlersTiger Wang1-1/+1
Here we go again...
2020-07-181.13 items supportTiger Wang1-2/+0
+ Add 1.16 block and item definitions
2020-07-17cProtocolRecognizer goes on a diet (#4770)Tiger Wang1-1/+1
- Removed inheritance from cProtocol
2020-07-14cWorld * -> cWorld (#4771)Tiger Wang1-82/+59
* cWorld * -> cWorld
2020-07-14Introduce recipe book functionality (#4493)Tobias Wilken1-0/+2
* Introduce recipe book functionality The recipe book helps especially new players. Missing it gives the impression that cuberite is not as advanced as it is. The handling of the recipe book uses the following functions: - Unlock Recipes (https://wiki.vg/index.php?title=Protocol&oldid=14204#Unlock_Recipes) to make recipes available and show the notification for new recipes. Initialization is done on player login for known ones, the update is done when new items are discovered. - Craft Recipe Request (https://wiki.vg/index.php?title=Protocol&oldid=14204#Craft_Recipe_Request) when the user selects a recipe from the recipe book to fill the slots. Known recipes are initialized on player login via `Unlock Recipes` with `Action` 0. As soon as a new recipe is discovered this is added via `Unlock Recipes` with `Action` 1. To be able to know and recognize new recipes the player class is extended with `KnownItems` and `KnownRecipes`. As soon as a player touches an item this is compared to the list of `KnownItems`, if the item is unknown the recipes are checked for this item and the other ingredients are checked with the list of `KnownItems`. If a full match is discovered the recipe is unlocked with the client and stored in the `KnownRecipes`. To unlock recipes the recipe ID is sent to the client. A mapping file (for protocol 1.12.2) translated the minecraft recipe names to ids. The crafting.txt is extended with and minecraft recipe names is possible. Limitations: Only a single recipe is added to the crafting area. Multiple clicks or shift click does not increase the number of builds. Co-authored-by: peterbell10 <peterbell10@live.co.uk> * Address first issues mentioned by @peterbell10 - Some linting - Extract loading of recipe specific protocol mapping into a function - Build `RecipeNameMap` only once - Use `std::optional` - Extract `LoadRecipe` from `Window` * Start to implement new suggestions * Update with suggestions from @peterbell10 * Some minor cleanup * Update protocol packet IDs * Remove unused include * Include header in cmake * Change a vector to integer counter * Change dromedaryCase method names to PascalCase * Address suggestions from @madmaxoft * Read Protocol subdirectories to load recipe books To load all recipebooks iterate over the `Protocol` subdirectories to find mapping files. Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-05-15Enable some more clang-tidy linter checks (#4738)peterbell101-9/+5
* Avoid inefficient AString -> c_str() -> AString round trip * Avoid redundant string init expressions * Avoid unnecessary return, continue, etc. * Add .clang-format to help with clang-tidy fix-its * Avoid unnecessary passing by value * Avoid unnecessary local copying * Avoid copying in range-for loops * Avoid over-complicated boolean expressions * Some violations missed by my local clang-tidy * Allow unnecessary continue statements * Add brackets * Another expression missed locally * Move BindingsProcessor call into clang-tidy.sh and add space * Fix pushd not found error * Different grouping of CheckBlockInteractionRate
2020-01-07Added temporary block type mapping for 1.13+ protocols.Mattes D1-17/+44
2020-01-07Root: Load the UpgradeBlockTypePalette on startup.Mattes D1-0/+19
2019-09-27Fixed MSVC warnings (#4400)Mattes D1-1/+1
2019-08-05Register vanilla blocks in BlockTypeRegistry.Mattes D1-0/+1
2018-05-06Use clang-tidy to check more code conventions (#4214)Bond-0091-1/+0
* Create clang-tidy.sh * Add clang-tidy to circle.yml * Fixed some naming violations Fixes #4164
2018-04-02Broadcast playerlist removal in every world (#4201)mathiascode1-0/+19
2018-01-03Add the fmt library (#4065)peterbell101-5/+5
* Replaces AppendVPrintf with fmt::sprintf * fmt::ArgList now used as a type safe alternative to varargs. * Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu. * Adds FLOG functions to log with fmt's native formatting style.
2017-12-21Fixed Clang 5.0 compile errors (#4085)bibo381-1/+1
* Fixed Clang 5.0 compile errors * Fixed wrong comment * Only disable warnings in Clang 5 or higher * Added a CMake condition for the Clang 5 no-zero-as-null-pointer-constant warning * Now using the use_nullptr branch of the Cuberite specific SQLiteCpp fork
2017-10-21cWorld: Move Initialization from Start to the constructor.peterbell101-10/+19
Start now does nothing more than launch the world's threads.
2017-09-19cRoot: Make PollPeriod representation 32 bit (#4030)peterbell101-3/+1
2017-09-19Removed UTF-8 BOM (#4033)Lukas Pioch1-1/+1
2017-09-14Fix error with implicit cast from long long to long (#4026)Alexander Harkness1-1/+1
2017-09-12Limit how long cRoot::InputThread may block (#4019)peterbell101-10/+26
Limit how long cRoot::InputThread may block Only calls `std::getline` when there is input available which removes the need to "notify" the input thread. Fixes #2494 and fixes #3177
2017-09-11Replace ItemCallbacks with lambdas (#3993)peterbell101-45/+25
2017-09-07Made world data paths adjustable, and added API to temporarily disable saving chunks to disk. (#3912)Lane Kolbly1-14/+34
2017-09-02Revert "Replace ItemCallbacks with lambdas (#3948)"LogicParrot1-25/+45
This reverts commit 496c337cdfa593654018c171f6a74c28272265b5.
2017-09-01Replace ItemCallbacks with lambdas (#3948)peterbell101-45/+25
2017-08-25Add cUUID class (#3871)peterbell101-2/+2
2017-06-03Add command line argument for disabling the logfileworktycho1-6/+11
2017-05-05Prevent infinite loop when logging fails (#3693)josh-parris1-0/+1
Prevent infinite loop when logging fails
2017-03-17Fixed looping when unable to bind port (#3621)johnsoch1-0/+7
Fixes #3593
2017-02-24Changed world_end to world_the_end #3531 (#3538)Bond-0091-11/+26
2017-02-22Add support for alternate config file locations (#3578)Gareth Nelson1-1/+7
2017-01-18DeadlockDetect now lists some tracked CS's stats.Mattes D1-7/+7
2017-01-03Disconnect sent flag addedsweetgiorni1-5/+6
Truthiness no longer assumed
2017-01-03Player checksweetgiorni1-4/+7
Checks if there are any players connected to the server before running PlayerCallback and waiting 1 second.
2017-01-03Api Documentationsweetgiorni1-1/+1
Added API documentation for GetShutdownMessage. Style fix in Root.cpp
2017-01-03Custom Disconnect Messagesweetgiorni1-0/+16
Adds a m_ShutdownMessage option to the settings. When the stop command is issued, players are kicked with said message before the server shuts down.
2017-01-01Fix crash after attempting to kill a non-running thread (#3504)Fabian Stein1-4/+7
Fixes #3221
2017-01-01Disabled anticheat (#3511)LogicParrot1-1/+2
2016-12-12Use CMake's Android generators to crosscompileTiger Wang1-12/+10
2016-11-18Removed ClientHandle.h dependencies from common headers.Mattes D1-13/+17
2016-11-06Anticheat fastbreak (#3411)mohe20151-0/+3
Added block hardness checks when breaking blocks.
2016-08-29Remove settings.ini world migration code (#3360)LogicParrot1-49/+0
2016-07-29Fix the error in #3270.Alexander Harkness1-1/+1
2016-07-21Tab completion across worlds (#3270)Alexander Harkness1-0/+30
Fixes #2563.
2016-06-18SelfTests: Removed the unneeded cSelfTests class.Mattes D1-6/+0
2016-04-19Auto clean bad world linkagesLogicParrot1-1/+1
2016-02-09Write to console when autofixing linkagesLogicParrot1-0/+1
2016-02-08Add DefaultWorld to newly generated INILogicParrot1-1/+2
2016-02-08remove cWorld::createAndInitializeWorldLogicParrot1-28/+1
2016-02-06Proper world linkages and dimension types for newly created world.ini'sLogicParrot1-1/+59
2016-02-05Prevent server from starting if there's bad world linkageLogicParrot1-3/+12
2016-02-04Fix unexpected world creation introduced by #2821LogicParrot1-1/+1
2016-01-28Front-end updateMathias1-1/+0
2016-01-21Fix running as a service.Anthony Birkett1-10/+3
Two problems identified, both traced to commit 4315a11 (main.cpp) ParseArguments() was no longer being called before checking cRoot::m_RunAsService. This led to m_RunAsService never being set (we use -d on the command line to instigate a service start). (Root.cpp) Terminate events were being ignored when running as a service. We only need to ignore the cin.good() call, not terminate events as a whole.
2016-01-12Fixed crash introduced by #2821LogicParrot1-29/+31
2016-01-06Fixed Clang warnings.Mattes D1-3/+3
2015-12-25Fix pre - #2815 default world linkage configsSafwat Halaby1-2/+48
2015-12-25Nether and End in settings.ini by default, and created at startupSafwat Halaby1-3/+17
2015-12-19Added HTTPS links wherever they are supported.Alexander Harkness1-4/+4
2015-11-03Implemented brewingLukas Pioch1-5/+3
2015-09-25Compile.sh namechange to cuberiteSafwat Halaby1-1/+1
2015-09-25Namechange to CuberiteMattes D1-1/+1
2015-09-15Increase robustness of the logging subsystemtycho1-9/+10
2015-08-27Include signal.h jointly for POSIX systemsMatti Hanninen1-5/+7
Otherwise, for example, FreeBSD the build fails due to SIGKILL not being around.
2015-08-22Cast UINT to WORD to appease warningTiger Wang1-6/+5
* Additional minor cleanups
2015-08-20Fixed and improved restartingTiger Wang1-130/+161
Restarts are now an actual, close-as-possible to application exit+reopen.
2015-08-12Fix old style casts and implicit conversionsMatti Hänninen1-2/+2
2015-07-29Silenced and fixed many warning messages across multiple files.Samuel Barney1-5/+5
2015-07-10Updated and submodularised JsonCPPTiger Wang1-0/+2
Conflicts: lib/jsoncpp
2015-06-14Fixed log files' timestampsTiger Wang1-1/+1
Also made Release mode log less technical information about the world storage threads.
2015-06-13Work on NetherPortalScanner. Setup portal scanner to reset PortalCooldown. Changed where player is spawned. Added a_InitSpawn flag to CreateAndInitializeWorld.Lane Kolbly1-2/+5
2015-06-12Fixed build error on LinuxAlexander Harkness1-1/+1
2015-06-11SelfTests are registered and executed after logging framework init.Mattes D1-3/+14
Fixes #2228.
2015-06-05Daemon support on Linux.Anthony Birkett1-1/+1
Added null console log listener, avoid printf() when stdout is closed.
2015-05-29Fix for the way connecting clients receive player lists and broadcast chatb33duck1-2/+17
2015-05-28Fixed the way connecting clients receive player lists and broadcast chat to worldsb33duck1-2/+8
2015-05-26Added method to get the uptime of the server in seconds. Implements #1650.Lukas Pioch1-16/+16
2015-05-16Move make_unique into a namespace to avoid ADL issuestycho1-2/+2
this prevents VS finding std::make_unique for constructors that take types from std
2015-05-16Initial implementation of IniFile overloadingtycho1-27/+30
2015-05-09CheckBasicStyle: checks spaces around * and &.Mattes D1-2/+2
2015-04-24Eliminate race condition in cRoot::FindAndDoWithPlayerworktycho1-4/+4
Avoid a race condition where a player gets deleted during the FindAndDoWithPlayer callback by moving the callback into DoWithPlayer.
2015-04-05Fixed crash on exit introduced with Windows Service capability.Mattes D1-20/+14
Ref.: #1845
2015-04-01Working as a Windows service. Starts and stops correctly.Anthony Birkett1-1/+11
Added "/service" switch, to prompt the binary to attempt starting as a service. Added service* methods, to control service startup. Split up main() into universalMain(), which contains the startup code for both service and normal start. Added cRoot::m_RunningAsService bool, Added cRoot::SetStopping(bool) to allow a stop request to be sent by the service controller. Added cBlockIDMap::init() to avoid loading items.ini before the working directory has been set.
2015-01-27Fixed server failure to open any port not aborting the server.Mattes D1-29/+35
2015-01-17Fixed CppCheck: (performance) Prefer prefix ++/-- operators for non-primitive types.Kirill Kirilenko1-1/+1
2014-12-23Init Mojang API pointerworktycho1-0/+1
Fixes CID 90583
2014-12-21Fixed crash on restartTiger Wang1-3/+12
2014-12-12Fixed print of milliseconds from chronoLukas Pioch1-1/+1
2014-12-09Fixed compiling.Howaner1-1/+1
2014-12-09Changed DoWithPlayer to auto instead of using iterator.Vincent1-2/+2
2014-12-08created callback in Root and changed CheckMultiLogin() to use the DoWithPlayer function at Root instead of World.Vincent1-1/+8
2014-12-08Fixed compile errorsVincent1-1/+1
2014-12-08Moved the check into a new function and just calls that function and a blank FindAndDoWithPlayer added.Vincent1-0/+9
2014-12-04Fixed trailing whitespace.Mattes D1-1/+1
2014-11-26cRoot: Fixed a memory leak with cRankManager.Mattes D1-1/+1
2014-11-12Fixed trailing whitespace.Mattes D1-1/+1
2014-11-05renamed FindAndDoWithUUID to DoWithPlayerByUUID, fixed style and comments, added description to APIDumpLukas Pioch1-2/+2
2014-11-02Added FindAndDoWithUUIDLukas Pioch1-0/+16
2014-10-24SuggestionsTiger Wang1-1/+1
2014-10-23Merged IniFile into main MCS sources.Mattes D1-3/+2
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-22/+22
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-20/+20
2014-10-20Migrated cSleep and cTimer to std::chronoTiger Wang1-9/+3
2014-10-19Migrated random generators to std::randomTiger Wang1-16/+6
2014-10-19Use std::threadTiger Wang1-10/+20
2014-10-18Fixed failure for cRankManager to restartTiger Wang1-1/+2
2014-10-17cMojangAPI: Don't update data if server is in offline mode.Mattes D1-2/+3
2014-09-27Dropped support for <1.7.xTiger Wang1-12/+0
2014-09-17Fixed minor style issues.madmaxoft1-2/+2
2014-09-10Added abilty to set build infoTycho1-0/+6
build info is displayed at startup Fixes #1410
2014-09-08capitalisation errorworktycho1-1/+1
2014-09-08derpworktycho1-1/+1
2014-09-08If server fails init, save any changed or generated settings.worktycho1-0/+1
2014-08-29Added new console command with cleanupTiger Wang1-11/+3
2014-08-21Removed cGroup and cGroupManager.Mattes D1-16/+0
2014-08-13RankMgr: Initial migration code.madmaxoft1-0/+1
2014-08-12Renamed LoggersTycho1-7/+7
2014-08-10First Implementatation of new Loggin frameworkTycho1-8/+18
2014-07-30Added a cMojangAPI class for PlayerName -> UUID lookups, with cache.madmaxoft1-0/+1
The cache is persisted into a SQLite DB file on server shutdown.
2014-07-27Add "Broadcasting" settings to world.iniHowaner1-2/+2
2014-07-22Speed improvements, crash fixes, & self-suggestionsTiger Wang1-2/+4
2014-07-21Style: Normalized to no spaces before closing parenthesis.madmaxoft1-12/+12
2014-07-21Style: Normalized spaces after if, for and while.madmaxoft1-3/+3
2014-07-20Bug and crash fixesTiger Wang1-2/+7
* Fixes end portals' solidity * Fixed crashes to do with multithreading and removing an entity from the wrong world * Fixed crashes due to bad merge * Fixed crashes due to an object being deleted twice * Simplified cWorld::Start() and added comments to configuration files
2014-07-20main.cpp: field style fixesarchshift1-4/+4
2014-07-19main.cpp: Fixed warnings with g_TERMINATE_EVENT_RAISED and g_SERVER_TERMINATEDarchshift1-2/+0
2014-07-17Fixed spaces around single-line comments.madmaxoft1-3/+3
There should be at least two spaces in front and one space after //-style comments.
2014-07-17Fixed basic whitespace problems.madmaxoft1-4/+4
Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
2014-07-16Store properties as Json::ValueTiger Wang1-1/+1
2014-07-14Player properties are now retrievedTiger Wang1-2/+2
2014-06-10Portal improvements and suggestionsTiger Wang1-3/+3
2014-05-31Implemented end and nether portalsTiger Wang1-8/+13
2014-05-09Fixed MSVC 64-bit build warnings.Mattes D1-8/+6
2014-05-08Fixed MSVC 64-bit build warnings.Mattes D1-8/+6
2014-04-13Added Yggdrasil Authentication Systemdaniel09161-2/+2
Code by Howaner. Fixes/Changes by me.
2014-03-29Fixed a minor ini key duplication bugTiger Wang1-0/+1
2014-03-12Added additional macros to support the MSVC size_t format and changed all formats to use the macrosTycho1-5/+5
2014-03-11Fixed more Format issuesTycho1-5/+5
2014-03-08Fixed issues with int vs size_t and a few other warningsTycho1-4/+2
2014-03-02cBlockInfo now manages the respective cBlockHandlerandrew1-1/+0
2014-02-21Unicode :-(Howaner1-1/+1
2014-02-21Add 'Group not found', when the Server load the users.ini and add auto generate from users.iniHowaner1-1/+3
2014-02-15Removed the unnecessary LoopPlayersAndBroadcastChat() functions.madmaxoft1-2/+2
2014-02-15Implemented cCompositeChat.madmaxoft1-1/+13
This allows plugins to send composite chat messages, containing URLs, commands to run and cmdline suggestions. Fixes #678.
2014-02-07Improved chat messaging functionsTiger Wang1-2/+2
* Moved string manipulation into cClientHandle and therefore... + Added configuration option for prefixes. * Cleaned up code. * Updated documentation for API.
2014-02-07WebAdmin is stopped properly on server shutdown / restart.madmaxoft1-5/+2
Fixes #272.
2014-02-07Fixed wiki link in auto-generated settings.ini.madmaxoft1-1/+2
2014-02-05Improvements:STRWarrior1-0/+9
Adds a function in cRoot that allows you to reload all the groups permissions. Note: Players don't automatically load their new permissions. You can use cPlayer::LoadPermissionsFromDisk for that.
2014-01-28Fixed timing on *nix.madmaxoft1-1/+1
2014-01-01Fixed GetPhysicalRAMUsage on Linuxandrew1-2/+2
2013-12-22Added many event catchersTiger Wang1-9/+25
* Window close * CTRL-C * etc.
2013-12-22merged in warnings changesTycho Bickerstaff1-1/+1
2013-12-21Root is now warnings cleanTycho Bickerstaff1-1/+1
2013-12-20Fixed the rest of constructor reorders.madmaxoft1-34/+38
2013-12-11HOOK_WORLD_STARTED now gets called when the CreateAndInitializeWorld function is used.STRWarrior1-0/+1
2013-12-11Added a HOOK_WORLD_STARTED hook and a cRoot::CreateAndInitializeWorld function for plugins.STRWarrior1-0/+18
2013-12-08Moved bindings-related to a Bindings subfolder.madmaxoft1-1/+1
Ref.: #407
2013-12-07Console trims its commands before executing 'emTiger Wang1-3/+3
2013-11-30DeadlockDetect is configurable now.madmaxoft1-4/+7
This is needed when debugging Lua plugins.
2013-11-27Fixed some of tiger's derpyness.Alexander Harkness1-1/+1
2013-11-26Hopefully fixed last of the Linux compile errorsTiger Wang1-1/+1
2013-11-24Attempt to fix compilationTiger Wang1-1/+1
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-22Added cRoot:GetFurnaceFuelBurnTime() to Lua API.madmaxoft1-0/+10
2013-11-15cRoot::SaveAllChunks() doesn't wait for the save (deadlocks).madmaxoft1-1/+1
Rather, it only queues the save task onto each world's tick thread.
2013-11-10Fixed cRoot::FindAndDoWithPlayer().madmaxoft1-2/+2
Now /kick and /ban work.
2013-11-07Added hardcore client effectTiger Wang1-1/+4
Also fixed multiple world comments issue.
2013-11-04Autogeneration of settings.ini and webadmin.iniTiger Wang1-3/+14
Fixes issue #75
2013-10-27Authenticator doesn't save the ini file.madmaxoft1-1/+2
Didn't load it -> shouldn't save it.
2013-10-26Changed "cIniFile IniFile" to cIniFile & IniFile"STRWarrior1-1/+1
2013-10-26Both the LoadWorlds() function and cAuthenticator now use the cIniFile object from the Root::Start() function.STRWarrior1-5/+3
2013-10-25cIniFile doesn't store filename internally anymore.madmaxoft1-4/+5
2013-10-18Fixed webadmin logging.madmaxoft1-3/+0
This fixes #262.
2013-10-08Implemented the two memory-statistics functions in cRoot.madmaxoft1-2/+112
This fixes #185. cWebAdmin::GetMemoryUsage() is accessible but deprecated (with a warning output to the screen).
2013-10-07Fixed startup timings on server restart.madmaxoft1-4/+3
2013-10-05WebAdmin uses the new HTTP functionality.madmaxoft1-9/+6
This is a partial implementation of #183.
2013-09-30Removed unneeded statementTiger Wang1-2/+1
Also LOGINFO'd "Starting WebAdmin"
2013-09-29Improvements to startup timerTiger Wang1-15/+7
As suggested by xoft. Also reverted changes of displayed protocol version.
2013-09-28Minor startup streamliningTiger Wang1-23/+41
* LOGD'd unneeded debugging messages, streamlining startup + Added a basic timer for how long in seconds it took to start up + Added two checks for plural (plugin/s, second/s)
2013-09-27Rewritten HTTPServer to split into cHTTPConnection, cHTTPRequest and cHTTPResponse classes.madmaxoft1-1/+1
2013-09-24Implemented basic HTTP message header parsing.madmaxoft1-4/+2
2013-08-19Moved entities into the Entities subfolder.madmaxoft1-1/+1
2013-08-17Added cRoot:BroadcastChat() to the Lua API.madmaxoft1-0/+12
This allows plugins to broadcast a chat message to all connected players. It is a replacement for previously removed cServer:BroadcastChat().
2013-08-14Added simple deadlock detection code.madmaxoft1-4/+13
This will assert and then deliberately crash the server once a deadlock is detected. For detection, only the world tick threads are considered, cWorld's m_WorldAge is checked periodically and if it doesn't increment for several seconds, a deadlock is reported.
2013-08-11Each world now ticks in a separate thread.madmaxoft1-10/+5
2013-08-07Removed Squirrel.madmaxoft1-8/+0
This compiles under Windows, but is untested in Linux.
2013-08-05cIniFile now reads .example.ini if not requested not to.madmaxoft1-12/+5
As specified in #44, when the .ini file cannot be opened, a .example.ini is tried, and if it succeeds, it is written as .ini. This makes it easy to provide ini file templates.
2013-07-24Server shuts down when the stdin is closed (linux Ctrl+D / win Ctrl+Z)madmaxoft@gmail.com1-2/+11
Fixes FS #419 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1679 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-29Advanced RCON: Command output is sent to the RCON client.madmaxoft@gmail.com1-30/+64
RCON authentication is now required before executing commands. Console command handlers now return two values, bool (IsHandled) and string (CommandOutput). API change: removed cRoot:ExecuteConsoleCommand(), added cRoot:QueueExecuteConsoleCommand(). API change: removed cPluginManager:ExecuteConsoleCommand(), use cRoot:QueueExecuteConsoleCommand() instead git-svn-id: http://mc-server.googlecode.com/svn/trunk@1631 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-27Fixed server stopping after #363 fixmadmaxoft@gmail.com1-10/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1422 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-27Fixed a deadlockmadmaxoft@gmail.com1-0/+23
FS #363 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1421 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-04Moved client socket accepting into a separate thread object, cListenThreadmadmaxoft@gmail.com1-11/+10
MCServer can now listen on multiple ports FS #312 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1252 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-15Plugins can now bind console commandsmadmaxoft@gmail.com1-8/+19
FS #300 Most console commands are now implemented in the Core plugin. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1214 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-05Added new hooks: OnChunkAvailable(), OnChunkUnloaded() and OnChunkUnloading(). Modified OnChunkGenerated() signature.madmaxoft@gmail.com1-2/+3
http://forum.mc-server.org/showthread.php?tid=464&pid=6312#pid6312 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1193 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-16Android: Made the initial pre-calculated spawn area smallerfaketruth1-6/+12
Android: Fixed FastNBT Android: Fixed level.dat reading/writing GroupManager uses groups.example.ini as default WebAdmin uses webadmin.example.ini as default git-svn-id: http://mc-server.googlecode.com/svn/trunk@1049 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-16Fixed boolean comparison.madmaxoft@gmail.com1-1/+1
Don't compare booleans to false / true, use them directly. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1048 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-11Settings.ini is read only once on server startmadmaxoft@gmail.com1-4/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1035 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-11PrimaryServerVersion is not force-saved into settings.ini. madmaxoft@gmail.com1-3/+12
Server admins are advised to keep the value undefined, which will default in the latest supported version being the primary git-svn-id: http://mc-server.googlecode.com/svn/trunk@1034 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-10Made settings.ini default to settings.example.ini when it doesn't existfaketruth1-1/+6
I suggest to do the same with the other ini files? git-svn-id: http://mc-server.googlecode.com/svn/trunk@1030 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-31Added the [Server].PrimaryServerVersion setting to settings.ini; 1.4.2 gets the correct versionmadmaxoft@gmail.com1-1/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1018 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-06Completely removed the old (buggy) redstone simulator.madmaxoft@gmail.com1-6/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@937 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-29Unified folder name-casingmadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@902 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-16/+13
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-20Refactored windows.madmaxoft@gmail.com1-2/+0
As described on the forum: http://forum.mc-server.org/showthread.php?tid=561 For now, only basic clicking works; shift-click not implemented yet. git-svn-id: http://mc-server.googlecode.com/svn/trunk@867 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-23Added a RateCompareString function to StringUtilsfaketruth1-0/+53
Created a preprocessor template (define) for DoWith* functions Exported cWorld::FindAndDoWithPlayer(), cRoot::FindAndDoWithPlayer() and cRoot::ForEachPlayer() to Lua Added a function FindAndDoWithPlayer to cRoot and cWorld. It takes a part of a player name and finds a single player based on that. Fixed Core's MOTD to contain the correct URL to the MCServer site Fixed Core /kick command Fixed Core's WebAdmin kick git-svn-id: http://mc-server.googlecode.com/svn/trunk@779 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-22Chat history limit on the WebAdmin chatfaketruth1-33/+26
Did some refactoring on the JavaScript side of the WebAdmin chat Got rid of cRoot::sRootState Fixed a crash on the WebAdmin when a page is loaded before a world exists git-svn-id: http://mc-server.googlecode.com/svn/trunk@775 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Android: Do not create an input thread for Androidfaketruth1-4/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@760 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-18Chat packet handled in the new way; fixed missing packet sending for inventory slot.madmaxoft@gmail.com1-9/+9
Again, API change! cPlugin:OnChat() has had its parameters swapped, to match all the other callbacks - Player first, Message second git-svn-id: http://mc-server.googlecode.com/svn/trunk@751 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-16MCServer should run just fine on Android now :Dfaketruth1-0/+4
The server is also stoppable from Android git-svn-id: http://mc-server.googlecode.com/svn/trunk@743 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-16Windows compilation fix after Android changesmadmaxoft@gmail.com1-5/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@742 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-15Compiles on Android! Added Eclipse project, import it into your workspace and it should be runnable on Android!faketruth1-0/+2
Disabled Squirrel for Android cLog now logs to Android LogCat as well Fixed Lua so it compiles on Android Removed/commented out exceptions in JsonCpp so it compiles on Android git-svn-id: http://mc-server.googlecode.com/svn/trunk@741 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-15Console command "chunkstats" now lists each world and also totalsmadmaxoft@gmail.com1-0/+53
git-svn-id: http://mc-server.googlecode.com/svn/trunk@739 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-15A new Block handling system :olapayo94@gmail.com1-0/+13
It was really a lot of work :D Took me the complete weekend :D Would really like to here your opinion on this =) The aim of this is to put all the actions for one block in one place so it is not spread around the source. (ToPickup, Action in cWorld, Action in cChunk, Action here, action there :D) git-svn-id: http://mc-server.googlecode.com/svn/trunk@671 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-15World threads are stopped before the plugin mgr for clean exit (FS #228)madmaxoft@gmail.com1-0/+14
git-svn-id: http://mc-server.googlecode.com/svn/trunk@669 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-12Missed a filelapayo94@gmail.com1-1/+1
Patched the server to allow shutdown from other threads git-svn-id: http://mc-server.googlecode.com/svn/trunk@657 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-19Made ForEach API safer to use, now supports Destroy()-ing objects, too ( http://forum.mc-server.org/showthread.php?tid=434&pid=3513#pid3513 )madmaxoft@gmail.com1-2/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@633 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-394/+394
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-12Updated the crafting recipes architecture to better support crafting hooks. Removed the old recipe file and implementation altogether.madmaxoft@gmail.com1-4/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@597 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-09More ini settings save their defaultsmadmaxoft@gmail.com1-5/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@588 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-05New hook, E_PLUGIN_CHUNK_GENERATED, called after each chunk is generated (the chunk is already present in cWorld)madmaxoft@gmail.com1-16/+33
git-svn-id: http://mc-server.googlecode.com/svn/trunk@558 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-04Added the new recipe parser, parsing the crafting.txt file. Included are a few recipes. The old parser still works, but will be replaced soon.madmaxoft@gmail.com1-5/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@549 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-02Added Lua function cRoot:ForEachWorld(), removed the obsolete cRoot:GetWorld() method (both C++ and Lua)madmaxoft@gmail.com1-9/+16
git-svn-id: http://mc-server.googlecode.com/svn/trunk@534 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25Merged the composable_generator branch into the trunkmadmaxoft@gmail.com1-29/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10Fixed a few obsoleted functionsmadmaxoft@gmail.com1-0/+28
git-svn-id: http://mc-server.googlecode.com/svn/trunk@397 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-09cClientHandles have a unique ID now to distinguish themfaketruth1-4/+4
cAuthenticator uses unique client ID for authentication Changed the kick function used by cAuthenticator to take a client ID instead of name, so the correct user is kicked Using callback reference instead of pointer in GetChunkData and affiliates GetChunkData returns false when failed, and true when succeeded Renamed entity type enums to something prettier Exposed some functions to Lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@388 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-07Fixed bug where cPlayer's cClientHandle was used after cPlayer was destroyed http://forum.mc-server.org/showthread.php?tid=380faketruth1-2/+2
Also removed the SetClientHandle() function from cPlayer Added a Destroyed() function to cEntity that is called ONLY ONCE after an entity has been 'destroyed' Cleaned up some code, using enums for GameMode and Weather and replaced some 'const char *' with 'const AString &' Exposed some more functions to Lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@382 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-22Added a crude way of disabling redstone. It's necessary though, redstone is completely broken, crashes the server all the timefaketruth1-0/+42
git-svn-id: http://mc-server.googlecode.com/svn/trunk@312 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-17Lots of logging addedmadmaxoft@gmail.com1-4/+28
git-svn-id: http://mc-server.googlecode.com/svn/trunk@282 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-15Can use the 'restart' command again. cAuthenticator no longer asserts because it properly stops when the server is stopped.faketruth1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@266 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-08Added total chunk count to webadminmadmaxoft@gmail.com1-0/+14
git-svn-id: http://mc-server.googlecode.com/svn/trunk@248 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-08MTRand class is not created in each tick, therefore much improving tick-thread time (now uses ~5 % CPU instead of one full core)madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@245 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01Rewritten cAuthenticator to make use of the new cIsThread architecture - now authentication runs in a single separate thread for all clients;madmaxoft@gmail.com1-1/+67
Global player-kicking function (cServer, cRoot); More char * -> AString conversion git-svn-id: http://mc-server.googlecode.com/svn/trunk@221 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-01Removed a few duplicate includesmadmaxoft@gmail.com1-5/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@215 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-29VC2008 / VC2010: Enabled precompiled header through Globals.h; the header included in every module in the project. Compilation optimization.madmaxoft@gmail.com1-1/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@188 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-23Added thread names to cThread so when debugging in Visual Studio you actually know what thread you're looking atfaketruth1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@100 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-01You can now run multiple worlds by defining them in settings.ini . However there's no way to change worlds on the fly yetfaketruth1-4/+78
Players are now stored in separate folder /players instead of in the world folder (!so move the folder!) Fixed a memory leak/error in cPickup.cpp Multiple worlds are stored in cRoot cClientHandle lists are taken out of cWorld and now stored in cServer Worlds now have names to distinguish them by Some functions in the Core plugin now distinguish between worlds git-svn-id: http://mc-server.googlecode.com/svn/trunk@40 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-31Player data is saved and loaded as human readable JSON now.faketruth1-0/+3
cFileFormatUpdate will loop through old files and convert them to new files (should replace legacy old format loading code) cItem has two new functions to load from Json and output Json, this will keep the items in Json standard ChestEntity and FurnaceEntity use the new functions in cItem git-svn-id: http://mc-server.googlecode.com/svn/trunk@35 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-26Fixed bug in cMakeDir where it would only create directories named "world"faketruth1-31/+11
The user input thread now properly stops when the server restarts or stops git-svn-id: http://mc-server.googlecode.com/svn/trunk@13 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-03MCServer c++ source filesfaketruth1-0/+162
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6