summaryrefslogtreecommitdiffstats
path: root/source/Player.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Server counts the players correctly.madmaxoft2013-08-141-0/+3
| | | | Was missing the PlayerDestroying() call, so players weren't removed from the playercount.
* Player counts are now properly handled.madmaxoft2013-08-141-9/+6
| | | | Fixes #80
* Merge branch 'master' into PerWorldThreads.madmaxoft2013-08-131-1/+1
|\ | | | | | | Also fixed the AllToLua script not resolving conflicts.
| * Keep players from taking damage when teleporting.STRWarrior2013-08-121-1/+1
| |
* | Clients are now ticked in cServer first, then in cWorld once they get assigned a world.madmaxoft2013-08-131-15/+19
| |
* | Removed cServer::BroadcastChat() and cServer::SendMessage().madmaxoft2013-08-121-6/+16
|/ | | | 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.
* Added back the required extra line in player.cppAlexander Harkness2013-08-101-0/+1
|
* Deleting cPlayer now does LOGD instead of LOGTiger Wang2013-08-101-2/+1
| | | Hopefully only prints in debug the debug message!
* Merge pull request #55 from mc-server/falldamage-teleportAlexander Harkness2013-08-091-0/+1
|\ | | | | Keep players from taking damage when teleporting. (Hopefully).
| * Fixed stupid syntax error (thanks build system).Alexander Harkness2013-08-091-1/+1
| |
| * Keep players from taking damage when teleporting. (Hopefully).Alexander Harkness2013-08-091-0/+1
| | | | | | | | Fixes #29
* | Fixed some formatting issues I accidentally introducedJames Ravenscroft2013-08-091-11/+12
| |
* | Removed the need to recalculate whether player is under water in ApplyFoodExhaustionJames Ravenscroft2013-08-091-11/+3
| |
* | Added IsSwimming and IsSubmerged flags and access methodsJames Ravenscroft2013-08-091-9/+28
| |
* | Fixed food handler for mushroom soup - proper food level and saturation are applied and the player receives a wooden bowl back after nommingJames Ravenscroft2013-08-081-0/+7
|/
* Made comments more readable by adding space between // and text content. Added /// doxygen syntax comments to declarationsJames Ravenscroft2013-08-081-7/+7
|
* Fixed the formatting issues in player cpp filesJames Ravenscroft2013-08-081-31/+30
|
* Made player drowning implementationJames Ravenscroft2013-08-081-1/+44
|
* Addeed OnSpawningEntity, OnSpawnedEntity, OnSpawningMonster, OnSpawnedMonster hooks.madmaxoft2013-08-081-3/+7
| | | | As requested in FS 418.
* New players get full healthmadmaxoft2013-08-011-4/+5
| | | | Fixes #28.
* Fixed inverted sanity check in SetGameMode()madmaxoft2013-07-301-1/+1
| | | | Fixes #22.
* Changed everyting to Unix line endings.Alexander Harkness2013-07-291-1423/+1423
|
* Player eating is now properly broadcast to other players.madmaxoft2013-07-281-1/+1
| | | | Also fixed the API relating to food, determining player gamemode, and removed several unneeded API functions.
* Implemented basic eating support.madmaxoft2013-07-281-0/+58
| | | | Food is now properly consumed and it takes 1.5 sec.
* Hunger-per-distance is calculated only for the XZ distancemadmaxoft2013-07-281-0/+1
|
* Player food level is reset on respawnmadmaxoft2013-07-281-0/+4
|
* Added cPlayer::IsGameModeXXX() and cWorld::IsGameModeXXX() functions.madmaxoft2013-07-281-1/+35
| | | | These are the preferred way of determining the gamemode, you should use those instead of doing manual comparisons to the gamemode value.
* Hunger: If a player dies the food level resets.STRWarrior2013-07-271-1325/+1326
|
* Removed debug-logging the player movement in each tickmadmaxoft@gmail.com2013-07-261-1/+0
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1685 0a769ca7-a7f5-676a-18bf-c427514a06d6
* First implementation of movement-related hunger and APImadmaxoft@gmail.com2013-07-121-69/+214
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1673 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed sprinting in 1.6.1, made speeds available through API; fixed messages containing quotes.madmaxoft@gmail.com2013-07-071-0/+54
| | | | | | Fixes FS #415 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1660 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Improved function names for protocol packet sending; alpha-sorted the function listsmadmaxoft@gmail.com2013-07-071-3/+3
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1659 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed a crash when moving a player to a non-existent world (reported by tonibm19)madmaxoft@gmail.com2013-07-051-1/+1
| | | | | | http://forum.mc-server.org/showthread.php?tid=434&pid=8865#pid8865 crashdump.zip/crash_mcs_165c.dmp git-svn-id: http://mc-server.googlecode.com/svn/trunk@1645 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed player moving between worlds.madmaxoft@gmail.com2013-07-031-19/+30
| | | | | | | 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
* Rewritten entity-on-fire management ("forever on fire" bugs)madmaxoft@gmail.com2013-07-011-11/+14
| | | | | | | | | Fixes FS #297 and part of FS #403. Added sizes to all entities. Moved all damage-related functions from cPawn to cEntity API change: renamed cPawn:TeleportTo() to cEntity:TeleportToCoords() git-svn-id: http://mc-server.googlecode.com/svn/trunk@1635 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added respawn screen when switching worlds.nielsbreu@gmail.com2013-06-161-1/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1598 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Implemented proper player crouching.madmaxoft@gmail.com2013-06-041-0/+18
| | | | | | Fixes FS #365 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1553 0a769ca7-a7f5-676a-18bf-c427514a06d6
* LuaWindow: Fixed memory leaks with unclosed windowsmadmaxoft@gmail.com2013-06-021-5/+5
| | | | | | | A player disconnecting will now force all windows to close, not respecting any plugin's overrides. http://forum.mc-server.org/showthread.php?tid=1146&pid=8350#pid8350 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1543 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added the OnClosing callback to cLuaWindow APImadmaxoft@gmail.com2013-05-301-5/+16
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1534 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Window contents are sent whenever the window is opened by a player.madmaxoft@gmail.com2013-05-301-0/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1533 0a769ca7-a7f5-676a-18bf-c427514a06d6
* LuaWindow: Initial code, the window can be opened, but not much manipulatedmadmaxoft@gmail.com2013-05-301-6/+23
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1532 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Implemented left-click inventory paintingmadmaxoft@gmail.com2013-05-301-0/+30
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1529 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Moved BlockEntities to a separate foldermadmaxoft@gmail.com2013-05-281-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1527 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Refactored cInventory to use cItemGrid for the actual Storagemadmaxoft@gmail.com2013-05-241-13/+5
| | | | | | 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
* Inventory code cleanup, players can now see each other's armormadmaxoft@gmail.com2013-05-191-10/+12
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1493 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Empty permission is always grantedmadmaxoft@gmail.com2013-05-191-1/+7
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1490 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Replaced MIN / MAX with std::min and std::max (pt 2)madmaxoft@gmail.com2013-05-071-9/+7
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1456 0a769ca7-a7f5-676a-18bf-c427514a06d6
* cPlayer now uses BroadcastMovementUpdate during its Tick functionkeyboard.osh@gmail.com2013-04-191-40/+6
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1395 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Proper entity removal functionsmadmaxoft@gmail.com2013-04-131-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1386 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Rewritten entities so that they are owned by individual chunks and ticked within their chunk's Tick()madmaxoft@gmail.com2013-04-131-8/+7
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1385 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed personal crafting grid not being tossed on inventory close.madmaxoft@gmail.com2013-04-041-19/+0
| | | | | | 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
* Pawn, Player: fixed asserts when teleporting players outside of the world (setting spawn Y to 256)madmaxoft@gmail.com2013-04-011-9/+20
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1346 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added helper functions AddSpeed, AddSpeedX, AddSpeedY, AddSpeedZ, AddPosition, AddPosX, AddPosY, AddPosZ. Made sure that all entites use these helper functions.keyboard.osh@gmail.com2013-03-231-1/+1
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1299 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Implemented BroadcastMovementUpdate function. Moved m_Pos,m_Rot,m_Speed to private members and made sure that all classes uses the public functions to access these members.keyboard.osh@gmail.com2013-03-221-29/+29
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1294 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Pickups are now being saved into Anvil.madmaxoft@gmail.com2013-03-091-1/+1
| | | | | | Also changed cEntity rotation datatype to double git-svn-id: http://mc-server.googlecode.com/svn/trunk@1262 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed random teleporting into the void when leaving minecartsmadmaxoft@gmail.com2013-03-051-4/+9
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1259 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Player can sit in minecarts (but not move them yet)madmaxoft@gmail.com2013-03-031-1/+11
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1249 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Changed HOOK_PLAYER_MOVED to HOOK_PLAYER_MOVING to match the scheme used for names.madmaxoft@gmail.com2013-01-261-1/+1
| | | | | | -ING means the event is being processed and may be refused by a plugin, -ED means it has already happenned and the plugin cannot do anything about it. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1174 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Merged branch "branches/hooks" into "trunk".madmaxoft@gmail.com2013-01-121-2/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1139 0a769ca7-a7f5-676a-18bf-c427514a06d6
* MTRand reference is now passed as a Tick() parameter so that it isn't created and destroyed over and over again. All entities will handle physics (empty callback for now)madmaxoft@gmail.com2012-12-221-5/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1096 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added more constants into eEntityType; made them a compulsory parameter to the constructor, so that all entities have proper type.madmaxoft@gmail.com2012-12-211-2/+2
| | | | | | Also added a few utility functions to cEntity for distinguishing the types (IsPlayer(), IsPickup() etc.) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1092 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Reworked the IsA() / GetClass() framework to actually be useful. Added GetParentClass().madmaxoft@gmail.com2012-12-211-6/+0
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1090 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Refactored the TakeDamage API to take equipped weapon and armor into consideration (PvP untested)madmaxoft@gmail.com2012-12-211-15/+24
| | | | | | 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
* Fixed fall damage againluksor111@gmail.com2012-12-151-1/+1
| | | | | | Added sound effects to pistons git-svn-id: http://mc-server.googlecode.com/svn/trunk@1074 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed warnings in Player.cppluksor111@gmail.com2012-11-271-2/+2
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@1071 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Added initial adventure mode supportluksor111@gmail.com2012-11-271-2/+6
| | | | | | | | | Added missing Emerald crafting recipe You get more fall damage when jumping Torch no longer protects players from fall damage Fixed Ender Chest drops git-svn-id: http://mc-server.googlecode.com/svn/trunk@1070 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Fixed certain blocks crashing clients when minedluksor111@gmail.com2012-11-261-1/+1
| | | | | | | | Fixed rail duplication glitch Fixed fall damage calculation Glass no longer drops glass git-svn-id: http://mc-server.googlecode.com/svn/trunk@1068 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Refactored the world time.madmaxoft@gmail.com2012-11-011-5/+5
| | | | | | 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
* Fixed issues with pickups. sebi.noreply@gmail.com2012-10-241-2/+9
| | | | | | | | | * Now when picking up max. stack amount is checked. * Added cInventory::AddItemAnyAmount() which will not fail if it cannot add all items (it will just modify amount) * If there is no space in inventory and picking up stacked items, it will try to fill stacks already in inventory, partially picking up the item. * When closing inventory player will drop any items it's currently 'dragging' git-svn-id: http://mc-server.googlecode.com/svn/trunk@1008 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Converted some const char*s and std::strings to AStringsfaketruth2012-10-181-6/+35
| | | | | | | 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
* Fixed initial player head rotation when a player is being spawned on another clientfaketruth2012-09-291-1/+4
| | | | | | | Fixed showing correct item in the player hand when spawned on another client (it didn't include metadata/health before) Fixed player head rotation when moving and looking around at the same time git-svn-id: http://mc-server.googlecode.com/svn/trunk@914 0a769ca7-a7f5-676a-18bf-c427514a06d6
* SocketThread: clients aren't double-removed anymore.madmaxoft@gmail.com2012-09-291-1/+4
| | | | git-svn-id: http://mc-server.googlecode.com/svn/trunk@909 0a769ca7-a7f5-676a-18bf-c427514a06d6
* Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com2012-09-241-0/+1019
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6