#NEWLINE# @ tornado . gen . coroutine #NEWLINE# def perform_event_player( self , uid , text , texteval , otext , otexteval ) : #NEWLINE# #INDENT# if ( self . level != LEVEL_EXECUTE ) : #NEWLINE# #INDENT# raise Exception ( 'Events may only occur in action code' ) #NEWLINE# #UNINDENT# if text : #NEWLINE# #INDENT# if texteval : #NEWLINE# #INDENT# ctx = EvalPropContext ( self . task , parent = self , level = LEVEL_MESSAGE ) #NEWLINE# val = ( yield ctx . eval ( text , evaltype = EVALTYPE_TEXT ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# val = text #NEWLINE# #UNINDENT# self . task . write_event ( uid , val ) #NEWLINE# #UNINDENT# if otext : #NEWLINE# #INDENT# others = ( yield self . task . find_locale_players ( uid = uid , notself = True ) ) #NEWLINE# if otexteval : #NEWLINE# #INDENT# ctx = EvalPropContext ( self . task , parent = self , level = LEVEL_MESSAGE ) #NEWLINE# val = ( yield ctx . eval ( otext , evaltype = EVALTYPE_TEXT ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# val = otext #NEWLINE# #UNINDENT# self . task . write_event ( others , val )