Hello, I will edit the SAMP Server Version.
My Code:
Problem: Server still stopped.
My Code:
Код:
char* serverName = "rofler";
char queryBufferSend[50000];
int queryLen = 0;
int sockfd, n;
int serverNameLen = (int)strlen(serverName); *(int *)&queryBufferSend[16] = serverNameLen; queryLen += 4;
strncpy(&queryBufferSend[20], serverName, serverNameLen); queryLen += serverNameLen;
struct sockaddr_in servaddr, cliaddr;
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons(SAMPServer::GetListeningPort() + 1);
bind(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr));
sendto(sockfd, queryBufferSend, queryLen, 0, (struct sockaddr *)&cliaddr, sizeof(cliaddr));
Problem: Server still stopped.