Introduction: AutoPortForward automaticlly forwards the port that is specified in the server.properties. The gateway device must support UPNP. How this plugin works: AutoPortForward discovers gateway devices (ex: routers) and attempts to forward the port specified on a one of the devices. AutoPortForward will remove the port forward on disable, and add it again on enable. What versions of CraftBukkit / Bukkit are supported: AutoPortForward will work with almost if not all versions of CraftBukkit and Bukkit, as long as the onEnable and onDisable are the same. Configuration: AutoPortForward uses the port in the server.properties (server-port) - The default is 25565. WARNING: AutoPortForward will remove port mappings that use TCP on the port the server will be running off of, so if you have a web server running on port 80, and a minecraft server on port 80 (Which you shouldn't do) it will delete the web server port mapping and add the minecraft server. BukkitDev + Download : http://dev.bukkit.org/server-mods/auto-port-forward/ Changelog: Version 0.1 - Release Version 0.2 - Cleaned up code + Added a new system to download the lib automaticlly Version 2.0 Complete rewrite
Like this: http://en.wikipedia.org/wiki/UPnP#NAT_traversal Edit: To install the plugin, download http://maven.nuiton.org/nexus/conte...bbi/sbbi-upnplib/1.0.4/sbbi-upnplib-1.0.4.jar into your lib folder - the original author has forgotten to shade the upnplib library into the .jar.
jca2323 It seems like your BukkitDev project page is down, and you might want to recompile your jar only with the class files, because you have unnecessary libs and other project files within the .jar, bloating up the file size (a whopping 4.1MB!)
Ok, Im going to add a new system to download the lib if it doesn't exist. MeneXia Version 0.2 -Cleaned up code -Added system to automaticlly download the required lib. Thanks to zhuowei for the download link -New download link: http://dl.dropbox.com/u/47438843/AutoPortForward.jar As zhuowei said this uses UPNP, a way for devices to discover devices on a network to find a gateway device and than requests it to forward a port through a UPNP TCP request. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
You can actually include the library file in the plugin .jar if you like. There's probably an Eclipse option to do that automatically, or you can simply drag all the classes from the library into the plugin.
Doesnt work with 1.2.5-R3.0 im getting this error. do have that other file its looking for but sbbi-upnplib-1.0.4.jar shows an error saying it doesnt have a plugin.yml Code: 2012-05-28 11:10:57 [INFO] [AutoPortForward] Enabling AutoPortForward v1.0 2012-05-28 11:10:57 [SEVERE] [AutoPortForward] Failed to download sbbi-upnplib-1.0.4.jar Please download it manually from http://maven.nuiton.org/nexus/content/groups/releases/net/sbbi/sbbi-upnplib/1.0.4/sbbi-upnplib-1.0.4.jar Disabling 2012-05-28 11:10:57 [SEVERE] java.io.FileNotFoundException: AutoPortForward\sbbi-upnplib-1.0.4.jar (The system cannot find the path specified) 2012-05-28 11:10:57 [SEVERE] at java.io.FileOutputStream.open(Native Method) 2012-05-28 11:10:57 [SEVERE] at java.io.FileOutputStream.<init>(Unknown Source) 2012-05-28 11:10:57 [SEVERE] at java.io.FileOutputStream.<init>(Unknown Source) 2012-05-28 11:10:57 [SEVERE] at com.jca2323.AutoPortForward.AutoPortForwardMain.downloadFile(AutoPortForwardMain.java:150) 2012-05-28 11:10:57 [SEVERE] at com.jca2323.AutoPortForward.AutoPortForwardMain.onEnable(AutoPortForwardMain.java:43) 2012-05-28 11:10:57 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:215) 2012-05-28 11:10:57 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) 2012-05-28 11:10:57 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) 2012-05-28 11:10:57 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:256) 2012-05-28 11:10:57 [SEVERE] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:238) 2012-05-28 11:10:57 [SEVERE] at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:381) 2012-05-28 11:10:57 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:368) 2012-05-28 11:10:57 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:197) 2012-05-28 11:10:57 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:432) 2012-05-28 11:10:57 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
Download the latest version from here: http://dl.dropbox.com/u/47438843/AutoPortForward.jar Put that in your plugin directory and restart the server. Your not using the latest verision.
I downloaded the latest one and Im still recieving some type of error. Code: 2012-05-28 11:20:03 [INFO] [AutoPortForward] AutoPortForward by jca2323 version 1.0_02 loaded 2012-05-28 11:20:03 [INFO] [AutoPortForward] Forwarding port: 25565 2012-05-28 11:20:03 [SEVERE] Error occurred while enabling AutoPortForward v1.0 (Is it up to date?) java.lang.NoClassDefFoundError: net/sbbi/upnp/impls/InternetGatewayDevice at com.jca2323.AutoPortForward.AutoPortForwardMain.forwardPort(AutoPortForwardMain.java:36) at com.jca2323.AutoPortForward.AutoPortForwardMain.onEnable(AutoPortForwardMain.java:30) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:215) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:256) at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:238) at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:381) at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:368) at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:197) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:432) at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) Caused by: java.lang.ClassNotFoundException: net.sbbi.upnp.impls.InternetGatewayDevice at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41) at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 12 more
The latest version from the link says: [AutoPortForward] AutoPortForward by jca2323 version 1.4 loaded yours says 1.0_02 TopGear93
i downloaded the so called " latest one " from your dropbox. "Download the latest version from here: http://dl.dropbox.com/u/47438843/AutoPortForward.jar"
dl.dropbox.com/u/47438843/AutoPortForward.jar Link was screwed try the one in the post, sorry EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Amazing idea, if it works, If it doesnt > Not Craftbukkit R4.0 EDIT by Moderator: merged posts, please use the edit button instead of double posting.
It doesn't work: Code: [AutoPortForward] Enabling AutoPortForward v4.0 2012-07-11 13:48:36 [INFO] [AutoPortForward] AutoPortForward by jca2323 version 1.4 loaded 2012-07-11 13:48:36 [INFO] [AutoPortForward] Forwarding port: 25565 2012-07-11 13:48:43 [WARNING] [AutoPortForward] Failed to find a device, disabling. 2012-07-11 13:48:43 [INFO] [AutoPortForward] Disabling AutoPortForward v4.0 2012-07-11 13:48:43 [INFO] [AutoPortForward] AutoPortForward disabled. 2012-07-11 13:48:43 [INFO] I've got a Linksys E2000 router (with UPNP) so it has to work?
Does It Work For iiNet Routers Though?? But If It Works GOOD JOB I've Been Trying To Port Forward It For AGES
I have an error 2012-07-12 08:49:11 [INFO] [AutoPortForward] Enabling AutoPortForward v4.0 2012-07-12 08:49:11 [INFO] [AutoPortForward] AutoPortForward by jca2323 version 1.4 loaded 2012-07-12 08:49:11 [INFO] [AutoPortForward] Forwarding port: 25565 2012-07-12 08:49:17 [INFO] [AutoPortForward] Attempting to use device: Thomson TG 2012-07-12 08:49:17 [INFO] [AutoPortForward] Attempting to forward port.. 2012-07-12 08:49:17 [SEVERE] [AutoPortForward] Exception while forwarding port: 2012-07-12 08:49:17 [SEVERE] net.sbbi.upnp.messages.UPNPResponseException: Detailed error code :702, Detailed error description :Invalid value specified 2012-07-12 08:49:17 [SEVERE]at net.sbbi.upnp.messages.ActionMessageResponseParser.startElement(ActionMessageResponseParser.java:145) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source) 2012-07-12 08:49:17 [SEVERE]at net.sbbi.upnp.messages.ActionMessage.service(ActionMessage.java:172) 2012-07-12 08:49:17 [SEVERE]at net.sbbi.upnp.impls.InternetGatewayDevice.addPortMapping(InternetGatewayDevice.java:388) 2012-07-12 08:49:17 [SEVERE]at com.jca2323.AutoPortForward.AutoPortForwardMain.forwardPort(AutoPortForwardMain.java:103) 2012-07-12 08:49:17 [SEVERE]at com.jca2323.AutoPortForward.AutoPortForwardMain.onEnable(AutoPortForwardMain.java:65) 2012-07-12 08:49:17 [SEVERE]at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:215) 2012-07-12 08:49:17 [SEVERE]at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) 2012-07-12 08:49:17 [SEVERE]at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) 2012-07-12 08:49:17 [SEVERE]at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:256) 2012-07-12 08:49:17 [SEVERE]at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:238) 2012-07-12 08:49:17 [SEVERE]at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:381) 2012-07-12 08:49:17 [SEVERE]at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:368) 2012-07-12 08:49:17 [SEVERE]at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:197) 2012-07-12 08:49:17 [SEVERE]at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:432) 2012-07-12 08:49:17 [SEVERE]at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) 2012-07-12 08:49:17 [INFO] [AutoPortForward] Disabling. Failed to forward port. 2012-07-12 08:49:17 [INFO] [AutoPortForward] Disabling AutoPortForward v4.0 2012-07-12 08:49:17 [INFO] [AutoPortForward] AutoPortForward disabled.
Seems like more troublesome than it's worth. Edit: I gave it a try, for fun. Enabled UPnP. I don't know why you say that this is version 1.5 when your plugin.yml has version 4.0 written in it and when it's loaded it displays 1.4 This is what I got : Spoiler (Move your mouse to the spoiler area to reveal the content) Show Spoiler Hide Spoiler 00:28:17 [INFO] [AutoPortForward] Enabling AutoPortForward v4.0 00:28:17 [INFO] [AutoPortForward] AutoPortForward by jca2323 version 1.4 loaded 00:28:17 [INFO] [AutoPortForward] Forwarding port: 25555 00:28:23 [INFO] [AutoPortForward] Attempting to use device: UPnP IGD 00:28:23 [INFO] [AutoPortForward] Attempting to forward port.. 00:28:23 [SEVERE] [AutoPortForward] Exception while forwarding port: 00:28:23 [SEVERE] net.sbbi.upnp.messages.UPNPResponseException: Detailed error c ode :402, Detailed error description :Invalid Args 00:28:23 [SEVERE] at net.sbbi.upnp.messages.ActionMessageResponseParser.st artElement(ActionMessageResponseParser.java:145) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.parsers.AbstractSA XParser.startElement(Unknown Source) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.impl.XMLNSDocument ScannerImpl.scanStartElement(Unknown Source) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFr agmentScannerImpl$FragmentContentDriver.next(Unknown Source) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.impl.XMLDocumentSc annerImpl.next(Unknown Source) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.impl.XMLNSDocument ScannerImpl.next(Unknown Source) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFr agmentScannerImpl.scanDocument(Unknown Source) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.parsers.XML11Confi guration.parse(Unknown Source) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.parsers.XML11Confi guration.parse(Unknown Source) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.parsers.XMLParser. parse(Unknown Source) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.parsers.AbstractSA XParser.parse(Unknown Source) 00:28:23 [SEVERE] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl $JAXPSAXParser.parse(Unknown Source) 00:28:23 [SEVERE] at javax.xml.parsers.SAXParser.parse(Unknown Source) 00:28:23 [SEVERE] at net.sbbi.upnp.messages.ActionMessage.service(ActionMe ssage.java:172) 00:28:23 [SEVERE] at net.sbbi.upnp.impls.InternetGatewayDevice.addPortMapp ing(InternetGatewayDevice.java:388) 00:28:23 [SEVERE] at com.jca2323.AutoPortForward.AutoPortForwardMain.forwa rdPort(AutoPortForwardMain.java:103) 00:28:23 [SEVERE] at com.jca2323.AutoPortForward.AutoPortForwardMain.onEna ble(AutoPortForwardMain.java:65) 00:28:23 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlug in.java:215) 00:28:23 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin( JavaPluginLoader.java:337) 00:28:23 [SEVERE] at im.creep.bukkitinsider.smartassery.ModifiableSimplePl uginManager.enablePlugin(ModifiableSimplePluginManager.java:408) 00:28:23 [SEVERE] at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftSe rver.java:378) 00:28:23 [SEVERE] at org.bukkit.craftbukkit.CraftServer.enablePlugins(Craf tServer.java:360) 00:28:23 [SEVERE] at net.minecraft.server.MinecraftServer.t(MinecraftServe r.java:432) 00:28:23 [SEVERE] at net.minecraft.server.MinecraftServer.a(MinecraftServe r.java:419) 00:28:23 [SEVERE] at net.minecraft.server.MinecraftServer.init(MinecraftSe rver.java:234) 00:28:23 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftSer ver.java:487) 00:28:23 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(Sour ceFile:492) 00:28:23 [INFO] [AutoPortForward] Disabling. Failed to forward port. 00:28:23 [INFO] [AutoPortForward] Disabling AutoPortForward v4.0 00:28:23 [INFO] [AutoPortForward] AutoPortForward disabled.
Looks interesting, please upgrade to latest RB. Does it work on any routers other than the one you tested / made it on?