Player/LocalPlayer/RemotePlayer inheritance cleanup (part 1 on X)
authorLoic Blot <loic.blot@unix-experience.fr>
Sat, 8 Oct 2016 08:38:04 +0000 (10:38 +0200)
committerNer'zhul <nerzhul@users.noreply.github.com>
Sat, 8 Oct 2016 09:36:28 +0000 (11:36 +0200)
commit8bcd10b872bc88c6f474913d6efb8d53c50c5ae1
tree39a8af0048ed642eddc43c74ab9f736558663e9d
parent0264e38bff12a3c6b81231ac1f6cd281179df744
Player/LocalPlayer/RemotePlayer inheritance cleanup (part 1 on X)

* LocalPlayer take ownership of maxHudId as it's the only caller
* RemotePlayer take ownership of day night ratio as it's the only user
* Pass getPlayerControl as const reference to prevent object copy on each call (perf improvement in ObjectRef::l_get_player_control call)
* getPlayerSAO is now only RemotePlayer call
* get/setHotbarItemCount is now RemotePlayer owned
* Server: Use RemotePlayer instead of Player object on concerned call to properly fix the object type
* PlayerSAO now uses RemotePlayer instead of Player because it's only server side
* ObjectRef::getplayer also returns RemotePlayer as it's linked with PlayerSAO
12 files changed:
src/content_sao.cpp
src/content_sao.h
src/game.cpp
src/localplayer.h
src/network/clientpackethandler.cpp
src/network/serverpackethandler.cpp
src/player.h
src/script/lua_api/l_env.cpp
src/script/lua_api/l_object.cpp
src/script/lua_api/l_object.h
src/server.cpp
src/server.h