From 67f53660db85c2f325472701517e04c446ec8ed4 Mon Sep 17 00:00:00 2001 From: Tametomo Date: Tue, 5 May 2009 07:11:44 -0600 Subject: Moved two files which held net data into the net folder. Considering their function, this is a much better place to put them. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tametomo Signed-off-by: Bjørn Lindeijer --- src/CMakeLists.txt | 4 +- src/Makefile.am | 4 +- src/gui/changeemaildialog.cpp | 3 +- src/gui/changepassworddialog.cpp | 3 +- src/gui/charselectdialog.cpp | 2 +- src/gui/charselectdialog.h | 5 +-- src/gui/login.cpp | 3 +- src/gui/register.cpp | 3 +- src/gui/serverdialog.cpp | 3 +- src/gui/serverselectdialog.cpp | 5 ++- src/gui/unregisterdialog.cpp | 3 +- src/logindata.h | 74 ----------------------------------- src/main.cpp | 4 +- src/net/ea/charserverhandler.cpp | 2 +- src/net/ea/loginhandler.cpp | 4 +- src/net/ea/logouthandler.cpp | 4 +- src/net/logindata.h | 74 +++++++++++++++++++++++++++++++++++ src/net/serverinfo.h | 36 +++++++++++++++++ src/net/tmwserv/charserverhandler.cpp | 2 +- src/net/tmwserv/loginhandler.cpp | 2 +- src/serverinfo.h | 36 ----------------- 21 files changed, 140 insertions(+), 136 deletions(-) delete mode 100644 src/logindata.h create mode 100644 src/net/logindata.h create mode 100644 src/net/serverinfo.h delete mode 100644 src/serverinfo.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 87b300bb..861d9d18 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -234,6 +234,7 @@ SET(SRCS net/generalhandler.h net/guildhandler.h net/inventoryhandler.h + net/logindata.h net/loginhandler.h net/logouthandler.h net/maphandler.h @@ -248,6 +249,7 @@ SET(SRCS net/net.h net/partyhandler.h net/playerhandler.h + net/serverinfo.h net/skillhandler.h net/tradehandler.h resources/action.cpp @@ -357,7 +359,6 @@ SET(SRCS lockedarray.h log.cpp log.h - logindata.h main.cpp main.h map.cpp @@ -384,7 +385,6 @@ SET(SRCS properties.h rotationalparticle.cpp rotationalparticle.h - serverinfo.h shopitem.cpp shopitem.h simpleanimation.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 761599d1..47d27ede 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -187,6 +187,7 @@ tmw_SOURCES = gui/widgets/avatar.cpp \ net/generalhandler.h \ net/guildhandler.h \ net/inventoryhandler.h \ + net/logindata.h \ net/loginhandler.h \ net/logouthandler.h \ net/maphandler.h \ @@ -201,6 +202,7 @@ tmw_SOURCES = gui/widgets/avatar.cpp \ net/net.h \ net/partyhandler.h \ net/playerhandler.h \ + net/serverinfo.h \ net/skillhandler.h \ net/tradehandler.h \ resources/action.cpp \ @@ -310,7 +312,6 @@ tmw_SOURCES = gui/widgets/avatar.cpp \ lockedarray.h \ log.cpp \ log.h \ - logindata.h \ main.cpp \ main.h \ map.cpp\ @@ -337,7 +338,6 @@ tmw_SOURCES = gui/widgets/avatar.cpp \ properties.h \ rotationalparticle.cpp \ rotationalparticle.h \ - serverinfo.h \ shopitem.cpp \ shopitem.h \ simpleanimation.cpp \ diff --git a/src/gui/changeemaildialog.cpp b/src/gui/changeemaildialog.cpp index b6473612..d36ab487 100644 --- a/src/gui/changeemaildialog.cpp +++ b/src/gui/changeemaildialog.cpp @@ -23,7 +23,6 @@ #include "main.h" #include "log.h" -#include "logindata.h" #include "gui/register.h" #include "gui/okdialog.h" @@ -32,6 +31,8 @@ #include "gui/widgets/label.h" #include "gui/widgets/textfield.h" +#include "net/logindata.h" + #include "utils/gettext.h" #include "utils/stringutils.h" diff --git a/src/gui/changepassworddialog.cpp b/src/gui/changepassworddialog.cpp index 39d992b2..35f57ef4 100644 --- a/src/gui/changepassworddialog.cpp +++ b/src/gui/changepassworddialog.cpp @@ -23,7 +23,6 @@ #include "main.h" #include "log.h" -#include "logindata.h" #include "gui/register.h" #include "gui/okdialog.h" @@ -33,6 +32,8 @@ #include "gui/widgets/textfield.h" #include "gui/widgets/label.h" +#include "net/logindata.h" + #include "utils/gettext.h" #include "utils/stringutils.h" diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index ba69a9b3..f88fa733 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -34,7 +34,7 @@ #include "gui/changepassworddialog.h" #include "gui/changeemaildialog.h" -#include "logindata.h" +#include "net/logindata.h" #include "net/tmwserv/accountserver/account.h" #endif diff --git a/src/gui/charselectdialog.h b/src/gui/charselectdialog.h index 75a98465..adbf3de1 100644 --- a/src/gui/charselectdialog.h +++ b/src/gui/charselectdialog.h @@ -30,11 +30,8 @@ #include -#ifdef TMWSERV_SUPPORT -#include "../logindata.h" -#endif - class LocalPlayer; +class LoginData; class Player; class PlayerBox; diff --git a/src/gui/login.cpp b/src/gui/login.cpp index 8391a5c4..77f2e137 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -31,8 +31,9 @@ #include "gui/widgets/passwordfield.h" #include "gui/widgets/textfield.h" +#include "net/logindata.h" + #include "main.h" -#include "logindata.h" #include "configuration.h" #include "utils/gettext.h" diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 6dfc761d..2b897641 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -23,7 +23,6 @@ #include "configuration.h" #include "log.h" -#include "logindata.h" #include "main.h" #include "gui/login.h" @@ -37,6 +36,8 @@ #include "gui/widgets/radiobutton.h" #include "gui/widgets/textfield.h" +#include "net/logindata.h" + #include "utils/gettext.h" #include "utils/stringutils.h" diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index f3b0739a..a3dfdeae 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -29,9 +29,10 @@ #include "gui/widgets/layout.h" #include "gui/widgets/textfield.h" +#include "net/logindata.h" + #include "configuration.h" #include "log.h" -#include "logindata.h" #include "main.h" #include "utils/gettext.h" diff --git a/src/gui/serverselectdialog.cpp b/src/gui/serverselectdialog.cpp index be4baead..ccdf2bb6 100644 --- a/src/gui/serverselectdialog.cpp +++ b/src/gui/serverselectdialog.cpp @@ -25,9 +25,10 @@ #include "gui/widgets/listbox.h" #include "gui/widgets/scrollarea.h" -#include "logindata.h" +#include "net/logindata.h" +#include "net/serverinfo.h" + #include "main.h" -#include "serverinfo.h" #include "utils/gettext.h" #include "utils/stringutils.h" diff --git a/src/gui/unregisterdialog.cpp b/src/gui/unregisterdialog.cpp index 6775051e..048239c5 100644 --- a/src/gui/unregisterdialog.cpp +++ b/src/gui/unregisterdialog.cpp @@ -23,7 +23,6 @@ #include "main.h" #include "log.h" -#include "logindata.h" #include "gui/okdialog.h" #include "gui/register.h" @@ -34,6 +33,8 @@ #include "gui/widgets/passwordfield.h" #include "gui/widgets/textfield.h" +#include "net/logindata.h" + #include "utils/gettext.h" #include "utils/stringutils.h" diff --git a/src/logindata.h b/src/logindata.h deleted file mode 100644 index 4cf989cb..00000000 --- a/src/logindata.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * The Mana World - * Copyright (C) 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef LOGINDATA_H -#define LOGINDATA_H - -#include - -#include "being.h" - -struct LoginData -{ - std::string username; - std::string password; - std::string newPassword; - std::string hostname; - std::string updateHost; -#ifdef TMWSERV_SUPPORT - std::string email; - std::string newEmail; -#endif - short port; - -#ifdef EATHENA_SUPPORT - int account_ID; - int session_ID1; - int session_ID2; - Gender sex; -#endif - - bool remember; /**< Whether to store the username and host. */ - bool registerLogin; /**< Whether an account is being registered. */ - - void clear() - { - username.clear(); - password.clear(); - newPassword.clear(); - hostname.clear(); - updateHost.clear(); -#ifdef TMWSERV_SUPPORT - email.clear(); - newEmail.clear(); -#endif - port = 0; - -#ifdef EATHENA_SUPPORT - account_ID = 0; - session_ID1 = 0; - session_ID2 = 0; - sex = GENDER_UNSPECIFIED; -#endif - } -}; - -#endif // LOGINDATA_H diff --git a/src/main.cpp b/src/main.cpp index 6d48bf8e..0fa4044a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,12 +30,10 @@ #include "localplayer.h" #include "lockedarray.h" #include "log.h" -#include "logindata.h" #ifdef USE_OPENGL #include "openglgraphics.h" #endif #include "playerrelations.h" -#include "serverinfo.h" #include "sound.h" #include "statuseffect.h" #include "units.h" @@ -63,9 +61,11 @@ #include "net/charhandler.h" #include "net/generalhandler.h" +#include "net/logindata.h" #include "net/loginhandler.h" #include "net/maphandler.h" #include "net/net.h" +#include "net/serverinfo.h" #ifdef TMWSERV_SUPPORT #include "net/tmwserv/charserverhandler.h" #include "net/tmwserv/connection.h" diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index c1d84265..b28961b6 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -24,12 +24,12 @@ #include "net/ea/network.h" #include "net/ea/protocol.h" +#include "net/logindata.h" #include "net/messagein.h" #include "net/messageout.h" #include "game.h" #include "log.h" -#include "logindata.h" #include "main.h" #include "gui/charcreatedialog.h" diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index b657bb1c..44eabe46 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -23,13 +23,13 @@ #include "net/ea/protocol.h" +#include "net/logindata.h" #include "net/messagein.h" #include "net/messageout.h" +#include "net/serverinfo.h" #include "log.h" -#include "logindata.h" #include "main.h" -#include "serverinfo.h" #include "utils/gettext.h" #include "utils/stringutils.h" diff --git a/src/net/ea/logouthandler.cpp b/src/net/ea/logouthandler.cpp index 4986fd4a..7de87c6a 100644 --- a/src/net/ea/logouthandler.cpp +++ b/src/net/ea/logouthandler.cpp @@ -23,13 +23,13 @@ #include "net/ea/protocol.h" +#include "net/logindata.h" #include "net/messagein.h" #include "net/messageout.h" +#include "net/serverinfo.h" #include "log.h" -#include "logindata.h" #include "main.h" -#include "serverinfo.h" #include "utils/gettext.h" #include "utils/stringutils.h" diff --git a/src/net/logindata.h b/src/net/logindata.h new file mode 100644 index 00000000..4cf989cb --- /dev/null +++ b/src/net/logindata.h @@ -0,0 +1,74 @@ +/* + * The Mana World + * Copyright (C) 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef LOGINDATA_H +#define LOGINDATA_H + +#include + +#include "being.h" + +struct LoginData +{ + std::string username; + std::string password; + std::string newPassword; + std::string hostname; + std::string updateHost; +#ifdef TMWSERV_SUPPORT + std::string email; + std::string newEmail; +#endif + short port; + +#ifdef EATHENA_SUPPORT + int account_ID; + int session_ID1; + int session_ID2; + Gender sex; +#endif + + bool remember; /**< Whether to store the username and host. */ + bool registerLogin; /**< Whether an account is being registered. */ + + void clear() + { + username.clear(); + password.clear(); + newPassword.clear(); + hostname.clear(); + updateHost.clear(); +#ifdef TMWSERV_SUPPORT + email.clear(); + newEmail.clear(); +#endif + port = 0; + +#ifdef EATHENA_SUPPORT + account_ID = 0; + session_ID1 = 0; + session_ID2 = 0; + sex = GENDER_UNSPECIFIED; +#endif + } +}; + +#endif // LOGINDATA_H diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h new file mode 100644 index 00000000..c38d13c7 --- /dev/null +++ b/src/net/serverinfo.h @@ -0,0 +1,36 @@ +/* + * The Mana World + * Copyright (C) 2004 The Mana World Development Team + * + * This file is part of The Mana World. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef SERVERINFO_ +#define SERVERINFO_ + +#include + +struct SERVER_INFO +{ + int address; + short port; + std::string name; + short online_users; + std::string updateHost; +}; + +#endif diff --git a/src/net/tmwserv/charserverhandler.cpp b/src/net/tmwserv/charserverhandler.cpp index 273c2d8f..7b74904f 100644 --- a/src/net/tmwserv/charserverhandler.cpp +++ b/src/net/tmwserv/charserverhandler.cpp @@ -27,12 +27,12 @@ #include "net/tmwserv/accountserver/accountserver.h" #include "net/tmwserv/accountserver/account.h" +#include "net/logindata.h" #include "net/messagein.h" #include "game.h" #include "localplayer.h" #include "log.h" -#include "logindata.h" #include "main.h" #include "gui/charcreatedialog.h" diff --git a/src/net/tmwserv/loginhandler.cpp b/src/net/tmwserv/loginhandler.cpp index 40842658..35739669 100644 --- a/src/net/tmwserv/loginhandler.cpp +++ b/src/net/tmwserv/loginhandler.cpp @@ -27,9 +27,9 @@ #include "net/tmwserv/accountserver/account.h" #include "net/tmwserv/accountserver/accountserver.h" +#include "net/logindata.h" #include "net/messagein.h" -#include "logindata.h" #include "main.h" #include "utils/gettext.h" diff --git a/src/serverinfo.h b/src/serverinfo.h deleted file mode 100644 index c38d13c7..00000000 --- a/src/serverinfo.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The Mana World - * Copyright (C) 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef SERVERINFO_ -#define SERVERINFO_ - -#include - -struct SERVER_INFO -{ - int address; - short port; - std::string name; - short online_users; - std::string updateHost; -}; - -#endif -- cgit v1.2.3-70-g09d2