summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorBryan Hoyle <starfoxprime@gmail.com>2012-06-22 16:00:17 (GMT)
committer Bryan Hoyle <starfoxprime@gmail.com>2012-06-22 16:00:17 (GMT)
commit6fa05d1930964d0a09093c627b30241d73c69dda (patch)
treeb2d9856f5f0c26529de8eff8fc8b8f39cb234b64 /src/client
parent58f3494f6fce58729e6e3fe91e1234a9bd636d55 (diff)
parent55d90a44a8425f70b08d864570e255f4bad8ba4c (diff)
downloadpowder-6fa05d1930964d0a09093c627b30241d73c69dda.zip
powder-6fa05d1930964d0a09093c627b30241d73c69dda.tar.gz
Merge branch 'master' of github.com:FacialTurd/PowderToypp
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Client.cpp4
-rw-r--r--src/client/SaveInfo.cpp6
-rw-r--r--src/client/SaveInfo.h1
3 files changed, 7 insertions, 4 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp
index 71bbfc4..ec88927 100644
--- a/src/client/Client.cpp
+++ b/src/client/Client.cpp
@@ -851,6 +851,7 @@ SaveInfo * Client::GetSave(int saveID, int saveDate)
json::Number tempDate = objDocument["Date"];
json::Boolean tempPublished = objDocument["Published"];
json::Boolean tempFavourite = objDocument["Favourite"];
+ json::Number tempComments = objDocument["Comments"];
json::Array tagsArray = objDocument["Tags"];
vector<string> tempTags;
@@ -873,6 +874,7 @@ SaveInfo * Client::GetSave(int saveID, int saveDate)
tempPublished.Value(),
tempTags
);
+ tempSave->Comments = tempComments.Value();
tempSave->Favourite = tempFavourite.Value();
return tempSave;
}
@@ -939,7 +941,7 @@ std::vector<SaveComment*> * Client::GetComments(int saveID, int start, int count
std::stringstream urlStream;
char * data;
int dataStatus, dataLength;
- urlStream << "http://" << SERVER << "/Browse/View.json?ID=" << saveID << "&Mode=Comments&Start=" << start << "&Count=" << count;
+ urlStream << "http://" << SERVER << "/Browse/Comments.json?ID=" << saveID << "&Start=" << start << "&Count=" << count;
data = http_simple_get((char *)urlStream.str().c_str(), &dataStatus, &dataLength);
if(dataStatus == 200 && data)
{
diff --git a/src/client/SaveInfo.cpp b/src/client/SaveInfo.cpp
index bfacd7d..da1033f 100644
--- a/src/client/SaveInfo.cpp
+++ b/src/client/SaveInfo.cpp
@@ -11,7 +11,7 @@
SaveInfo::SaveInfo(SaveInfo & save) :
userName(save.userName), name(save.name), Description(save.Description), date(
save.date), Published(save.Published), id(save.id), votesUp(
- save.votesUp), votesDown(save.votesDown), gameSave(NULL), vote(save.vote), tags(save.tags) {
+ save.votesUp), votesDown(save.votesDown), gameSave(NULL), vote(save.vote), tags(save.tags), Comments(save.Comments) {
if(save.gameSave)
gameSave = new GameSave(*save.gameSave);
}
@@ -20,14 +20,14 @@ SaveInfo::SaveInfo(int _id, int _date, int _votesUp, int _votesDown, string _use
string _name) :
id(_id), votesUp(_votesUp), votesDown(_votesDown), userName(_userName), name(
_name), Description("No description provided"), date(_date), Published(
- true), gameSave(NULL), vote(0), tags() {
+ true), gameSave(NULL), vote(0), tags(), Comments(0) {
}
SaveInfo::SaveInfo(int _id, int date_, int _votesUp, int _votesDown, int _vote, string _userName,
string _name, string description_, bool published_, vector<string> tags_) :
id(_id), votesUp(_votesUp), votesDown(_votesDown), userName(_userName), name(
_name), Description(description_), date(date_), Published(
- published_), gameSave(NULL), vote(_vote), tags(tags_) {
+ published_), gameSave(NULL), vote(_vote), tags(tags_), Comments(0) {
}
SaveInfo::~SaveInfo()
diff --git a/src/client/SaveInfo.h b/src/client/SaveInfo.h
index 5360f90..e1b013e 100644
--- a/src/client/SaveInfo.h
+++ b/src/client/SaveInfo.h
@@ -18,6 +18,7 @@ public:
int date;
int votesUp, votesDown;
bool Favourite;
+ int Comments;
GameSave * gameSave;