mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
this throws a RAV but why
This commit is contained in:
parent
93c259181c
commit
63e4ddb62c
|
|
@ -735,7 +735,7 @@ void CPlatformNetworkManagerStub::SearchForGames()
|
|||
}
|
||||
|
||||
#ifdef _WINDOWS64 //Should we have this windows64 only? idk i havent tested so...
|
||||
ifstream ServersTxt("servers.txt");
|
||||
std::FILE* file = std::fopen("servers.txt", "r");
|
||||
|
||||
//Memory leak prevention
|
||||
if (allocatedServers != NULL) {
|
||||
|
|
@ -744,9 +744,9 @@ void CPlatformNetworkManagerStub::SearchForGames()
|
|||
}
|
||||
delete(allocatedServers);
|
||||
}
|
||||
allocatedServers = new vector<FriendSessionInfo*>;
|
||||
|
||||
if (ServersTxt) {
|
||||
if (file) {
|
||||
allocatedServers = new vector<FriendSessionInfo*>;
|
||||
|
||||
string line;
|
||||
wstring wline;
|
||||
|
|
@ -756,8 +756,9 @@ void CPlatformNetworkManagerStub::SearchForGames()
|
|||
wstring port;
|
||||
wstring name;
|
||||
|
||||
while (getline(ServersTxt, line)) {
|
||||
wline = convStringToWstring(line);
|
||||
char buffer[512];
|
||||
while (std::fgets(buffer, sizeof(buffer), file)) {
|
||||
wline = convStringToWstring(buffer);
|
||||
if (phase == 0) {
|
||||
ip = line;
|
||||
phase = 1;
|
||||
|
|
@ -790,7 +791,8 @@ void CPlatformNetworkManagerStub::SearchForGames()
|
|||
allocatedServers->push_back(info);
|
||||
}
|
||||
}
|
||||
ServersTxt.close();
|
||||
|
||||
delete(file);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue