Posted: 16 Oct 2011, 12:39
Well, I am not sure if it is default server behavior, but it is very likely. I don't have access to my game to check it right now whether I get those events fired in my zone extension. Nevertheless, just ignore it for now, and if you don't notice any problem about it later you are fine
What about sync? I told you that you have to synchronize it. Check that request dispatching section in the "cookbook", to help you organize your request inside extension. When you have fine grained requests it is much easier to synchronize them. For example, at the beginning you can put all game related requests in synchronized methods, so that there is no chance of two users running concurrently through requests (they are practically serialized). On the other hand you don't want your chat request methods synchronized, since they have no effect on game data.
That way you got your game extension synchronized with almost no effort. I think this kind of sync scheme will work good for any kind of turn based game. If you write real time game, then you need finer sync scheme, where you have shorter sync blocks around specific parts of code. This will improve performance, but it is harder to implement correctly, and it can produce errors that are hard to find if you make a mistake
What about sync? I told you that you have to synchronize it. Check that request dispatching section in the "cookbook", to help you organize your request inside extension. When you have fine grained requests it is much easier to synchronize them. For example, at the beginning you can put all game related requests in synchronized methods, so that there is no chance of two users running concurrently through requests (they are practically serialized). On the other hand you don't want your chat request methods synchronized, since they have no effect on game data.
That way you got your game extension synchronized with almost no effort. I think this kind of sync scheme will work good for any kind of turn based game. If you write real time game, then you need finer sync scheme, where you have shorter sync blocks around specific parts of code. This will improve performance, but it is harder to implement correctly, and it can produce errors that are hard to find if you make a mistake