Advertisement
Guest User

NetworkListener class

a guest
Jun 27th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. public class NetworkListener extends Listener {
  2.  
  3.     public void connected(Connection c) {
  4.  
  5.     }
  6.    
  7.     public void disconnected(Connection c) {
  8.        
  9.     }
  10.    
  11.     public void recieved(Connection c, Object obj) {
  12.         if(obj instanceof Packet00LoginRequest) {
  13.             Packet01LoginAnswer loginAnswer = new Packet01LoginAnswer();
  14.             loginAnswer.answer = "Login Success";
  15.             c.sendTCP(loginAnswer);
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement