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

Members online

No members online now.

Latest posts

Latest profile posts

caraMel wrote on lony's profile.
Thanks for the follow!!
CubeCraft really needs to do something with the left click CPS auto kick detection. I was watching my friend (who's on Android, controller PvP) fighting the last team normally and got hit with the anti cheat kick for a CPS related issue and the thing is, she was using a regular PS4 controller and was clicking normally in PvP, no high cps to my knowledge). Luckily I recorded my POV of it happening as a spectator
tacoman222xx wrote on YeoXuHang's profile.
Happy birthday Yeo! I don't know if 18 is as special of a number where you live as where I do, but it's still a really nice milestone!
ItzJuan wrote on lony's profile.
thank you for following!
MrSpacee wrote on EpicShotz1432's profile.
Happy birthday!
Top Bottom