Skip to content

Conversation

@ArchDemons
Copy link
Collaborator

No description provided.

This was referenced Aug 28, 2025
added event bus
added lombok
// Add new & remove old
entities.applyChanges();

synchronized (this.queue) {
Copy link
Owner

Choose a reason for hiding this comment

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

Locks? I'm trying to get rid of all locks... We still have the gold lock but that too should go.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

maybe we dont need use lock there. Doesnt check thead safe without lock of this code

Copy link
Owner

@tonihele tonihele Sep 13, 2025

Choose a reason for hiding this comment

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

Yeah, the ECS system we use is thread safe. And all commands coming from client I planned to enqueue to the main game loop thread. That way we don't need to mess about with locks (the gold lock or any other). I'm unsure though how would this affect the game as there would be a small delay in processing the client commands.

if ((room.getFlags().contains(Room.RoomFlag.PLACEABLE_ON_WATER))
|| room.getFlags().contains(Room.RoomFlag.PLACEABLE_ON_LAVA)) {
instancePlots = new ArrayList<>(mapController.getTerrainBatches(instancePlots, x1, x2, y1, y2));
// instancePlots = new ArrayList<>(mapController.getTerrainBatches(instancePlots, x1, x2, y1, y2));
Copy link
Owner

@tonihele tonihele Sep 13, 2025

Choose a reason for hiding this comment

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

We should just remove the code, not comment it, a bit confusing. Version control is there to manage these.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we need this code :), but not compatible with new code. This is the reason why the PR is in WIP

implementation "com.simsilica:sio2:1.8.0"
implementation "com.simsilica:sim-ethereal:1.8.0"
implementation "com.google.guava:guava:33.4.8-jre"
implementation "org.reflections:reflections:0.10.2"
Copy link
Owner

Choose a reason for hiding this comment

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

I've been removing these (reflections) at work :D For security reasons. Are there any alternatives?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need scan package for classes with annotation... I don`t know any other library that can do this

Copy link
Owner

Choose a reason for hiding this comment

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

Well, me neither. I just designed around it at work. It is a bit of a hazard in my opinion to take this in. Is there any alternative to having to scan package classes with annotation? I know what you are trying to solve here, having to manually add the class to be de/serialized. How else we could do it better?

Copy link
Collaborator Author

@ArchDemons ArchDemons Sep 13, 2025

Choose a reason for hiding this comment

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

compile-time annotation preprocessor (like lombok), but it`s rocket science for me :). I work with spring framework. Packages scan - the core of DI container and dynamic connection of the components

@tonihele
Copy link
Owner

Generally the idea is fine. Lot of trivial DeepSource issues. Still WIP?

@ArchDemons
Copy link
Collaborator Author

I want to try something lik Command-Query on Event Bus. Each client send query (e.g. i want build room 5x5) to server. Server checks possibility, and send command to client (e.g. build room 5x5) without any checks on client

@ArchDemons ArchDemons changed the title WIP: build & sell system build & sell system Oct 12, 2025
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.

2 participants