]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/aClient.cpp
updated the Change log w/ new additions
[irc/gameservirc.git] / gameserv / aClient.cpp
index de5459547ec9a01f1260f9462156eb3b86b93a41..8de6b3567170b0c262d149a3f562b91e4f7c938e 100644 (file)
@@ -52,7 +52,7 @@ aClient::~aClient()
     if (stats)
     {
        #ifdef DEBUGMODE
-           log("aClient deleted: %s %s %s", nick, stats->name.c_str(), stats->password.c_str()); 
+           log("aClient deleted: %s %s %s", nick, stats->getName().c_str(), stats->getPassword().c_str()); 
        #endif
 
        delete stats;
@@ -67,6 +67,23 @@ aClient::~aClient()
     flags = 0;
 }
 
+bool aClient::operator!=(const aClient &right)
+{
+  return !(*this == right);
+}
+
+bool aClient::operator==(const aClient &right)
+{
+  if (strcmp(nick, right.nick) == 0 && stats == right.stats)
+       {
+         return true;
+       }
+  else
+       {
+         return false;
+       }
+}
+
 ostream &operator<<( ostream &out, const aClient &c )
 {
     out << (c.nick[0] == '\0' ? "NULL" : c.nick);
@@ -75,22 +92,22 @@ ostream &operator<<( ostream &out, const aClient &c )
 
 void aClient::setData(const aClient *right)
 {
-    if (right != this)
+  if (right != this)
     {
-       strcpy(nick, right->nick);
-       #ifdef P10
-           strcpy(realnick, right->realnick);
-       #endif
-       if (right->stats)
-       {
-           if (!stats)
-               stats = new Player;
-           #ifdef DEBUGMODE
-               log("Should be setting data for %s", right->stats->name.c_str());
-           #endif
-
-           stats->setData(right->stats);
-       }
+         strcpy(nick, right->nick);
+#ifdef P10
+         strcpy(realnick, right->realnick);
+#endif
+         if (right->stats)
+               {
+                 if (!stats)
+                       stats = new Player;
+#ifdef DEBUGMODE
+                 log("Should be setting data for %s", right->stats->getName().c_str());
+#endif
+                 
+                 stats->setData(right->stats);
+               }
     }
 }