package org.drools.games.adventures

import org.drools.games.adventures.Request;
import org.drools.games.adventures.Response;
import org.drools.games.adventures.SessionCharacter

dialect "mvel"

rule updateUserSession when
    $us : UserSession()
    not SessionCharacter( session == $us )    
then
    s = new SessionCharacter();
    s.session = $us;
    insert( s );
end


rule updateCharacters salience 5 when
    $chars : List() from collect( Character() )
    $us : UserSession( )    
then
   $us.channels["characters"].send( $chars ); 
end 