Forum C# Event handling in C#

Event handling in C#

Postby mistersuits » July 4th, 2011, 12:14 am

System.EventHandler is not allowed.

What is the suggested way then to handle asynchronous events server-side?

For example, a user joins a room but a big action between current players is currently being processed so I don't want this new user to be able to start playing until the action is completed.

Thanks for the help in advance.

(Edit: I tried replacing the EventHandler delegate with something like Action, still doesn't work. Error seems to be with the "uses the non-allowed method: !!0 System.Threading.Interlocked::CompareExchange<System.EventHandler>(!!0&,!!0,!!0)")
mistersuits
 
Posts: 1
Joined: June 9th, 2011, 3:07 am

Re: Event handling in C#

Postby Henrik » July 4th, 2011, 10:28 am

mistersuits wrote:For example, a user joins a room but a big action between current players is currently being processed so I don't want this new user to be able to start playing until the action is completed.

Well, how would you tell this new user to "start playing" ? By sending a message to his client? Then you could do that at the end of the big action, for example.

Otherwise you can use the built-in timers to schedule a callback to try again:
http://playerio.com/documentation/refer ... leCallback
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Event handling in C#

Postby Oliver » July 4th, 2011, 5:19 pm

EventHandler sounds like somethign that could be whitelisted. I'll look into it.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am


Return to C#