[Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
|
10-15-2016, 03:36 PM
(This post was last modified: 10-17-2016 08:37 PM by Wishdream.)
Post: #1
|
|||
|
|||
[Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
Phantasy Star Portable 2 and The Port Offset Conundrum
First of all hi! I'm not exactly new at PPSSPP and I forgot my old account so I know what I'm saying. I'll make it brief. For the past few days I've been trying to play with others on Phantasy Star Portable 2. The problem is when the users use port offsetting. With the recent 1.2.2 and 1.3, we hadn't been able to connect at all but not to a point we can't see each other. We have a pretty diverse setup, 1 on Linux, 2 on Windows, 1 on Android. It's pretty easy to get the game working on all platforms though, we use port offset. The port offset has to be > 1024. Both Linux and Windows on the same server. Note: This will not work on a PSP and impossible to let a PSP connect if you use Port Offset. The Problem In order to play with Android and Linux, you'll need to port offset. At first it seems to work, but then you will experience the following:
Now, I want to work with people to fix this. Mostly because the people affected are non-Windows users. I've tested this in pretty much most circumstances. Here's the results: Test Setup Config
Hosting Solo and Multi Party on Adhoc, Port Offset - No Port Offset
Note: This method has been tried and does happen in coldbird.net, myneighborsushicat.com, localhost/127.0.0.1, Hamachi, Evolve and OpenVPN. I want to create a seamless experience between all platforms for those who want to play this game. Let me hear your solutions and show if you experience the same thing. Let's help debug this so we can sort this out for other games too. P.S. The port offset problem occurs on all systems. And yes, Windows & Windows with No Port Offset has been tried and I am well aware that it works. So please, if you are only here to say Windows & Windows - No Port Offset so it would work... you are not really helping. The goal of this thread is to eliminate the Port Offset problem of PSP2 as well as other games displaying the same symptoms. Thank You |
|||
10-15-2016, 03:51 PM
Post: #2
|
|||
|
|||
RE: [BUG(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
Try PPSSPP 1.3 with 2 windows
For Phantasy Star Portable 2, Adhoc only working on windows. what ever Port Offset is, it not working on non-windows. |
|||
10-15-2016, 04:07 PM
(This post was last modified: 10-16-2016 05:29 AM by Wishdream.)
Post: #3
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
(10-15-2016 03:51 PM)onelight Wrote: Try PPSSPP 1.3 with 2 windowsWell, I want to solve the problem of Port Offset in general. So, no I will not accept that as a solution and a workaround. We already proven that it works. The port offset clearly works on all platforms as given in each screenshot. And technically, the problem also occurs in Windows and Windows alone with Port Offset. So the problem is not that it's not working on non-Windows, because the platforms are clearly communicating with each other. The problem is, why is the Port Offset suddenly not working when the game starts. Again, I'm not new so I know what I'm talking about and this is not to solve a personal problem. My theory is that PSP2 uses a hardcoded port on gameplay, so even when you use the port offset ports, it still uses the original ports. I don't exactly have a socket sniffer to test this theory, but if that was the case then it's possible to contribute a module to the github repo. |
|||
10-16-2016, 04:30 PM
(This post was last modified: 10-16-2016 04:41 PM by onelight.)
Post: #4
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
On LINUX, Port Offset is not Necessary if you run PPSSPP as root.
sudo ./PPSSPPSDL and port offset =0 is the way uses the original ports on LINUX For most game, it work perfect but not PSP2. It is strange that my adhoc_stuff build make it work and I don't know it before PPSSPPSDL-v1.1.1-202-Adhoc_stuff-chatSimple-LINUX http://portal.ctfile.com/info/0hl314849 |
|||
10-17-2016, 03:19 AM
Post: #5
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
Do you still have the source code for it? It might've have a regression, if so then it's possible for me to make a module for it. I have to do a negative check to see what's been changed.
Also, I didn't know you have to run ppsspp as root to make it work on Linux. But I don't think you can sudo on Android though. I have to check for that because essentially it's also a Linux system. Does it have to be specifically the SDL version? Because Arch does not have the SDL version. Though it does seem the default version is the SDL version for Arch. I'll have to test it out later. |
|||
10-17-2016, 11:30 AM
Post: #6
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
source code https://github.com/hrydgard/ppsspp/pull/8134
v1.3 build http://portal.ctfile.com/info/gV3315320 |
|||
10-17-2016, 08:02 PM
(This post was last modified: 10-17-2016 08:38 PM by Wishdream.)
Post: #7
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
Hmm... Looks like the branch where your builds work just needs to be rebased for things to work.
Most of the port offset stuff has been applied sure but the rest of the fixes in the branch has not been applied. It's safe to assume it's safe to rebase now since work on it has not been touched since 9 months ago. Once the branch has been rebased and merged then the fixes will be in the main branch. Though people will have to grab that build to get a stable experience. I'll see if the builds fixes the problem though. Thanks for the linux build by the way. Also, I can confirm that Arch's main build uses the SDL build and the Qt build is an enhanced version of the main build. And topic updated for the status of each platform. EDIT: Had to install GLEW1.13 to make your build work. EDIT 2: This still does not allow Android builds to work since technically they still use port offset, unless I find a way to sudo in which I have not tried yet. |
|||
10-19-2016, 10:49 AM
(This post was last modified: 10-19-2016 10:54 AM by AdamN.)
Post: #8
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
(10-17-2016 03:19 AM)Wishdream Wrote: Do you still have the source code for it? It might've have a regression, if so then it's possible for me to make a module for it. I have to do a negative check to see what's been changed. sudo is required to bind & listening privileged ports (<1024), on rooted Android you'll need to install sudo or terminal emulator app, since android doesn't come with sudo built-in However, it's strange if you also need sudo when using Port Offset > 1024 in order to work, unless if a firewall is blocking non-root/non-admin application from binding any port (which also happened on Windows with third-party firewall/internet security) My Modified PPSSPP : ============== Win32&64: https://www.dropbox.com/s/2t3mtdhb0f045cn/PPSSPP_1.11-testbuild_Win32x64.zip?dl=0 Android(ARMv7): https://www.dropbox.com/s/b41bm43mtn1gpnn/PPSSPP_1.11-testbuild_ARMv7.apk?dl=0 |
|||
10-19-2016, 01:30 PM
Post: #9
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
(10-19-2016 10:49 AM)AdamN Wrote: sudo is required to bind & listening privileged ports (<1024), on rooted Android you'll need to install sudo or terminal emulator app, since android doesn't come with sudo built-in Phantasy Star Portable 2 need sudo AND Port Offset = 0 in order to work |
|||
10-19-2016, 02:36 PM
(This post was last modified: 10-19-2016 03:09 PM by AdamN.)
Post: #10
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
(10-19-2016 01:30 PM)onelight Wrote:Hmm.. there might be another network function i missed and being used by PSP2 that uses port but didn't shift the port number.(10-19-2016 10:49 AM)AdamN Wrote: sudo is required to bind & listening privileged ports (<1024), on rooted Android you'll need to install sudo or terminal emulator app, since android doesn't come with sudo built-in Does PSP2 also need Port Offset = 0 on Windows in order to work? or is it only happening on Linux (i don't have the game) Btw, when using Port Offset = 0 does PSP2 binds port 80? just in case it uses non-adhoc network function that suppose to access HTTP port 80 by default, because as i remember only functions related to adhoc that was shifted by port offset. I remember there was a game that bind port 80 and was conflicting with my webserver on my PC a game where we rides a dragon (don't remember the title and i haven't tested it with port offset back then) My Modified PPSSPP : ============== Win32&64: https://www.dropbox.com/s/2t3mtdhb0f045cn/PPSSPP_1.11-testbuild_Win32x64.zip?dl=0 Android(ARMv7): https://www.dropbox.com/s/b41bm43mtn1gpnn/PPSSPP_1.11-testbuild_ARMv7.apk?dl=0 |
|||
10-20-2016, 06:28 AM
(This post was last modified: 10-20-2016 12:46 PM by Wishdream.)
Post: #11
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
(10-19-2016 02:36 PM)AdamN Wrote: Hmm.. there might be another network function i missed and being used by PSP2 that uses port but didn't shift the port number. I can't check if PSP2 binds to port 80 at the moment because of a typhoon, stuck on mobile. But yes, Windows does need Port Offset = 0 to work as well. Beyond that, Windows will be also be stuck in the lobby and not get into the game. This also applies to every other platform too including Android. I placed the status of it in the first post to let everyone know. So it does seem that PSP2 is using a network function that doesn't pass through the Port Offset. EDIT: I did some port checking and these are the things that is used while connecting on Port Offset. On Port Offset 3000 Code: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME On Port Offset 0 Code: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Using the Debug Log this is what I get from the Port 3000 one, I removed the un-readable bits: Code: 38:54:817 user_main I[NET]: HLE/sceNetAdhoc.cpp:2102 sceNetAdhocPtpListen( ,13001,8224,200000,300,5,0) |
|||
10-20-2016, 12:20 PM
(This post was last modified: 10-21-2016 07:19 AM by AdamN.)
Post: #12
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
It's not replacing it entirely, binded/listened ports is being shifted by 3000 correctly, while sockets who connection gets established to binded port will get a random port which is normal for client socket.
But i think i can see the issue, its the one with port 3000 i think, or may be not I guess port 0 shouldn't be shifted and remain 0 so the system will assign any available port randomly (port 0 usually used for client socket anyway, and not being used to bind/listen) Btw, do you have a working windows build? the one on the latest nightly build at orphis doesn't seem to work with PSP2 PS: the "un-readable bits" in function parameters usually MAC address bytes shown as byte string instead of hex string My Modified PPSSPP : ============== Win32&64: https://www.dropbox.com/s/2t3mtdhb0f045cn/PPSSPP_1.11-testbuild_Win32x64.zip?dl=0 Android(ARMv7): https://www.dropbox.com/s/b41bm43mtn1gpnn/PPSSPP_1.11-testbuild_ARMv7.apk?dl=0 |
|||
10-22-2016, 08:32 AM
Post: #13
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
(10-20-2016 12:20 PM)AdamN Wrote: It's not replacing it entirely, binded/listened ports is being shifted by 3000 correctly, while sockets who connection gets established to binded port will get a random port which is normal for client socket. Now that you mentioned it, yeah port 0 should remain port 0 to assign a random port. Well, that's pretty clever to show the MAC address as a byte string. Kind of a way to obscufate the MAC address. Anyways, I got a working copy of the latest nightly build at orphis recently that works with PSP2. |
|||
10-24-2016, 07:26 AM
(This post was last modified: 10-24-2016 08:32 AM by AdamN.)
Post: #14
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
Okay, i managed to fix the issue with PSP2 when PortOffset is non-zero (and probably other games with similar issue), and yes it was because of Port 0 was offseted in PtpOpen function
Here is the windows build (based on my old adhocstuff refork, since i need to be able to run multiple instance in a single PC for testing) Win32 build: https://www.dropbox.com/s/iowb4kr00nzbs7...s.zip?dl=0 Win64 build: https://www.dropbox.com/s/dujdrcnec3nryr...4.zip?dl=0 Here is the fix (i forgot how to use github, silly me ) You'll need to add that line 1647 in screenshot Code: if (sport == 0) sport = -(int)portOffset; //making sure sport is 0 when shifted (10-22-2016 08:32 AM)Wishdream Wrote:no intention to obscufate the MAC address, i'm just being lazy, that's all it's not even a real MAC address (generated randomly)(10-20-2016 12:20 PM)AdamN Wrote: It's not replacing it entirely, binded/listened ports is being shifted by 3000 correctly, while sockets who connection gets established to binded port will get a random port which is normal for client socket. Anyway it should be replaced with an easy-to-see MAC address just like shown by AdhocServer My Modified PPSSPP : ============== Win32&64: https://www.dropbox.com/s/2t3mtdhb0f045cn/PPSSPP_1.11-testbuild_Win32x64.zip?dl=0 Android(ARMv7): https://www.dropbox.com/s/b41bm43mtn1gpnn/PPSSPP_1.11-testbuild_ARMv7.apk?dl=0 |
|||
10-24-2016, 11:36 AM
(This post was last modified: 10-24-2016 11:37 AM by Wishdream.)
Post: #15
|
|||
|
|||
RE: [Bug(?)] Phantasy Star Portable 2 and the Port Offset Conundrum
(10-24-2016 07:26 AM)AdamN Wrote: You'll need to add that line 1647 in screenshot Oh pffft okay then XD Should I commit this to your fork or just create a new fork entirely and just work some of the fixes from there? Or you're just saying it so we can build along with the fix and compile? |
|||
« Next Oldest | Next Newest »
|