MCPcopy Create free account
hub / github.com/cuberite/cuberite / ParseHandshake

Method ParseHandshake

src/Protocol/Protocol125.cpp:1358–1381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1356
1357
1358int cProtocol125::ParseHandshake(void)
1359{
1360 HANDLE_PACKET_READ(ReadBEUTF16String16, AString, Username);
1361
1362 AStringVector UserData = StringSplit(Username, ";"); // "FakeTruth;localhost:25565"
1363 if (UserData.empty())
1364 {
1365 m_Client->Kick("Did not receive username");
1366 return PARSE_OK;
1367 }
1368 m_Username = UserData[0];
1369
1370 LOGD("HANDSHAKE %s", Username.c_str());
1371
1372 if (!m_Client->HandleHandshake( m_Username ))
1373 {
1374 return PARSE_OK; // Player is not allowed into the server
1375 }
1376
1377 SendHandshake(cRoot::Get()->GetServer()->GetServerID());
1378 LOGD("User \"%s\" was sent a handshake response", m_Username.c_str());
1379
1380 return PARSE_OK;
1381}
1382
1383
1384

Callers

nothing calls this directly

Calls 6

StringSplitFunction · 0.85
emptyMethod · 0.80
KickMethod · 0.80
c_strMethod · 0.80
HandleHandshakeMethod · 0.80
GetServerMethod · 0.80

Tested by

no test coverage detected