Skip to content

Listen a Request

Ta Van Dung edited this page Jun 15, 2016 · 1 revision
import com.tvd12.ezyfox.core.annotation.ClientRequestListener;
import com.tvd12.ezyfox.core.annotation.ClientResponseHandler;
import com.tvd12.ezyfox.core.annotation.RequestParam;
import com.tvd12.ezyfox.core.annotation.ResponseParam;
import com.tvd12.ezyfox.core.content.AppContext;

import lombok.Data;

@Data
@ClientRequestListener(command = "sum")
public class SumRequestListener {
    
    @RequestParam private int a;
    @RequestParam private int b;
    
    public void execute(AppContext context, GameUser user) {
        int total = a + b;
    }
    
}

Hello World

Clone this wiki locally