Socket problem (Help if u pro ;)) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Socket problem (Help if u pro ;)) (
/showthread.php?tid=612351)
Socket problem (Help if u pro ;)) -
MafiaOink - 17.07.2016
Hi guys, I'm having problem in some socket string thing, Whenever the client sends a data to the server, The string end is making a new line even in console and if I print it back it is like this:
Test_Jack
failed to log in bla bla, and in the file one it is like this:
(File: Test_Jack
.dudb.sav) WHILE it shouldnt be a new line cuz the old one had too much space left before a new line and even if I remove strins, It creates new line, its a problem with the "data" variable or there is a solution or my client is broken? I am usng Socket Test cause I have not made my application yet!
HELP ME Please!
Code down below!
I am using strdel to remove this {gc_name} and it works fine but its not causing it isnt it
Код:
strdel(data, 0, 9);
new filefile[128];
format(filefile, 64, "%s", data);
new datalen = strlen(data);
strins(filefile, ".dudb.sav", datalen);
if (dini_Exists(filefile))
{
format(ClientInfo[remote_clientid][Name], 25, "%s", data);
socket_sendto_remote_client(GlobalChatServer, remote_clientid, "Welcome to Global Chat, Insert your account password to continue!");
ClientInfo[remote_clientid][LoggedIn] = false;
printf("[Global Chat] Client %d setted its name to %s!", remote_clientid, data);
}
else
{
new xes[128];
format(xes, 128, "%s account is not found! You should join with your IG name (FileDebug: %s)!", data, filefile);
socket_sendto_remote_client(GlobalChatServer, remote_clientid, xes);
printf("[Global Chat] Client %d failed to set its name to %s (File: %s)!", remote_clientid, data, filefile);
}