How to Connect to SFS server on Jelastic?

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

Moderators: Lapo, Bax

User avatar
Zenith
Posts: 55
Joined: 09 Oct 2017, 09:57

How to Connect to SFS server on Jelastic?

Postby Zenith » 20 Nov 2017, 09:15

I have been creating a game and now it is working fine on localhost with SFS running on same machine.

Thereafter I got PAAS on a site and have deployed SFS on it.

I got these:
1. A domain to access my admin panel:
env-xxxxxxxxxx.xxxxx.paas.massivegrid.net

2. An Ip Address(host?) : 192:168.xx.xx
Image

3. I added a public port pointing to 9933 . The public port is : 11xxx.
Image


For logging into SFS Admin Panel I have used:
Host: env-xxxxxxxxxx.xxxxx.paas.massivegrid.net (as in point one)
Port: 11xxx (as in point two)
username: sfsadmin
password: sfsadmin
This worked . I was able to login.


4. Now inside of the sfs admin panel I changed this.
Earlier it was : 0.0.0.0 9933
I changed it to Ip Adress as in point number two and port being same.
Should I change the port also to public port in point three?
Should I have done this? Should I revert this altogether?
Image

5. Also as I needed this to work on websockets and webgl build I did this.
Should I change the HTTP Port here to public port? Or to something else?
Image

6. Now to connect to this I need to change in my Unity Build too right?
There I need to mention
Host:
TCP Port:
WS Port:

I want this to work on unity editor also and on webgl builds also . So what would be the corresponding values to be put here?
For Working in localhost these were: 127.0.0.1 ,9933,9933



I am very new to using SFS and Jelastic so very sorry if these questions are very Nooby! :(

Thanks for any help in advance. regards.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to Connect to SFS server on Jelastic?

Postby Lapo » 20 Nov 2017, 10:53

Zenith wrote:4. Now inside of the sfs admin panel I changed this.
Earlier it was : 0.0.0.0 9933
I changed it to Ip Adress as in point number two and port being same.

No this is incorrect. You should leave 0.0.0.0 which automatically binds the network, regardless of the local private IP address.

Should I change the port also to public port in point three?

The port should not be changed.

5. Also as I needed this to work on websockets and webgl build I did this.
Should I change the HTTP Port here to public port? Or to something else?
Image

Yes, this is correct.

6. Now to connect to this I need to change in my Unity Build too right?
There I need to mention
Host:
TCP Port:
WS Port:

From the webgl client you will use the same domain name for the host and the port will be 8080 instead od 9933.

I want this to work on unity editor also and on webgl builds also . So what would be the corresponding values to be put here?
For Working in localhost these were: 127.0.0.1 ,9933,9933

You will have to define a variable in your code for the port value that will change value based on the type of build you're using. This requires conditional compilation.

You can find out more details on how this is done by checking any of our examples, such as the Connector.
They are found here:
http://smartfoxserver.com/download/sfs2x#p=examples

Tutorials here:
http://docs2x.smartfoxserver.com/Exampl ... /connector
(here you can see how the conditional compilation is done)

hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Zenith
Posts: 55
Joined: 09 Oct 2017, 09:57

Re: How to Connect to SFS server on Jelastic?

Postby Zenith » 20 Nov 2017, 16:15

Thanks a lot .
I tried and have got it to work.

I had to switch on a public IP and then it started working. It could not connect to the main domain which I used to login to admin panel.

Maybe that was obvious and I did not know. :)
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to Connect to SFS server on Jelastic?

Postby Lapo » 20 Nov 2017, 17:55

Great :)
Lapo

--

gotoAndPlay()

...addicted to flash games
Hereafter
Posts: 1
Joined: 20 Jun 2020, 17:31

Re: How to Connect to SFS server on Jelastic?

Postby Hereafter » 20 Jun 2020, 17:39

Hello there,

I am opening an old thread because I have problems making Jelastic work too.
SmartFoxServer2X has been setup succesfully on Jelastic. (Imported the environment from GitHub)
Now I want to test connection or the MMORoomDemo to see if I got things alright.
As seen on the example on the website I need to copy the file MMORoomDemoExtension.jar to
/opt/shared/smartfox/2X/SmartFoxServer_2X/SFS2X/extensions/MMORoomDemo

But as mentioned on in the example:
if SmartFoxServer and Unity are not running on the same machine,
change the IP address of the server in the inspector of the UI game object in the Connection scene;

Where can I change this?

Also, I only imported the SFS2X environment from GitHub, do I need to install/upload patches and API's too if I am using Unity projects?
Like SFS2X_API_CSharp_v1.7.13.zip?

I am looking forward to your reply!

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 56 guests