summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
7 daysFix cChunkMap issues below with coords below y=0 (#5397)hle01-2/+8
* return false in cChunkMap::GetBlockTypeMeta if requested height is invalid * add checks to users of cWorld::GetBlockTypeMeta * add checks for invalid height to cChunkMap::GetBlock and cChunkMap::GetBlockMeta * add hle0 to CONTRIBUTORS * Fix merge conflict with isValidHeight * Add initialisation contract and fulfil it. --------- Co-authored-by: Alexander Harkness <me@bearbin.net>
2024-09-08Uninitialised value fix (#5570)Victor1-0/+1
2023-05-16Removed all Printf-family functions from StringUtils.Mattes D1-18/+13
Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments. Also fixed code-style violations already present in the code.
2022-10-28Kick clients when resource pack rejected (#5440)plan12311-0/+13
2022-07-16ClientHandle: Fix block interaction regressions (#5431)Tiger Wang1-33/+23
* ClientHandle: Fix block interaction regressions * Fix reach distance being halved. * Fix fire extinguish not working, fixes #5422. * AddFaceDirection: deprecate non-vector version
2022-04-26Implement relative SendPlayerMoveLook. Use it in TurnToDirt (#5413)DarkoGNU1-0/+9
* Implement relative SendPlayerMoveLook * Use relative teleport in cBlockFarmlandHandler::TurnToDirt * Static cast to UInt8. Explicit float values * Maybe explicit doubles, too * Fix TurnToDirt for some edge cases * Improve the height check in TurnToDirt * Const is good, right? * Const - the continuation
2022-04-20handled the infinite loop and stylex12xx12x1-2/+2
2022-04-20Valid Height is now checked by vector.x12xx12x1-52/+48
2022-04-20Updated protocol functions to Vector3xx12xx12x1-105/+84
also added support in included functions
2022-02-12ClientHandle: cancel multi-block placements correctyTiger Wang1-9/+7
https://github.com/cuberite/cuberite/pull/5392#issuecomment-1032712796
2022-02-08ClientHandle: update variable namesTiger Wang1-6/+6
2022-02-08Spectators: prevent using items and spawn eggsTiger Wang1-8/+17
2022-01-24Add player permission level (#5358)Simon Pribylski1-2/+15
2022-01-14eblockfaceTiger Wang1-8/+8
2022-01-14Fixed Compiler Warningsx12xx12x1-8/+8
2022-01-02Suspicious packets: give 'em the silent treatment (#5375)Tiger Wang1-9/+8
Ref: #5372
2022-01-02ClientHandle: improve right-click robustness (#5372)Tiger Wang1-31/+43
* ClientHandle: improve right-click robustness + Add checks for result of GetBlockTypeMeta + Kick if the client sent an invalid block face or coordinate * Update outdated comments
2021-12-02ItemHandler initialisation is a constant expression (#5344)x12xx12x1-15/+17
* Transition to non-pointer item handler * That is my destructor - I decide when I leave this world * I declare your destruction private and you final
2021-11-11Miscellaneous fixes (#5320)Tiger Wang1-55/+53
* Protocol: update Abilities flags + Add Spectator handling * BioGen: move <iostream> include * ClientHandle: rename Respawn packet dimension check flag * Make it clearer what it's doing. * ClientHandle: move ProcessProtocolIn calls to World * Player: remove some redundant initialisation * Player: UpdateCapabilities enables flight for spectators * Produce growth: improve comments * ClientHandle: run unload checks using delta time * Fix forgotten initialisation of time member
2021-10-03Authenticator: avoid move assignments to self (#5315)Tiger Wang1-38/+36
If authentication was off cClientHandle::m_Username ended up moved into itself. Add a copy to avoid this. Thanks @Seadragon91!
2021-10-02Authentication flow: move construction, slim down classes (#5312)Tiger Wang1-12/+11
- Remove extra members in ForgeHandshake
2021-09-30Spectation: add dedicated pathway for spectator mode (#5303)Tiger Wang1-1/+1
* Spectation: add dedicated pathway for spectator mode + Sync player rotation with spectated entity. + Add dedicated infrastructure to cPlayer for handling spectation, instead of misusing entity riding. * Avoid infinite recursion when exiting spectation, fixes #5296 * AttachTo: Change parameter to reference
2021-09-23Permission-based player chat message formatting (#5304)Rorkh1-1/+8
+ Permissions for chat message format access
2021-09-23BungeeGuard style proxy security and OnlyAllowBungee config (#5291)Ethan Jones1-0/+75
2021-09-16Ignore dead movement (#5292)Ethan Jones1-6/+7
* Ignore player updates from dead players #5289 * move the condition down a bit, add parentheses Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-09-15Don't allow players in adventure mode to break blocks (#5293)Ethan Jones1-0/+6
2021-08-26Disconnect: call HandleOutgoingData one last timeTiger Wang1-0/+1
* Fixes #5285
2021-07-20Setting command-block's command requires a permission. (#5270)Mattes D1-0/+5
2021-07-10Chorus fruit teleport (#5259)KingCol131-1/+2
* Outline function for teleporting. * Created new handler for chorus fruit. * Fixed AttemptTeleport failing. * Better names, working sound effect. * Corrected naming. * Remove stray LOGD. * Offset teleport to middle of block. * Style Fixes Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com> * Style Fixes 2 Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com> * Move FindTeleportDestination to static cPawn method. * cBoundingBox interface. * Cleanup includes. * Maybe exported to API? * Change a_World to reference, add to APIDesc. Co-authored-by: x12xx12x <44411062+12xx12@users.noreply.github.com>
2021-07-10Symmetry in MultiVersionProtocol to fix a crash (#5261)Tiger Wang1-2/+2
+ Add HandleOutgoingData, which tests for m_Protocol before calling DataPrepared. * Change std::function to bool + if/else to handle incoming data; it's almost certainly faster. * Fixes #5260
2021-07-06Replace chunk coordinates magic with numeric_limitsTiger Wang1-14/+13
2021-07-06Invalidate m_LastStreamedChunk when player position doesn't matchTiger Wang1-47/+55
So teleporting to and back doesn't cause chunk sending to stop. * Fixes #4531
2021-07-06Protocol: call the encryptor once before sending dataTiger Wang1-0/+1
2021-07-06Remove outdated comment and redundant checkTiger Wang1-9/+5
Refactoring made the comment no longer true. The check isn't needed since no packets are sent, and Destroy does nothing, if m_HasSentDC.
2021-06-28Protocol: use dedicated packet for 1 block changeTiger Wang1-5/+15
It's six bytes smaller.
2021-05-05Move item placement into item handlers (#5184)Tiger Wang1-44/+30
* Move item placement into item handlers + Add appropriate CanBeAt checks in cPlayer::PlaceBlocks, into which all placement handlers call. * Partly addresses #5157 * Fixes #4878 * Fixes #2919 * Fixes #4629 * Fixes #4239 * Fixes #4849 Co-authored-by: changyong guo <guo1487@163.com> Co-authored-by: Xotheus <shady3300@outlook.com> Co-authored-by: Krist Pregracke <krist@tiger-scm.com> * Review fixes * Update APIDesc.lua * Rename Co-authored-by: changyong guo <guo1487@163.com> Co-authored-by: Xotheus <shady3300@outlook.com> Co-authored-by: Krist Pregracke <krist@tiger-scm.com>
2021-05-03Add player statistics to API (#5193)nshah251-2/+2
* Fixed issue #5166 Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-04-12More cProtocol cleanupTiger Wang1-73/+73
* Alpha sort functions * Simplify hand handling * Fix left handed mode client-side display
2021-04-12Improve bed handling robustnessTiger Wang1-2/+1
+ Boot the player out if the bed was destroyed
2021-04-12Unify multiprotocol entity animationsTiger Wang1-19/+1
2021-04-12Streamline player abilities handlingTiger Wang1-9/+9
* Update player list gamemode on world change * Fix invisibility for spectators, use entity metadata * Populate m_World for cPlayers on load - Remove SendPlayerMaxSpeed, a duplicate of SendEntityProperties
2021-04-12Fix block break particlesTiger Wang1-1/+1
2021-04-12Fix sending incorrect date values on world changeTiger Wang1-3/+7
Yak shave: make more things use cTickTime. Fix a couple of incorrect modulo-on-millisecond-value by making them use WorldTickAge.
2021-04-03Basic elytra flight (#5124)Damián Imrich1-51/+36
* Basic elytra flight Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-03-30Player data loading cleanupTiger Wang1-13/+14
* Kick player if data were corrupt to avoid making it worse
2021-03-30Do an early check for empty network buffers (#5172)Tiger Wang1-5/+14
Avoid overhead when nothing to do.
2021-03-28Call ProcessProtocolOut at opportune timesTiger Wang1-3/+8
2021-03-28Send keep alives slightly less frequentlyTiger Wang1-7/+3
Ref: http://github.com/cuberite/cuberite/issues/4082#issuecomment-348675321
2021-03-28Fix chunk block changes being sent out of order (#5169)Tiger Wang1-8/+23
* Flush out all pending, buffered changes at the end of each tick, after every chunk is ticked. This makes every block update client-side in unison, instead of unlucky ones only being sent 1 tick later. * Re-add buffer for outgoing network data; IOCP async WSASend has higher overhead than expected... Fixes regression introduced in 054a89dd9
2021-03-20Change TimeOfDay to WorldDate (#5160)Tiger Wang1-2/+2
* Change TimeOfDay to WorldDate * Do not wrap at 20 minutes, continue incrementing * Fixes #4737 * Fixes #5159
2021-03-19Don't send ping updates one packet at a timeTiger Wang1-2/+2
* Use the batch update feature of the packet. * Lengthen interval between time and ping update packets (ref. http://github.com/cuberite/cuberite/issues/4082#issuecomment-348675321).
2021-03-15Properly deprecate more XYZ parameter'd functions (#5147)Tiger Wang1-4/+4
* Fixes #5144
2021-03-08Do protocol decryption in-place (with CryptoAPI on Windows) (#5145)Tiger Wang1-3/+3
2021-03-05Adding Boss bar (#5025)12xx121-6/+60
+ Add boss bar Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-02-06Adds playerlist header and footer broadcasting (1.8-1.13)dImrich1-0/+9
2021-01-19MultiVersionProtocol: fix two crashesTiger Wang1-10/+12
First one: add missing exception handler in ProcessProtocolIn Second: remove faulty logic dealing with incomplete packets. `a_Data = a_Data.substr(m_Buffer.GetUsedSpace() - m_Buffer.GetReadableSpace());` was incorrect; it attempted to apply a length derived from m_Buffer to an unrelated a_Data. Its purpose was to give cProtocol the data the client sent, minus initial handshake bytes. However, we can use the knowledge that during initial handshake, there is no encryption and every byte can be written unchanged into m_Buffer, to just call cProtocol with a data length of zero. This will cause it to parse from m_Buffer - wherein we have already written everything the client sent - with no a_Data manipulation needed. Additionally, removed UnsupportedButPingableProtocolException (use of exception as control flow) and encode this state as m_Protocol == nullptr, id est "no protocol for this unsupported version", which is then handled by cMultiVersionProtocol itself.
2021-01-12Clarify cClientHandle, cPlayer ownership semanticsTiger Wang1-271/+88
+ 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.
2021-01-11zlib -> libdeflate (#5085)Tiger Wang1-19/+36
+ Use libdeflate + Use std::byte * Fix passing temporary to string_view + Emulate make_unique_for_overwrite
2020-12-26Avoid an std::list in StreamNextChunkTiger Wang1-22/+22
2020-12-26Streamline ClientHandle chunk send a littleTiger Wang1-33/+4
- Removed RemoveFromAllChunks. On destruction cWorld::RemovePlayer calls RemoveClientFromChunks already, and there's no need to manually clear the chunk lists.
2020-12-26ViewDistance: unsigned -> signedTiger Wang1-6/+4
2020-12-18Ignore CanFly flag sent by the clientmathiascode1-2/+1
2020-12-18Warnings improvementsTiger Wang1-15/+17
* 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-11-06Players are no longer kicked when clicking on bedrock (#5023)Tiger Wang1-34/+26
* Players are no longer kicked when clicking on bedrock * Fixes #5022
2020-10-08Merged OnBreak with OnPlayerBreak (#4967)12xx121-6/+6
Co-authored-by: 12xx12 <12xx12100@gmail.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-10-05Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963)peterbell101-2/+2
* 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-10-03Remove SetProperty(...cPlayer)Tiger Wang1-1/+1
Enchantment table, anvil windows are already opened one per-player.
2020-10-02Fix instant mining of blocks not being recognised, tweak anti-cheat (#4938)KingCol131-7/+7
* Tried to fix a small issue... Ended up rewriting a bunch of god awful, opaque code with no source and no sense. Who names a function GetPlayerRelativeBlockHardness??? It's gone now. We're safe again. * Testing anti-cheat. * Tidy up debug logging. * Remove empty member declaration. * Rewrite GetDigSpeed slightly for better readability. * GetMiningProgressPerTick now returns 1 when instantly mined. Fixed hasily written typo. * Comment style and typo fixes.
2020-10-01Enchanting table shows detail on hover. Enchanting is deterministic. (#4937)KingCol131-50/+38
* Use lapis for enchanting, subtract correct number of levels, ClientHandle now selects from pregenerated list. Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-29HandleEnchantItem: use a lambda (#4944)Tiger Wang1-5/+8
2020-09-28Enchanting consumes lapis, removes correct number of levels (#4934)KingCol131-11/+51
* Use lapis for enchanting, subtract correct number of levels. * Enforced distancing regulation better than our government. Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-25Do not call into things we don't own in destructorsTiger Wang1-1/+0
- Remove improper accesses in cChunk destructor * Fixes #4894
2020-09-20BlockHandler initialisation is a constant expression (#4891)Tiger Wang1-10/+8
* BlockHandler initialisation is a constant expression If we can't make it all namespaces, this is the next best I guess. + Tag handlers constexpr, const as needed + Inherit constructors * Privatise handler functions * More constexpr Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-09-12Reverse order of ChunkSender priorities (#4858)Tiger Wang1-3/+3
* Reduces confusion when using overloaded operator< and priority_queue Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-09-12Use tracing for explosions (#4845)Tiger Wang1-2/+22
* TNT: Implement tracing algorithm + Add intensity tracing * Fix iterating over all players to SendExplosion, even those not in range * Implemented TNT entity interaction * Fixed misaligned destruction tracing * Finalise TNT algorithm - Remove BlockArea and just use chunks Using SetBlock makes it so that we can update everything properly, and does appear to be faster. * BlockInfo learns about explosion attentuation * Rename Explodinator parameters * TNT: pull block destruction into common function Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-09-05Add more statistic tracking (#4837)12xx121-0/+1
+ Added possible 1.8 stats + Added stat tracking for 1.8.2 + Added stat tracking for 1.9 + Added the breed cow achievement Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-08-21ChunkDataSerializer: don't repeatedly mallocateTiger Wang1-1/+2
+ Store an instance of the class, the way it seems it is meant to be used.
2020-08-04OnBroken/OnPlaced are for entity actionsTiger Wang1-1/+0
* Call OnPlaced/OnBroken in PlaceBlock/DigBlock - Remove unused Placing/Breaking handlers * Have the blockhandler's Check handle neighbour updating, instead of QueueTickBlockNeighbors
2020-08-01Replaced cpp14::make_unique<> with std::make_unique<>.Mattes D1-1/+1
2020-07-19Implement "caching" in ChunkDataSerializerTiger Wang1-2/+2
+ When sending a chunk to multiple clients, group them by protocol version and send the same data
2020-07-18Delete unused memberTiger Wang1-1/+0
2020-07-17cProtocolRecognizer goes on a diet (#4770)Tiger Wang1-11/+11
- Removed inheritance from cProtocol
2020-07-14Introduce recipe book functionality (#4493)Tobias Wilken1-1/+43
* 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-5/+8
* 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-05-04Added check if player is in spectator mode (#4709)Lukas Pioch1-0/+6
2020-05-04Improve entity position updates (#4701)Tiger Wang1-26/+4
* Make puking pickups fly nicer * Improve entity position updates * Move determination of whether a delta is too big for a packet into the protocol handlers + Less jittery movement + Generalise CollectEntity to take any entity
2020-05-01Unify entity spawn packet sendingTiger Wang1-29/+2
2020-04-21Vector3 in Handlers (#4680)Mattes D1-15/+17
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-20Delet SpawnObject paramsTiger Wang1-2/+2
* Fix #4679 awkward...
2020-04-07Initial resource pack support (#4622)Mat1-0/+9
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-04-02Replace buckets to the selected hotbar slot, rather than the first available. (#4580)Alexander Harkness1-3/+3
* Replace buckets to the selected hotbar slot, rather than the first available. Replicates vanilla behaviour, as well as being more logical. * Refactor cInventory::AddItem. Behaviour is now documented * Add new cInventory::ReplaceOneEquippedItem and ::SetEquippedItem methods * Return empty potion to the same slot after drinking * Replace buckets correctly in other situations, not simply water and lava Uses the new ReplaceOneEquippedItem method * Correct collecting water from source block with bottle * Add cPlayer::ReplaceOneEquippedItemTossRest method * Handle stacked filled buckets (in theory) Use new cPlayer::ReplaceOneEquippedItemTossRest method
2020-03-30Send experience on respawn (#4586)Mat1-0/+1
2020-03-29Fix client disconnect assert (#4579)peterbell101-3/+3
2020-03-28cClientHandle: Only allow m_State to increase (#4533)peterbell101-40/+45
* cClientHandle: Only allow m_State to increase * WasAddedToWorld was incorrect if kicked * Rewrite cClient::Destroy with a guard clause
2020-03-24When Client sends message longer than 256 bytes, kick him instead of handling message (#4514)Max Luchterhand1-0/+10
* Wrong overload of function push() got called when pushing a cEntity*. Using a const cEntity * fixes this. * Fixed accidental wrong indentation * Compiler didn't like old style cast * Kicking player when writing chat message longer than 2048 * Accounted for Astrings size() method returning bits, not bytes * Fixed typo * Changed MAX_STRING_SIZE to 1024, removed unnecessary division by 8 * Handling message length check in cClientHandle:HandleChat * Guard clause instead of if else * Remove stale changes * Fixed formatting Co-authored-by: mluchterhand <mluchterhand@max.de> Co-authored-by: Peter Bell <peterbell10@live.co.uk> Co-authored-by: Mattes D <github@xoft.cz>
2020-03-23Manual merge of #4498.Alexander Harkness1-1/+1
Credit to @MeMuXin Closes #4498
2020-03-21Don't call player movement hook if nothing changed (#4517)Mat1-0/+20
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-03-05Stabilise MoveToWorld (#4004)Mat1-1/+1
* Stabilise MoveToWorld * Fix comments and deprecate ScheduleMoveToWorld * Enhanced thread safety for m_WorldChangeInfo * Return unique_ptr from cAtomicUniquePtr::exchange * cWorld now calls entity cEntity::OnAddToWorld and cEntity::OnRemoveFromWorld. Allows broadcasting entities added to the world from the world's tick thread. This also factors out some common code from cEntity::DoMoveToWorld and cEntity::Initialize. As a consequence, cEntity::Destroy(false) (i.e. Destroying the entity without broadcasting) is impossible. This isn't used anywhere in Cuberite so it's now deprecated. * Update entity position after removing it from the world. Fixes broadcasts being sent to the wrong chunk. * Fix style * cEntity: Update LastSentPosition when sending spawn packet * Add Wno-deprecated-declarations to the lua bindings * Kill uses of ScheduleMoveToWorld
2020-01-15Blocks are usable in adventure mode (#4464)Mat1-1/+1
2019-12-30Disable block placement in adventure mode (#4424)Mat1-2/+2
2019-10-16Refactored block-to-pickup conversion. (#4417)Mattes D1-9/+15
2019-10-03Added another check if the item is place able (#4404)Lukas Pioch1-0/+7
2018-09-24Add a formatting function for Vector3 (#4282)peterbell101-9/+9
* Vector3: Add custom fmt compatible formatter. * cLuaState: Add fmt version of ApiParamError * Use vector formatting in manual bindings * Always log vectors with FLOG
2018-08-26Store and pass entity effect duration as an int not a short. (#4293)Alexander Harkness1-1/+1
Fixes #4292.
2018-07-27cWorld: Manually bind deprecated broadcast functions (#4265)peterbell101-1/+1
Ref: https://github.com/cuberite/cuberite/pull/4264#discussion_r204769193
2018-07-26CheckBasicStyle: Check number of empty lines between functions (#4267)peterbell101-1/+3
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-23Keep players in gmNotSet (#4248)changyong guo1-8/+13
This allows players game mode to update to the default after portal to another world. Fixes #4207
2018-07-23recover hotbar selected slot after reconnect (#4249)changyong guo1-0/+12
1. implement protocol message SendHeldItemChange 2. add save / load inventory equipped item slot in JSON 3. send held item slot message after player connect to server Fixes #4189
2018-07-20Make offline UUIDs consistent with vanilla. (#4178)peterbell101-4/+2
Fixes #4177 This is a breaking change to existing Cuberite permissions settings.
2018-06-24Support swap item between main hand and offhand by press key "F" (#4241)changyong guo1-1/+8
Hi, I found cuberite don't support to press key "F" to swap items on main hand and offhand, so I implemented this feature. Best regards Changyong
2018-05-02Prefer static_cast to reinterpret_cast (#4223)peterbell101-3/+3
* Change reinterpret_cast -> static_cast wherever possible * Remove more unnecessary `const_cast`s. reinterpret_casts should be avoided for the same reason as c-style casts - they don't do any type-checking. reinterpret_cast was mainly being used for down-casting in inheritance hierarchies but static_cast works just as well while also making sure that there is actually an inheritance relationship there.
2018-04-27Removed unnecessary disconnect (#4200)mathiascode1-5/+0
2018-04-03Properly destroy player (#4199)mathiascode1-7/+7
2018-04-02Broadcast playerlist removal in every world (#4201)mathiascode1-5/+3
2018-01-25cClientHandle: Always call HOOK_PLAYER_RIGHT_CLICK (#4149)peterbell101-6/+11
Reverts the reduction in cases where the hook was called, a change which broke plugins.
2018-01-08Rewrite cClientHandle::HandleRightClick (#4089)9caihezi1-148/+130
* Add hand parameter to distinguish main hand/off hand. * Add a new function cClientHandle::HandleUseItem to separate the functionality of using an item without a target block. This matches the protocol with client version >= 1.9 * Always actively update the status of a block if the placement fails (by out of reach or rejected by plugin). * Do not call plugin callback CallHookPlayerRightClick(-1, 255, -1, -1, 0, 0, 0) when using item. The CallHookPlayerUsingItem will still be called. Now at most one of CallHookPlayerRightClick, CallHookPlayerUsingBlock, CallHookPlayerUsingItem and CallHookPlayerEating will be called based on the type of action (not including the used version of callbacks). * Do not count using item as BlockInteractionsRate check (Using item takes time). * Now we can open chests(etc.) when sneaking as long as the player's hand is empty. This is what vanilla server does.
2018-01-03Add the fmt library (#4065)peterbell101-1/+1
* 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-11-20cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050)Bond-0091-1/+1
2017-10-21Implement horse inventory (#4053)peterbell101-0/+12
* Implement horse inventory * Fix sign conversions * Add API doc for ItemCategory::IsHorseArmor * Improve HandleOpenHorseInventory comment and style fixes.
2017-09-25BroadcastBlockBreakAnimation and BroadcastBlockEntity use vectors (#4038)Bond-0091-3/+3
2017-09-19Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)Lane Kolbly1-1/+11
* Made BroadcastSoundEffect take vector parameters. * Added docs for new vectored methods * Removed old code * Fixed lua warnings * Made old BroadcastSoundEffect not an override. * m_Block to m_BlockPos, used Vector3d constructor where prettier. * a_Block to a_BlockPos * Changed thunderbolt a_Block to a_BlockPos
2017-09-19Removed UTF-8 BOM (#4033)Lukas Pioch1-1/+1
2017-09-11Replace ItemCallbacks with lambdas (#3993)peterbell101-51/+22
2017-09-08Shutdown connection when disconnect packet sent (#3999)Alexander Harkness1-4/+10
2017-09-02Revert "Replace ItemCallbacks with lambdas (#3948)"LogicParrot1-22/+51
This reverts commit 496c337cdfa593654018c171f6a74c28272265b5.
2017-09-01OnLogin now kicks players properly (#3980)Alexander Harkness1-1/+2
2017-09-01Replace ItemCallbacks with lambdas (#3948)peterbell101-51/+22
2017-08-30Update mbedtls to 2.5.1 (#3964)peterbell101-2/+2
* Renaming changes: * macro prefix "POLARSSL" -> "MBEDTLS" * functions now prefixed with "mbedtls_" * rename PolarSSL++ -> mbedTLS++ * rename polarssl submodule * Use mbedtls' AES-CFB8 implementation. * Add cSslConfig to wrap mbedtls_ssl_config * Update cTCPLink and cBlockingSslClientSocket to use cSslConfig * Use cSslConfig in cHTTPServer * Use cSslConfig for cMojangAPI::SecureRequest * CI Fixes * Set -fomit-frame-pointer on the right target
2017-08-27Implement Forge protocol handshake support (#3869)satoshinm1-1/+24
2017-08-25Add cUUID class (#3871)peterbell101-34/+7
2017-08-21Fully implemented leashes (#3798)Pablo Beltrán1-0/+18
2017-08-11Removed incorrect assert in cClientHandle::SendRespawn.Lane Kolbly1-3/+0
2017-08-07Changed entity ownership model to use smart pointersTiger Wang1-4/+25
2017-08-02Removed double includes (#3885)Lukas Pioch1-1/+0
2017-08-01cBlockHandler: take player by refpeterbell101-4/+4
2017-08-01cWorld::SendBlockTo take player by refpeterbell101-14/+14
2017-07-28Tentative fix for player-limit race condition (#3862)Tiger Wang1-8/+14
* Attempts to fix #2257 Derived from d233e9843148313c71fbaba96ccff660e47b07b1 * Changed player count type to int * Clarified certain actions
2017-06-26Fixed memory leak in cClientHandle. (#3794)Mattes D1-5/+5
2017-06-09Fix assert when clicking blocks at the top of the world.Mattes D1-12/+16
2017-05-27Add rank prefix and suffix to player name in chat (#3730)Heiko Hund1-1/+5
Fixes issue #1721
2017-05-24Off-hand/shield slot functional, save and load slot, bow + arrow functional (#3725)Pablo Beltrán1-0/+10
Fixes #3714.
2017-05-19Allow enabling/disabling of block change limitmathiascode1-1/+1
2017-01-28Fixed ClientHandle:GetProtocolVersion returning wrong number.Mattes D1-8/+2
2016-12-16Initial support for the 1.11 protocol.Mattes D1-2/+2
2016-11-19Fixed race conditions in cClientHandle's State.Mattes D1-157/+208
2016-11-06Anticheat fastbreak (#3411)mohe20151-0/+27
Added block hardness checks when breaking blocks.
2016-10-21Added SendMessageRaw for sending json string.Lukas Pioch1-0/+9
2016-10-12Spectators added (#2852)bibo381-2/+54
2016-09-27Use cChunkDef::Height for Y coord comparison where applicable.Moritz Borcherding1-2/+2
2016-09-25Fixed cCompositeChat's constructor LuaAPI bindings.Mattes D1-5/+3
The tolua-generated constructor would return an extra string value.
2016-09-03Improve cPlayer::DoMoveToWorld (#3113)LogicParrot1-1/+0
2016-08-29Proper respawn packets on dimension travelLogicParrot1-1/+17
2016-08-28Fixed SendUnloadChunk bug (#3353)LogicParrot1-1/+1
2016-08-28Fix breaking ice in survival not giving a water's source (#3356)ElNounch1-1/+1
Fix #3355
2016-08-04Fixed RasPi builds of unit tests.Mattes D1-1/+3
On RasPi with gcc 4.8.2, the asserts wouldn't compile when tests were enabled. Enforced the assumption that ASSERT code is generated only in Debug builds.
2016-07-21Tab completion across worlds (#3270)Alexander Harkness1-1/+13
Fixes #2563.
2016-05-141.9 / 1.9.2 / 1.9.3 / 1.9.4 protocol support (#3135)Pokechu221-1/+16
* Semistable update to 15w31a I'm going through snapshots in a sequential order since it should make things easier, and since protocol version history is written. * Update to 15w34b protocol Also, fix an issue with the Entity Equipment packet from the past version. Clients are able to connect and do stuff! * Partially update to 15w35e Chunk data doesn't work, but the client joins. I'm waiting to do chunk data because chunk data has an incomplete format until 15w36d. * Add '/blk' debug command This command lets one see what block they are looking at, and makes figuring out what's supposed to be where in a highly broken chunk possible. * Fix CRLF normalization in CheckBasicStyle.lua Normally, this doesn't cause an issue, but when running from cygwin, it detects the CR as whitespace and creates thousands of violations for every single line. Lua, when run on windows, will normalize automatically, but when run via cygwin, it won't. The bug was simply that gsub was returning a replaced version, but not changing the parameter, so the replaced version was ignored. * Update to 15w40b This includes chunk serialization. Fully functional chunk serialization for 1.9. I'm not completely happy with the chunk serialization as-is (correct use of palettes would be great), but cuberite also doesn't skip sending empty chunks so this performance optimization should probably come later. The creation of a full buffer is suboptimal, but it's the easiest way to implement this code. * Write long-by-long rather than creating a buffer This is a bit faster and should be equivalent. However, the code still doesn't look too good. * Update to 15w41a protocol This includes the new set passengers packet, which works off of the ridden entity, not the rider. That means, among other things, that information about the previously ridden vehicle is needed when detaching. So a new method with that info was added. * Update to 15w45a * 15w51b protocol * Update to 1.9.0 protocol Closes #3067. There are still a few things that need to be worked out (picking up items, effects, particles, and most importantly inventory), but in general this should work. I'll make a few more changes tomorrow to get the rest of the protocol set up, along with 1.9.1/1.9.2 (which did make a few changes). Chunks, however, _are_ working, along with most other parts of the game (placing/breaking blocks). * Fix item pickup packet not working That was a silly mistake, but at least it was an easy one. * 1.9.2 protocol support * Fix version info found in server list ping Thus, the client reports that it can connect rather than saying that the server is out of date. This required creating separate classes for 1.9.1 and 1.9.2, unfortunately. * Fix build errors generated by clang These didn't happen in MSVC. * Add protocol19x.cpp and protocol19x.h to CMakeLists * Ignore warnings in protocol19x that are ignored in protocol18x * Document BLOCK_FACE and DIG_STATUS constants * Fix BLOCK_FACE links and add separate section for DIG_STATUS * Fix bat animation and object spawning The causes of both of these are explained in #3135, but the gist is that both were typos. * Implement Use Item packet This means that buckets, bows, fishing rods, and several other similar items now work when not looking at a block. * Handle DIG_STATUS_SWAP_ITEM_IN_HAND * Add support for spawn eggs and potions The items are transformed from the 1.9 version to the 1.8 version when reading and transformed back when sending. * Remove spammy potion debug logging * Fix wolf collar color metadata The wrong type was being used, causing several clientside issues (including the screen going black). * Fix 1.9 chunk sending in the nether The nether and the end don't send skylight. * Fix clang build errors * Fix water bottles becoming mundane potions This happened because the can become splash potion bit got set incorrectly. Water bottles and mundane potions are only differentiated by the fact that water bottles have a metadata of 0, so setting that bit made it a mundane potion. Also add missing break statements to the read item NBT switch, which would otherwise break items with custom names and also cause incorrect "Unimplemented NBT data when parsing!" logging. * Copy Protocol18x as Protocol19x Aditionally, method and class names have been swapped to clean up other diffs. This commit is only added to make the following diffs more readable; it doesn't make any other changes (beyond class names). * Make thrown potions use the correct appearence This was caused by potions now using metadata. * Add missing api doc for cSplashPotionEntity::GetItem * Fix compile error in SplashPotionEntity.cpp * Fix fix of cSplashPotionEntity API doc * Temporarilly disable fall damage particles These were causing issues in 1.9 due to the changed effect ID. * Properly send a kick packet when connecting with an invalid version This means that the client no longer waits on the server screen with no indication whatsoever. However, right now the server list ping isn't implemented for unknown versions, so it'll only load "Old" on the ping. I also added a GetVarIntSize method to cByteBuffer. This helps clean up part of the code here (and I think it could clean up other parts), but it may make sense for it to be moved elsewhere (or declared in a different way). * Handle server list pings from unrecognized versions This isn't the cleanest way of writing it (it feels odd to use ProtocolRecognizer to send packets, and the addition of m_InPingForUnrecognizedVersion feels like the wrong technique), but it works and I can't think of a better way (apart from creating a full separate protocol class to handle only the ping... which would be worse). * Use cPacketizer for the disconnect packet This also should fix clang build errors. * Add 1.9.3 / 1.9.4 support * Fix incorrect indentation in APIDesc
2016-04-24Fixed some logout crashesLogicParrot1-2/+3
2016-04-23ClientHandle destruction thread safetyLogicParrot1-2/+13
2016-04-19Auto clean bad world linkagesLogicParrot1-0/+1
2016-04-05Minor improvements to player freezeLogicParrot1-4/+4
2016-04-05Improved player freeze codeLogicParrot1-16/+19
2016-03-31Players never fall through unloaded chunks or end up inside solids on teleportLogicParrot1-1/+46
2016-02-19Proper entity destruction in non-ticking chunksLogicParrot1-19/+12
2016-02-18Don't remove water after ice block has been destroyedLukas Pioch1-1/+5
2016-02-08Prevent player from falling when block breaking is deniedLogicParrot1-0/+2
2016-01-31Updated old forum linksMathias1-1/+1
2016-01-22Improved tamed wolf pack cooperation and projectile reactionsLogicParrot1-1/+1
2016-01-16Fix crash when tamed wolf is hit by arrowsLogicParrot1-1/+4
2016-01-13Limited the username length to 16 characters.bibo381-0/+6
This fixes a client crash, because Minecraft requires that a username is not longer than 16 characters. See also: http://minecraft.gamepedia.com/The_Player#Name Fixes #2545
2016-01-12Tamed wolf assists owner (attack / defence)LogicParrot1-67/+69
2015-12-18Reorganised the redstone simulatorTiger Wang1-0/+6
-> Many thanks to @worktycho for the idea, and @Haxi52 for the implementation plan! * Uses classes and inheritance now * Speed should be improved
2015-12-13allow use failures to propagate from the entity/block to the playerGargaj1-7/+8
2015-11-24Add enum for Sound and Particle EffectsDave Tucker1-2/+3
Fixes #2603 Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-11-02Examined a fix for #2588Tiger Wang1-0/+6
2015-10-21Fixed a crash when sending messages too early after connection.Mattes D1-1/+12
2015-10-05Improved the data structure for storing loaded chunkstycho1-7/+7
Should significantly increase the performance of deciding which chunks to stream
2015-09-25Maked it compileable for clang-3.7Lukas Pioch1-5/+5
2015-09-21Refactored cProtocol Chat handlingtycho1-8/+10
2015-08-20Fixed food drain bugsTiger Wang1-24/+14
2015-08-12Fix old style casts and implicit conversionsMatti Hänninen1-1/+1
2015-07-29Silenced and fixed many warning messages across multiple files.Samuel Barney1-23/+23
2015-07-14Improved mapsTiger Wang1-20/+2
2015-07-07Fixed warnings generated by 64-bit MSVC.Mattes D1-2/+2
2015-06-10Reinstate "Chunk queue collapsing"Tiger Wang1-15/+12
This reinstates commit f36acb683594daff5af3971dcbe3c3a171628b78 and reverts commit adfbc42c021e1bcfcb355933c0fd784306ce0e18.
2015-06-07Revert "Chunk queue collapsing"worktycho1-12/+15
2015-06-05Made the list of chunks to stream an unordered_settycho1-15/+12
This should increase performance of chunk streaming
2015-06-02Added system and above action bar chat messagesjan641-0/+58
2015-05-30Fix Destroy() calling behaviourTiger Wang1-1/+2
* Fixes Core/#142
2015-05-29Fix for the way connecting clients receive player lists and broadcast chatb33duck1-3/+3
2015-05-28Fixed the way connecting clients receive player lists and broadcast chat to worldsb33duck1-2/+2
2015-05-28Potential crash fixesTiger Wang1-6/+3
* Potentially addresses my comment in #1969 * Probably fixes #2145
2015-05-26Fixed ClientHandle not getting properly removed from the worldtycho1-2/+9
when socket is closed whilst the client is being added to the world Fixes #1969
2015-05-13Fixed chat message manipulation by plugins.Mattes D1-1/+1
Plugins, in their OnChat hook, can change the chat message sent by a player.
2015-05-09More style checking.Mattes D1-6/+6
Spaces around some operators are checked.
2015-05-07Added support for additional data in the ParticleEffect Packettycho1-0/+9
Also started refactoring how broadcasts are handled
2015-04-19ClientHandle: Fixed re-sending refused right-clicks.Mattes D1-1/+8
The coords weren't checked against Y boundary and -1 coords weren't sent. This fixes mc-server/Gallery#45.
2015-04-14Placing a fluid from bucket calls plugin hooks.Mattes D1-1/+3
Ref.: #1857.
2015-04-13Implement backend for /title commandScott Moore1-0/+63
2015-03-21Fixed signedness warnings in Protocol.Mattes D1-1/+1
2015-03-21Fixed signedness issues in protocols.Mattes D1-1/+1
2015-03-21Unified cByteBuffer types.Mattes D1-12/+12
cByteBuffer now reads and writes any of the [U]Int<N> types.
2015-03-20Correct world height validations.Tommy Santerre1-0/+6
Unify the way we test block above the current one (Height - 1 instead of a_RelY + 1). Allow generation of world of flat height = 255
2015-03-05Reverted non-functional changesTiger Wang1-1/+2
2015-02-22Fixed race condition for TCP link deleting.Mattes D1-2/+6
This could have caused crashes when a client disconnected from the server.
2015-02-08Handle client 'leave bed' requestTiger Wang1-25/+3
* Fixes #1728
2015-01-27Fixed a deadlock in cClientHandle network sending.Mattes D1-4/+23
2015-01-27Client: Only decode protocol when there's actual data incoming.Mattes D1-2/+8
2015-01-27Fixed enchant packet handling.Mattes D1-3/+3
2015-01-27Converted cServer to use the cNetwork API.Mattes D1-108/+106
2015-01-18Fixed warnings in 1.7 protocol.Mattes D1-2/+2
2014-12-24Refactored all player block placing to go through hooks.Mattes D1-148/+10
Fixes #1618.
2014-12-13Own classes for all windows.Howaner1-0/+3
2014-12-11Cosmetic touchups.Mattes D1-1/+1
Removed trailing whitespace, added cast to remove warning, added file seeking in case of corrupt files.
2014-12-10Changed method call to DoesAllowMultiLogin() instead of IsAllowMultiLogin()Vincent1-1/+1
Compiles correctly.
2014-12-09Fixed return value in CheckMultiLogin()Vincent1-1/+2
2014-12-09Fixed indent problems and added return definitions to CheckMultiLogin().Vincent1-3/+3
Changed from IsAllowMultiLogin() to DoesAllowMultiLogin(). Fixed CheckMultiLogin() to not run to the end without returning a value.
2014-12-08Changed CheckMultiLogin() to not have main body wrapped in an if statement.Vincent1-19/+22
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-08created callback in Root and changed CheckMultiLogin() to use the DoWithPlayer function at Root instead of World.Vincent1-1/+1
2014-12-08Fixed compile errorsVincent1-8/+3
2014-12-08removed last space in handlehandshakeVincent1-1/+0
2014-12-08Changed HandleHandshake to return the result of CheckMultiLogin instead of just true since it already returns true if it finds and kicks the current player.Vincent1-24/+23
2014-12-08Moved the check into a new function and just calls that function and a blank FindAndDoWithPlayer added.Vincent1-22/+38
2014-12-07changed from using iterator to auto for server and clienthandleVincent1-2/+2
2014-12-07Fixed c++11 branch issues.Mattes D1-4/+8
2014-12-05BasicStyle: Added missing braces to control statements.Mattes D1-0/+4
2014-11-30Changed Kick messagevincentleung11-2/+2
2014-11-30removed extra space and fixed some formatting in cCallbackvincentleung11-3/+3
2014-11-30Uses callback for players already in World.Vincent1-5/+12
2014-11-29fixed naming of strings and changed from i to IVincent1-4/+4
2014-11-29issue 1253 - prevent multiple logins with same usernameVincent1-0/+18
2014-11-25ClientHandle: Fixed max block place distance check.Mattes D1-4/+10
Fixes #1492
2014-11-17Fixed a wrong assert in cClientHandle::SetViewDistance().Mattes D1-4/+8
2014-11-15Use LastPlacedSign instead of LastPlacedBlock.Howaner1-3/+4
2014-11-15Renamed m_UsedViewDistance to m_CurrentViewDistanceHowaner1-8/+8
2014-11-15Renamed m_SetViewDistance to m_RequestedViewDistanceHowaner1-4/+4
2014-11-15Fixed a security problem with signs.Howaner1-2/+7
2014-11-14Use m_UsedViewDistance and m_SetViewDistance.Howaner1-8/+10
2014-10-30Fixed m_SentChunks list chunk removing.Howaner1-1/+1
2014-10-30Added a MaxViewDistance option.Howaner1-1/+3
2014-10-23Use 3 priorities.Howaner1-1/+1
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-26/+26
2014-10-21Reverted hook move.Howaner1-5/+5
2014-10-21Use two lists and 2 chunk send prioritys.Howaner1-41/+0
2014-10-21New c++11 stuff.Howaner1-4/+4
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-26/+26
2014-10-20Migrated cSleep and cTimer to std::chronoTiger Wang1-13/+5
2014-10-19Migrated random generators to std::randomTiger Wang1-12/+0
2014-10-16Merged branch 'fix_chunks'.Mattes D1-3/+34
2014-10-15Functions in cPluginManager get references instead of pointers.Mattes D1-2/+2
2014-10-15Usernames are lowercased before generating offline UUID.Mattes D1-1/+4
This breaks previous offline UUIDs, but it guarantees that future offline UUIDs will be the same even for usernames with wrong capitalization.
2014-10-07Added distance check.Howaner1-0/+12
2014-10-07Corrected drops from dead bush, tall grass and cobweb.Howaner1-5/+5
2014-10-06Stream 4 chunks per tick. Added priority.Howaner1-13/+22
2014-10-06Better StreamNextChunk() methodHowaner1-15/+116
2014-10-05cClientHandle: Added protocol version knowledge.Mattes D1-2/+10
2014-10-03Improved furnacesTiger Wang1-1/+1
* Fixed progress bar on 1.8 * Fixed bugs * Improved code * Fixes #1068 * Fixes #1070
2014-10-02Optimized chunk loaderHowaner1-86/+77
2014-09-30Rewritten plugin messages, vanilla are being parsed directly.madmaxoft1-90/+30
This should finally fix the compatibility problems between 1.7 and 1.8 protocols with the changes in the vanilla plugin messages.
2014-09-28Fixed trailing whitespace.madmaxoft1-1/+1
2014-09-27Combined conditionsMasy981-8/+11
2014-09-27Added barriers correctlyMasy981-0/+5
2014-09-27Dropped support for <1.7.xTiger Wang1-14/+0
2014-09-26Fixed players custom name in 1.8Howaner1-2/+2
2014-09-18Exported player list states to extra functions.Howaner1-6/+42
2014-09-17BungeeCord compatibility: don't overwrite UUID / properties.madmaxoft1-2/+10
2014-09-131.8: Fixed maps.Howaner1-4/+4
2014-09-12Play placesound from the middle of the block.Howaner1-1/+1
2014-09-12Fixed block place sounds.Howaner1-2/+14
2014-09-12Players in survival mode are not allowed to break a bedrock.Howaner1-0/+6
2014-09-12Fixed many right click issues.Howaner1-4/+10
2014-09-121.8: Fixed eating.Howaner1-0/+1
2014-09-111.8: Added ParticleEffect packet.Howaner1-2/+2
2014-09-091.8: Added MultiBlockChange packet.Howaner1-3/+4
2014-09-09Moved sound-configs into BlockID.h and fixed/ added loads of soundsMasy981-1/+1
2014-09-09Added the player list to the 1.8 protocol.Howaner1-3/+7
2014-09-091.8: Added new uuid field.Howaner1-17/+25
2014-09-08More fixes.Howaner1-11/+1
2014-09-08Fixed more 1.8 packets.Howaner1-12/+21
2014-09-02Added SetCustomName() to players.Howaner1-7/+5
2014-08-28Added speed entity effect.Hownaer1-1/+1
2014-08-28Fire can be destroyed with the sword in creative-modeHownaer1-1/+2
2014-08-28Fixed crashes and use std::swap.Hownaer1-3/+19
2014-08-28remove y-coord from chunksLO1ZB1-10/+10
2014-08-22Fixed item drop.Howaner1-14/+18
Fixes #1341
2014-08-21Added initializers for class members.Mattes D1-0/+10
As reported by Coverity, these weren't initialized.
2014-08-11Revert "Removes the fire if the block under the fire was broken."Howaner1-5/+0
This reverts commit 01001d2a49a3366e9b1eccf938d5073ab9a2f06e.
2014-08-11Removes the fire if the block under the fire was broken.Howaner1-0/+5
2014-08-11Moved the clicked-through block check to the top of the function.Howaner1-36/+17
2014-08-11Fixed cancelled fire interact from all directions.Howaner1-4/+12
2014-08-11Exported daylight cycle flag to the protocol.Howaner1-9/+3
2014-08-10Added a comment and simplified code.Howaner1-6/+3
2014-08-07Added SetDoDaylightCycle() and IsDaylightCycleEnabled() to cWorld.Howaner1-1/+10
I need this for a GameRule plugin.
2014-08-06Resending fire to the client when the interact cancelled.Howaner1-0/+8
2014-08-02Fixed a bug who can used from hacked clients.Howaner1-1/+16
2014-08-01Compile fix.Howaner1-2/+1
2014-07-31Import Statistics.hHowaner1-0/+1
2014-07-31Fixed hunger bugs, Implemented golden apple, added jump statistic, added correct food effects.Howaner1-1/+3
2014-07-31Renamed "select..." methods to "set..." and better IsValidEffect() function.Howaner1-2/+2
2014-07-31Renamed functions and added beacon json saving.Howaner1-12/+12
2014-07-30Added beacon.Howaner1-0/+54
2014-07-30MojangAPI: Implemented UUID shortening and dashing.madmaxoft1-1/+2
2014-07-29Slight cleanup after portalsTiger Wang1-2/+1
2014-07-27Fixed group color's.Howaner1-15/+4
2014-07-23SuggestionsTiger Wang1-2/+2
2014-07-21Style: Normalized to no spaces before closing parenthesis.madmaxoft1-3/+3
2014-07-20Bug and crash fixesTiger Wang1-0/+2
* 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-19Fixed attempts to call c_str on ChatColorsarchshift1-4/+4
2014-07-19Fixed style: spaces after commas.madmaxoft1-2/+2
2014-07-18Fix failed merge and other issuesTiger Wang1-2/+2
2014-07-18Fixed creative players not being able to drinkarchshift1-3/+4
Fixes #1215
2014-07-17Normalized comments.madmaxoft1-1/+1
This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
2014-07-17Fixed spaces around single-line comments.madmaxoft1-11/+13
There should be at least two spaces in front and one space after //-style comments.
2014-07-17Fixed basic whitespace problems.madmaxoft1-10/+10
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-3/+4
2014-07-13Changed BroadcastSoundEffect function to take floating pos.Howaner1-3/+3
2014-07-13Revert failed fix for #31Tiger Wang1-27/+4
This reverts commit 69dc9b4c9aea58ebd95e2dbd0205701dfc4ce54e.
2014-06-30Unnecessary returnHowaner1-2/+0
2014-06-29Fixed respawningTiger Wang1-2/+2
* Fixes #1103
2014-06-29Fixed offline UUID generator.Mattes D1-2/+4
It generated invalid UUIDs, too many hex chars.
2014-06-29Send statistics to the player, when he logged in.Howaner1-0/+3
2014-06-28Fixed issue with breaking blocks at -1 coordinatesTiger Wang1-6/+1
2014-06-27Added generic entity-collecting.Mattes D1-2/+2
Now any cEntity can be collected, not only cPickups. This should help PR #1098.
2014-06-27Removed the md5 library, obsoleted by PolarSSL.Mattes D1-13/+9
Fixes #1130.
2014-06-21Added cClientHandle::IsUUIDOnline function.madmaxoft1-0/+29
Ref.: #771
2014-06-17ItemHandler: changed IsDrinkable() to take a short argumentarchshift1-3/+4
2014-06-17Implemented drinkable potions, noeffect entity effect,archshift1-3/+3
Clears entity effects on death
2014-06-17Implemented milk, added documentation to Pawn.harchshift1-3/+3
2014-06-17Add more documentation.Howaner1-0/+2
2014-06-17Add comment.Howaner1-0/+1
2014-06-17Revert "Fix right click bugs."Howaner1-41/+40
This reverts commit 61b6fdde7553dac6e2d5c5a071b9a13fa0d71b2f.
2014-06-12Portals animate and delay correctlyTiger Wang1-4/+3
2014-06-08Fixed deadlock when moving players to other worlds.Mattes D1-16/+5
Fixes #1039, fixes #851
2014-06-08Proper fix for long interaction.madmaxoft1-7/+14
Fixes #1078 and #1038.
2014-06-04Fixed bad coordinateworktycho1-1/+1
2014-05-31Implemented end and nether portalsTiger Wang1-4/+3
2014-05-28Fix fire break.Howaner1-16/+17
2014-05-28Fix right click bugs.Howaner1-40/+41
2014-05-27ClientHandle.cpp: Process look before posarchshift1-1/+1
2014-05-26ClientHandle.cpp: remove redundant codearchshift1-22/+2
HandlePlayerMoveLook() calls HandlePlayerPos() and HandlePlayerLook() to reduce code redundancy.
2014-05-26Revert "Add more move checks"madmaxoft1-58/+16
This reverts commit 989312c4e7f517ae324e857cb255211e3fd8bb06.
2014-05-25Hopefully fixed piston duplication issuesTiger Wang1-1/+0
* Fixes #879 * Fixes #714
2014-05-18Implemented cacti damageTiger Wang1-2/+3
+ Implemented cacti damage * Fixed pickup tossing (PR #994 bug)
2014-05-16Add more move checksHowaner1-16/+58
- Invalid X/Y/Z/Stance check (std::isnan) - Illegal stance - Illegal position (32.000.000 is the world size)
2014-05-15Fix compile error.Howaner1-1/+1
2014-05-15Move radius check.Howaner1-25/+40
2014-05-11Fixed stat serializationandrew1-8/+0
2014-05-11Statistic Managerandrew1-1/+18
2014-05-11Rename HandleBlockDigCancel to FinishDigAnimtion.Howaner1-3/+3
2014-05-09Add block place/break distance check.Howaner1-0/+21
2014-05-09Add DIG_STATUS_CANCELLED packet and add item resend, when a block can't place/break.Howaner1-17/+44
2014-05-06Simplified the HandleAnvilItemName() code.Howaner1-7/+2
2014-05-05Changed HandleAnvilItemName() length to size_t in ClientHandle.hHowaner1-1/+1
2014-05-05Add clicks, exp subtraction, item check, ...Howaner1-1/+1
2014-05-05Add MC|ItemName plugin message.Howaner1-0/+32
2014-05-02HOOK_DISCONNECT has cClientHandle as its first parameter.madmaxoft1-3/+3
Ref.: #655.
2014-05-01More ClientHandle fixes.madmaxoft1-2/+2
2014-05-01Fixed warnings in ClientHandle.madmaxoft1-2/+2
2014-05-01Fixed crashes in the SSL HTTP connection.madmaxoft1-1/+2
2014-04-29Delayed sending the KeepAlive packet for 3 seconds after login.madmaxoft1-0/+5
This should alleviate #889.
2014-04-28Fixed braces.madmaxoft1-1/+5
2014-04-28Fixed missing return value warning in MSVC.madmaxoft1-0/+1
2014-04-27Redstone simulator now directly accesses cChunkTiger Wang1-1/+2
* Redstone simulator performance improvements * Added return values to some functions * Minor fixes
2014-04-26More small fixes.archshift1-9/+9
2014-04-26Moar alignment.archshift1-7/+7
2014-04-26Further refactored, Reverted Minecart changearchshift1-57/+21
Other small changes.
2014-04-25Oops, fixed that.archshift1-0/+2
2014-04-25Refactored SendChat(), placing the message-type formatting into its own function.archshift1-84/+78
Removed default case warning in the process.
2014-04-24Fix armor in survival mode.Howaner1-1/+1
2014-04-19Declared one mutex as mutable in order to allow for const correct get accessors.jfhumann1-4/+4
2014-04-18Small style changesjfhumann1-1/+1
2014-04-18Did some static analysis, fixed some bugs and optimized a lot of codejfhumann1-8/+10
2014-04-18Removed old includedaniel09161-1/+1
2014-04-17Fixed some Errors (not all)daniel09161-7/+10
2014-04-17Modified many thingsdaniel09161-856/+1
2014-04-16Fixed conflicting enchantments checkingdaniel09161-23/+23
2014-04-16Added deletions from merge conflictdaniel09161-0/+875
2014-04-16Fixed merge conflictdaniel09161-877/+0
2014-04-15Attempted fix for the client crash with the new protocols.madmaxoft1-6/+9
2014-04-15Code Optimizationdaniel09161-356/+180
2014-04-15Added Book Enchantingdaniel09161-1/+310
2014-04-15Modified namesdaniel09161-47/+47
2014-04-15Add linux compatibilityHowaner1-61/+71
2014-04-14Implemented the 1.7.6 protocol and authenticator.madmaxoft1-8/+22
Server works both in online and offline modes with 1.7.9.
2014-04-14A client UUID is generated when the server is in offline mode.madmaxoft1-0/+24
1.7.9 client works with these changes in offline mode.
2014-04-14Removed Debug Messagedaniel09161-2/+0
2014-04-14Added/Modified last things for Enchanting Systemdaniel09161-15/+53
2014-04-14Bug fixesdaniel09161-2/+2
2014-04-13Fixed invisibility enchantmentsdaniel09161-1/+3
2014-04-13Fixed mistakedaniel09161-1/+1
2014-04-13Fixed Server Crashdaniel09161-0/+6
2014-04-13Some Fixesdaniel09161-1/+8
2014-04-13Added Yggdrasil Authentication Systemdaniel09161-2/+5
Code by Howaner. Fixes/Changes by me.
2014-04-12Added complete Enchanting Systemdaniel09161-15/+662
http://minecraft.gamepedia.com/Enchantment_mechanics
2014-04-12Entities handle chunks properly againTiger Wang1-1/+1
* Entities properly handle chunks * Changed EntityStatus enums to be less shouty
2014-04-04Fixed some Clang warnings in protocols.madmaxoft1-2/+2
2014-04-02Fixed All signedness warnings in HTTPServer.cppTycho1-1/+1
2014-03-31Simplified and fixed slabs, fixes #835Tiger Wang1-1/+1
2014-03-29Compare for inequality in FACE_NONE checksTiger Wang1-3/+3
2014-03-29Removed leftover clienthandle codeTiger Wang1-10/+6
2014-03-29Fixed players not updating after world changeTiger Wang1-4/+2
Addendum to 6dea7993f2a563a8b3a0746feeb2174922631526
2014-03-28Fixed block interaction rate checkTiger Wang1-2/+4
2014-03-23Implemented lilypad placementTiger Wang1-4/+8
2014-03-11Fixed a load of format string errorsTycho1-1/+1
2014-03-11Unified Vector classesandrew1-3/+0
2014-03-10Removed Some unnessicary macrosTycho1-13/+0
2014-03-09!= FACE_NONETiger Wang1-1/+1
2014-03-09Fixed data length issuesTiger Wang1-1/+1
2014-03-09CheckBlockInteractionsRate() fixed & enabledTiger Wang1-29/+19
2014-03-09Slight plugin messaging changesTiger Wang1-0/+13
- Clients are not allowed to register duplicate channels - Clients are not allowed to use channels that were not registered
2014-03-08Split cClientHandle::HandleEntityAction() into three seperate functions HandleEntityCrouch, HandleEntityLeaveBed and HandleEntitySprinting.Jan-Fabian Humann1-28/+30
2014-03-08Fixed issues with int vs size_t and a few other warningsTycho1-2/+2
2014-03-05Add data backsending, when the Client interacts a Block and the Interact is cancelled.Howaner1-4/+10
2014-03-02cBlockInfo now manages the respective cBlockHandlerandrew1-3/+3
2014-03-01g_BlockXXX => cBlockInfo::XXXandrew1-1/+1
2014-02-28Use switch in GetStepSoundHowaner1-1/+1
2014-02-28Fix Double Slabs, fix Slab Meta and add more things to burnableHowaner1-1/+1
2014-02-23Use the ItemCategorie::IsSword() Method.Howaner1-1/+1
2014-02-23No Sword Block Destroying in Creative ModeHowaner1-0/+10
2014-02-20cClientHandle manages the client-registered plugin channels.madmaxoft1-10/+77
Fixes #706.
2014-02-18Map decorators; Map clientsandrew1-13/+9
2014-02-18Implemented paintings, fixes #689Tiger Wang1-0/+8
+ Implemented paintings
2014-02-17Map item handler; Fixed several bugsandrew1-2/+0
2014-02-16Links sent via chat messages are clickable.madmaxoft1-8/+14
Fixes #658.
2014-02-16Add Locale to ClientHandleHowaner1-0/+1
2014-02-15Implemented cCompositeChat.madmaxoft1-1/+11
This allows plugins to send composite chat messages, containing URLs, commands to run and cmdline suggestions. Fixes #678.
2014-02-15cMap::UpdateRadiusandrew1-0/+2
2014-02-14Send map when selectedandrew1-0/+13
2014-02-13Implementation of in-game mapsandrew1-0/+18
2014-02-07Added sender name to PM if prefixes disabledTiger Wang1-1/+1
* Also moved the PVP setting into Mechanics
2014-02-07Improved chat messaging functionsTiger Wang1-6/+108
* Moved string manipulation into cClientHandle and therefore... + Added configuration option for prefixes. * Cleaned up code. * Updated documentation for API.
2014-02-06Server internally uses new functionsTiger Wang1-8/+6
2014-02-05Reduced max explosions per tickTiger Wang1-1/+1
2014-02-05Fixed explosions bugTiger Wang1-20/+10
* Fixed bug where explosions would sometimes never be sent
2014-02-04Improved Type safety of eBlockFaceTycho1-5/+5
May Fix #640
2014-02-03Fixed a crash bugTiger Wang1-8/+2
2014-02-03Server now handles join messages alsoTiger Wang1-9/+11
* Revised as well hook documentation
2014-02-01Changed Signiture of OnDiggingTycho1-3/+3
2014-02-01Changed Signiture of OnDestroyedByPlayerTycho1-3/+4
2014-02-01Changed pointers to referencesTycho1-4/+3
2014-02-01Changed signitures of Several BLockHandler MethodsTycho1-1/+2
Changed the signitures of the following to use interfaces: GetPlacementBlockTypeMeta OnPlaced OnPlacedByPlayer OnDestroyed OnNeighbourChanged NeighbourChanged OnUse CanBeAt Check
2014-01-31Some updates for enchanting (2)daniel09161-0/+36
2014-01-26Refactored cBlockHandler::OnUse and dependentsTycho1-1/+4
2014-01-25First attempt at Implementing InterfacesTycho1-1/+1
2014-01-25Two minor changesTiger Wang1-1/+1
2014-01-24Fixed a possible deadlock on client disconnect.madmaxoft1-9/+0
2014-01-23Command block fixes 2andrew1-16/+9
2014-01-23Split TossItem into three Toss functions (Held, Equipped and Pickup)Mike Hunsinger1-2/+3
2014-01-21Scoreboard SendTo()andrew1-0/+3
2014-01-21Scoreboard protocol supportandrew1-0/+30
2014-01-19Removed unneeded paramtersTiger Wang1-2/+2
2014-01-19Rewritten SocketThreads for proper shutdown scenario.madmaxoft1-5/+1
This fixes #560 and #390.
2014-01-19Changed SendBlockEntity format slightlyTiger Wang1-3/+6
* Writing NBT is now in Protocol, not BlockEntity files * Fixed a last output bug
2014-01-19Implemented MC|Brand responseTiger Wang1-3/+9
2014-01-19Improved command blocksTiger Wang1-0/+9
* Their command and previous output are displayed on the client * They have a BlockHandler implementation, so you can't place blocks on them anymore + As a side effect, implemented UpdateBlockEntity
2014-01-18Command block fixesandrew1-5/+12
2014-01-18Parse the MC|AdvCdm plugin messageandrew1-0/+64
2014-01-16Removed obsoleted functionsTiger Wang1-2/+2
2014-01-15Implemented Ctrl-Q drop stackTiger Wang1-0/+11
Also fixed an issue with TossItems not respecting count.
2014-01-09Added cClientHandle::SendPluginMessage().madmaxoft1-0/+9
It is not yet exported in the API, though.
2014-01-07Plugin messages are received and handed to plugins.madmaxoft1-0/+9
Note that MCS doesn't currently handle any channel registrations, this will come later on.
2013-12-31fixed ClientHandle warningsTycho Bickerstaff1-0/+1
2013-12-22Implented BroadcastParticleEffectSTRWarrior1-0/+9
2013-12-20Fixed the rest of constructor reorders.madmaxoft1-21/+20
2013-12-19Fixed PlayerAbilities and creativeTiger Wang1-3/+3
2013-12-19Fixed 1.7 arm swing animationTiger Wang1-1/+23
2013-12-18Disconnection message no longer shown if pingTiger Wang1-5/+8
2013-12-18The "<>" of a player name is now colouredTiger Wang1-1/+1
2013-12-18Fixed 1.7 player disconnection not calling hookTiger Wang1-4/+14
This fixes #357
2013-12-18Renamed back EntityAnimation to PlayerAnimationTiger Wang1-1/+1
This fixes #411 and partially reverts 30ead790490f04248b861db79fddde9148b552f4
2013-12-16Fixed cClientHandle::Tick() being called from two threads.madmaxoft1-6/+43
When the player was initialized, the Tick() function continued to stream chunk, while the cWorld called Tick() from its tick thread. Final fix for #187.
2013-12-16Fixed multiple player spawn broadcasts.madmaxoft1-3/+0
2013-12-15Fixed calling OnPlayerJoined() in the wrong place.madmaxoft1-6/+1
This is the first part of a fix for #187.
2013-12-15This adds a function that allows you to 'shoot' a player towards a direction.STRWarrior1-2/+0
2013-12-15Moved reading flags to the protocol.STRWarrior1-17/+3
2013-12-15Added m_IsFlying and m_CanFly. Both have a Get and Set function. Added cClientHandle::SendPlayerAbilities() functionSTRWarrior1-0/+33
2013-12-14Forgot to commit the ClientHandle.STRWarrior1-0/+18
2013-12-12Unknown packet type extended to 32 bits.madmaxoft1-3/+3
2013-12-08Moved bindings-related to a Bindings subfolder.madmaxoft1-1/+1
Ref.: #407
2013-12-07Fixed trapdoors not togglingTiger Wang1-1/+1
The redstone simulator kept on resetting them.
2013-12-07Renamed animation functionTiger Wang1-7/+7
Renamed BroadcastPlayerAnimation to BroadcastEntityAnimation. Not just players can have animations, you know.
2013-12-06Fixed bed leave animationTiger Wang1-1/+1
2013-12-06Updated comments for slabsTiger Wang1-5/+6
2013-12-02Switched to using provided ReadItem function.Samuel Barney1-0/+9
Fixed misplacing when clicking on the bottom of bottom slabs and the top of top slabs.
2013-11-30Properly fixed snow height, fixes #98 and #264Tiger Wang1-9/+14
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-15finished #143 I believeDaniel O'Brien1-2/+5
2013-11-15added cProtocol function to pass xp to clientDaniel O'Brien1-0/+9
2013-11-10Bundled fixes [SEE DESC]Tiger Wang1-2/+2
* Fixed compiler warning in Monster.cpp * Future proofed particle effects * Improved pickups, made less jittery
2013-11-08cProtocol::SendWindowOpen() signature changed.madmaxoft1-2/+2
This implements #313.
2013-11-05Removed the obsolete SendWholeInventory(cInventory &) function.madmaxoft1-11/+2
This won't compile because there's still a change in Protocol17x.cpp pending; the next commit will fix this.
2013-11-04Autogeneration of settings.ini and webadmin.iniTiger Wang1-2/+2
Fixes issue #75
2013-11-03ClientHandle: Fixed an error in player-joining hook.madmaxoft1-2/+2
Players being disconnected used to fire the PlayerJoined hook repeatedly.
2013-10-29Changed GameMode() == 1 to IsGameModeCreative in AggressiveMonster.cpp and ClientHandle.cppSTRWarrior1-1/+1
2013-10-29Fixed bug where creative inventory didn't work.STRWarrior1-1/+1
2013-10-28Renamed cWindow constants to include the "wt" prefix.madmaxoft1-2/+2
2013-09-22Changed a commentTiger Wang1-1/+1
Was a remnant of my TypeType minecarts :D
2013-09-21Fixed pickup spawning with inherited gamemode.madmaxoft1-0/+1
2013-09-15Removed leftover CanBePlacedOnSideTiger Wang1-7/+0
2013-09-15Removed leftover DoesAllowBlockOnTopTiger Wang1-9/+0
2013-09-09Removed the cDoors class.madmaxoft1-1/+0
The helper functions that it implemented were moved into their respective blockhandlers.
2013-09-08Fixed client spawning.madmaxoft1-108/+51
The method used for 1.2.5 clients no longer works. Fixes #139.
2013-09-06Implemented SteerVehicle packet.madmaxoft1-0/+9
2013-09-06Implemented SteerVehicle packet.madmaxoft1-0/+9
2013-08-30Shooting a bow kinda works.madmaxoft1-4/+4
The arrow is released, but sometimes hits wrong blocks or disappears completely.
2013-08-29Implemented xoft's suggestions [SEE DESC]Tiger Wang1-2/+2
Rail metas are now in BlockID and exported to LUA Minecart now does a SetMass, instead of m_Mass Minecarts use SubType instead of TypeType
2013-08-28Fixed Minecart spawning issuesTiger Wang1-2/+2
Now you can have everything!
2013-08-24Client can no longer place blocks outside the Y range of the world.madmaxoft1-1/+6
Fixes #128.
2013-08-24Added comments and fixed a bugTiger Wang1-9/+21
Bug was placing slabs between slabs not making a double slab.
2013-08-24Fixed final slab bugTiger Wang1-1/+1
This bug allowed a double slab to be made below by placing a compatible slab on a "top" slab. The coordinates are always one lower, so now it checks to see if the slab orientation can be made into a double.
2013-08-23Double slabs work *choke choke*Tiger Wang1-20/+49
2013-08-22Another fix for #31.madmaxoft1-0/+6
This seems to have done it, no more crashes for me.
2013-08-20Added a delay between the kick packet and socket close.madmaxoft1-2/+17
This should have helped #31, but the client disagrees.
2013-08-20Fixed player spawning.madmaxoft1-0/+10
Now the player is spawned only after the chunk they're in is sent to the client. Hopefully no more falling-through-terrain-while-loggin-in.
2013-08-19Fixed the extreme strain on the world tick thread.madmaxoft1-0/+2
Block changes were sent even with empty changesets, causing a lot of lost CPU cycles.
2013-08-19Moved entities into the Entities subfolder.madmaxoft1-3/+2
2013-08-18Added cWindow property manipulation API.madmaxoft1-17/+17
Now enchantment table and furnace properties can be set by a plugin
2013-08-14ClientHandle no longer queues chat messages.madmaxoft1-47/+17
It is no longer needed to queue chat messages, because the protocol is parsed within the Tick thread itself, without holding any SocketThread CS.
2013-08-14Player counts are now properly handled.madmaxoft1-1/+37
Fixes #80
2013-08-13Clients are now ticked in cServer first, then in cWorld once they get assigned a world.madmaxoft1-31/+32
2013-08-12Removed cServer::BroadcastChat() and cServer::SendMessage().madmaxoft1-6/+8
These two functions make it difficult to move to the new ticking system, and they aren't used anyway. If so required, they can be emulated by ForEachWorld / ForEachPlayer calls.
2013-08-11Moved MaxPlayers and Description from cWorld to cServer.madmaxoft1-7/+7
Also started creating a new cWorld::cTickThread class, but not used yet.
2013-08-11Added OnPlayerAnimation() hook.madmaxoft1-0/+6
Initial patch by @STR_Warrior, updated to account for different animation packets.
2013-08-10Removed extra disconnect messageTiger Wang1-5/+0
There seems to be already one in the HandleDisconnect hook function.
2013-08-09Fixed some formatting issues I accidentally introducedJames Ravenscroft1-0/+2
2013-08-09Added IsSwimming and IsSubmerged flags and access methodsJames Ravenscroft1-4/+2
2013-08-08Fixed the jump food exhaustion being added when player is swimmingJames Ravenscroft1-3/+8
2013-08-02Implemented OnPlayerRightClickingEntity() hookmadmaxoft1-0/+4
Fixes FS 425
2013-07-31Implemented the actual tab completion for commands and playernames.madmaxoft1-1/+1
Each command is reported only if the player has the permission to use it.
2013-07-30Tab completion packet is handled and sent.madmaxoft1-0/+26
This only handles the network comm and the overall design logic, the actual completion is not yet implemented, only dummy values are returned for now.
2013-07-29Added the "Edit Sign" packet sent to the client placing a sign.madmaxoft1-0/+9
Fixes issue #20. The 1.6.2 client wouldn't open the sign editor UI unless it receives a special packet
2013-07-28Player eating is now properly broadcast to other players.madmaxoft1-0/+5
Also fixed the API relating to food, determining player gamemode, and removed several unneeded API functions.
2013-07-28Implemented basic eating support.madmaxoft1-12/+8
Food is now properly consumed and it takes 1.5 sec.
2013-07-12First implementation of movement-related hunger and APImadmaxoft@gmail.com1-9/+19
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1673 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-08Color codes are stripped from the DC messagemadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1670 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-07Fixed sprinting in 1.6.1, made speeds available through API; fixed messages containing quotes.madmaxoft@gmail.com1-0/+11
Fixes FS #415 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1660 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-07Improved function names for protocol packet sending; alpha-sorted the function listsmadmaxoft@gmail.com1-148/+157
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1659 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-05Unmounting vehicles implemented in the 1.6.1 waymadmaxoft@gmail.com1-0/+13
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1650 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-05Fixed 1.6.1's movement speedmadmaxoft@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1649 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-07-03Fixed player moving between worlds.madmaxoft@gmail.com1-13/+54
Fixes FS #407. Also fixes a few possible deadlocks between SocketThreads and TickThread git-svn-id: http://mc-server.googlecode.com/svn/trunk@1641 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-29Fixed crouch-placing unplaceable items (FS #399)madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1632 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-22Plugins can modify message in the OnChat() hook handler.madmaxoft@gmail.com1-2/+3
FS #376 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1622 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-18Crouching will allow block placement on otherwise functional blocks.madmaxoft@gmail.com1-2/+2
Fixes FS #382 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1607 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-18Added a crude limiter for explosions sent to client.madmaxoft@gmail.com1-1/+27
Now the client can survive even 3000k TNT blocks exploding without jerking much. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-18More TNT fixes.madmaxoft@gmail.com1-1/+1
Chain-reaction TNTs are spawned in proper coordinates (FS #390) Centralized Primed TNT entity spawning and made available to the plugins. Internal changes for better TNT performance. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1604 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-16Added an elaborative comment on the deadlock prevention codemadmaxoft@gmail.com1-1/+12
(FS #375) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1597 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-15First attempt at fixing the inter-threading deadlocks between the tick thread and the socket threadmadmaxoft@gmail.com1-1/+11
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1591 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-04Removed cLadder, cSign, cStairs, cTorch and cVine classes, moved their functionality into the appropriate BlockHandlers / ItemHandlersmadmaxoft@gmail.com1-4/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1555 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-04Implemented proper player crouching.madmaxoft@gmail.com1-4/+18
Fixes FS #365 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1553 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-30LuaWindow: Initial code, the window can be opened, but not much manipulatedmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1532 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-28Moved BlockEntities to a separate foldermadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1527 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-24Refactored cInventory to use cItemGrid for the actual Storagemadmaxoft@gmail.com1-4/+3
This makes the API more orthogonal and is easier to use in the plugins. Also changes in the inventory are now propagated to the needed places (armor updates to BroadcastEntityEquipment etc.) even when the inventory is changed by a plugin. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1503 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-19Inventory code cleanup, players can now see each other's armormadmaxoft@gmail.com1-5/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1493 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-08Refactored window clicking code to use different click actionsmadmaxoft@gmail.com1-5/+5
First part of solving FS #371; should fix #370. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1459 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-19Fixed Linux compilation, slight code cleanupmadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1396 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-18Initial implementation of explosions and TNT blockkeyboard.osh@gmail.com1-0/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1392 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-13Rewritten entities so that they are owned by individual chunks and ticked within their chunk's Tick()madmaxoft@gmail.com1-16/+14
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1385 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-04Fixed personal crafting grid not being tossed on inventory close.madmaxoft@gmail.com1-4/+4
FS #355, http://www.mc-server.org/support/index.php?do=details&task_id=355 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1358 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-02Added support for head yaw tracking and packet sending and fixed bug in BroadcastMovementUpdatekeyboard.osh@gmail.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1350 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-18Added support for the packet #28 (0x1C): ENTITY_VELOCITYkeyboard.osh@gmail.com1-0/+11
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1283 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-03Player can sit in minecarts (but not move them yet)madmaxoft@gmail.com1-1/+25
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1249 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-27Made FAST_FLOOR_DIV work correctly, replaced all floorf() divisions with it.madmaxoft@gmail.com1-2/+2
Still not perfect - chunk and region calculations can be made into a single CPU instruction - SAR - but not all compilers are known to support that (">>" operator on signed datatypes needs to perform arithmetic shift, C/C++ standard makes it implementation-specific; MSVC and GCC do what we need, LLVM unknown) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1224 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-21Moved the Speed member into cEntity class instead of its descendants.madmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1222 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-18Minecarts can now be placed.madmaxoft@gmail.com1-0/+9
No interaction, no physics, though. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1219 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-14Fixed one-hit-blocks not being broken server-sidemadmaxoft@gmail.com1-2/+4
FS #301 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1213 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-13Added missing dig status.luksor111@gmail.com1-0/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1141 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-12Merged branch "branches/hooks" into "trunk".madmaxoft@gmail.com1-171/+307
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1139 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-05Not sending multiple DC packets to the client.madmaxoft@gmail.com1-6/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1120 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-27Fixed OnBlockPlace hookluksor111@gmail.com1-10/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1113 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-26Adjusted the protocol framework to support different types of falling block spawning.madmaxoft@gmail.com1-0/+9
In brief, with cProtocol, "say what you want done, not how you want me to do it". But still 1.4.6 crashes on falling block spawning. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1104 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-24Added the 1.4.6 protocolmadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1099 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-21Refactored the TakeDamage API to take equipped weapon and armor into consideration (PvP untested)madmaxoft@gmail.com1-6/+4
http://forum.mc-server.org/showthread.php?tid=625 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1087 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-20Removed chat messages from consoleluksor111@gmail.com1-1/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1082 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-19Added dispensers (they can't dispense items yet)luksor111@gmail.com1-15/+21
Fixed crash when digging snow Moved BlockPlace hook check, so Core plugin will no longer block item usage Player chat messages are now visible in the console git-svn-id: http://mc-server.googlecode.com/svn/trunk@1081 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-18Fixed wrong c++ standard assumptions about bools.madmaxoft@gmail.com1-2/+4
Should fix FS #265. http://forum.mc-server.org/showthread.php?tid=629&pid=5415#pid5415 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1053 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-16Removed log message when spawning players on a client.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1047 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-12Fixed block breaking in survival.luksor111@gmail.com1-4/+15
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1038 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-11Hopefully a fix for crash when chunks are added to a client being destroyed.madmaxoft@gmail.com1-4/+21
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1032 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-01Refactored the world time.madmaxoft@gmail.com1-7/+10
Now it is stored in two values - WorldAge (only incremented, plugins cannot change) and TimeOfDay (plugins can change). Since sub-tick precision is needed in Tick(), we store it both as number of seconds (double) and number of ticks (Int64) is calculated off of that. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1022 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-22You can now see particles and hear sounds when other players are destroying blocks.luksor111@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1004 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-21Added jukeboxes (patch contributed by Luksor)madmaxoft@gmail.com1-0/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@994 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-18Converted some const char*s and std::strings to AStringsfaketruth1-0/+9
Added a cPlayer:RemoveFromGroup() so players can be removed from groups programmatically Added a cClientHandle:SetUsername to be used by Lua. I'm curious what ThuGie can do with his plugin. git-svn-id: http://mc-server.googlecode.com/svn/trunk@978 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-17Fixed a vulnerability in cClientHandle::HandleRespawn()faketruth1-1/+9
Changed some hook locations: Moved HOOK_PLAYER_JOIN to where HOOK_PLAYER_SPAWN was (before player is added to the world) Added HOOK_PLAYER_SPAWN to after a player's initial spawn and after a player is re-spawned after death git-svn-id: http://mc-server.googlecode.com/svn/trunk@972 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-10Added an option to disable/enable PVP on a per world basisfaketruth1-0/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@944 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-06Fixed an invalid direction to AddDirection()madmaxoft@gmail.com1-8/+11
( http://forum.mc-server.org/showthread.php?tid=571&pid=4821#pid4821 ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@939 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-06Completely removed the old (buggy) redstone simulator.madmaxoft@gmail.com1-1/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@937 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-01Slight refactoring of BlockHandlers - dropping unneeded virtual functionsmadmaxoft@gmail.com1-3/+3
( http://forum.mc-server.org/showthread.php?tid=434&pid=4734#pid4734 ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@917 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-30Added falling block entities. Sand and gravel now properly fall downfaketruth1-0/+8
Implemented the PACKET_SPAWN_OBJECT packet Made some things use BLOCKTYPE instead of char Android: Requests WebAdmin port when pressing the configure button git-svn-id: http://mc-server.googlecode.com/svn/trunk@915 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-29Removed a rogue cSleep from ClientHandle. Since sockets are owned by sockethreads, the client can safely Destroy() itself right after sending a packet.madmaxoft@gmail.com1-4/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@912 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-29Beds can be slept in now (it doesn't change the time though)faketruth1-0/+27
git-svn-id: http://mc-server.googlecode.com/svn/trunk@911 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-25Added the block dig animation packet (patch contributed by l0udPL)madmaxoft@gmail.com1-2/+45
git-svn-id: http://mc-server.googlecode.com/svn/trunk@892 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-25Sockets are now owned by SocketThreads instead of ClientHandle (FS #246 and FS #247)madmaxoft@gmail.com1-27/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@891 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-23/+23
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: ChunkDataSerializer is Protocol-relatedmadmaxoft@gmail.com1-1/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@886 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: OSSupport-related files in a separate subfolder, renamed.madmaxoft@gmail.com1-4/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@885 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: Removed unused cBlockToPickupmadmaxoft@gmail.com1-1/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@884 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: Mobs-related files in a separate subfolder, renamed.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@883 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: Protocol-related files in a separate subfoldermadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@880 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Source files cleanup: UI files renamedmadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@878 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Fixed position confirming for 1.3.2 (FS #245)madmaxoft@gmail.com1-1/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@877 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Fixed players not spawning to others when they join the server.madmaxoft@gmail.com1-0/+3
Ref.: http://forum.mc-server.org/showthread.php?tid=434&pid=4633#pid4633 git-svn-id: http://mc-server.googlecode.com/svn/trunk@876 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-23Tweaked logging.madmaxoft@gmail.com1-0/+6
Less output for UI. More output for player pos confirming (FS #245) and for player spawning git-svn-id: http://mc-server.googlecode.com/svn/trunk@875 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-20Refactored windows.madmaxoft@gmail.com1-12/+14
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-09-11Merged in a patch for sounds by l0udPLmadmaxoft@gmail.com1-0/+11
http://forum.mc-server.org/showthread.php?tid=434&pid=4564#pid4564 git-svn-id: http://mc-server.googlecode.com/svn/trunk@858 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-07Relaxed the check for held item, the client sometimes sends wrong ItemType.madmaxoft@gmail.com1-2/+9
http://forum.mc-server.org/showthread.php?tid=549&pid=4502#pid4502 git-svn-id: http://mc-server.googlecode.com/svn/trunk@846 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-06Added protocol-specific authentication, now works for both 1.2.5 and 1.3.2madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@841 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-06ClientHandle: added an overflow buffer for outgoing data, it fixes the "bad packet id" problem with 1.3.2.madmaxoft@gmail.com1-5/+32
git-svn-id: http://mc-server.googlecode.com/svn/trunk@837 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-05Added the possibility of reserved player slots by implementing the HandleHandshake hook!faketruth1-0/+17
More info: http://forum.mc-server.org/showthread.php?tid=555 git-svn-id: http://mc-server.googlecode.com/svn/trunk@836 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-04Fixed a possible race condition in cClientHandle's packet sending code; prepared for moving cSocket out of cClientHandle's ownership.madmaxoft@gmail.com1-2/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@832 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-02Next iteration on the 1.3.2 protocol. Still no good, but sometimes it just gets through. For your testing pleasures ;)madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@819 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-01Fix for Rev 814, the correct cPlayer object is actually sent into the callbacks.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@816 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-01Implemented: http://www.mc-server.org/support/index.php?do=details&task_id=239&project=2&dev=26lapayo94@gmail.com1-1/+1
Fixed Bug on build collision git-svn-id: http://mc-server.googlecode.com/svn/trunk@813 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-31Progress on the 1.3.2 protocol.madmaxoft@gmail.com1-2/+2
Sometimes the client lets the player through, but most of the times the connection breaks for no apparent reason. git-svn-id: http://mc-server.googlecode.com/svn/trunk@812 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-31Another possible deadlock in cClientHandle averted. Hope this is the one.madmaxoft@gmail.com1-5/+13
git-svn-id: http://mc-server.googlecode.com/svn/trunk@810 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-31Fixed one possibility of a deadlock in cClientHandle::SendChunkData()madmaxoft@gmail.com1-13/+16
git-svn-id: http://mc-server.googlecode.com/svn/trunk@809 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-30Added a basic protocol recognizer and the base for 1.3.2 protocol.madmaxoft@gmail.com1-25/+10
Also fixed a few type-related warnings. git-svn-id: http://mc-server.googlecode.com/svn/trunk@805 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-30cProtocol handles the initial handshake up to player loginmadmaxoft@gmail.com1-58/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@804 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-29Gotten completely rid of all cPackets. The cProtocol125 class now does all the parsing and writing by itself.madmaxoft@gmail.com1-4/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@802 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-28Moved all packet-serializing code into cProtocol125; half the packet classes aren't needed anymore.madmaxoft@gmail.com1-38/+36
git-svn-id: http://mc-server.googlecode.com/svn/trunk@800 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-27Cut out all packet handling to a separate cProtocol descendantmadmaxoft@gmail.com1-892/+175
git-svn-id: http://mc-server.googlecode.com/svn/trunk@796 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-26git-svn-id: http://mc-server.googlecode.com/svn/trunk@795 0a769ca7-a7f5-676a-18bf-c427514a06d6madmaxoft@gmail.com1-0/+16
2012-08-25cSocket doesn't use cPackets.madmaxoft@gmail.com1-10/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@790 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-25cWorld doesn't use cPackets.madmaxoft@gmail.com1-0/+58
git-svn-id: http://mc-server.googlecode.com/svn/trunk@789 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-25Removed cPackets from cChunk.madmaxoft@gmail.com1-2/+69
Also decoupled a possible deadlock in player login code. git-svn-id: http://mc-server.googlecode.com/svn/trunk@788 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-24cPickup doesn't use cPackets.madmaxoft@gmail.com1-0/+13
Also, Lua API change, OnCollectItem -> OnCollectPickup; first param is cPlayer to match other callbacks. git-svn-id: http://mc-server.googlecode.com/svn/trunk@786 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-24Monster classes don't use cPackets. Chat messages are sent / broadcast without cPackets. BlockEntities don't use cPackets.madmaxoft@gmail.com1-0/+77
git-svn-id: http://mc-server.googlecode.com/svn/trunk@783 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Window, Chest, Furnace and Pawn are not using cPackets at allmadmaxoft@gmail.com1-0/+39
git-svn-id: http://mc-server.googlecode.com/svn/trunk@762 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Almost all packets' handling is now rewritten not to use cPacket descendants elsewhere than in cClientHandle.madmaxoft@gmail.com1-49/+286
git-svn-id: http://mc-server.googlecode.com/svn/trunk@761 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Another handful of packets rewritten.madmaxoft@gmail.com1-31/+123
Also changed cItem::m_ItemID into m_ItemType of type short. Easier handling. m_ItemID kept for compatibility reasons (Lua-interface etc.) git-svn-id: http://mc-server.googlecode.com/svn/trunk@756 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-19Fixed Bug #236lapayo94@gmail.com1-3/+3
Workbench, Chest and Furnace are usable again git-svn-id: http://mc-server.googlecode.com/svn/trunk@755 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-18Chat packet handled in the new way; fixed missing packet sending for inventory slot.madmaxoft@gmail.com1-26/+28
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-18Packet refactoring, phase two, partial. Rewritten a few packet handling functions not to use cPacket-descendant objects.madmaxoft@gmail.com1-115/+196
This breaks plugin API! Plugins need to modify their hook functions to match those used in the Core plugin git-svn-id: http://mc-server.googlecode.com/svn/trunk@750 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-17Packets now parse themselves from a cByteBuffer object (1st part of packeting rewrite, http://forum.mc-server.org/showthread.php?tid=524 )madmaxoft@gmail.com1-15/+37
git-svn-id: http://mc-server.googlecode.com/svn/trunk@744 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-15Added temporary debug statistics of the RelEntMoveLook packet removal efficiencymadmaxoft@gmail.com1-0/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@740 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-06A bit of cleanup and documentation around the UI window handlingmadmaxoft@gmail.com1-2/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@716 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-17Simple health regeneration systemlapayo94@gmail.com1-14/+3
Prepared for food git-svn-id: http://mc-server.googlecode.com/svn/trunk@679 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-16Fixed some small bugs :)lapayo94@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@672 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-15A new Block handling system :olapayo94@gmail.com1-560/+78
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-13The gamemode is now only saved if it is different from the current gamemode.lapayo94@gmail.com1-1/+2
Default gamemode now depends on the joined world, not on the default world git-svn-id: http://mc-server.googlecode.com/svn/trunk@661 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-12Save last gamemodelapayo94@gmail.com1-1/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@660 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-16Leaves: Applied patch by Luksor.cedeel@gmail.com1-0/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@624 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-16Proper kick reasons!cedeel@gmail.com1-3/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@621 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-16Exported cWorld::ForEachEntity and cWorld::ForEachEntityInChunk; no idea if they actually workmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@620 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-15Lit furnaces can be used by playersmadmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@617 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-15Basic handling of vines. No growth yet.cedeel@gmail.com1-13/+18
git-svn-id: http://mc-server.googlecode.com/svn/trunk@615 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-15Fixed placing block on tall grass (FS #209)madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@614 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Fixed snow again, this time for real.cedeel@gmail.com1-2/+17
I didn't realize the client would also try to replace the snow from the sides. git-svn-id: http://mc-server.googlecode.com/svn/trunk@612 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Fixes placing blocks on snow.cedeel@gmail.com1-10/+21
Also a little formatting. git-svn-id: http://mc-server.googlecode.com/svn/trunk@611 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-2084/+2084
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-13Added a BlockToPickup hook for modifying pickups when a player breaks a block.madmaxoft@gmail.com1-2/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@602 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-09Disallowed placing cacti in watermadmaxoft@gmail.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@592 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-09Plants growable by bonemeal are settable in the world.ini. Default matches vanilla MC.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@584 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-09Bonemeal is consumed in survival mode when used on growable blocksmadmaxoft@gmail.com1-1/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@582 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-08Sugarcane grows and can be grown using bonemeal.madmaxoft@gmail.com1-0/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@578 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07Bonemeal works on crops, melons, pumpkins, saplings and grass. Plant growing has been refactored into separate functions callable from Lua, too.madmaxoft@gmail.com1-3/+33
git-svn-id: http://mc-server.googlecode.com/svn/trunk@573 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07Repeaters' delays can be set by rclkmadmaxoft@gmail.com1-3/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@570 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07Multiple packets are serialized in one request.madmaxoft@gmail.com1-5/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@568 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07Added more statistics to the packet queue overfill problem.madmaxoft@gmail.com1-2/+20
git-svn-id: http://mc-server.googlecode.com/svn/trunk@566 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-07(Temporary) hotfix for the "too many packets" error - set the packet limit 5x higher.madmaxoft@gmail.com1-1/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@565 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-06Item-dropping code rewritten and centralized - now there's only one place to modify if we want to split or merge same-item drops: cWorld:SpawnItemPickups(). Also, mined blocks can now drop more items, and they recognize if they're being mined by the correct tool.madmaxoft@gmail.com1-41/+41
git-svn-id: http://mc-server.googlecode.com/svn/trunk@561 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-04Updated zlib, added chat formatting, fixed upside down stairs and slabs, fixed makefiles, hopefully updated vc project filescedeel@gmail.com1-4/+21
git-svn-id: http://mc-server.googlecode.com/svn/trunk@546 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-02ClientHandle dumps the contents of all packets in the queue if the packet queue gets overloaded to the point of client-kicking. Use this to debug FS #197.madmaxoft@gmail.com1-0/+63
git-svn-id: http://mc-server.googlecode.com/svn/trunk@540 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-30Seeds can now be planted and they grow (albeit too quickly and too non-uniformly, need to fix blocktick selection)madmaxoft@gmail.com1-1/+28
git-svn-id: http://mc-server.googlecode.com/svn/trunk@523 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-29Farmland is created using a hoe on dirt or grass.madmaxoft@gmail.com1-2/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@520 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-29Refactored item-eating from cClientHandle into cPlayermadmaxoft@gmail.com1-71/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@519 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-29Added code for the chunks to manipulate their neighbors while ticking. Also added some basic farming support - melon and pumpkin growing code. Untested and untestable so far, will test and fix later.madmaxoft@gmail.com1-65/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@518 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-25Merged the composable_generator branch into the trunkmadmaxoft@gmail.com1-4/+33
git-svn-id: http://mc-server.googlecode.com/svn/trunk@504 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-04-10Added the "/regeneratechunk" command that regenerates either current chunk or a chunk specified with x, z parameters. TODO: permissions - we don't want guests erasing our chunks!madmaxoft@gmail.com1-1/+16
git-svn-id: http://mc-server.googlecode.com/svn/trunk@454 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-04-03Logging OnBlockDig and OnBlockPlace only in Debug mode ( http://mc-server.org/support/index.php?do=details&task_id=133&project=2 )madmaxoft@gmail.com1-2/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@447 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-26Added the supported client version to banner; shamelessly added myself to the authors list ;)madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@436 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-24Added the new 1.2.4's PlayerAbilities packet; restructures packet files for less files, more dense.madmaxoft@gmail.com1-7/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@431 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-24Protocol version bumped up to 29 (MC 1.2.4), seems to work.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@430 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-24Removed the split between 1.2.3 and 1.1, left only 1.2.3 codemadmaxoft@gmail.com1-16/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@429 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-22Fixed a deadlock by removing clients from all chunks upon their exit, not using the clients chunklists.madmaxoft@gmail.com1-4/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@426 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-14Split chunk data into separate arrays; decoupled most sources from cChunk.h dependencymadmaxoft@gmail.com1-4/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@411 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-11Not sending chunks to the client twicemadmaxoft@gmail.com1-21/+16
git-svn-id: http://mc-server.googlecode.com/svn/trunk@399 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10Fixed a few obsoleted functionsmadmaxoft@gmail.com1-6/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@397 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-10Using references instead of pointers for sending packetsmadmaxoft@gmail.com1-15/+15
git-svn-id: http://mc-server.googlecode.com/svn/trunk@394 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-09cClientHandles have a unique ID now to distinguish themfaketruth1-1/+11
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/+0
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-03-06Fixed rev368's ChunkSender, now sends properly even chunks that are loaded. Fixed a deadlock in cClientHandle vs TickThread over cClientHandle::m_CSChunkListsmadmaxoft@gmail.com1-4/+11
git-svn-id: http://mc-server.googlecode.com/svn/trunk@371 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-05ChunkSender: Chunks are now compressed and sent to clients from a separate threads, proper passive waiting between threads. Not much tested, just appears to work :)madmaxoft@gmail.com1-33/+22
git-svn-id: http://mc-server.googlecode.com/svn/trunk@365 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-04Changed signed char to unsigned char in block packets, so we can receive height up to 255faketruth1-4/+6
Blocks placed above 128 limit don't become obsidian anymore. This was due to the cChunk::MakeIndex() function return 0 when outside of bounds, it now returns an 'error constant' git-svn-id: http://mc-server.googlecode.com/svn/trunk@356 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-03Got rid of some hardcoded numbers, now using hardcoded variables! woofaketruth1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@355 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-02That should not have been committed...faketruth1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@354 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-03-01Started carefully moving to 1.2.2faketruth1-1/+18
Clients can get up to the login packet, after which the server tries to send chunks but in the wrong format and the client disconnects git-svn-id: http://mc-server.googlecode.com/svn/trunk@347 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-29Fixed the authenticator bugmadmaxoft@gmail.com1-0/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@344 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-29Making sure cClientHandle::m_Player was NULL after authentication completedfaketruth1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@343 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-28Setting the m_bDestroyed flag only after the cClienthandle is truly destroyed; cClientHandle's destructor now locks loaded chunk listsmadmaxoft@gmail.com1-3/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@340 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-26Attempt at fixing crashes with disconnecting playersmadmaxoft@gmail.com1-0/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@329 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-26Using cSocketThreads for client outgoing packets. Unfortunately had to put in one intermediate thread (cServer::cNotifyWriteThread) to avoid deadlocks. Still, seems we have a proper multithreading for clients and no more per-client threads, yay :)madmaxoft@gmail.com1-115/+73
git-svn-id: http://mc-server.googlecode.com/svn/trunk@328 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-26Extended SocketThreads for writing support (unusable in cClientHandle due to too many deadlock possibilities)madmaxoft@gmail.com1-9/+8
Extended the range of ignored packets in pre-game client states (fixes connection issues with some mods installed) git-svn-id: http://mc-server.googlecode.com/svn/trunk@327 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-23Made the viewdistance settable by users and default in settings.ini. The default is 9.madmaxoft@gmail.com1-6/+27
git-svn-id: http://mc-server.googlecode.com/svn/trunk@326 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-22Fixed a bug that no chunks were unloaded on the client. Now chunks are properly unloaded on the clients.faketruth1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@318 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-21Removed cChunkPtrs from everywhere but internal cChunkMap usage. Now we should finally be threadsafe :)madmaxoft@gmail.com1-12/+9
Also fixed a threading issue when a player connecting might have gotten stuck in "Downloading world" forever git-svn-id: http://mc-server.googlecode.com/svn/trunk@304 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-21Fixed heightmap optimization from rev 302; removed a few more cChunkPtrsmadmaxoft@gmail.com1-11/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@303 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-20Removed some more cChunkPtr usagemadmaxoft@gmail.com1-1/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@298 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-20Using own ASSERT() that logs to filefaketruth1-5/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@297 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-17Chunk coords mostly "upgraded" to include the Y coord for future compatibilitymadmaxoft@gmail.com1-14/+14
git-svn-id: http://mc-server.googlecode.com/svn/trunk@285 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-16Got rid of dangerous GetEntity(), not using DoWithEntity()faketruth1-6/+20
git-svn-id: http://mc-server.googlecode.com/svn/trunk@278 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-15Restored chest and furnace functionality as it was (it's basically working but joined chests show single-chest window)madmaxoft@gmail.com1-87/+85
git-svn-id: http://mc-server.googlecode.com/svn/trunk@263 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-294/+406
git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 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-9/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@245 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-08cSocketThreads plugged in for cClientHandle reading. Sending still kept the old way. Please help me test this commit thoroughly, this is a change that can break on subtleties.madmaxoft@gmail.com1-110/+65
git-svn-id: http://mc-server.googlecode.com/svn/trunk@244 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-07Rewritten all packets to use buffers instead of direct sockets, for future cSocketThreads compatibility.madmaxoft@gmail.com1-23/+38
Moved data sending from cPacket into cSocket git-svn-id: http://mc-server.googlecode.com/svn/trunk@240 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-05Now showing proper error messages when sockets fail :)faketruth1-1/+1
Crossplatform GetLastError function in cSocket git-svn-id: http://mc-server.googlecode.com/svn/trunk@234 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-03cClientHandle: split packet handling into separate functions for claritymadmaxoft@gmail.com1-969/+1158
git-svn-id: http://mc-server.googlecode.com/svn/trunk@229 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-02-02cClientHandle: gotten rid of the obnoxious m_pState, now using direct members insteadmadmaxoft@gmail.com1-332/+333
git-svn-id: http://mc-server.googlecode.com/svn/trunk@228 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-40/+28
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-01sprintf() begone! Replaced with StringUtils' Printf()madmaxoft@gmail.com1-8/+12
git-svn-id: http://mc-server.googlecode.com/svn/trunk@216 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-31Slight code cleanup, no big changesmadmaxoft@gmail.com1-40/+126
git-svn-id: http://mc-server.googlecode.com/svn/trunk@202 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-8/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@188 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-23Cactus towers can be destroyed by removing the bottom blockfaketruth1-1/+53
Added checks whether flowers/mushrooms/saplings can be placed on surface Added checks for cactus to see if it's allowed to be placed Fluids now wash away certain items (flower, sapling, cactus) git-svn-id: http://mc-server.googlecode.com/svn/trunk@169 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-20MCServer is now compatible with Minecraft client 1.1 (as long as the client is not using any mods/plugins I think)faketruth1-2/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@165 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-19Terrain generation is synchronous again, async generation has bugs.faketruth1-1/+33
Made some funky smart pointer things for chunks. Fixed a bug where the client would override the player position on the server and back again, resulting in sending too many chunks to the client which it doesn't even need. Fixed some compiler warnings in cPickup.cpp git-svn-id: http://mc-server.googlecode.com/svn/trunk@164 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-02Fixed crashing bug in cClientHandle::~cClientHandlefaketruth1-1/+3
When there are players in the server, and a client connects as far as the handshake and then disconnects, the server crashed. This is because there is no m_Player yet after the handshake, and the destructor uses m_Player without checking if it exists git-svn-id: http://mc-server.googlecode.com/svn/trunk@163 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-01Fixed the numchunks console command.faketruth1-8/+8
Added some form of reference counting to cChunk to make sure it's not referenced when deleting it. Right now it's only needed due to the generation of chunks in a separate thread and adding it to the spread light list in cWorld git-svn-id: http://mc-server.googlecode.com/svn/trunk@161 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-01- implemented separated inventory for creative mode (cSurvivalInventory and cCreativeInventory)lapayo94@gmail.com1-17/+37
(Separation is not perfect yet, because maybe there are some mayor changes needed :D) - implemented CreativeInventoryAction (was mistakenly called CreateInventoryAction) -> Fixed meta data for creative selected blocks ->->Slabs/Steps are now placed correctly - slabs can now be build to a double slab - fixed a bug in the inventory which put items with different meta values in the same slot git-svn-id: http://mc-server.googlecode.com/svn/trunk@160 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-01Chests, furnaces and dispensers face the correct way now.faketruth1-0/+5
http://mc-server.org/support/index.php?do=details&task_id=88 git-svn-id: http://mc-server.googlecode.com/svn/trunk@159 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-31Made a couple of functions in cChunk inline, this should speed up several block operations on chunksfaketruth1-16/+6
Players should not spawn in the ground anymore. When an entity was added to cWorld twice (which shouldn't happen actually), the server would crash when the entity is destroyed, this should be fixed now. git-svn-id: http://mc-server.googlecode.com/svn/trunk@158 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-29 - Initial food handling by cedeelmtilden@gmail.com1-13/+30
git-svn-id: http://mc-server.googlecode.com/svn/trunk@156 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-29 - Chests open and close on clients when opened/closedmtilden@gmail.com1-1/+1
- Beginnings of "Double Chest". All that's needed is detection when 2 chests get put next to each other, block other chests from then touching them on any side, load/save with the m_JoinedChest seeing each other and adding and making sure the left side is always the top rows. I'm not sure exactly at this moment how to do all of the detection and saving/loading of the double chest stuff so if you've any ideas feel free to point out some areas in the server code or implement it yourself. git-svn-id: http://mc-server.googlecode.com/svn/trunk@154 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-29- Pickups should now burn in firelapayo94@gmail.com1-2/+9
- The player no longer gets an empty bucket when in creative mode - improved the simulators again (moved to std::list because this should be faster with so many objects) (But the water simulation still is very slow) git-svn-id: http://mc-server.googlecode.com/svn/trunk@153 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-28- implemented the fire simulation in native c++ (cFireSimulator)lapayo94@gmail.com1-84/+43
- Changed the Durationsystem for Items. cPlayer::UseEquippedItem calls cItem::DamageItem this function damages the item if it has a duration. (needed the duration also in another place so this saves code ;)) - added some other burning blocks - the mobtypes for the settings.ini which i must have forgotten in the last commit git-svn-id: http://mc-server.googlecode.com/svn/trunk@150 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-28 - Fixed too fast actions kick for realmtilden@gmail.com1-5/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@149 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-28Fixed some small memory leakslapayo94@gmail.com1-0/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@148 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-28 - Didn't notice steak missing as wellmtilden@gmail.com1-0/+8
Interesting to note, when you make a food item handled with health it gets rid of the eating animation, this seems backwards. git-svn-id: http://mc-server.googlecode.com/svn/trunk@143 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-28 - Added chicken to eatingmtilden@gmail.com1-0/+9
- Increased max interactions again, seems to be fine now for even the fastest clickers. git-svn-id: http://mc-server.googlecode.com/svn/trunk@142 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-27I'll lower my frequency of commits.. 1000 default ends up sent more often than calc'd packets.mtilden@gmail.com1-1/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@135 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-27Oops, accidentally left debug printmtilden@gmail.com1-1/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@134 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-27 - Added basic ping handling.mtilden@gmail.com1-3/+27
Not sure what's up with the MC client, though. It doesn't seem to end up giving good results like the KA packet return is hanging and waiting for other things to process instead of being handled on its own to give a true result. Feel free to update if there's any way to deliver truer results. git-svn-id: http://mc-server.googlecode.com/svn/trunk@133 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-27Slightly cleaner block change interactions static in headermtilden@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@130 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-27Set player interaction kicking to 5 interactions per .1 seconds to help with lag disconnects. Still need to change code to lessen the false positives.admin@omencraft.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@128 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26Players can switch worlds on the fly with the command /gotoworld [worldName]. This uses the function cPlayer::MoveToWorld()faketruth1-0/+14
Changed isValidItem to IsValidItem in Core.lua git-svn-id: http://mc-server.googlecode.com/svn/trunk@126 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26Fixed the little check for max players. If somehow a player was able to connect and the number of players would exceed the max players, everybody is allowed in and the server will never be 'full'. It's fixed nowfaketruth1-9/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@122 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 - Linux compatible fixes including updated makefilemtilden@gmail.com1-3/+7
- Mersenne Twister still says uint32 but it's now signed for compatibility with random uses needing negative values - Server seed is sent to clients, but needs to be able to be signed long long later on for authentic reasons - Protocol Version is required to match to ensure client compatibility, this should probably have a settings.ini check as well as store the value there git-svn-id: http://mc-server.googlecode.com/svn/trunk@121 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 - Default Notchian Ping (static until ping implemented through keepalive send/receive)mtilden@gmail.com1-2/+10
- Player "left" message regardless of exit reason git-svn-id: http://mc-server.googlecode.com/svn/trunk@119 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 - Scoreboard deleting moved to cClientHandle::~cClientHandle() with checks. Please test this every way you can with clients disconnecting from the internet, crashing, etc. It should work on all cases as every client gets called in this part to be 'Deleted'mtilden@gmail.com1-6/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@118 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 - Cleaned up PLI Packet and its creation/sending and fixed bug of player not being removed on scoreboard (forgot to send color in the removal packet)mtilden@gmail.com1-6/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@116 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-26 - Make Color was using 2 extra characters which took 2 characters off the 16 max (including color codes) for scoreboard displaymtilden@gmail.com1-0/+11
- Added xC9 PlayerListItem packet and added code for player names to be added and removed from the scoreboard (need a catch-all for client disconnects: crashes, timeouts, etc) - Changed wid wording to a_WindowType git-svn-id: http://mc-server.googlecode.com/svn/trunk@113 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-25Hold item is now dropped when inventory is closedlapayo94@gmail.com1-2/+4
Thanks to mtilden for this ( http://forum.mc-server.org/showthread.php?tid=183&pid=1428#pid1428 ) Also the items in the 4 crafting slots are now dropped. git-svn-id: http://mc-server.googlecode.com/svn/trunk@107 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-25Code improvementslapayo94@gmail.com1-0/+1
Fixed authentication (Can be activated now) Added MersenneTwister.h Thanks to mtilden ( http://forum.mc-server.org/showthread.php?tid=183&pid=1428#pid1428 and http://forum.mc-server.org/showthread.php?tid=183&pid=1418#pid1418 ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@106 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-25- improved and simplified the door system (shorter, clearer)lapayo94@gmail.com1-26/+25
- Doors now drop a complete door & other part gets destroyed - Build a function for pickup counts (cBlockToPickup::PickupCount) (Default is 1) git-svn-id: http://mc-server.googlecode.com/svn/trunk@104 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-25Chunks are generated in a separate thread allowing players to keep on playing and chatting while chunks are generated. This means, however, that cWorld::GetChunk() does not always return a chunk and is something you need to be aware of. I am not entirely sure if all this is completely stable, but I think so :Ofaketruth1-7/+21
Chunks are now generated before the player is able to see them. This is done because after a chunks is done generating, some blocks might still need to be set (parts of trees from neighboring chunk), causing more bandwidth to be used (each changed block needs to be sent to clients again) and (fps) lagging the clients when changing a lot of blocks. Calculating ahead fixes these issues. Separated the placing of foliage (trees and stuff) when generated chunks into a new function GenerateFoliage() Cleaned up the VS2010 project, now using some VS2010 specific functions like dependencies on projects (no need for setting library dependencies manually). VS2010 project now compiles way faster in Release by using multi threading. git-svn-id: http://mc-server.googlecode.com/svn/trunk@103 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-24Max. players and MOTD are now changeable in the settings.inilapayo94@gmail.com1-3/+9
Thanks to mtilden ( http://forum.mc-server.org/showthread.php?tid=183&pid=1381#pid1381 ) git-svn-id: http://mc-server.googlecode.com/svn/trunk@101 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-3/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@100 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-22Digging leaves with shears now drops leaveslapayo94@gmail.com1-1/+2
Falling Sand now notifies water around Implemented Function to get the relative chunk position in the total position (cChunk::PositionToWorldPosition) Pistons don´t drop water and lava items anymore when stopping water/lava implemented Getter for lava and water simulator IsBlockWater and IsBlockLava function in Defines.h git-svn-id: http://mc-server.googlecode.com/svn/trunk@97 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-21- Crafting fixed in 1.0.0lapayo94@gmail.com1-7/+26
- Server compatible with the weapons and equip again. (Some Packets were incompatible) - fixed bucket bugs (not all) - Fixed clients getting crashed by wrong Pickups - fixed nearly all mob drops. (Check wheather they are burning is missing Big Grin) - maybe some other things I can´t recall atm Big Grin git-svn-id: http://mc-server.googlecode.com/svn/trunk@94 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-11Found and fixed a bug not letting users place blocks in water or lava.admin@omencraft.com1-2/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@91 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-10Fixed logging in underground bug this time. A hack, but it works. :Dadmin@omencraft.com1-4/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@90 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-10Can now set gamemode via lua.admin@omencraft.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@89 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-10Made block action sanity checks more robust, water buckets, lava buckets and empty buckets should all now work.admin@omencraft.com1-15/+70
git-svn-id: http://mc-server.googlecode.com/svn/trunk@87 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-10Added code for doors. Doors now place correctly but opening them is buggy and I need to change the current opening code to use bitwise operators.admin@omencraft.com1-2/+48
git-svn-id: http://mc-server.googlecode.com/svn/trunk@85 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-10Added random weather that persists per world. Also added SetWeather, GetWeather, and CastThunderbolt to lua bindings.admin@omencraft.com1-17/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@83 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-09Added m_IP to player class and binding to get IP for LUA. (Probably should use m_pState)admin@omencraft.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@82 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-08It's a Squirrel!!faketruth1-0/+1
In SquirrelBindings.h use #define USE_SQUIRREL 1 to enable squirrel git-svn-id: http://mc-server.googlecode.com/svn/trunk@76 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-07Updated redstone and pistons some mode. If you break an extended piston the piston extension will now also break. When a redstone device is broken by something other than a person the redstone circuit should now update.admin@omencraft.com1-15/+34
git-svn-id: http://mc-server.googlecode.com/svn/trunk@74 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-07Added Sebi's changes to pistons and item drops.admin@omencraft.com1-13/+20
git-svn-id: http://mc-server.googlecode.com/svn/trunk@72 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-07Pistons now generate noise and animate when moving.admin@omencraft.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@71 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-06Redstone wire now updates correctly when added and removed. it also updates all currently programmed redstone items and wire circuits. Also cleaned up the mess I left of the code.admin@omencraft.com1-2/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@69 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-06Redstone is now self aware. It's not quite as dumb as it used to be at any rate. Redstone wires have no range and understand they are supposed to stay on whenever there's an active torch touching it. (Need to add other power devices)admin@omencraft.com1-9/+29
git-svn-id: http://mc-server.googlecode.com/svn/trunk@68 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-06Patch with diff file created by Sebi (implemented some stuff like lava physics, drops are deleted when in lava, water is now slower, lava gives actual damage etc.). Pistons now work mostly as they should. They do not yet show the motion animation and do not emit sound. They do extend, push, and retract as they should though. Right now the only way to activate a piston is to light redstone wire adjacent to it with a redstone torch.admin@omencraft.com1-7/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@67 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-05Added all the items up to Beta 1.9.5. Added pistons and piston class.admin@omencraft.com1-2/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@63 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-04Added (Probably incorrectly) a cRedstone class. Also, palcing a redstone torch will recursively light any redstone wire it's connected to. Removing a torch from an active wire will unlight the entire length. Class needs to be updated to make use of non deprecated function. Current deprecated function warning drastically slows redstone performance.admin@omencraft.com1-5/+27
git-svn-id: http://mc-server.googlecode.com/svn/trunk@51 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-03Fixed some redstone items and a bug that prevented floats from client to server packets reading correctly on 64 bit linux.admin@omencraft.com1-2/+0
git-svn-id: http://mc-server.googlecode.com/svn/trunk@50 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-03Added some redstone items.admin@omencraft.com1-6/+30
git-svn-id: http://mc-server.googlecode.com/svn/trunk@49 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-03Updated the thunderbolt packet. Lightning and rain can be tested with a workbench and a chest. >:)admin@omencraft.com1-7/+17
git-svn-id: http://mc-server.googlecode.com/svn/trunk@48 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-02Added New/Invaid State and Thunderbolt packets. For testing purposes it now rains whenever a player opens a workbench and stops when they pen a chest. The rain start/stop in only sent to the sole clientopening the items.admin@omencraft.com1-7/+26
git-svn-id: http://mc-server.googlecode.com/svn/trunk@47 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-02Fixed some "Entity was not found in any chunk!" warningsfaketruth1-4/+8
Player's current world is saved in the player file. When a player joins the server, the player joins the last world he was in. It seems MCServer can finally run multiple worlds! It just needs functionality to switch between them git-svn-id: http://mc-server.googlecode.com/svn/trunk@46 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-02Fixed player spawn teleport postion.admin@omencraft.com1-1/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@45 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-01fixed player spawning in the ground.admin@omencraft.com1-0/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@42 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-01Accidentally removed a line of codefaketruth1-1/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@41 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-46/+49
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-11-01Put in some sanity checks to ensure players don't interact with blocks too quickly. Changed gamemode to be player based. (MCServer crashes when picking up an item. Need to find and fix bug.)admin@omencraft.com1-5/+23
git-svn-id: http://mc-server.googlecode.com/svn/trunk@38 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-11-01Players can now place blocks in creative mode. The blocks players select from the creative mode inventory are not stored in the players' inventory. (I kind of like that)admin@omencraft.com1-3/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@37 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-31Prepared some parts of the code for multi world support, I created lots of TODO'sfaketruth1-15/+16
git-svn-id: http://mc-server.googlecode.com/svn/trunk@29 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-27Fixed a memory leakfaketruth1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@19 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-26Made several recomended changes. Gamemode is now world based. Need to add it to player.admin@omencraft.com1-3/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@18 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-26Moved GAMEMODE declaration to a single place... cPacket.h. Player can't take damage any more but can still sometimes die on spawn. Not sure why. Falling through the void does not kill you yet.admin@omencraft.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@17 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-26Creative mode now breaks blocks without providing block drops. Need to work with Player's Inventory for proper creative mode support. GAMEMODE is declared and set twice.admin@omencraft.com1-3/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@16 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-26Added CreateInventoryAction packet for creative mode. Used cPacketEntityEquipment as template. Forced server into Creative Mode. Can't break blocks yet. Player can stil be damaged in creative mode and dying takes you back to survival mode.admin@omencraft.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@15 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-26added simple code for server side item durabilty on tool items that have durabilty. need to add block destroyed durability modifier.admin@omencraft.com1-3/+70
git-svn-id: http://mc-server.googlecode.com/svn/trunk@12 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-23Abstracted sockets some more to ensure the same behavior over the entire program and on multiple platforms.faketruth1-19/+3
MCSocket.h should soon be deprecated and deleted Do a full rebuild (mine bugged out when I didn't) git-svn-id: http://mc-server.googlecode.com/svn/trunk@8 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-21Compiles for linuxfaketruth1-2/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@6 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-03MCServer c++ source filesfaketruth1-0/+1082
git-svn-id: http://mc-server.googlecode.com/svn/trunk@3 0a769ca7-a7f5-676a-18bf-c427514a06d6