Day 26 @ Sun and Day 27 @ Home

A lot has happened in two days.

Day 26

The day’s accomplishments:

  1. Minor refactoring/code cleanup.
  2. Expanded server <-> client messaging abilities…server can send a message to one client OR all clients. (If a client tries to create an invalid connection, etc, the server will only notify that client, not every client.)
  3. With Jordan’s help, discovered a deeply insidious bug in the WonderBlocks backend where == was used instead of .equals() to compare two objects. This worked fine when the backend was running in isolation, because the things being compared could actually refer to the same object in memory, as everything was running in one shared memory space. This caused problems when the backend was actually used inside Wonderland, however, because those conditions don’t apply there.
  4. Removed unnecessary HUD elements.
  5. Added the ability to create connections between Blocks via a pop-up dialog box.

Day 27

We worked from home today because Gerard had an interview in the morning. Wish him luck in that endeavor! Because we were at WPI, we had a meeting with Gary to discuss our progress.

Today’s other accomplishments:

  1. Fixed show-stopping synchronization errors in two places in the backend code. We noticed during our functional testing that some operations would randomly not be performed, manager states would go out of sync, and a ConcurrentModificationException would be thrown by both the Wonderland client and server. This was again due to the differences between running the backend in its own memory space and running the backend inside Wonderland. This same problem appeared in two places in the backend code: a single HashSet in memory was being iterated through in one class, while another class simultaneously removed elements from it. Operations like that are not threadsafe, which is why we were seeing those problems. Solving the issue turned out to be simple: now, we create a copy of the HashSet to be altered, and then iterate through the copy while altering the original. A more elegant solution would have been to switch from using foreach loops to using Iterators with Iterator.remove(), etc, but doing so would have required extensive backend refactoring. Although creating copies of the HashSets in question is less memory-efficient than using Iterators, it was a quick and acceptable solution to the problem. Interestingly, the functional tests that revealed these problems involved deleting a Block that was a parent in more than one conncection, as well as deleting a Block that was a child in more than one connection.
  2. Added a ‘Name’ field to the connection creation dialog.
  3. More general refactoring/cleanup.

The last two major features that we still have to add to WonderBlocks is the ability to create Blocks in-world, and the ability to edit Blocks. After that, all WonderBlocks core functionality will have been implemented! There are still plenty of minor things to do after that, however.

Comments are closed.