![]() |
#271 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Jul 2010
Location: Belgrade, Serbia
Posts: 876
Reputation: 47
|
![]()
there is bug with socket_remote_client_connected, fix is really easy.
File CSocket.cpp on line 286 condition should be reversed Code:
if(m_pSocketInfo[socketid].ssl) { if(recv(m_pSocketInfo[socketid].connected_clients[remote_clientid], tempbuf, sizeof(tempbuf), NULL) != 0) return 1; } Code:
if(false == m_pSocketInfo[socketid].ssl) { if(recv(m_pSocketInfo[socketid].connected_clients[remote_clientid], tempbuf, sizeof(tempbuf), NULL) != 0) return 1; } |
![]() |
![]() |
![]() |
#272 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Feb 2016
Posts: 1,018
Reputation: 155
|
![]()
Hey,
I have been recently trying to send/receive from the server to my PHP file through this plugin, It's going pretty well but I'm just facing one issue with receiving the data from the server, It just keeps on crashing the website or sending errors, I'm running a 3 seconds timer to update the chat, Here is my codes anyway: In the PHP file: PHP Code:
PHP Code:
|
![]() |
![]() |
![]() |
#273 |
Little Clucker
![]() Join Date: Aug 2012
Posts: 21
Reputation: 1
|
![]()
The plugin wont load i dont know why..
"failed to load socket.dll" |
![]() |
![]() |
![]() |
#274 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Oct 2008
Location: The Netherlands
Posts: 845
Reputation: 71
|
![]() |
![]() |
![]() |
![]() |
#275 |
Banned
![]() Join Date: Jun 2016
Posts: 726
Reputation: 8
|
![]()
How to send from website, to sa-mp server only?
|
![]() |
![]() |
![]() |
#276 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Dec 2009
Location: England, Leicestershire
Posts: 492
Reputation: 70
|
![]()
I'm guessing your using PHP, right? If so then you need to read up on PHP about sending data via sockets. You will need to setup your server to accept a socket connection from your website, and then via PHP send the raw data to the samp server.
A useful tip would to use JSON or serialization to pass large amounts of data to the server, but if your only sending a small amount, you might be okay. Make sure you secure your connection if possible, make sure only your webserver ip address is the one connecting, and that if you can use SSL to secure your traffic, there is a free way to do this using Let Encrypt ( ****** Search ), yet can be difficult to setup in some cases. Sources Official PHP Sockets Page PHP Sockets Tutorial |
![]() |
![]() |
![]() |
#277 | |
Gangsta
![]() ![]() ![]() ![]() Join Date: Dec 2009
Location: England, Leicestershire
Posts: 492
Reputation: 70
|
![]() Quote:
Though there is a way to make PHP run infinitely it is not a suggested route to take, and will lead to such issues as what you currently have. PHP ends its process right after the code has been ran, meaning that though you have that code waiting to receive the data, it will not run it since the process is not running to execute it. This is why I suggested to run something like node.js since the application is designed to run constantly, and not end after the code has been ran. If you are in fact running PHP in a while loop to keep it alive, and your still not getting data, it maybe that your loops is causing the issue, with reading data from the socket and instead your data is being dropped. It would be helpful if you could explain your setup, to further help us to finding a solution. |
|
![]() |
![]() |
![]() |
#278 |
Huge Clucker
![]() ![]() ![]() Join Date: Mar 2011
Posts: 368
Reputation: 35
|
![]()
can someone help me?
i made visual studio application that connects to server via socket and send integer to server but i cant recieve it in script how to read that data? i connected to server via socket on both sides but dont know what to use of those natives in script and where |
![]() |
![]() |
![]() |
#279 |
Little Clucker
![]() Join Date: Aug 2011
Location: Russia
Posts: 28
Reputation: 0
|
![]()
Who has problems on the Windows system? unpack in folder game server.
https://yadi.sk/d/sp0vposL3Gk7FR folder server.rar |
![]() |
![]() |
![]() |
#280 | |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Oct 2009
Posts: 2,146
Reputation: 157
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Socket Plugin] Retrieving input stream | iRage | Scripting Help | 0 | 08/01/2014 09:11 AM |
Question about socket plugin | Kirollos | Scripting Help | 6 | 13/07/2012 08:33 PM |