summaryrefslogtreecommitdiffstats
path: root/src/Root.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-02-06Adds playerlist header and footer broadcasting (1.8-1.13)dImrich1-0/+3
2020-12-18Warnings improvementsTiger Wang1-5/+5
* 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-05Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963)peterbell101-5/+5
* 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-3/+2
2020-09-25Deleted BiomeDef.h and ChunkDef.h from Globals.h (#4885)KingCol131-1/+1
* Removed BiomeDef.h * Removed ChunkDef.h from Globals.h * Added to CONTRIBUTORS. * Re-added empty last line to Globals.h * Included stddef and StringUtils in BiomeDef.h * Fixed build tools compiling. It compiles, but at what cost? * Added include to src/Generating/Trees.h * Include added in ChunkGeneratorThread.h * Moved rearranged includes in LineBlockTracer.cpp * Re-arrange headers in ChunkInterface.cpp * Included ChunkDef.h in Path.h * Included ChunkDef.h in NBTChunkSerializer.h * Rearranged included and added required includes to headers. * Removed unnecessary included in StringUtils.h.
2020-09-21Synchronously save chunks on server shutdown (#4900)Alexander Harkness1-0/+3
+ Synchronously save chunks on server shutdown. Fixes #4884
2020-09-05Streamline startup sequenceTiger Wang1-31/+24
* Clean up cRoot & main * Move some OS-specifics into OSSupport
2020-07-19Remove ProtocolPalettesTiger Wang1-16/+0
2020-07-14cWorld * -> cWorld (#4771)Tiger Wang1-12/+6
* cWorld * -> cWorld
2020-07-14Introduce recipe book functionality (#4493)Tobias Wilken1-5/+3
* 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-04-03Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)Mattes D1-0/+1
The BlockID.h file was removed from Globals.h and renamed to BlockType.h (main change) The BlockInfo.h file was removed from Globals.h (main change) The ENUM_BLOCK_ID and ENUM_ITEM_ID enum names were replaced with ENUM_BLOCK_TYPE and ENUM_ITEM_TYPE (cosmetics) The various enums, such as eDimension, eDamageType and eExplosionSource were moved from BlockType.h to Defines.h, together with the helper functions for converting between them and strings (StringToDimension et al.) (minor) Many inline functions were moved from headers to their respective cpp files, so that BlockType.h could be included only into the cpp file, rather than the header. That broke our tests a bit, since they pick bits and pieces out of the main code and provide stubs for the rest; they had to be re-stubbed and re-verified. eMonsterType values are no longer tied to E_ITEM_SPAWN_EGG_META_* values
2020-01-07Added temporary block type mapping for 1.13+ protocols.Mattes D1-0/+11
2020-01-07Root: Load the UpgradeBlockTypePalette on startup.Mattes D1-0/+7
2019-08-05Register vanilla blocks in BlockTypeRegistry.Mattes D1-0/+7
2018-04-02Broadcast playerlist removal in every world (#4201)mathiascode1-1/+4
2017-10-21cWorld: Move Initialization from Start to the constructor.peterbell101-1/+1
Start now does nothing more than launch the world's threads.
2017-09-11Replace ItemCallbacks with lambdas (#3993)peterbell101-7/+8
2017-09-07Made world data paths adjustable, and added API to temporarily disable saving chunks to disk. (#3912)Lane Kolbly1-0/+3
2017-09-02Revert "Replace ItemCallbacks with lambdas (#3948)"LogicParrot1-9/+8
This reverts commit 496c337cdfa593654018c171f6a74c28272265b5.
2017-09-01Replace ItemCallbacks with lambdas (#3948)peterbell101-8/+9
2017-08-25Add cUUID class (#3871)peterbell101-2/+3
2017-08-03Remove double includes part 2 (#3890)peterbell101-2/+0
2017-08-03Removed unused forward declarations (#3888)Lukas Pioch1-1/+0
2017-02-22Add support for alternate config file locations (#3578)Gareth Nelson1-0/+2
2017-01-18DeadlockDetect now lists some tracked CS's stats.Mattes D1-2/+3
2016-07-21Tab completion across worlds (#3270)Alexander Harkness1-0/+4
Fixes #2563.
2016-03-01Renamed HTTPServer folder to HTTP.Mattes D1-1/+1
It contains client code as well.
2016-02-08remove cWorld::createAndInitializeWorldLogicParrot1-11/+2
2016-02-05Prevent server from starting if there's bad world linkageLogicParrot1-0/+4
2015-12-25Fix pre - #2815 default world linkage configsSafwat Halaby1-1/+1
2015-12-25Nether and End in settings.ini by default, and created at startupSafwat Halaby1-1/+1
2015-11-03Implemented brewingLukas Pioch1-0/+3
2015-08-20Fixed and improved restartingTiger Wang1-5/+5
Restarts are now an actual, close-as-possible to application exit+reopen.
2015-07-31Unified the doxy-comment format.Mattes D1-20/+20
2015-06-13Work on NetherPortalScanner. Setup portal scanner to reset PortalCooldown. Changed where player is spawned. Added a_InitSpawn flag to CreateAndInitializeWorld.Lane Kolbly1-1/+1
2015-06-11SelfTests are registered and executed after logging framework init.Mattes D1-1/+7
Fixes #2228.
2015-05-29Fix for the way connecting clients receive player lists and broadcast chatb33duck1-0/+6
2015-05-28Fixed the way connecting clients receive player lists and broadcast chat to worldsb33duck1-0/+4
2015-05-26Added method to get the uptime of the server in seconds. Implements #1650.Lukas Pioch1-32/+37
2015-05-16Initial implementation of IniFile overloadingtycho1-2/+3
2015-05-09CheckBasicStyle: checks spaces around * and &.Mattes D1-1/+1
2015-04-05Fixed crash on exit introduced with Windows Service capability.Mattes D1-4/+1
Ref.: #1845
2015-04-01Working as a Windows service. Starts and stops correctly.Anthony Birkett1-0/+4
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.
2014-12-21Fixed crash on restartTiger Wang1-2/+2
2014-12-08Changed CheckMultiLogin() to not have main body wrapped in an if statement.Vincent1-0/+1
Added in indent to cPlayerListCallBack in cCallback class inside CheckMultiLogin(). Added doxy-comment for DoWithPlayer(). Changed comments on IsPlayerInQueue() and IsAllowMultiLogin() to doxy-comments.
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-1/+3
2014-11-26cRoot: Fixed a memory leak with cRankManager.Mattes D1-2/+4
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-02Simplified FindAndDoWithUUID, formatted lineLukas Pioch1-1/+1
2014-11-02Added FindAndDoWithUUIDLukas Pioch1-0/+3
2014-10-24SuggestionsTiger Wang1-0/+1
2014-10-19Migrated random generators to std::randomTiger Wang1-1/+1
2014-10-19Use std::threadTiger Wang1-3/+3
2014-10-18Fixed failure for cRankManager to restartTiger Wang1-2/+2
2014-10-01cRoot: Removed useless variable from Lua API.madmaxoft1-2/+3
2014-10-01Unified cRoot broadcast chat documentation.madmaxoft1-5/+5
2014-09-27Dropped support for <1.7.xTiger Wang1-6/+0
2014-08-21Removed cGroup and cGroupManager.Mattes D1-6/+0
2014-08-10First Implementatation of new Loggin frameworkTycho1-2/+0
2014-08-08Exported cRankManager to LuaAPI.madmaxoft1-0/+3
2014-08-03cMojangAPI: Added UUID-to-Name lookup.madmaxoft1-1/+1
Also fixed the bindings, now all functions are static-like.
2014-07-30Exported cMojangAPI to Lua.madmaxoft1-1/+1
2014-07-30Added a cMojangAPI class for PlayerName -> UUID lookups, with cache.madmaxoft1-0/+3
The cache is persisted into a SQLite DB file on server shutdown.
2014-07-20Bug and crash fixesTiger Wang1-2/+11
* 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-1/+1
2014-07-19main.cpp: Fixed warnings with g_TERMINATE_EVENT_RAISED and g_SERVER_TERMINATEDarchshift1-0/+2
2014-07-17Fixed basic whitespace problems.madmaxoft1-12/+16
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/+6
2014-07-14Player properties are now retrievedTiger Wang1-1/+1
2014-06-10Portal improvements and suggestionsTiger Wang1-1/+1
2014-04-13Added Yggdrasil Authentication Systemdaniel09161-2/+2
Code by Howaner. Fixes/Changes by me.
2014-02-15Removed the unnecessary LoopPlayersAndBroadcastChat() functions.madmaxoft1-11/+9
2014-02-15Implemented cCompositeChat.madmaxoft1-2/+4
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-9/+10
* Moved string manipulation into cClientHandle and therefore... + Added configuration option for prefixes. * Cleaned up code. * Updated documentation for API.
2014-02-06Added more chat functionsTiger Wang1-1/+3
2014-02-05Improvements:STRWarrior1-0/+3
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-02-04Added more SendMessageXXX() functionsTiger Wang1-3/+11
2013-12-11Added a HOOK_WORLD_STARTED hook and a cRoot::CreateAndInitializeWorld function for plugins.STRWarrior1-0/+1
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-22Added cRoot:GetFurnaceFuelBurnTime() to Lua API.madmaxoft1-0/+4
2013-11-22Changed cRoot:GetFurnaceRecipe() Lua binding signature.madmaxoft1-1/+1
Fix #364.
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-1/+1
2013-10-23Removed cRoot:m_PrimaryServerVersion from Lua API.madmaxoft1-5/+5
We have the accessor methods for it.
2013-10-08Implemented the two memory-statistics functions in cRoot.madmaxoft1-1/+11
This fixes #185. cWebAdmin::GetMemoryUsage() is accessible but deprecated (with a warning output to the screen).
2013-09-27Rewritten HTTPServer to split into cHTTPConnection, cHTTPRequest and cHTTPResponse classes.madmaxoft1-2/+2
2013-09-24Implemented basic HTTP message header parsing.madmaxoft1-0/+2
2013-08-17Added cRoot:BroadcastChat() to the Lua API.madmaxoft1-0/+3
This allows plugins to broadcast a chat message to all connected players. It is a replacement for previously removed cServer:BroadcastChat().
2013-08-11Each world now ticks in a separate thread.madmaxoft1-2/+3
2013-06-29Advanced RCON: Command output is sent to the RCON client.madmaxoft@gmail.com1-11/+41
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 a deadlockmadmaxoft@gmail.com1-17/+24
FS #363 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1421 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-15Plugins can now bind console commandsmadmaxoft@gmail.com1-5/+12
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-01-12Merged branch "branches/hooks" into "trunk".madmaxoft@gmail.com1-8/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1139 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-20Added primary server version interface to cRoot and "primaryserverversion" console command.madmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1059 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-31Added the [Server].PrimaryServerVersion setting to settings.ini; 1.4.2 gets the correct versionmadmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1018 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-23Added a RateCompareString function to StringUtilsfaketruth1-1/+4
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-2/+3
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-18Chat packet handled in the new way; fixed missing packet sending for inventory slot.madmaxoft@gmail.com1-1/+1
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-15Console command "chunkstats" now lists each world and also totalsmadmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@739 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-15World threads are stopped before the plugin mgr for clean exit (FS #228)madmaxoft@gmail.com1-0/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@669 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-109/+109
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-3/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@597 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-2/+7
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-18/+21
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/+13
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-0/+1
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/+8
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-2/+2
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-1/+1
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/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@312 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-13Rewritten most of the code for multithreading; still not 100%, but getting there. If this commit proves to be too problematic, we can always undo it.madmaxoft@gmail.com1-2/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-08Added total chunk count to webadminmadmaxoft@gmail.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@248 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-10/+32
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
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-2/+11
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-26Fixed bug in cMakeDir where it would only create directories named "world"faketruth1-1/+3
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/+52
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6