Jump to content
×
×
  • Create New...
  • 0

Login MaxLength Username


Lorthir

Question

2 answers to this question

Recommended Posts

  • 0

length.h

 

	LOGIN_MAX_LEN			= 30,

pachet.h

typedef struct command_login3
{
	BYTE	header;
	char	login[LOGIN_MAX_LEN + 1];
	char	passwd[PASSWD_MAX_LEN + 1];
	DWORD	adwClientKey[4];
} TPacketCGLogin3;

input_login.cpp

void CInputLogin::Login(LPDESC d, const char * data)
{
	TPacketCGLogin * pinfo = (TPacketCGLogin *) data;

	char login[LOGIN_MAX_LEN + 1];
	trim_and_lower(pinfo->login, login, sizeof(login));

input_auth.cpp

	char login[LOGIN_MAX_LEN + 1];
	trim_and_lower(pinfo->login, login, sizeof(login));
	char szLogin[LOGIN_MAX_LEN * 2 + 1];
	DBManager::instance().EscapeString(szLogin, sizeof(szLogin), login, strlen(login));
	char returnID[LOGIN_MAX_LEN + 1] = {0};
	strncpy(tempInfo2.login, returnID, LOGIN_MAX_LEN);

input.cpp

					std::string msg = stBuf.substr(3, LOGIN_MAX_LEN);

input_teen.cpp

db.h

	char        szLogin[LOGIN_MAX_LEN+1];

 

 

Client: Source

 

packet.h

 

	ID_MAX_NUM = 30,
typedef struct command_login3
{
    BYTE	header;
    char	name[ID_MAX_NUM + 1];
    char	pwd[PASS_MAX_NUM + 1];
    DWORD	adwClientKey[4];
} TPacketCGLogin3;

AccountConnector.cpp

			strncpy(LoginPacket.name, m_strID.c_str(), ID_MAX_NUM);
			strncpy(LoginPacket.pwd, m_strPassword.c_str(), PASS_MAX_NUM);
			LoginPacket.name[ID_MAX_NUM] = '\0';
			LoginPacket.pwd[PASS_MAX_NUM] = '\0';

And navicat design table account :D

Loginwindow.py

"name" : "ID_EditLine",

"input_limit" : 16,

Change how you want :)

 

Accept special characters in your password and login id :

http://i.imgur.com/RCjYbF8.png

 

Edited by VegaS
  • Love 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.