summaryrefslogtreecommitdiff
path: root/src/client/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Client.cpp')
-rw-r--r--src/client/Client.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp
index 238c216..b35c292 100644
--- a/src/client/Client.cpp
+++ b/src/client/Client.cpp
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <deque>
#include <fstream>
+#include <dirent.h>
#ifdef MACOSX
#include <mach-o/dyld.h>
@@ -849,6 +850,8 @@ void Client::DeleteStamp(std::string stampID)
return;
}
}
+
+ updateStamps();
}
std::string Client::AddStamp(GameSave * saveData)
@@ -910,6 +913,28 @@ void Client::updateStamps()
return;
}
+void Client::RescanStamps()
+{
+ DIR * directory;
+ struct dirent * entry;
+ directory = opendir("stamps");
+ if (directory != NULL)
+ {
+ stampIDs.clear();
+ while (entry = readdir(directory))
+ {
+ if(strncmp(entry->d_name, "..", 3) && strncmp(entry->d_name, ".", 2) && strstr(entry->d_name, ".stm") && strlen(entry->d_name) == 14)
+ {
+ char stampname[11];
+ strncpy(stampname, entry->d_name, 10);
+ stampIDs.push_front(stampname);
+ }
+ }
+ closedir(directory);
+ updateStamps();
+ }
+}
+
int Client::GetStampsCount()
{
return stampIDs.size();