Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ground items kotlin #372

Open
wants to merge 1 commit into
base: kotlin-experiments
Choose a base branch
from
Open

Ground items kotlin #372

wants to merge 1 commit into from

Conversation

rmcmk
Copy link
Contributor

@rmcmk rmcmk commented Nov 12, 2017

  • Needs tests
  • Need to solve that eyesore in Region
  • Would be cool to include picking up items and other basic functionality

@rmcmk rmcmk changed the base branch from master to kotlin-experiments November 12, 2017 22:59
@garyttierney
Copy link
Contributor

It'd be nice to get transactions in with this before kotlin-experiments is merged back to master.

@garyttierney garyttierney self-requested a review November 16, 2017 22:04
@garyttierney
Copy link
Contributor

Needs tests

You can use the existing mocks of the World and Player to register a task and manually advance it to the delays you've set. Then you can run the assertions that the item was globalized / deleted. There should be an example in BankTests.

@Major-
Copy link
Member

Major- commented Nov 16, 2017

It'd be nice to get transactions in with this before kotlin-experiments is merged back to master.

Not sure I agree with this. kotlin-experiments is already massive, we were supposed to have feature-frozen it

@tlf30
Copy link
Contributor

tlf30 commented Nov 18, 2017

I agree with @Major-, I love the work that @ryleykimmel has done here, but it would be better to put merge this once kotlin-experiments is merged. Kotlin-experiments branch is already going to be a huge merge.
Again, I love the work that @ryleykimmel has done here, and it definitely needs to be merged at some point.

@garyttierney
Copy link
Contributor

That's fine. I'm more concerned with this making it to master before the transactional item stuff and then requiring a rewrite.

@rmcmk
Copy link
Contributor Author

rmcmk commented Nov 19, 2017

FWIW the item transaction code I wrote many years ago should be scrapped. I don't remember the plan I had in mind when creating this and feel it could be (re)designed in a better manner.

@Major-
Copy link
Member

Major- commented Mar 28, 2018

Need to decide whether or not this should be merged or should actually be in core (i.e. written in Java)

@Major- Major- added blocked Blocked on another issue needs-discussion The project maintainers request input from users labels Mar 28, 2018
/**
* A [ScheduledTask] that manages the globalization and expiration of [GroundItem]s.
*/
class GroundItemSynchronizationTask(private val groundItem: GroundItem) : ScheduledTask(DELAY, false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be better done as a single task that polls GroundItem's from a queue every tick.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind explaining how that queue should work? I don't think to queue them makes much sense here as all this task is doing is keeping the ground items state in sync with the client at the appropriate time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there's one GroundItemSyncTask at all times and new ones are just added to its queue, rather than creating a new task for each item. Downside of this is we have to implement what is essentially scheduling logic in the task itself

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of defeats the purpose of the task scheduler, does it not?

Copy link
Member

@Major- Major- Apr 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partially, yes; that is the downside

@rmcmk
Copy link
Contributor Author

rmcmk commented Jul 22, 2018

I'm looking at revisiting this. Can we come to a consensus on whether this should be core functionality or left alone in Kotlin?

Personally I think it fits better in the core as this kind of thing isn't really fit for a plugin as it is core functionality to how ground items work, but I'm not sure.

Ping @Major- @garyttierney

@Major-
Copy link
Member

Major- commented Jul 28, 2018

@ryleykimmel also agree it should be in core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on another issue needs-discussion The project maintainers request input from users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants