Is there a way to prevent players from using the built in feature to give another player resources, other than making them unallied? Or if not, is there a way to detect when someone uses it, so you can undo it?
In Game Constants you can set the value traded based on how you click (ctrl-click or shift-click and normal click, I believe) to 0, eliminating the ability to trade resources.