Hazelcast in smartfox

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

Moderators: Lapo, Bax

adifong
Posts: 20
Joined: 10 Aug 2016, 06:50

Hazelcast in smartfox

Postby adifong » 06 May 2019, 10:25

Hi,

right now i try to use hazelcast in my smartfox server, and i already read the white paper hazelcast integration..
after i follow all the code in the white paper, my code is not working in tris game and still stuck for a while.
is it possible that i get the full code for tris game with the hazelcast function.

thank you
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Hazelcast in smartfox

Postby Lapo » 06 May 2019, 14:27

Hi,
I don't think we've ever prepared a downloadable version of the code in the white-paper.
In any case what is exactly the problem you're seeing maybe we can help.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
adifong
Posts: 20
Joined: 10 Aug 2016, 06:50

Re: Hazelcast in smartfox

Postby adifong » 08 May 2019, 04:31

Hi lapo,

i have something to confirm..
1. (server side) hazelcast become a member of instance, and smartfox become a client of instance?
- so there will be 2 running apps hazelcast member and 2 smartfox server client?
2. (client side) send/get request from hazelcast not to smartfox?

thanks for reply..
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Hazelcast in smartfox

Postby Lapo » 09 May 2019, 15:57

Sorry for the delay
adifong wrote:1. (server side) hazelcast become a member of instance, and smartfox become a client of instance?

It depends in Hazelcast every node that joins the cluster can be a server or a client (in respect to the cluster).
Clients can only read data from the grid memory, but not change it, if I remember correctly. However in the examples we provide we never use the Hazelcast client.

2. (client side) send/get request from hazelcast not to smartfox?

I don't understand the question, sorry. Maybe can you rephrase it?
Hazelcast is only a server side component that helps maintaining a shared state across all servers in the cluster. It can be thought of an in-memory database that uses plain Java objects.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
Akshat
Posts: 6
Joined: 17 Jul 2020, 09:22

Re: Hazelcast in smartfox

Postby Akshat » 11 Aug 2020, 11:40

Hi Team ,

I have integrated Hazelcast with Smartfox server and able to connect other sfs members and share data . Now I am stuck at one point . My class objects contains Room instances also . How do I serialize it ?

I tried sending it as a string by using room.toString() , but then how do i convert it back to Room instance format ?

Please Help

Thanks
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Hazelcast in smartfox

Postby Lapo » 11 Aug 2020, 13:22

Hi,
the Room object is too complex and cannot be serialized.
What you could do, is serialize the object partially by extracting the properties that you want to transmit and only send those to the other side.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 94 guests