-
Notifications
You must be signed in to change notification settings - Fork 42
build & sell system #498
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
base: master
Are you sure you want to change the base?
build & sell system #498
Conversation
added event bus added lombok
| // Add new & remove old | ||
| entities.applyChanges(); | ||
|
|
||
| synchronized (this.queue) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
|
Generally the idea is fine. Lot of trivial DeepSource issues. Still WIP? |
|
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 |
No description provided.