Socket problem (Help if u pro ;))
#1

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);
			}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)