package sfs3.extensions.examples.shooter.handlers;

import com.smartfoxserver.bitswarm.data.TransportType;
import com.smartfoxserver.entities.Room;
import com.smartfoxserver.entities.User;
import com.smartfoxserver.entities.data.ISFSObject;
import com.smartfoxserver.entities.data.SFSObject;
import com.smartfoxserver.extensions.BaseClientRequestHandler;

import sfs3.extensions.examples.shooter.utils.RoomHelper;
import sfs3.extensions.examples.shooter.utils.UserHelper;

public class SendAnimHandler extends BaseClientRequestHandler
{
	@Override
	public void handleClientRequest(User u, ISFSObject data, TransportType txType)
	{
		SFSObject sfsObject = new SFSObject();
		sfsObject.putString("msg", data.getString("msg"));
		sfsObject.putInt("id", u.getId());
		
		Room currentRoom = RoomHelper.getCurrentRoom(this);
		send("anim", (ISFSObject) sfsObject, UserHelper.getRecipientsList(currentRoom, u));
	}
}
