If you're expecting global variables to be non null I would recommend to check them with the AdminTool when the problem occurs.
Already done during several hours of investigation this bug.
Just to make sure that at least on the server side these variables are non-null.
Already done during several hours of investigation this bug.
I would also suggest to check the server side logs when this happens, to see if any exception might have caused the problem.
No exception whatsoever.
Ultimately we will need a proof of concept that demonstrates the issue, so that we can investigate it.
Lets save same time, shall we? I will make several assumptions and if all of them is correct, you should be able to identify the issue yourself
1. Client api is multithreaded
2. There is a thread, that receives events from server and another one, which fires events for the client itself
3. During ROOM_ADD and ROOM_JOIN, you are setting the room variables
4. Room variables are implemented via dictionary
5. Dictionaries are not thread safe
If all of these point are valid (and i know they are), that these chan of events are causing the problem
1. thread for processing server events set ups room, set ups global room variables and enqueue the ROOM_ADD event
2. out application calls ProcessEvents, which pick up the ROOM_ADD event from the queue
3. thread processing server events receives join room event from the server, during that (before ROOM_JOIN is fired), it set ups global variables
4. in the meantime, application runs ROOM_ADD handler and checks the room variables
In case, that during setting up room variables (during FnJoinRoom) is thread paused, and our handler goes live, it returns null - because Dictionary is not thread safe.
Code: Select all
public void Merge(...)
{
...
// problem is HERE, because dictionary is not thread safe
this.variables[variable.Name] = variable;
}
If the code above represents a code you are using (i cannot know that, but i assume that), that the problem is in that line of code.
I am looking forward to hearing from you soon
PS: In previous post quote, i have just described, why we need to read the global room variable inside ROOM_ADD event