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
Adding a new ship design replaces an existing one instead #2883
Comments
I ran into this issue while acting as delegate for ThinkSome's empire in the current (ninth) multiplayer game, turn 68. I added a design while the empire was set to ready and it overwrote an existing design. I'm not entirely sure if this was caused because I had the empire set to ready or if I had just coincidentally run into the problem then. ThinkSome had been having this issue as well which is why I was delegating for him. I was unable to reproduce in a local multiplayer game. I have attached the log, apologies for the length as I logged in and out many times to test different permutations to see if I could get the problem to go away. The following entries are of most interest:
|
There is a server log https://freeorion-test.dedyn.io/FO0009-freeoriond.log Can it be helpful? |
Does anyone know under what circumstances ShipDesignOrder::ExecuteImpl() would be called with m_create_new_design = true and m_design_id != INVALID_DESIGN_ID (in Order.cpp)? I've been looking through the code and I can't figure out what could possibly make that happen even though the error logs seem to indicate that it has. |
@swaqvalley Which log line you mean? |
The ones that say "[error] client : Order.cpp:1186 : Empire, 8, tried to create a new ShipDesign with an id, 33101 of an already-existing ShipDesign Efficiency" |
It could be set such way from |
Maybe there is serialization inconsistency. Client creates new design, send order about it to the server, disconnects. Then client connects again, get order about new design from the server and deserializes it incorrectly. |
The server got same error:
|
I suppose I got idea. When server sends orders back to the client they are executed. So client get back correct Line 1206 in 7a1afa5
sets new |
Normally the order is created by the client with I don't know what happens if a client dis and reconnects after issuing such an order, though I don't see why there would be any difference with serialization in that case. Once the client executes the order and sends it to the server, the server can send it back to the client and it will still have the set So it looks like the client tried to issue a series of new design orders, and they were all assigned the same ID for some reason... |
@geoffthemedio Can we add some more logs to see what was generated here? |
...what was generated where? |
Design ID generated here. Also what if his design ID collided with other empire's design ID? |
@geoffthemedio Should universe check in |
It already does...
Generated where?
The ID Allocator should prevent that already: https://github.com/freeorion/freeorion/blob/master/universe/IDAllocator.h#L14 |
Could ID Allocators on the server and the client be desynchronized?
In freeorion/universe/Universe.cpp Line 433 in 6908c9e
|
@swaqvalley If issue related to sending ship design order back-forth between the server and the client you should try to re-connect to the server. Use option |
Thanks, @o01eg Reproduction instructions!
|
I did some testing of PR #2913 and it is better but as @o01eg stated it doesn't solve the root of the issue and there is still some weirdness.
|
@swaqvalley Could you see what happened in the server and client logs? |
In that case we either need to reopen this issue, or open a separate one describing the actual root issue and the remaining "weirdness" (which would be my recommendation). |
@o01eg Logs from my last testing run attached. Nothing stands out to me. Ship names were d1, d2, d3 on Dummy empire and a1, a2, a3, a4 on swaq empire, if I recall correctly. |
freeorion.log:
I didn't find related errors in the server logs. |
Ship design 1866 was created before:
|
@swaqvalley Can you open a new issue about the weirdness you mention? |
Environment
Description
Expected Result
Steps to reproduce
Have a shitload of designs, make a new one, click
Add Finished Design
, it will replace an existing one, including the build queues.The text was updated successfully, but these errors were encountered: