SmartFox UDP problem

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

unforg1v3n
Posts: 2
Joined: 30 Aug 2021, 06:01
Contact:

SmartFox UDP problem

Postby unforg1v3n » 30 Aug 2021, 06:08

Hi,

I have a problem, i'm trying to run my game on VPS and i have an issue.
I setup my smartfox server like docs said, everything worked perfectly until ...
I decided to send my players positions and rotations with UDP protocol. The packet is being sent suyccessfully (as my trace says), but the client that should receive it , doesn't. I made a lot of Debug.Log (clientside , yes im using unity) and traces (serverside) and it appears that the problem lays somewhere between.
Everything works perfect if i change the protocol to TCP, positions and rotations are sync correctly, but i wanted to use udp instead. Here is my code.

Code: Select all

int userId = obj.getInt("id");
         User user = UserHelper.getUserById(actualroom, userId);
         
         //if the user leaves the room we dont send transform anymore
         if(user==null)return;
         //sending the position with UDP protocol
         send("transform",obj, UserHelper.getRecipientsList(actualroom),true);


Of course the client has InitUDP with correct parameters setup correctly, i mean right after the successful login. Also made a debug to make sure its initialized and available and console returns values of true.
So i dont really understand why my client does not receive any information (onextensionresponse) where it should.

I will say another weird things -> when i join with more clients (like 2,3 or more) everything works again, the first clients (like 1-2) dont get any informations, the extensionresponse does not see anything but next ones see everything. Please help.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SmartFox UDP problem

Postby Lapo » 30 Aug 2021, 08:29

Hi,
we have already replied to your email, so let's keep the conversation in one place.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 63 guests