Post: how do i setup sprx key system
10-17-2015, 06:32 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); so far i have this

You must login or register to view this content.

and need help setting up auth server to make it paid menu
(adsbygoogle = window.adsbygoogle || []).push({});
10-17-2015, 07:23 AM #2
Hash847
Purple God
Originally posted by AlienflowDev View Post
so far i have this

You must login or register to view this content.

and need help setting up auth server to make it paid menu


I can't really help you here. I don't do websites / servers. If you send a pm to You must login or register to view this content. he might be able to help you.. I think he knows how to do it
10-17-2015, 07:24 AM #3
Originally posted by Winter View Post
I can't really help you here. I don't do websites / servers. If you send a pm to You must login or register to view this content. he might be able to help you.. I think he knows how to do it


will do thanks Happy
10-17-2015, 10:59 AM #4
Well for one, your defined SERVER identifier shouldn't be ASCII. You're never even storing the IP Address into the structure before calling connect.

    
#define MAX_CON_ATTEMPT 25 // can change to whatever you want
SOCKET s;
bool bConnected = false; // var to be used for example, in the connection call
unsigned char SERVER_IP[4] = { 00, 00, 00, 00 };
sockaddr server_info;
int dwConCount = 0;

bool connect_tcp(unsigned char abIP[4], short shPort, bool*pbEsta, sockaddr*sOut) {
s = socket(2, 1, 0);
sockaddr server;
server.sa_family = 2;
*(short*)&server.sa_data[0] = shPort;
*(int*)&server.sa_data[2] = *(int*)&abIP;
*sOut = server;
return (*pbEsta = !connect(s, &server, sizeof(server)));
}

int sendData(char*dataBuf, int len){
main:
if(!isConnected){
if(dwConCount >= MAX_CON_ATTEMPT) {
printf("ERROR! Exceeded max amount of attempted connections.\n");
closesocket(s);
return -1;
}
connect_tcp(SERVER_IP, 3550, &isConnected, &server_info);
dwConCount++;
goto main;
}
else{
return send(s, dataBuf, len, 0);
}
}

int recvData(char*dataBuf, int len){
main:
if(!isConnected){
if(dwConCount >= MAX_CON_ATTEMPT) {
printf("ERROR! Exceeded max amount of attempted connections.\n");
closesocket(s);
return -1;
}
connect_tcp(SERVER_IP, 3550, &isConnected, &server_info);
dwConCount++;
goto main;
}
else{
return recv(s, dataBuf, len, 0);
}
}


This code is better, plus you can detect if the connection succeeded or not. As for the send/recv functions, you wouldn't always want to send 0x64 bytes of data to the server, so if I was you I'd return the call (the size of bytes sent (so you know it was successful)) and parse the size via a function parameter.

EDIT:

As for authentication, asking for help on this subject isn't a very good idea. You want your auth to be unique, if it is already known to people without any security, it's going to be cracked. Look into managing data server sided, and also into You must login or register to view this content., as for security, hashing is your best bet.

The following user thanked Bitwise for this useful post:

BaSs_HaXoR
10-23-2015, 03:57 AM #5
Useful information but OP is a bundle of sticks that got perma banned.
Closing but not trashing this so some people can learn at least.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo