this.apps = apps;
}
@Override
public void gotOutgoing(int id, long ip, int port, int sourceport) {
GOIMGameItem obj = (GOIMGameItem)apps.get(id);
//short portval = (short) port;
//System.out.println("Got outgoing(" + id + "): " + (obj == null ? "null?!":obj.toString()));
//System.out.println("Port: " + Integer.toString(port));
byte myip[] = new byte[] { (byte)((ip >> 24) & 0xFF),
(byte)((ip >> 16) & 0xFF),
(byte)((ip >> 8) & 0xFF),
(byte)((ip & 0xFF)) };
try {
if(obj != null)
obj.retrieveExtensionProxy().sniffedPacketFromGame(obj,new InetSocketAddress(InetAddress.getByAddress(myip),port), sourceport);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (NullPointerException e) {
e.printStackTrace();
System.err.println("Null pointer exception ... obj: " + obj);
if(obj != null)
System.err.println("obj: " + obj.toString() + " ... obj.retrieveExtensionProxy: " + obj.retrieveExtensionProxy());
}
//System.out.printf("I got a connection from %s to " + myip[0] + "." + myip[1] + "." + myip[2] + "." + myip[3] + ":%d\n",obj.name,myip[0],myip[1],myip[2],myip[3],port);
//System.out.printf("Got Outgoing (%d) by %s to %d,%d,%d,%d:%d\n",id,(obj == null ? "null" : obj.toString()),
//
// port