Re: [BETA] SA:MP Sockets Plugin -
Daniel June - 17.11.2010
Cool, Cool
Re: [BETA] SA:MP Sockets Plugin -
Alien193 - 23.11.2010
error in sockets.inc
forward OnSocketRec
eive(data[], address[], port);
in sample pwn
public OnSocketRec
ieve(data[], address[], port)
in this topic
Quote:
Originally Posted by StrickenKid
- forward OnSocketRecieve(data[], address[], port)
- This callback gets called when data has been received from the connected socket.
|
fixed please, boner "public function lacks forward declaration (symbol "OnSocketRecieve")"
Re: [BETA] SA:MP Sockets Plugin -
risen24 - 19.12.2010
This event doesn't work
Please, fix it
Re: [BETA] SA:MP Sockets Plugin -
ser11 - 21.01.2011
fix link not work
Re: [BETA] SA:MP Sockets Plugin -
Steven Paul - 21.01.2011
link is down
Re: [BETA] SA:MP Sockets Plugin -
ColderPL - 22.01.2011
Ohh noo!
Link is down!
Pls reupload
I need this
Re: [BETA] SA:MP Sockets Plugin -
legodude - 22.01.2011
reupload
Re: [BETA] SA:MP Sockets Plugin -
Blacklite - 23.01.2011
Link will be up within the next hour (DNS change)
Re: [BETA] SA:MP Sockets Plugin -
ser11 - 23.01.2011
where working links?
what autor waiting for?
Re: [BETA] SA:MP Sockets Plugin -
ColderPL - 23.01.2011
Still not working. ;[
Re: [BETA] SA:MP Sockets Plugin -
StrickenKid - 23.01.2011
The server is back up.
Re: [BETA] SA:MP Sockets Plugin -
MasterKy - 23.01.2011
Hey! Linux version failed to run, see it:
Failed (plugins/sockets.so: undefined symbol: sock)
I put this correctly in the server.cfg:
plugins sockets.so
Re: [BETA] SA:MP Sockets Plugin -
Vince - 23.01.2011
This is gonna be very useful.
[Socket] Successfully connected to: mail.venturas-cnr.com:25.
Re: [BETA] SA:MP Sockets Plugin -
MasterKy - 23.01.2011
How to use this function
, someone example or tutorial plz??
socket_send
Re: [BETA] SA:MP Sockets Plugin -
Vince - 24.01.2011
And I'm kinda stuck already. My problem is that OnSocketReceive isn't being called (or I'm doing something wrong).
When connecting to my mail server, there should be some data sent back, but there's none.
pawn Код:
main()
{
socket_connect("mail.venturas-cnr.com", 25);
// prints: [20:13:03] [Socket] Successfully connected to: mail.venturas-cnr.com:25.
}
public OnSocketReceive(data[], address[], port)
{
printf("OnSocketReceive Called!");
// Prints: Nothing
printf(data);
// Prints: Nothing
// Should print: 220 nl.webserver.serverffs.com ESMTP Exim 4.69 Mon, 24 Jan 2011 20:06:01 +0100
new
responsecode,
message[256];
sscanf(data, "ds[256]", responsecode, message);
return 1;
}
Mailserver, username, password, etc is fine. I tested with Putty.
Re: [BETA] SA:MP Sockets Plugin -
ser11 - 26.01.2011
plugins/sockets.so: undefined symbol: sock
Re: [BETA] SA:MP Sockets Plugin -
ColderPL - 26.01.2011
Hello my friends!
I have a terrible problem!
When I send to the client:
Код:
public OnSocketConnect(address[], port)
{
socket_send("Sing Alleluja!");
socket_close();
return 1;
}
Receives:
Sing Alleluja!╠╠╠╠╠╠╠╠╠╠X←
╠╠╠╠╠╠╠╠╠╠X←
:O WTF?!
You know what is the cause?
Please help
Re: [BETA] SA:MP Sockets Plugin -
ricardo178 - 26.01.2011
Nice
Re: [BETA] SA:MP Sockets Plugin -
luckieluuk - 28.01.2011
When I connect 2 servers, nothing happends, first it closed the connection again because the server i connected to was thinking the incoming connection was 127.0.0.1 (localhost)
So i removed that part of the code, but now still nothing happends.
I got the codes and belonging logs down here:
Log from my laptop:
Код:
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3c, ©2005-2010 SA-MP Team
Server Plugins
--------------
Loading plugin: sockets
SA:MP Sockets Plugin BETA R2 Loaded.
Loaded.
Loaded 1 plugins.
Started server on port: 7777, with maxplayers: 12 lanmode is ON.
Filter Scripts
---------------
Loaded 0 filter scripts.
----------------------------------
TruckersLife v.1.5a
----------------------------------
Number of vehicle models: 75
loadfs SocketClient
[Socket] Successfully connected to: 192.168.1.100:7788.
Connected to Server
Filterscript 'SocketClient.amx' loaded.
Incoming connection: 127.0.0.1:56580
[join] Chicken has joined the server (0:127.0.0.1)
[user] Account file loaded for Chicken(0)
[chat] [Chicken]: hi
[Socket] Debug: Function socket_send sent "Chicken says:hi".
[user] Account file saved for Chicken(0)
[part] Chicken has left the server (0:1)
Incoming connection: 127.0.0.1:63333
[join] Chicken has joined the server (0:127.0.0.1)
[user] Account file loaded for Chicken(0)
[chat] [Chicken]: test
[Socket] Debug: Function socket_send sent "Chicken says:test".
[chat] [Chicken]: test
[Socket] Debug: Function socket_send sent "Chicken says:test".
[user] Account file saved for Chicken(0)
[part] Chicken has left the server (0:1)
Code from my laptop
pawn Код:
#include <a_samp>
#include <sockets>
#define PORT 7788
#define COLOR_LINK 0xFFFAFAAA
forward OnSocketRecieve(data[], address[]);
public OnSocketConnect(address[])
{
if ( strcmp(address, "127.0.0.1") != 0 ) // not a local connection!
{
socket_close();
print("[socket] Client tried to connect to itself! Connection rejected!");
}
return 1;
}
public OnSocketRecieve(data[], address[])
{
new string[160];
format(string, sizeof(string), "[%s] %s", address, data);
print(string);
SendClientMessageToAll(COLOR_LINK, string);
return 1;
}
public OnFilterScriptInit()
{
socket_connect("192.168.1.100", PORT);
print("Connected to Server");
return 1;
}
public OnPlayerText(playerid, text[])
{
new string[160];
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), "%s says:%s", Name, text);
socket_send(string);
return 1;
}
Log from my server:
Код:
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3c, ©2005-2010 SA-MP Team
Server Plugins
--------------
Loading plugin: sockets
SA:MP Sockets Plugin BETA R2 Loaded.
Loaded.
Loaded 1 plugins.
Started server on port: 7777, with maxplayers: 12 lanmode is ON.
Filter Scripts
---------------
Loading filter script 'SocketServer.amx'...
Loaded 1 filter scripts.
----------------------------------
TruckersLife v.1.5a
----------------------------------
Number of vehicle models: 75
[Socket] Started listening on port 7788.
[Socket] Incomming connection from: 192.168.1.144:60613.
Incoming connection: 192.168.1.144:63334
[join] Chicken has joined the server (0:192.168.1.144)
[user] Account file loaded for Chicken(0)
[chat] [Chicken]: test
[Socket] Debug: Function socket_send sent "Chicken says:test".
[user] Account file saved for Chicken(0)
[part] Chicken has left the server (0:1)
Code from my server:
pawn Код:
#include <a_samp>
#include <sockets>
#define PORT 7788
#define COLOR_LINK 0xFFFAFAAA
forward OnSocketRecieve(data[], address[]);
main()
{
print("\n----------------------------------");
print(" Wormhole test loaded [SERVER]\n");
print("----------------------------------\n");
}
public OnSocketConnect(address[])
{
if ( strcmp(address, "127.0.0.1") != 0 ) // not a local connection!
{
socket_close();
print("[socket] Server tried to connect to itself! Connection rejected!");
}
return 1;
}
public OnSocketRecieve(data[], address[])
{
new string[160];
format(string, sizeof(string), "[%s] %s", address, data);
print(string);
SendClientMessageToAll(COLOR_LINK, string);
return 1;
}
public OnFilterScriptInit()
{
socket_startlistening(PORT);
return 1;
}
public OnPlayerText(playerid, text[])
{
new string[160];
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), "%s says:%s", Name, text);
socket_send(string);
return 1;
}
As you can see I tested it in both ways, from my PC to my server and back, but nothing happends
It indeed looks like the OnSocketRecieve function doesnt gets called
Re: [BETA] SA:MP Sockets Plugin -
Pghpunkid - 10.02.2011
Plugin wont load on my Windows 0.3c Server (Windows XP Professional). I made sure i had the .NET Framework (4.0, 3.5, 2.0, 1.0) and it still isnt working. Any insight?
EDIT: Ignore. It would help if i added it to the server.cfg with the correct name huh?