We may have to use the timer idea. First I want to do some more play testing to see if this is something that happens consistently. If there is certain conditions that happen that sets up this bug then perhaps we can manage to avoid this bug altogether. Like, does the AI offering peace even work normally, maybe its been bugged all along?
Play testing and logging diplomacy calls my reveal a pattern, at least it may tell us which events are bugged.
Each event has a random chance even after all conditions are met. So, for testing this we can removed the random part and then all events will pop when they are able. Perhaps by doing this we can reveal a pattern to this total madness. I call it madness because the DLL does all the necessary checks for diplomacy, but then they redo all the checks in the exe. Perhaps they meant to move most of the code to the dll but never managed it. Like CvDiploParameters is in the DLL but the info written is never used in the DLL.
Here is one thought, you know how with Rollo I could manually ask for peace and then I was able to... I have a thought brb...
Ok, I set it up so that Rollo would ask for peace the next turn, which causes the bug. I then open world builder and force Rollo into Peace, which fixed the Bug
However, I used world builder again to set us at war and the bug came back. So, it is the condition of War that is causing this apparently. Which makes me think could we trick the exe into thinking we are at peace, to allow the Diplomacy then set us back to war when the screen is popped. Python would know what Diplomacy is called and if the two Players are not at war it could set them to War. Anyway, if being at War causes this bug, then perhaps we can just remove this from delayed responses.
However, this made me realize the system is flawed. As the Player could sue for Peace and then Rollo's request would still be in the que. So, if we left this in Calls for Peace could check the que for the Player and if any requests for present are made we can remove that request. And actually, most of the other requests could be done manually and then they would still be left in the que, so to be realistic most of them would need to check for waiting diplomacy. Or, perhaps better when a Diplomacy is in the que, the owner of it can not be contacted. You get a hover text that says he has diplomats waiting for you already, yeah that would work best.