Skip to content

Buddy Add

Ta Van Dung edited this page Jun 14, 2016 · 1 revision
import com.tvd12.ezyfox.core.annotation.ServerEventHandler;
import com.tvd12.ezyfox.core.command.Log;
import com.tvd12.ezyfox.core.config.ServerEvent;
import com.tvd12.ezyfox.core.model.ApiBuddy;
import com.tvd12.ezyfox.core.model.ApiZone;
import com.tvd12.ezyfox.core.content.AppContext;

@ServerEventHandler(event = ServerEvent.BUDDY_ADD)
public class BuddyAddHandler {

    public void handle(AppContext context, ApiZone zone, ApiBuddy buddy) {
        context.command(Log.class).from(this)
            .info("user " + buddy.getOwner().getName() + " " + 
                    "has just add buddy " + buddy.getName() + " " + 
                    "in zone " + zone.getName());
        // your business
    }
    
}

Hello World

Clone this wiki locally