<?php ?>
<?php --------> Send to sa-mp server data <------- retrieve from server results Just in one php file instantly send,get results ?>
$.post("http://i call to my website php file", {name: name}, function( data ) { } );
Recompiled the plugin on Debian 8 x86-64 with the newest libssl package: socket.so
|
To eliminate human error, what is the contents of your plugins/ folder and what is the contents of your server.cfg?
|
plugins crashdetect sscanf streamer mysql pawncmd socket
public onSocketRemoteConnect(Socket:id, remote_client[], remote_clientid) { printf("Dolazeca konekcija sa [%d:%s]", remote_clientid, remote_client); // [id:ip] if(is_socket_valid(id)) socket_send(id, "Welcome :)", strlen("Welcome :)")); return 1; }
// .PWN script
gSocket = socket_create(TCP);
if(is_socket_valid(gSocket)) {
socket_set_max_connections(gSocket, MAX_PLAYERS);
socket_bind(gSocket, "SERVERIP");
socket_listen(gSocket, 7778);
}
// PHP Script
set_time_limit(0);
ob_implicit_flush();
$address = 'SERVERIP';
$port = 7778;
socket_connect($socket, $address, $port);
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, ©2005-2015 SA-MP Team [18:55:11] [18:55:11] Server Plugins [18:55:11] -------------- [18:55:11] Loading plugin: crashdetect [18:55:11] CrashDetect v4.18.1 is OK. [18:55:11] Loaded. [18:55:11] Loading plugin: socket02b [18:55:11] Failed. [18:55:11] Loaded 1 plugins. [18:55:11] [18:55:11] Filterscripts [18:55:11] --------------- [18:55:11] Loaded 0 filterscripts. [18:55:11] [debug] Run time error 19: "File or function is not found" [18:55:11] [debug] socket_create [18:55:11] [debug] is_socket_valid [18:55:11] [debug] socket_connect [18:55:11] [debug] socket_set_max_connections [18:55:11] [debug] socket_listen [18:55:11] [debug] socket_destroy [18:55:11] [debug] socket_send [18:55:11] [debug] Run time error 19: "File or function is not found" [18:55:11] [debug] socket_create [18:55:11] [debug] is_socket_valid [18:55:11] [debug] socket_connect [18:55:11] [debug] socket_set_max_connections [18:55:11] [debug] socket_listen [18:55:11] [debug] socket_destroy [18:55:11] [debug] socket_send [18:55:11] Script[gamemodes/socket.amx]: Run time error 19: "File or function is not found" [18:55:11] Number of vehicle models: 0 ---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, ©2005-2015 SA-MP Team [18:55:19] [18:55:19] Server Plugins [18:55:19] -------------- [18:55:19] Loading plugin: crashdetect [18:55:19] CrashDetect v4.18.1 is OK. [18:55:19] Loaded. [18:55:19] Loading plugin: socket01b [18:55:19] Socket plugin v0.1b loaded. [18:55:19] Loaded. [18:55:19] Loaded 2 plugins. [18:55:19] [18:55:19] Filterscripts [18:55:19] --------------- [18:55:19] Loaded 0 filterscripts. [18:55:20] socket_connect(): Socket ID 0 has failed to connect. [18:55:20] socket_listen(): Socket has failed to bind on port 7776. [18:55:20] Socket Test Gamemode main [18:55:20] Number of vehicle models: 0
Encountered the same issue on a clean setup, wondered why 0.2b ain't loading, even tho I had it in my dir/
Код:
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, ©2005-2015 SA-MP Team [18:55:11] [18:55:11] Server Plugins [18:55:11] -------------- [18:55:11] Loading plugin: crashdetect [18:55:11] CrashDetect v4.18.1 is OK. [18:55:11] Loaded. [18:55:11] Loading plugin: socket02b [18:55:11] Failed. [18:55:11] Loaded 1 plugins. [18:55:11] [18:55:11] Filterscripts [18:55:11] --------------- [18:55:11] Loaded 0 filterscripts. [18:55:11] [debug] Run time error 19: "File or function is not found" [18:55:11] [debug] socket_create [18:55:11] [debug] is_socket_valid [18:55:11] [debug] socket_connect [18:55:11] [debug] socket_set_max_connections [18:55:11] [debug] socket_listen [18:55:11] [debug] socket_destroy [18:55:11] [debug] socket_send [18:55:11] [debug] Run time error 19: "File or function is not found" [18:55:11] [debug] socket_create [18:55:11] [debug] is_socket_valid [18:55:11] [debug] socket_connect [18:55:11] [debug] socket_set_max_connections [18:55:11] [debug] socket_listen [18:55:11] [debug] socket_destroy [18:55:11] [debug] socket_send [18:55:11] Script[gamemodes/socket.amx]: Run time error 19: "File or function is not found" [18:55:11] Number of vehicle models: 0 ---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, ©2005-2015 SA-MP Team [18:55:19] [18:55:19] Server Plugins [18:55:19] -------------- [18:55:19] Loading plugin: crashdetect [18:55:19] CrashDetect v4.18.1 is OK. [18:55:19] Loaded. [18:55:19] Loading plugin: socket01b [18:55:19] Socket plugin v0.1b loaded. [18:55:19] Loaded. [18:55:19] Loaded 2 plugins. [18:55:19] [18:55:19] Filterscripts [18:55:19] --------------- [18:55:19] Loaded 0 filterscripts. [18:55:20] socket_connect(): Socket ID 0 has failed to connect. [18:55:20] socket_listen(): Socket has failed to bind on port 7776. [18:55:20] Socket Test Gamemode main [18:55:20] Number of vehicle models: 0 |
Socket plugin v0.2b loaded. Loaded. [Socket]: Connection listening on IP: 127.0.0.1 | port 7780.
public onSocketRemoteDisconnect(Socket:id, remote_clientid)
#include <a_samp>
#include <socket>
new Socket:CLIENT_SOCKET;
#define SOCKET_PORT 7785
#define SOCKET_MAX_CONNECTION 25
new connected_remote_clients;
public OnGameModeInit()
{
new ip[16];
GetServerVarAsString("bind", ip, sizeof (ip));
connected_remote_clients=0;
CLIENT_SOCKET = socket_create(TCP);
if(is_socket_valid(CLIENT_SOCKET))
{
socket_set_max_connections(CLIENT_SOCKET, SOCKET_MAX_CONNECTION);
socket_bind(CLIENT_SOCKET, ip);
socket_listen(CLIENT_SOCKET, SOCKET_PORT);
}
return 1;
}
public OnGameModeExit()
{
if(is_socket_valid(CLIENT_SOCKET))socket_destroy(CLIENT_SOCKET);
return 1;
}
public onSocketRemoteConnect(Socket:id, remote_client[], remote_clientid)
{
connected_remote_clients++;
return 1;
}
public onSocketReceiveData(Socket:id, remote_clientid, data[], data_len)
{
print(data);
SendSocketMessageToAllClients(data);
return 1;
}
public OnPlayerText(playerid, text[])
{
SendSocketMessageToAllClients(text);
return 1;
}
forward SendSocketMessageToAllClients(socket_message[]);
public SendSocketMessageToAllClients(socket_message[])
{
for(new client_i=0; client_i<connected_remote_clients; client_i++)
{
if(is_socket_valid(CLIENT_SOCKET))socket_sendto_remote_client(CLIENT_SOCKET, client_i, socket_message);
}
return 1;
}
[Errno 10054] An existing connection was forcibly closed by the remote host.
Encountered the same issue on a clean setup, wondered why 0.2b ain't loading, even tho I had it in my dir/
Код:
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, ©2005-2015 SA-MP Team [18:55:11] [18:55:11] Server Plugins [18:55:11] -------------- [18:55:11] Loading plugin: crashdetect [18:55:11] CrashDetect v4.18.1 is OK. [18:55:11] Loaded. [18:55:11] Loading plugin: socket02b [18:55:11] Failed. [18:55:11] Loaded 1 plugins. [18:55:11] [18:55:11] Filterscripts [18:55:11] --------------- [18:55:11] Loaded 0 filterscripts. [18:55:11] [debug] Run time error 19: "File or function is not found" [18:55:11] [debug] socket_create [18:55:11] [debug] is_socket_valid [18:55:11] [debug] socket_connect [18:55:11] [debug] socket_set_max_connections [18:55:11] [debug] socket_listen [18:55:11] [debug] socket_destroy [18:55:11] [debug] socket_send [18:55:11] [debug] Run time error 19: "File or function is not found" [18:55:11] [debug] socket_create [18:55:11] [debug] is_socket_valid [18:55:11] [debug] socket_connect [18:55:11] [debug] socket_set_max_connections [18:55:11] [debug] socket_listen [18:55:11] [debug] socket_destroy [18:55:11] [debug] socket_send [18:55:11] Script[gamemodes/socket.amx]: Run time error 19: "File or function is not found" [18:55:11] Number of vehicle models: 0 ---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3.7-R2, ©2005-2015 SA-MP Team [18:55:19] [18:55:19] Server Plugins [18:55:19] -------------- [18:55:19] Loading plugin: crashdetect [18:55:19] CrashDetect v4.18.1 is OK. [18:55:19] Loaded. [18:55:19] Loading plugin: socket01b [18:55:19] Socket plugin v0.1b loaded. [18:55:19] Loaded. [18:55:19] Loaded 2 plugins. [18:55:19] [18:55:19] Filterscripts [18:55:19] --------------- [18:55:19] Loaded 0 filterscripts. [18:55:20] socket_connect(): Socket ID 0 has failed to connect. [18:55:20] socket_listen(): Socket has failed to bind on port 7776. [18:55:20] Socket Test Gamemode main [18:55:20] Number of vehicle models: 0 |
Another late response, is there any news on this project ? I've already got my user panel and server setuped using this and now i'm experiencing random crashes.
Thanks. |