Vice City: Multiplayer

Server Development => Community Plugins => Topic started by: ysc3839 on Mar 28, 2015, 03:28 PM

Title: UPnPPortMapper
Post by: ysc3839 on Mar 28, 2015, 03:28 PM
Don't need any configuration. Just add UPnPPortMapper in server.cfg! :)
https://bitbucket.org/ysc3839/0.4-upnpportmapper/downloads
Title: Re: UPnPPortMapper
Post by: DizzasTeR on Mar 28, 2015, 04:56 PM
Mind giving some information on this one?
Title: Re: UPnPPortMapper
Post by: MacTavish on Mar 28, 2015, 05:25 PM
It crash Server With An Error Here is the screenshot
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi58.tinypic.com%2Fqp3sdz.png&hash=873a473b78b205eb8ffc7c702aa1921710700407)
Title: Re: UPnPPortMapper
Post by: . on Mar 28, 2015, 06:02 PM
The error happens somewhere around here:
hr = spmc->Add(Port, L"UDP", Port, IPW, true, L"VCMP", &spm);
According to the MS documentation (https://msdn.microsoft.com/en-us/library/windows/desktop/aa366148%28v=vs.85%29.aspx) on this function:
HRESULT Add(
  [in]   long lExternalPort,
  [in]   BSTR bstrProtocol,
  [in]   long lInternalPort,
  [in]   BSTR bstrInternalClient,
  [in]   VARIANT_BOOL bEnabled,
  [in]   BSTR bstrDescription,
  [out]  IStaticPortMapping **ppSPM
);

Found out that the following:
Quote from: MicrosoftThe following code is incorrect:

BSTR MyBstr = L"I am a happy BSTR";

Which means that some of those arguments aren't what they're supposed to be. And that you should use SysAllocString (https://msdn.microsoft.com/en-us/library/windows/desktop/ms221458%28v=vs.85%29.aspx) and SysFreeString (https://msdn.microsoft.com/en-us/library/windows/desktop/ms221481%28v=vs.85%29.aspx). Anyway, I'm not that much of a fan when it comes to MS, VS and Windows in general. So, it's out of my area.
Title: Re: UPnPPortMapper
Post by: ysc3839 on Mar 29, 2015, 06:00 AM
Quote from: S.L.C on Mar 28, 2015, 06:02 PMThe error happens somewhere around here:
hr = spmc->Add(Port, L"UDP", Port, IPW, true, L"VCMP", &spm);
According to the MS documentation (https://msdn.microsoft.com/en-us/library/windows/desktop/aa366148%28v=vs.85%29.aspx) on this function:
HRESULT Add(
  [in]   long lExternalPort,
  [in]   BSTR bstrProtocol,
  [in]   long lInternalPort,
  [in]   BSTR bstrInternalClient,
  [in]   VARIANT_BOOL bEnabled,
  [in]   BSTR bstrDescription,
  [out]  IStaticPortMapping **ppSPM
);

Found out that the following:
Quote from: MicrosoftThe following code is incorrect:

BSTR MyBstr = L"I am a happy BSTR";

Which means that some of those arguments aren't what they're supposed to be. And that you should use SysAllocString (https://msdn.microsoft.com/en-us/library/windows/desktop/ms221458%28v=vs.85%29.aspx) and SysFreeString (https://msdn.microsoft.com/en-us/library/windows/desktop/ms221481%28v=vs.85%29.aspx). Anyway, I'm not that much of a fan when it comes to MS, VS and Windows in general. So, it's out of my area.
I want to know why it works well on my PC?

Fixed!
Title: Re: UPnPPortMapper
Post by: ysc3839 on Mar 29, 2015, 06:15 AM
Quote from: Beztone on Mar 28, 2015, 05:25 PMIt crash Server With An Error Here is the screenshot
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi58.tinypic.com%2Fqp3sdz.png&hash=873a473b78b205eb8ffc7c702aa1921710700407)
Fixed. Please download again! :)
Title: Re: UPnPPortMapper
Post by: MacTavish on Mar 29, 2015, 10:21 AM
It works on My friends computer Doesn't worked for me maybe cause on my modem and it bugged register command after removing the plugin everything works fine
Title: Re: UPnPPortMapper
Post by: rObInX on Mar 29, 2015, 04:08 PM
I used x64 and it crashes my server.
Title: Re: UPnPPortMapper
Post by: ysc3839 on Apr 18, 2015, 02:32 PM
Updated! https://bitbucket.org/ysc3839/0.4-upnpportmapper/downloads
Title: Re: UPnPPortMapper
Post by: DizzasTeR on Apr 18, 2015, 03:04 PM
The x64 version is crashing the server, any help?
Title: Re: UPnPPortMapper
Post by: ysc3839 on Apr 19, 2015, 01:32 AM
Quote from: Doom_Killer on Apr 18, 2015, 03:04 PMThe x64 version is crashing the server, any help?
I tested it, but no any wrong. Maybe you haven't turn on the "UPnP" on your router.
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi59.tinypic.com%2F2heab5t.jpg&hash=f9b0a66acbe0b735368fb9b7e0e5b012ae037f96)
Title: Re: UPnPPortMapper
Post by: Honey on Apr 19, 2015, 03:16 AM
Doesn't seem to work for me on 32bit, I've UPnP Enabled but it still crashes my server !
Title: Re: UPnPPortMapper
Post by: Spidey on Nov 07, 2015, 04:04 PM
what the?

Loaded plugin: squirrel04rel32

Loaded plugin: xmlconf04rel32

Loaded plugin: sockets04rel32

Loaded plugin: hashing04rel32

Loaded plugin: announce_verbose

Loaded plugin: UPnPPortMapper-rel32

One or more plugins failed to initialise, quitting.

[MODULE]  Loaded SqVCMP 0.4 frontend by Stormeus. (v1.0)
scripts/main.nut line = (742) column = (2) : error expression expected
[WARNING] Could not load script 'scripts/main.nut'
[WARNING] expression expected
[ERROR]   No Squirrel gamemode was specified.
Title: Re: UPnPPortMapper
Post by: Thijn on Nov 07, 2015, 05:05 PM
The error expression expected isn't to do with this plugin.
Are you sure there aren't any plugin errors above this?
Title: Re: UPnPPortMapper
Post by: KAKAN on Nov 07, 2015, 05:34 PM
WHat would this plugin do?
It'll automatically forward our ports?
Title: Re: UPnPPortMapper
Post by: Xmair on Nov 08, 2015, 03:43 AM
rofl bumping a seven months old plugin
Title: Re: UPnPPortMapper
Post by: KAKAN on Nov 08, 2015, 05:59 AM
Quote from: Xmair on Nov 08, 2015, 03:43 AMrofl bumping a seven months old plugin
Yea, I had this question many days ago, but can't ask as this can be a bump.
But someone bumped on it, and so I can't stop myself and asked.
So if you know the answer please tell.
Title: Re: UPnPPortMapper
Post by: ysc3839 on Feb 04, 2016, 03:32 AM
Quote from: KAKAN on Nov 07, 2015, 05:34 PMWHat would this plugin do?
It'll automatically forward our ports?
Yes
Title: Re: UPnPPortMapper
Post by: EK.IceFlake on Feb 05, 2016, 06:45 PM
Stop being lazy and forward them from 192.168.0.1/192.168.1.1/192.168.100.1
Title: Re: UPnPPortMapper
Post by: Stormeus on Feb 05, 2016, 07:42 PM
Quote from: NE.CrystalBlue on Feb 05, 2016, 06:45 PMStop being lazy and forward them from 192.168.0.1/192.168.1.1/192.168.100.1

Stop being lazy and write your scripts using the C++ API.

Why bother when there's a much more consistent and efficient way of solving the problem?
Title: Re: UPnPPortMapper
Post by: DizzasTeR on Feb 06, 2016, 06:41 AM
Quote from: NE.CrystalBlue on Feb 05, 2016, 06:45 PMStop being lazy and forward them from 192.168.0.1/192.168.1.1/192.168.100.1

Says the one who said he is too lazy to register on a forum, lol.
Title: Re: UPnPPortMapper
Post by: NicusorN5 on Jun 01, 2016, 12:56 PM
Can you update the plugin for 04rel004???Please? :D
Title: Re: UPnPPortMapper
Post by: KAKAN on Jun 01, 2016, 02:43 PM
Quote from: NicusorN5 on Jun 01, 2016, 12:56 PMCan you update the plugin for 04rel004???Please? :D
Well, does this plugn works for ya? It crashes my server all the time :(
Title: Re: UPnPPortMapper
Post by: ysc3839 on Jun 01, 2016, 02:54 PM
Quote
Quote from: NicusorN5 on Jun 01, 2016, 12:56 PMCan you update the plugin for 04rel004???Please? :D
I have made some update several weeks ago but I don't have time these weeks. I'll update as soon as possible.
Title: Re: UPnPPortMapper
Post by: ysc3839 on Jun 01, 2016, 02:58 PM
Quote from: KAKAN on Jun 01, 2016, 02:43 PM
Quote from: NicusorN5 on Jun 01, 2016, 12:56 PMCan you update the plugin for 04rel004???Please? :D
Well, does this plugn works for ya? It crashes my server all the time :(
This is because your router(or your OS) doesn't support UPnP.(I use Windows' built-in UPnP) And I forgot to check the null pointer in the code. So it crashes.
Title: Re: UPnPPortMapper
Post by: KAKAN on Jun 01, 2016, 03:13 PM
Quote from: ysc3839 on Jun 01, 2016, 02:58 PM
Quote from: KAKAN on Jun 01, 2016, 02:43 PM
Quote from: NicusorN5 on Jun 01, 2016, 12:56 PMCan you update the plugin for 04rel004???Please? :D
Well, does this plugn works for ya? It crashes my server all the time :(
This is because your router(or your OS) doesn't support UPnP.(I use Windows' built-in UPnP) And I forgot to check the null pointer in the code. So it crashes.
The 2nd one might be the reason. Because, I used to host a KF server using UPnP which worked perfectly without problems. And also, I use foobar2000's upnp plugin, that works without any issues too.
Title: Re: UPnPPortMapper
Post by: NicusorN5 on Jun 01, 2016, 04:22 PM
Quote from: KAKAN on Jun 01, 2016, 02:43 PM
Quote from: NicusorN5 on Jun 01, 2016, 12:56 PMCan you update the plugin for 04rel004???Please? :D
Well, does this plugn works for ya? It crashes my server all the time :(
I enabled UPnPP in my router :D
Title: Re: UPnPPortMapper
Post by: ysc3839 on Jun 02, 2016, 04:16 AM
Quote from: KAKAN on Jun 01, 2016, 03:13 PM
Quote from: ysc3839 on Jun 01, 2016, 02:58 PM
Quote from: KAKAN on Jun 01, 2016, 02:43 PM
Quote from: NicusorN5 on Jun 01, 2016, 12:56 PMCan you update the plugin for 04rel004???Please? :D
Well, does this plugn works for ya? It crashes my server all the time :(
This is because your router(or your OS) doesn't support UPnP.(I use Windows' built-in UPnP) And I forgot to check the null pointer in the code. So it crashes.
The 2nd one might be the reason. Because, I used to host a KF server using UPnP which worked perfectly without problems. And also, I use foobar2000's upnp plugin, that works without any issues too.
Those program don't use Windows' UPnP so there is no problem. This plugin works well in my Windows 10.
Title: Re: UPnPPortMapper
Post by: KAKAN on Jun 02, 2016, 04:20 AM
Quote from: ysc3839 on Jun 02, 2016, 04:16 AM
Quote from: KAKAN on Jun 01, 2016, 03:13 PM
Quote from: ysc3839 on Jun 01, 2016, 02:58 PM
Quote from: KAKAN on Jun 01, 2016, 02:43 PM
Quote from: NicusorN5 on Jun 01, 2016, 12:56 PMCan you update the plugin for 04rel004???Please? :D
Well, does this plugn works for ya? It crashes my server all the time :(
This is because your router(or your OS) doesn't support UPnP.(I use Windows' built-in UPnP) And I forgot to check the null pointer in the code. So it crashes.
The 2nd one might be the reason. Because, I used to host a KF server using UPnP which worked perfectly without problems. And also, I use foobar2000's upnp plugin, that works without any issues too.
Those program don't use Windows' UPnP so there is no problem. This plugin works well in my Windows 10.
I was trying in Windows 8.1. This doesn't work with 7 too. My bro removed Win10 and installed Win7 :P
So, is there any way to fix it?
Title: Re: UPnPPortMapper
Post by: ysc3839 on Jun 02, 2016, 05:06 AM
Quote from: KAKAN on Jun 02, 2016, 04:20 AM
Quote from: ysc3839 on Jun 02, 2016, 04:16 AM
Quote from: KAKAN on Jun 01, 2016, 03:13 PM
Quote from: ysc3839 on Jun 01, 2016, 02:58 PM
Quote from: KAKAN on Jun 01, 2016, 02:43 PM
Quote from: NicusorN5 on Jun 01, 2016, 12:56 PMCan you update the plugin for 04rel004???Please? :D
Well, does this plugn works for ya? It crashes my server all the time :(
This is because your router(or your OS) doesn't support UPnP.(I use Windows' built-in UPnP) And I forgot to check the null pointer in the code. So it crashes.
The 2nd one might be the reason. Because, I used to host a KF server using UPnP which worked perfectly without problems. And also, I use foobar2000's upnp plugin, that works without any issues too.
Those program don't use Windows' UPnP so there is no problem. This plugin works well in my Windows 10.
I was trying in Windows 8.1. This doesn't work with 7 too. My bro removed Win10 and installed Win7 :P
So, is there any way to fix it?
It should no problem by default. You should try to fix Windows' UPnP.
Title: Re: UPnPPortMapper
Post by: ysc3839 on Jun 05, 2016, 10:13 AM
Updated to new plugin SDK.
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Ffiles.thijn.ovh%2Fimg%2F0209d4c0a8d316e75add12e56a070be5%2FUPnPPortMapper.zip&hash=25a6a168e2d745564c2e1ecb1c8c2adc79c0b332) (http://files.thijn.ovh/download/0209d4c0a8d316e75add12e56a070be5/UPnPPortMapper.zip)
Title: Re: UPnPPortMapper
Post by: NicusorN5 on Jun 05, 2016, 05:48 PM
Yay!Gonna try it! :D
:EDIT:
Screenshoted this error at the perfect time lolz:
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fdc611.4shared.com%2Fimg%2FMDXAvsHbce%2Fs24%2F15521c71c68%2Flolzwhataerr%3Fasync%26amp%3Brand%3D0.3203428046585902&hash=3ac35357df854c4089ebdc6eb0c382db6cd4430a)
Title: Re: UPnPPortMapper
Post by: ysc3839 on Jun 06, 2016, 03:15 AM
Quote from: NicusorN5 on Jun 05, 2016, 05:48 PMYay!Gonna try it! :D
:EDIT:
Screenshoted this error at the perfect time lolz:
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fdc611.4shared.com%2Fimg%2FMDXAvsHbce%2Fs24%2F15521c71c68%2Flolzwhataerr%3Fasync%26amp%3Brand%3D0.3203428046585902&hash=3ac35357df854c4089ebdc6eb0c382db6cd4430a)
Unknown error. Windows said there's no error.
Title: Re: UPnPPortMapper
Post by: NicusorN5 on Jun 07, 2016, 07:43 PM
WTF?Ur seriously? I understood nothing.
Title: Re: UPnPPortMapper
Post by: ysc3839 on Jul 31, 2016, 02:40 AM
If you find any problem using this plugin. Enable UPnP in Windows. http://www.computerhope.com/issues/ch001367.htm
Title: Re: UPnPPortMapper
Post by: Kewun on Aug 01, 2016, 05:14 PM
even if u enable upnp in windows, you still get this error as posted in @NicusorN5's screenshot
Title: Re: UPnPPortMapper
Post by: NicusorN5 on Aug 01, 2016, 05:52 PM
Quote from: KAKAN on Jun 01, 2016, 03:13 PMAnd also, I use foobar2000's upnp plugin, that works without any issues too.
Where is it???
Title: Re: UPnPPortMapper
Post by: Shovon^ on Sep 11, 2016, 04:30 AM
hey this plugin automatically port forwards??
Title: Re: UPnPPortMapper
Post by: Kewun on Sep 11, 2016, 08:30 AM
yeah, but doesnt work at most pcs
Title: Re: UPnPPortMapper
Post by: KAKAN on Sep 11, 2016, 10:46 AM
Quote from: Kewun on Sep 11, 2016, 08:30 AMyeah, but doesnt work at most pcs
no. It's you who can't configure the UPnP. Or maybe there's some fault in ysc's plugin which he might fix later :D
Title: Re: UPnPPortMapper
Post by: Kewun on Sep 11, 2016, 04:22 PM
its fault in his plugin

i configured upnp properly

Title: Re: UPnPPortMapper
Post by: KAKAN on Sep 12, 2016, 07:02 AM
Quote from: Kewun on Sep 11, 2016, 04:22 PMits fault in his plugin

i configured upnp properly


@Kewun, why just you don't try before saying something?
https://s11.postimg.org/w7cwysif7/nerd_kewun.png
check it out, it loads and works perfectly. So, it's you who is being a nerd and can't configure UPnP properly.
(https://s11.postimg.org/w7cwysif7/nerd_kewun.png)
Title: Re: UPnPPortMapper
Post by: ysc3839 on Sep 12, 2016, 08:06 AM
Quote from: ysc3839 on Jul 31, 2016, 02:40 AMIf you find any problem using this plugin. Enable UPnP in Windows. http://www.computerhope.com/issues/ch001367.htm
Quote from: Kewun on Sep 11, 2016, 04:22 PMits fault in his plugin

i configured upnp properly
Title: Re: UPnPPortMapper
Post by: Kewun on Sep 12, 2016, 03:18 PM
upnp is enabled

Quote from: KAKAN on Sep 12, 2016, 07:02 AM
Quote from: Kewun on Sep 11, 2016, 04:22 PMits fault in his plugin

i configured upnp properly


@Kewun, why just you don't try before saying something?
https://s11.postimg.org/w7cwysif7/nerd_kewun.png
check it out, it loads and works perfectly. So, it's you who is being a nerd and can't configure UPnP properly.
(https://s11.postimg.org/w7cwysif7/nerd_kewun.png)
i tried
and im not a nerd like you
Title: Re: UPnPPortMapper
Post by: KAKAN on Sep 12, 2016, 05:57 PM
Quote from: Kewun on Sep 12, 2016, 03:18 PMupnp is enabled

Quote from: KAKAN on Sep 12, 2016, 07:02 AM
Quote from: Kewun on Sep 11, 2016, 04:22 PMits fault in his plugin

i configured upnp properly


@Kewun, why just you don't try before saying something?
https://s11.postimg.org/w7cwysif7/nerd_kewun.png
check it out, it loads and works perfectly. So, it's you who is being a nerd and can't configure UPnP properly.
(https://s11.postimg.org/w7cwysif7/nerd_kewun.png)
i tried
and im not a nerd like you
that means you can't configure UPnP properly. Take a look at my screenshot, it loads and works perfectly.
So, it's not his plugin fault.