Minecraft PC IP: play.cubecraft.net

_Oplex_

Dedicated Member
May 5, 2016
694
1,059
198
Under Your Bed (O.o)
So lets say i have 2 people. And they both go on the same page. All they see is a empty textArea. If person1 would edit the text i want to also change the text on person2 screen. First i want to try simple ajax, but that is just not a good solution.
Now im thinking about a server side event. Would that work? I googled about it and it looks good to me. But are there any other things i can try?
It can be simple or complex.
 

DrHam

Forum Veteran
Sep 15, 2015
3,615
4,166
518
Kepler-452b
Like a chat?
Ajax is a nice, simple solution iirc

How would you implement a server side solution for “live changes” without refreshing?

Don’t take my advice as something 101% correct
 

_Oplex_

Dedicated Member
May 5, 2016
694
1,059
198
Under Your Bed (O.o)

Max ♠

Forum Expert
Feb 20, 2016
1,420
2,940
344
25
North pole
Now im thinking about a server side event. Would that work? I googled about it and it looks good to me. But are there any other things i can try?
It can be simple or complex.
SSE seems to be the best option, wouldnt recommend PHP for this however, Node seems like a much better fit

Something janky with ajax could also work, although like you said, not the best option.

There's also a library for SSE in PHP, don't know how well it works, https://github.com/licson0729/libSSE-php
 
  • Like
Reactions: _Oplex_ and DrHam

_Oplex_

Dedicated Member
May 5, 2016
694
1,059
198
Under Your Bed (O.o)
Node seems like a much better fit
Yep, that would be great. but the server i want to host this on has also a mail client on it. I am not that experienced with setting up such thing with ports etc. I am now using socket.io and that is actually what i want. It works fast and easy.

im just making it. and the server would be a problem on a later stage. thx @A Christmas Hangar and @zivdnaL
 
  • Like
Reactions: Max ♠

LazosPlaying

Well-Known Member
Sep 13, 2016
9
9
78
24
Slovenija
aljaxus.eu
Yeah you should use sockets for that. xhr requests are totally not the answer for "live editing" because they open a new connection every time they fire while with sockets you basically have one unclosed connection. Keep us updated on how things go ^-^
 
Members Online

Latest profile posts

Things I noticed after BedWars released:
- Solo maps are the same as duos maps (without the new duos maps, idk why)
- BedWars logo in the lobby reacts to the player, it turns towards the direction you're facing and animates itself disappearing when you go far from it
- Bed skins are affected by team color (good job CubeCraft!)
aronthesheep wrote on Thjis's profile.
This man is so cool fr
JAV4N wrote on Tateerq's profile.
yo
Livvv wrote on slrmohamed's profile.
Thanks for the follow! ^-^
Top Bottom