1
0

Code Update

This commit is contained in:
daniel0916 2014-04-13 15:32:15 +02:00
parent b506a74076
commit 3733ee2c0e

View File

@ -26,7 +26,6 @@
#define DEFAULT_AUTH_SERVER "sessionserver.mojang.com" #define DEFAULT_AUTH_SERVER "sessionserver.mojang.com"
#define DEFAULT_AUTH_ADDRESS "/session/minecraft/hasJoined?username=%USERNAME%&serverId=%SERVERID%" #define DEFAULT_AUTH_ADDRESS "/session/minecraft/hasJoined?username=%USERNAME%&serverId=%SERVERID%"
#define MAX_REDIRECTS 10
@ -146,8 +145,9 @@ void cAuthenticator::Execute(void)
bool cAuthenticator::AuthWithYggdrasil(AString & a_UserName, const AString & a_ServerId, AString & a_UUID) bool cAuthenticator::AuthWithYggdrasil(AString & a_UserName, const AString & a_ServerId, AString & a_UUID)
{ {
AString REQUEST; AString REQUEST;
int ret, len, server_fd = -1; int ret, server_fd = -1;
unsigned char buf[1024]; size_t len = -1;
unsigned char * buf;
const char *pers = "cAuthenticator"; const char *pers = "cAuthenticator";
entropy_context entropy; entropy_context entropy;
@ -221,7 +221,8 @@ bool cAuthenticator::AuthWithYggdrasil(AString & a_UserName, const AString & a_S
REQUEST += "Connection: close\r\n"; REQUEST += "Connection: close\r\n";
REQUEST += "\r\n"; REQUEST += "\r\n";
len = sprintf_s((char *)buf, sizeof(buf), REQUEST.c_str()); len = REQUEST.size();
buf = (unsigned char *)REQUEST.c_str();
while ((ret = ssl_write(&ssl, buf, len)) <= 0) while ((ret = ssl_write(&ssl, buf, len)) <= 0)
{ {