Solved Use the socket of MundoSk

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Spartan9802

Member
Jan 26, 2017
158
8
18
26
Good evening,
I do not understand how sockets works, I would like to use them for a system of voting of a page php to my server, is it possible? Is there an event to indicate when an information is sent / received ?
Thank you !
 
Good evening,
I do not understand how sockets works, I would like to use them for a system of voting of a page php to my server, is it possible? Is there an event to indicate when an information is sent / received ?
Thank you !
As far as I know, MundoSK only listens for sockets sent from servers.
If anyone has more knowledge on this subject, please correct me if I am wrong.

The last thing I made with MundoSK sockets was inter-server chat communication, which only sent and received information via two servers and nothing else.

Looking at this syntax, it seems you have to open sockets through functions:
code_language.skript:
open function socket at port %port% with password "%password%" through function "%function%"

Server 1
code_language.skript:
function gChat(t: strings, info: objects):
  loop all players:
    if {gchat::%uuid of loop-player%} is set:
      send "%{_t::1}%" to loop-player
  send "%{_t::1}%" to console

on chat:
    cancel the event
    set {_msg} to "A %player% > %message%"
    replace all "<none>" in {_msg} with "Console"
    loop all players:
        if {gchat::%uuid of loop-player%} is set:
            send "%{_msg}%" to loop-player
    write "password" and {_msg} to socket with host "localhost" port 25567

on script load:
  open function socket at port 25566 with password "wwaters11" through function "gChat"

Server 2
code_language.skript:
function gChat(t: strings, info: objects):
  loop all players:
    if {gchat::%uuid of loop-player%} is set:
      send "%{_t::1}%" to loop-player
  send "%{_t::1}%" to console

on chat:
    cancel the event
    set {_msg} to "A %player% > %message%"
    replace all "<none>" in {_msg} with "Console"
    loop all players:
        if {gchat::%uuid of loop-player%} is set:
            send "%{_msg}%" to loop-player
    write "password" and {_msg} to socket with host "localhost" port 25566

on script load:
  open function socket at port 25567 with password "wwaters11" through function "gChat"
 
Thanks !
I understand better this is what I understood by looking at the documentation ...
It is therefore not possible to execute a command from a php request?
 
  • Like
Reactions: Spartan9802
Status
Not open for further replies.