1. These forums are being retired. Please ask all questions and help threads and any other type of discussions on GitHub. During this time, new threads and user registrations have been disabled.

1.23 (obsolete) UPnP for TShock 1.0.4

A UPnP plugin for TShock.

  1. Simon311

    Simon311 TShock Contributor; Moderator
    TShock Contributor Plugin Developer

    Joined:
    Feb 23, 2013
    Messages:
    337
    A UPnP plugin for TShock.

    Outputs status, if not working - see what it says.

    Potentially allows you to host a server w/o Hamachi or Port Forwarding.

    Since update 1.0.0.1 works both on Windows and Linux. (unless you're doing something exotic, like running on Mono under Windows)


    Experimental alternative:
    If the plugin doesn't work for you - you can try this DLL instead (Source). Windows only.
    It might just work for you :) .

    Commands / Permissions:
    • /ureload - Reinitiates UPnP. Useful if something went wrong on startup. Requires permission "upnp".
    Changelog:
    • Version 1.0.2: API 1.16
    • Version 1.0.1: API 1.15
    • Version 1.0.0.4: Added REST forwarding, slight changes in Gateway Discovery, added showing your IP on startup.
    • Version 1.0.0.3 : Fixed service discovery errors. Thanks, Ijwu.
    • Version 1.0.0.2 : Added /ureload, Logging, Fixed Port Taken Error
    • Version 1.0.0.1 : Linux support, status output
     
    • Like Like x 7
    • Useful Useful x 1
  2. Patrikk

    TShock Mod TShock Contributor Plugin Developer

    Joined:
    May 25, 2012
    Messages:
    104
    Awesome! I would have kill for this a month ago xD
     
  3. Tyson Strange

    Tyson Strange Level 5

    Joined:
    Jul 23, 2011
    Messages:
    107
    not that port forwarding is hard anyway
     
  4. k0rd

    k0rd Tee Shawk Developer
    TShock Admin

    Joined:
    Dec 22, 2011
    Messages:
    438
  5. Simon311

    Simon311 TShock Contributor; Moderator
    TShock Contributor Plugin Developer

    Joined:
    Feb 23, 2013
    Messages:
    337
    Not hard, but there might be different circumstances.
    I mean kids who want to play with their friends probably don't even have access to their routers. :)

    Wow, this is a lot of code! Did you check out mine? It uses just one small class. And it *should be* compatible with Mono, but in my case both .GatewayAddresses and .DhcpAddresses returned an empty list on Mono. Anyway, the point isn't so much in having it Mono, but rather give Windows users a chance to use UPnP.
    I mean seriously, have you seen many people trying to host a server on Linux behind NAT? Most Mono users are VPS users :) .
    However, I will still try to get this working on Mono :)

    Also, I see there are already 6 downloads, yet no feedback. =/
     
    • Like Like x 2
  6. Simon311

    Simon311 TShock Contributor; Moderator
    TShock Contributor Plugin Developer

    Joined:
    Feb 23, 2013
    Messages:
    337
    1.0.0.1 update, should support Linux now.
     
  7. FanDidlyTastic

    FanDidlyTastic Level 1

    Joined:
    Oct 5, 2013
    Messages:
    8
    Now this interests me as I do not have access to my router for port forwarding. So my question is, how exactly would this work? Say someone wanted to connect to my server, would they only need to typing in my IP address, like what you find from using http://whatismyipaddress.com/? What information would I need while using this to allow people to use my server, without Hamachi, or some other similar Vlan Emulation?
     
  8. Simon311

    Simon311 TShock Contributor; Moderator
    TShock Contributor Plugin Developer

    Joined:
    Feb 23, 2013
    Messages:
    337
    You got it right :) . Install the plugin, run TerrariaServer.exe w/o any parameters and see what UPnP plugin says, if it did discover service and port forward succesfully - just give your friends your IP and you're ready to go.
    Ofc, it still might not work if your ISP is blocking ports, but it seems that most decent ISPs don't.
     
  9. Rosen

    Rosen Level 7

    Joined:
    Jan 19, 2012
    Messages:
    175
    Nice. Gonna use it on Mono :)
     
  10. Simon311

    Simon311 TShock Contributor; Moderator
    TShock Contributor Plugin Developer

    Joined:
    Feb 23, 2013
    Messages:
    337
    We got a badass over here xD
     
    • Like Like x 2
  11. Rympha

    Rympha Level 1

    Joined:
    Oct 7, 2013
    Messages:
    9
    Having some issues with this:

    Everything is fresh and up-to-date, I have router access, admin rights, and running Windows 7.

    I had no problems running vanilla without hamachi after port forwarding but had absolutely no luck running Tshock outside of connecting via localhost.
    I've used Tshock in the past, problem free, although it was around a year ago now, but I dare say I'm familiar enough with the end user parts of it.
    My vanilla server still works fine.

    Any suggestions? Or solutions even?!
     
  12. Simon311

    Simon311 TShock Contributor; Moderator
    TShock Contributor Plugin Developer

    Joined:
    Feb 23, 2013
    Messages:
    337
    Are you using latest version of this plugin? If not or not sure - download 1.0.0.3 and try.
    Please respond as soon as possible.
     
  13. Rympha

    Rympha Level 1

    Joined:
    Oct 7, 2013
    Messages:
    9
    [10/07/13 19:36:25] [Server API] Info: Plugin UPnP v1.0.0.3 (by simon311) initiated.

    As far as I'm aware, yeah.
     
    • Like Like x 1
  14. Simon311

    Simon311 TShock Contributor; Moderator
    TShock Contributor Plugin Developer

    Joined:
    Feb 23, 2013
    Messages:
    337
    Please try to use this binary: https://dl.dropboxusercontent.com/u/6568152/UPnP.dll and report if it works.
    Please do try as soon as possible, I was about to go to sleep :)
     
  15. Rympha

    Rympha Level 1

    Joined:
    Oct 7, 2013
    Messages:
    9
    Seems to return the same yellow text.

    Judging from the posts up there it's more likely an issue outside of your plugin though.
     
  16. Simon311

    Simon311 TShock Contributor; Moderator
    TShock Contributor Plugin Developer

    Joined:
    Feb 23, 2013
    Messages:
    337
    Redownload and try: https://dl.dropboxusercontent.com/u/6568152/UPnP.dll (different file, same link)
    Should fix it
     
  17. Rympha

    Rympha Level 1

    Joined:
    Oct 7, 2013
    Messages:
    9
    Haha, that actually crashes TerrariaServer.exe instantly!
    http://puu.sh/4Kb9t.png if any of that means anything at all to you.

    Nevermind that, I forgot to close the crashed instance, looks like it's working flawlessly now, I'll edit this again after checking with a friend.
     
  18. Simon311

    Simon311 TShock Contributor; Moderator
    TShock Contributor Plugin Developer

    Joined:
    Feb 23, 2013
    Messages:
    337
    Actually, this looks like you tried to run two servers at the same time.
     
  19. Simon311

    Simon311 TShock Contributor; Moderator
    TShock Contributor Plugin Developer

    Joined:
    Feb 23, 2013
    Messages:
    337
    The output should say if UPnP works or not ;)
     
  20. Rympha

    Rympha Level 1

    Joined:
    Oct 7, 2013
    Messages:
    9
    There's no more yellow screaming at me but I'm getting a Gateway IP timeout and "Failed to discover UPnP service"

    Shall we say all is good now and I need to scoot off to my router settings or something? XD
    And I'll say I'm sorry for the hassle now, I've only scratched the surface of networking stuff, at best, so I'm a bit clueless, really.