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

Landblocks, logging, object factory prep work #121

Merged
merged 6 commits into from
Mar 18, 2017

Conversation

lurker-mcdoogle
Copy link
Contributor

@lurker-mcdoogle lurker-mcdoogle commented Mar 13, 2017

there are a lot of // TODO comments all over this thing.

here's what I know works:
/telepoi town1
/createlifestone
/telepoi town2
/telepoi town1
... and the lifestone is still there.

Features:

  • Landblock Management
  • Landblock Handoff of teleporting objects
  • Broadcasting of objects on a landblock based on existence
  • Update of objects in a landblock based on Movement
  • Landblock adjacency broadcasting
  • basic object factories
  • log4net - not having console output was killing me and we needed a logging framework anyway. nuget to the rescue.
  • moved "in front of" calculations to hang off the Position object for better reuse
  • PackedDWORD object
  • Delayed update of position after entering portal space seems to have helped porting stability.

Known Issues

  • Adjacency matrix has issues broadcasting to the correct adjacencies. Shouldn't be a big deal - I'll fix it later.
  • local chat is untested and possibly/likely broken.

Mag is showing up in the commit log because I squashed a commit with his name on it when attempting a rebase. Ended up just cherrypicking into a new branch.

@lurker-mcdoogle
Copy link
Contributor Author

Known Issue: Adjacency matrix has issues broadcasting to the correct adjacencies. Shouldn't be a big deal - I'll fix it later.

Mag-nus and others added 4 commits March 17, 2017 08:37
* reverted unintentional changes
* object factories, log4net, and various refactorings.  still getting stuck in portal space occasionally.
* rebased with latest changes, add removal of players from landblocks upon logout (i think)
@Mag-nus
Copy link
Member

Mag-nus commented Mar 18, 2017

Landblock.cs, line 289. Needs to be changed from > to >=

movedObjects = movedObjects.Where(p => p.LastUpdatedTicks > p.LastMovementBroadcastTicks).ToList();

// flag them as updated now in order to reduce chance of missing an update
movedObjects.ForEach(m => m.LastMovementBroadcastTicks = WorldManager.PortalYearTicks);

What's happening is a player is moving on the same PortalYearTick, right before Landblock.UseTime is called. When this happens, the > fails, and the cobject isn't processed as a move. That move gets skipped over.

Even though you set the LastMove to PortalYearTicks to indicate the object as processed, the next time UseTime is called, it's impossible for PortalYearTicks to have the same value as the previous call, thus, the >= won't be called in duplicate/error.

@Mag-nus
Copy link
Member

Mag-nus commented Mar 18, 2017

Landblock.cs UseTime() needs a Thread.Sleep(1) as the last line of the While() loop.

We also have variables that are being referenced across multiple threads. WorldObject.LastUpdateTicks and MutableWorldObject.LastMovementBroadcastTicks... I'm gonna think about this some more today.

@Mag-nus Mag-nus merged commit 8caf806 into ACEmulator:master Mar 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants