summaryrefslogtreecommitdiff
path: root/src/net/manaserv/accountserver
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/manaserv/accountserver')
-rw-r--r--src/net/manaserv/accountserver/account.cpp27
-rw-r--r--src/net/manaserv/accountserver/account.h8
-rw-r--r--src/net/manaserv/accountserver/accountserver.cpp34
-rw-r--r--src/net/manaserv/accountserver/accountserver.h14
-rw-r--r--src/net/manaserv/accountserver/internal.cpp2
-rw-r--r--src/net/manaserv/accountserver/internal.h8
6 files changed, 48 insertions, 45 deletions
diff --git a/src/net/manaserv/accountserver/account.cpp b/src/net/manaserv/accountserver/account.cpp
index f34139da..e680d9d5 100644
--- a/src/net/manaserv/accountserver/account.cpp
+++ b/src/net/manaserv/accountserver/account.cpp
@@ -24,15 +24,14 @@
#include "internal.h"
#include "net/manaserv/connection.h"
+#include "net/manaserv/messageout.h"
#include "net/manaserv/protocol.h"
-#include "net/messageout.h"
-
#include "utils/sha256.h"
#include <string>
-void Net::AccountServer::Account::createCharacter(
+void ManaServ::AccountServer::Account::createCharacter(
const std::string &name, char hairStyle, char hairColor, char gender,
short strength, short agility, short vitality,
short intelligence, short dexterity, short willpower)
@@ -50,28 +49,28 @@ void Net::AccountServer::Account::createCharacter(
msg.writeInt16(dexterity);
msg.writeInt16(willpower);
- Net::AccountServer::connection->send(msg);
+ ManaServ::AccountServer::connection->send(msg);
}
-void Net::AccountServer::Account::deleteCharacter(char slot)
+void ManaServ::AccountServer::Account::deleteCharacter(char slot)
{
MessageOut msg(PAMSG_CHAR_DELETE);
msg.writeInt8(slot);
- Net::AccountServer::connection->send(msg);
+ ManaServ::AccountServer::connection->send(msg);
}
-void Net::AccountServer::Account::selectCharacter(char slot)
+void ManaServ::AccountServer::Account::selectCharacter(char slot)
{
MessageOut msg(PAMSG_CHAR_SELECT);
msg.writeInt8(slot);
- Net::AccountServer::connection->send(msg);
+ ManaServ::AccountServer::connection->send(msg);
}
-void Net::AccountServer::Account::unregister(const std::string &username,
+void ManaServ::AccountServer::Account::unregister(const std::string &username,
const std::string &password)
{
MessageOut msg(PAMSG_UNREGISTER);
@@ -79,10 +78,10 @@ void Net::AccountServer::Account::unregister(const std::string &username,
msg.writeString(username);
msg.writeString(sha256(username + password));
- Net::AccountServer::connection->send(msg);
+ ManaServ::AccountServer::connection->send(msg);
}
-void Net::AccountServer::Account::changeEmail(const std::string &email)
+void ManaServ::AccountServer::Account::changeEmail(const std::string &email)
{
MessageOut msg(PAMSG_EMAIL_CHANGE);
@@ -90,10 +89,10 @@ void Net::AccountServer::Account::changeEmail(const std::string &email)
// Encryption is assumed server-side.
msg.writeString(email);
- Net::AccountServer::connection->send(msg);
+ ManaServ::AccountServer::connection->send(msg);
}
-void Net::AccountServer::Account::changePassword(
+void ManaServ::AccountServer::Account::changePassword(
const std::string &username,
const std::string &oldPassword,
const std::string &newPassword)
@@ -104,5 +103,5 @@ void Net::AccountServer::Account::changePassword(
msg.writeString(sha256(username + oldPassword));
msg.writeString(sha256(username + newPassword));
- Net::AccountServer::connection->send(msg);
+ ManaServ::AccountServer::connection->send(msg);
}
diff --git a/src/net/manaserv/accountserver/account.h b/src/net/manaserv/accountserver/account.h
index 03e83881..03453655 100644
--- a/src/net/manaserv/accountserver/account.h
+++ b/src/net/manaserv/accountserver/account.h
@@ -19,12 +19,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef NET_ACCOUNTSERVER_CHARACTER_H
-#define NET_ACCOUNTSERVER_CHARACTER_H
+#ifndef NET_MANASERV_ACCOUNTSERVER_CHARACTER_H
+#define NET_MANASERV_ACCOUNTSERVER_CHARACTER_H
#include <iosfwd>
-namespace Net
+namespace ManaServ
{
namespace AccountServer
{
@@ -51,4 +51,4 @@ namespace Net
}
}
-#endif
+#endif // NET_MANASERV_ACCOUNTSERVER_CHARACTER_H
diff --git a/src/net/manaserv/accountserver/accountserver.cpp b/src/net/manaserv/accountserver/accountserver.cpp
index 72f05aeb..afbee4ab 100644
--- a/src/net/manaserv/accountserver/accountserver.cpp
+++ b/src/net/manaserv/accountserver/accountserver.cpp
@@ -24,18 +24,20 @@
#include "internal.h"
#include "net/manaserv/connection.h"
+#include "net/manaserv/messageout.h"
#include "net/manaserv/protocol.h"
-#include "net/messageout.h"
-
#include "utils/sha256.h"
#include <string>
-void Net::AccountServer::login(Net::Connection *connection, int version,
- const std::string &username, const std::string &password)
+namespace ManaServ
+{
+
+void AccountServer::login(Connection *connection,
+ int version, const std::string &username, const std::string &password)
{
- Net::AccountServer::connection = connection;
+ AccountServer::connection = connection;
MessageOut msg(PAMSG_LOGIN);
@@ -43,14 +45,14 @@ void Net::AccountServer::login(Net::Connection *connection, int version,
msg.writeString(username);
msg.writeString(sha256(username + password));
- Net::AccountServer::connection->send(msg);
+ AccountServer::connection->send(msg);
}
-void Net::AccountServer::registerAccount(Net::Connection *connection,
+void AccountServer::registerAccount(Connection *connection,
int version, const std::string &username, const std::string &password,
const std::string &email)
{
- Net::AccountServer::connection = connection;
+ AccountServer::connection = connection;
MessageOut msg(PAMSG_REGISTER);
@@ -62,21 +64,23 @@ void Net::AccountServer::registerAccount(Net::Connection *connection,
msg.writeString(password);
msg.writeString(email);
- Net::AccountServer::connection->send(msg);
+ AccountServer::connection->send(msg);
}
-void Net::AccountServer::logout()
+void AccountServer::logout()
{
MessageOut msg(PAMSG_LOGOUT);
- Net::AccountServer::connection->send(msg);
+ AccountServer::connection->send(msg);
}
-void Net::AccountServer::reconnectAccount(Net::Connection *connection,
- const std::string &passToken)
+void AccountServer::reconnectAccount(Connection *connection,
+ const std::string &passToken)
{
- Net::AccountServer::connection = connection;
+ AccountServer::connection = connection;
MessageOut msg(PAMSG_RECONNECT);
msg.writeString(passToken, 32);
- Net::AccountServer::connection->send(msg);
+ AccountServer::connection->send(msg);
+}
+
}
diff --git a/src/net/manaserv/accountserver/accountserver.h b/src/net/manaserv/accountserver/accountserver.h
index dd62fd25..a1bbb5f5 100644
--- a/src/net/manaserv/accountserver/accountserver.h
+++ b/src/net/manaserv/accountserver/accountserver.h
@@ -19,29 +19,29 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef NET_ACCOUNTSERVER_ACCOUNTSERVER_H
-#define NET_ACCOUNTSERVER_ACCOUNTSERVER_H
+#ifndef NET_MANASERV_ACCOUNTSERVER_ACCOUNTSERVER_H
+#define NET_MANASERV_ACCOUNTSERVER_ACCOUNTSERVER_H
#include <iosfwd>
-namespace Net
+namespace ManaServ
{
class Connection;
namespace AccountServer
{
- void login(Net::Connection *connection, int version,
+ void login(ManaServ::Connection *connection, int version,
const std::string &username, const std::string &password);
- void registerAccount(Net::Connection *connection, int version,
+ void registerAccount(ManaServ::Connection *connection, int version,
const std::string &username, const std::string &password,
const std::string &email);
void logout();
- void reconnectAccount(Net::Connection *connection,
+ void reconnectAccount(ManaServ::Connection *connection,
const std::string &passToken);
}
}
-#endif
+#endif // NET_MANASERV_ACCOUNTSERVER_ACCOUNTSERVER_H
diff --git a/src/net/manaserv/accountserver/internal.cpp b/src/net/manaserv/accountserver/internal.cpp
index de1d412c..e1d105b7 100644
--- a/src/net/manaserv/accountserver/internal.cpp
+++ b/src/net/manaserv/accountserver/internal.cpp
@@ -21,7 +21,7 @@
#include "internal.h"
-namespace Net
+namespace ManaServ
{
class Connection;
diff --git a/src/net/manaserv/accountserver/internal.h b/src/net/manaserv/accountserver/internal.h
index ff741872..af91f692 100644
--- a/src/net/manaserv/accountserver/internal.h
+++ b/src/net/manaserv/accountserver/internal.h
@@ -19,10 +19,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef NET_ACCOUNTSERVER_INTERNAL_H
-#define NET_ACCOUNTSERVER_INTERNAL_H
+#ifndef NET_MANASERV_ACCOUNTSERVER_INTERNAL_H
+#define NET_MANASERV_ACCOUNTSERVER_INTERNAL_H
-namespace Net
+namespace ManaServ
{
class Connection;
@@ -32,4 +32,4 @@ namespace Net
}
}
-#endif
+#endif // NET_MANASERV_ACCOUNTSERVER_INTERNAL_H