06-25-2015, 09:51 PM
Does anyone understand how the ownership of cPlayer objects is supposed to work? It looks like they are owned both by their clienthandle and the chunk they are in.
Random Chitchat 2012-2016
|
06-25-2015, 09:51 PM
Does anyone understand how the ownership of cPlayer objects is supposed to work? It looks like they are owned both by their clienthandle and the chunk they are in.
06-26-2015, 01:02 AM
cClientHandle is the one doing the new and delete calls, so I'd say it is the owner.
Perhaps it's not the best architecture, because it doesn't support computer-controlled players, plugin writers have been calling for that one for some time. Although in my opinion it would be better to have bots implemented as clients, rather than in the server.
06-26-2015, 01:11 AM
Its completely messy, because all the other cEntity descendents are owned by the cChunk, meaning that cPlayers have to be special cased by the cChunk code all over the place.
I think we either need to stop cPlayer descending from cEntity, which would have a lot of code reuse problems, or transfer the ownership to cChunk.
06-26-2015, 01:12 AM
If someone is trying to implement a bot, I've had good success with https://github.com/andrewrk/mineflayer
06-26-2015, 09:16 AM
My proposal is this: cChunk::m_Entites should own the player objects, and cWorld::m_Players and cClientHandle::m_Player should be a weak reference to the object, or even just entity IDs. If we go for weak references, I'll have to write a custom smart pointer, because the std::lib types don't support what we would want to do. Alternatively, if we go for IDs we probably need to improve The performance of DoWithEntityById, because at the moment its O(C + E), where C is the number of loaded chunks, and E is the number of entities in the world.
06-26-2015, 09:49 AM
In the Plugin Repository, is there a way to change the background color of the tile that represents my plugin? Currently its a dark purple, making the text hard to read.
06-27-2015, 12:28 AM
That would be a really nice feature
06-27-2015, 09:33 PM
It looks like appveyor is broken.
I opend an issu for that:
https://github.com/cuberite/cuberite/issues/2297
06-27-2015, 11:36 PM
Everyone in the GitHub org should have access to Appveyor settings for the project, they added the "teams" feature a while back.
|
« Next Oldest | Next Newest »
|