Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Maximiliano on Feb 20, 2020, 11:34 PM

Title: About NewSocket
Post by: Maximiliano on Feb 20, 2020, 11:34 PM
Hello, good morning, I have a question :'v. Could someone explain to me how the NewSocket works, and if an example is possible (that is not related to the IRC).

Is it possible to use NewSocket to use an Web API ? Example: https://api.chucknorris.io/jokes/random .
If is possible, can i use it many times? Or will cause lag?

Excuse my ignorance about it and my bad english XD.

Thanks in advance.
Title: Re: About NewSocket
Post by: DizzasTeR on Feb 21, 2020, 07:34 AM
Sockets can be used for other stuff than just IRC yes, but you need to basically understand how they work and what to do with the requests and responses, although I never tried it.
Title: Re: About NewSocket
Post by: Luckshya on Feb 21, 2020, 07:56 AM
I have used sockets for HTTP requests but I had to create sockets everytime to send a request. So I created that simple plugin for that.

Maybe try this: https://forum.vc-mp.org/?topic=7522.0

And you can use JSON parser to parse the json string to squirrel data using some available parser like https://github.com/electricimp/JSONParser
Title: Re: About NewSocket
Post by: Maximiliano on Feb 21, 2020, 04:46 PM
Quote from: Doom_Kill3R on Feb 21, 2020, 07:34 AMSockets can be used for other stuff than just IRC yes, but you need to basically understand how they work and what to do with the requests and responses, although I never tried it.
Thank you very much for explaining and commenting.

Quote from: Luckshya on Feb 21, 2020, 07:56 AMI have used sockets for HTTP requests but I had to create sockets everytime to send a request. So I created that simple plugin for that.

Maybe try this: https://forum.vc-mp.org/?topic=7522.0

And you can use JSON parser to parse the json string to squirrel data using some available parser like https://github.com/electricimp/JSONParser
I will use your module :D Thank you very much