Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[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 [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.
[Image: W8HXyG8.png][Image: xVN4g2q.png]
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:
  • Port Offset is set > 1024, so we use port 5000 (For Port Offset to work, you'll have to restart your PPSSPP. Otherwise, you might be still using whatever port you have on Port Offset)
  • It all works good in the party formation lobby, we can see ourselves and able to form a full party.
  • The moment you start the game though, everyone else black screens.
  • The host is stuck on an endless walk cycle waiting.
  • After a few moments, all players disconnect and get sent back to the lobby or the Title Screen.

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
  • Fast Memory - OFF
  • Port Offset - 5000
  • Hamachi IP Connection
  • All 32-bit Versions
  • No Hacks
  • Alternative Speed = Unlimited
  • Tested on both using Wine and Native on Linux

Hosting Solo and Multi Party on Adhoc, Port Offset - No Port Offset
[Image: L2g5Tt7.png]
  • Windows - Lobby Only - Stuck walking on start - Works on Port 0
  • Linux (Debian & Arch) - Lobby Only - Stuck walking on start - Works on Port 0 via Sudo & Custom Build
  • Android - Lobby Only - Stuck walking on start - Not working at all
  • PSP - Port 0 Only, obviously works but will not work with Port Offset
Joining Multi Party on Adhoc, Port Offset - No Port Offset
[Image: 8CDn5yL.png]
  • Windows - Lobby Only - Blank screen on start - Works on Port 0
  • Linux (Debian & Arch) - Lobby Only - Blank screen on start - Works on Port 0 via Sudo & Custom Build
  • Android - Lobby Only - Blank screen on start - Not working at all
  • PSP - Port 0 Only, obviously works but will not work with 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
Visit this user's website Find all posts by this user
Quote this message in a reply
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.
Find all posts by this user
Quote this message in a reply
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 windows
For Phantasy Star Portable 2, Adhoc only working on windows.
what ever Port Offset is, it not working on non-windows.
Well, 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.
Visit this user's website Find all posts by this user
Quote this message in a reply
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
   
Find all posts by this user
Quote this message in a reply
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
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
   
Find all posts by this user
Quote this message in a reply
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
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.

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.

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
Find all posts by this user
Quote this message in a reply
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

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)

Phantasy Star Portable 2 need sudo AND Port Offset = 0 in order to work
Find all posts by this user
Quote this message in a reply
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:  
(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

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)

Phantasy Star Portable 2 need sudo AND Port Offset = 0 in order to work
Hmm.. there might be another network function i missed and being used by PSP2 that uses port but didn't shift the port number.

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 Big Grin 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
Find all posts by this user
Quote this message in a reply
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.

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 Big Grin a game where we rides a dragon (don't remember the title and i haven't tested it with port offset back then)

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
PPSSPPSDL  658        0   21u  IPv4 1565984      0t0  TCP 127.0.0.7:34803->127.0.0.1:27312 (ESTABLISHED)
PPSSPPSDL  658        0   22u  IPv4 1547680      0t0  TCP *:27312 (LISTEN)
PPSSPPSDL  658        0   23u  IPv4 1565325      0t0  TCP 127.0.0.1:27312->127.0.0.7:34803 (ESTABLISHED)
PPSSPPSDL  658        0   24u  IPv4 1566602      0t0  TCP 127.0.0.7:16001 (LISTEN)
PPSSPPSDL  658        0   25u  IPv4 1564563      0t0  TCP 127.0.0.7:3000->127.0.0.7:16009 (ESTABLISHED)
PPSSPPSDL  658        0   26u  IPv4 1566604      0t0  TCP 127.0.0.7:15000 (LISTEN)
PPSSPPSDL  658        0   27u  IPv4 1564558      0t0  TCP 127.0.0.7:16009 (LISTEN)
PPSSPPSDL  658        0   28u  IPv4 1564559      0t0  TCP 127.0.0.7:15039 (LISTEN)
PPSSPPSDL  658        0   29u  IPv4 1564560      0t0  TCP 127.0.0.7:16006 (LISTEN)
PPSSPPSDL  658        0   30u  IPv4 1564564      0t0  TCP 127.0.0.7:16009->127.0.0.7:3000 (ESTABLISHED)

On Port Offset 0
Code:
COMMAND    PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
PPSSPPSDL 6910        0   21u  IPv4 891627      0t0  TCP *:27312 (LISTEN)
PPSSPPSDL 6910        0   22u  IPv4 907154      0t0  TCP 127.0.0.6:42425->127.0.0.1:27312 (ESTABLISHED)
PPSSPPSDL 6910        0   23u  IPv4 908402      0t0  TCP 127.0.0.1:27312->127.0.0.6:42425 (ESTABLISHED)
PPSSPPSDL 6910        0   24u  IPv4 951272      0t0  TCP 127.0.0.6:13001 (LISTEN)
PPSSPPSDL 6910        0   25u  IPv4 952234      0t0  TCP 127.0.0.6:46103->127.0.0.6:13009 (ESTABLISHED)
PPSSPPSDL 6910        0   26u  IPv4 951274      0t0  TCP 127.0.0.6:12000 (LISTEN)
PPSSPPSDL 6910        0   27u  IPv4 952228      0t0  TCP 127.0.0.6:13009 (LISTEN)
PPSSPPSDL 6910        0   28u  IPv4 952229      0t0  TCP 127.0.0.6:12039 (LISTEN)
PPSSPPSDL 6910        0   29u  IPv4 952230      0t0  TCP 127.0.0.6:13006 (LISTEN)
PPSSPPSDL 6910        0   30u  IPv4 952238      0t0  TCP 127.0.0.6:44677->127.0.0.6:13009 (ESTABLISHED)
PPSSPPSDL 6910        0   31u  IPv4 952235      0t0  TCP 127.0.0.6:13009->127.0.0.6:46103 (ESTABLISHED)
PPSSPPSDL 6910        0   32u  IPv4 952250      0t0  TCP 127.0.0.6:13009->127.0.0.6:44677 (ESTABLISHED)
PPSSPPSDL 6910        0   33u  IPv4 955711      0t0  TCP 127.0.0.6:33831->127.0.0.6:12000 (ESTABLISHED)
PPSSPPSDL 6910        0   34u  IPv4 955725      0t0  TCP 127.0.0.6:12000->127.0.0.6:33831 (ESTABLISHED)

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)
38:54:818 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,13009,16448,200000,300,0)
38:54:818 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2102 sceNetAdhocPtpListen(2,12000,8224,200000,300,5,0)
38:54:853 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2102 sceNetAdhocPtpListen( ,13009,8224,200000,300,5,0)
38:54:853 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2102 sceNetAdhocPtpListen( ,12039,8224,200000,300,5,0)
38:54:853 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2102 sceNetAdhocPtpListen(  ,13006,8224,200000,300,5,0)
38:54:853 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,13009,16448,200000,300,0)
38:54:883 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2054 sceNetAdhocPtpClose(2,0) at 08cc5914
38:54:884 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,13009,16448,200000,300,0)
38:54:884 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1932 sceNetAdhocPtpConnect(2, 0, 00000001) at 08cc55c8
38:54:884 user_main    E[NET]: HLE/sceNetAdhoc.cpp:1973 sceNetAdhocPtpConnect[2]: Socket Error (115) to 127.0.0.12:16009
38:54:884 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1882 sceNetAdhocPtpAccept[4->7:13009]: Established (127.0.0.12:0)
38:54:886 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2279 sceNetAdhocPtpSend[7:13009]: Sent 40 bytes to 0C:0C:0C:0C:0C:0C:0
38:54:886 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2279 sceNetAdhocPtpSend[7:13009]: Sent 56 bytes to 0C:0C:0C:0C:0C:0C:0
38:54:931 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1932 sceNetAdhocPtpConnect(2, 0, 00000001) at 08cc5e58
38:54:931 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1987 sceNetAdhocPtpConnect[2:0]: Already Connected
38:54:931 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2367 sceNetAdhocPtpRecv[2:0]: Received 96 bytes from 0C:0C:0C:0C:0C:0C:13009
38:54:963 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2279 sceNetAdhocPtpSend[2:0]: Sent 40 bytes to 0C:0C:0C:0C:0C:0C:13009
38:54:963 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2279 sceNetAdhocPtpSend[2:0]: Sent 56 bytes to 0C:0C:0C:0C:0C:0C:13009
38:54:963 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2367 sceNetAdhocPtpRecv[7:13009]: Received 96 bytes from 0C:0C:0C:0C:0C:0C:0
38:55:963 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:00:066 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:04:170 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:08:272 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:12:376 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:16:479 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:20:582 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:24:685 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:28:788 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:32:891 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:36:995 user_main    I[NET]: HLE/sceNetAdhoc.cpp:1628 sceNetAdhocPtpOpen( ,0, ,12000,65664,200000,300,0)
39:41:099 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2054 sceNetAdhocPtpClose(3,0) at 08cc6a0c
39:41:099 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2054 sceNetAdhocPtpClose(1,0) at 08cc6a0c
39:41:100 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2054 sceNetAdhocPtpClose(2,0) at 08cc5914
39:41:100 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2054 sceNetAdhocPtpClose(5,0) at 08cc6a0c
39:41:100 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2054 sceNetAdhocPtpClose(4,0) at 08cc6a0c
39:41:100 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2054 sceNetAdhocPtpClose(7,0) at 08cc5914
39:41:101 user_main    I[NET]: HLE/sceNetAdhoc.cpp:2054 sceNetAdhocPtpClose(6,0) at 08cc6a0c
Visit this user's website Find all posts by this user
Quote this message in a reply
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 Big Grin

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 Big Grin

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
Find all posts by this user
Quote this message in a reply
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.
But i think i can see the issue, its the one with port 3000 i think, or may be not Big Grin

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 Big Grin

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.
Visit this user's website Find all posts by this user
Quote this message in a reply
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 Big Grin

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 Big Grin )
   
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:  
(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.
But i think i can see the issue, its the one with port 3000 i think, or may be not Big Grin

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 Big Grin

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.
no intention to obscufate the MAC address, i'm just being lazy, that's all Big Grin it's not even a real MAC address (generated randomly)
Anyway it should be replaced with an easy-to-see MAC address just like shown by AdhocServer Smile

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
Find all posts by this user
Quote this message in a reply
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
Code:
if (sport == 0) sport = -(int)portOffset; //making sure sport is 0 when shifted

no intention to obscufate the MAC address, i'm just being lazy, that's all Big Grin it's not even a real MAC address (generated randomly)
Anyway it should be replaced with an easy-to-see MAC address just like shown by AdhocServer Smile

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?
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: