summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-04-08 07:06:50 -0600
committerJared Adams <jaxad0127@gmail.com>2009-04-08 07:06:50 -0600
commitf2a0fe945ac44814b271bf3fb6e9df1464d6ccc5 (patch)
tree8e0214c70393d7f74150494f5a2f30520950bc4e
parent89f59c09fec10ff163f410960f77a9391f9e1e61 (diff)
downloadMana-f2a0fe945ac44814b271bf3fb6e9df1464d6ccc5.tar.gz
Mana-f2a0fe945ac44814b271bf3fb6e9df1464d6ccc5.tar.bz2
Mana-f2a0fe945ac44814b271bf3fb6e9df1464d6ccc5.tar.xz
Mana-f2a0fe945ac44814b271bf3fb6e9df1464d6ccc5.zip
Make some more file build for both servers
Also some cleanup in main.cpp
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/Makefile.am8
-rw-r--r--src/gui/serverselectdialog.cpp (renamed from src/gui/char_server.cpp)4
-rw-r--r--src/gui/serverselectdialog.h (renamed from src/gui/char_server.h)0
-rw-r--r--src/main.cpp48
-rw-r--r--src/main.h3
-rw-r--r--tmw.cbp25
7 files changed, 27 insertions, 69 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 89c70081..2409bc1c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -114,8 +114,6 @@ SET(SRCS
gui/buy.h
gui/buysell.cpp
gui/buysell.h
- gui/char_select.cpp
- gui/char_select.h
gui/charcreatedialog.cpp
gui/charcreatedialog.h
gui/chat.cpp
@@ -163,6 +161,8 @@ SET(SRCS
gui/npcintegerdialog.h
gui/npclistdialog.cpp
gui/npclistdialog.h
+ gui/npcpostdialog.cpp
+ gui/npcpostdialog.h
gui/npcstringdialog.cpp
gui/npcstringdialog.h
gui/npc_text.cpp
@@ -185,6 +185,8 @@ SET(SRCS
gui/sdlinput.h
gui/sell.cpp
gui/sell.h
+ gui/serverselectdialog.cpp
+ gui/serverselectdialog.h
gui/setup.cpp
gui/setup.h
gui/setup_audio.cpp
@@ -471,8 +473,6 @@ SET(SRCS_TMW
gui/guildwindow.h
gui/magic.cpp
gui/magic.h
- gui/npcpostdialog.cpp
- gui/npcpostdialog.h
gui/quitdialog.cpp
gui/quitdialog.h
gui/serverdialog.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index b8ce31a6..b19c065f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -118,6 +118,8 @@ tmw_SOURCES = gui/widgets/avatar.cpp \
gui/npcintegerdialog.h \
gui/npclistdialog.cpp \
gui/npclistdialog.h \
+ gui/npcpostdialog.cpp \
+ gui/npcpostdialog.h \
gui/npcstringdialog.cpp \
gui/npcstringdialog.h \
gui/ok_dialog.cpp \
@@ -138,6 +140,8 @@ tmw_SOURCES = gui/widgets/avatar.cpp \
gui/sdlinput.h \
gui/sell.cpp \
gui/sell.h \
+ gui/serverselectdialog.cpp \
+ gui/serverselectdialog.h \
gui/setup.cpp \
gui/setup.h \
gui/setup_audio.cpp \
@@ -374,8 +378,6 @@ tmw_SOURCES += \
gui/guildwindow.h \
gui/magic.cpp \
gui/magic.h \
- gui/npcpostdialog.cpp \
- gui/npcpostdialog.h \
gui/quitdialog.cpp \
gui/quitdialog.h \
gui/serverdialog.cpp \
@@ -456,8 +458,6 @@ endif
if SERVER_EATHENA
tmw_CXXFLAGS += -DEATHENA_SUPPORT
tmw_SOURCES += \
- gui/char_server.cpp \
- gui/char_server.h \
gui/skill.cpp \
gui/skill.h \
gui/status.cpp \
diff --git a/src/gui/char_server.cpp b/src/gui/serverselectdialog.cpp
index 48f8dedc..bcc756b7 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/serverselectdialog.cpp
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "gui/char_server.h"
+#include "gui/serverselectdialog.h"
#include "gui/widgets/button.h"
#include "gui/widgets/listbox.h"
@@ -40,7 +40,7 @@ extern SERVER_INFO **server_info;
class ServerListModel : public gcn::ListModel
{
public:
- virtual ~ServerListModel() {};
+ virtual ~ServerListModel() {}
int getNumberOfElements();
std::string getElementAt(int i);
diff --git a/src/gui/char_server.h b/src/gui/serverselectdialog.h
index b80ad286..b80ad286 100644
--- a/src/gui/char_server.h
+++ b/src/gui/serverselectdialog.h
diff --git a/src/main.cpp b/src/main.cpp
index 800f6b3b..de1ce635 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -44,9 +44,6 @@
#include "gui/widgets/label.h"
#include "gui/widgets/progressbar.h"
-#ifdef EATHENA_SUPPORT
-#include "gui/char_server.h"
-#endif
#include "gui/char_select.h"
#include "gui/gui.h"
#include "gui/login.h"
@@ -54,6 +51,7 @@
#include "gui/palette.h"
#include "gui/register.h"
#include "gui/sdlinput.h"
+#include "gui/serverselectdialog.h"
#include "gui/setup.h"
#ifdef TMWSERV_SUPPORT
#include "gui/connection.h"
@@ -139,19 +137,19 @@ namespace
} listener;
}
-#ifdef TMWSERV_SUPPORT
std::string token; //used to store magic_token
-extern Net::Connection *gameServerConnection;
-extern Net::Connection *chatServerConnection;
-extern Net::Connection *accountServerConnection;
-#else
// Account infos
char n_server, n_character;
// TODO Anyone knows a good location for this? Or a way to make it non-global?
class SERVER_INFO;
SERVER_INFO **server_info;
+
+#ifdef TMWSERV_SUPPORT
+extern Net::Connection *gameServerConnection;
+extern Net::Connection *chatServerConnection;
+extern Net::Connection *accountServerConnection;
#endif
Graphics *graphics;
@@ -167,12 +165,6 @@ Configuration branding; /**< XML branding information reader */
Logger *logger; /**< Log object */
KeyboardConfig keyboard;
-/*#ifdef TMWSERV_SUPPORT
-Net::Connection *gameServerConnection = 0;
-Net::Connection *chatServerConnection = 0;
-Net::Connection *accountServerConnection = 0;
-#endif*/
-
LoginData loginData;
LockedArray<LocalPlayer*> charInfo(maxSlot + 1);
@@ -808,25 +800,6 @@ static void accountRegister(LoginData *loginData)
loginData->password, loginData->email);
}
-static void accountUnRegister(LoginData *loginData)
-{
- Net::getLoginHandler()->unregisterAccount(loginData->username,
- loginData->password);
-
-}
-
-static void accountChangePassword(LoginData *loginData)
-{
- Net::getLoginHandler()->changePassword(loginData->username,
- loginData->password,
- loginData->newPassword);
-}
-
-static void accountChangeEmail(LoginData *loginData)
-{
- Net::getLoginHandler()->changeEmail(loginData->newEmail);
-}
-
static void switchCharacter(std::string *passToken)
{
Net::getLogoutHandler()->reset();
@@ -1291,7 +1264,7 @@ int main(int argc, char *argv[])
case STATE_CHANGEEMAIL_ATTEMPT:
logger->log("State: CHANGE EMAIL ATTEMPT");
- accountChangeEmail(&loginData);
+ Net::getLoginHandler()->changeEmail(loginData.newEmail);
break;
case STATE_CHANGEEMAIL:
@@ -1306,7 +1279,9 @@ int main(int argc, char *argv[])
case STATE_CHANGEPASSWORD_ATTEMPT:
logger->log("State: CHANGE PASSWORD ATTEMPT");
- accountChangePassword(&loginData);
+ Net::getLoginHandler()->changePassword(loginData.username,
+ loginData.password,
+ loginData.newPassword);
break;
case STATE_CHANGEPASSWORD:
@@ -1321,7 +1296,8 @@ int main(int argc, char *argv[])
case STATE_UNREGISTER_ATTEMPT:
logger->log("State: UNREGISTER ATTEMPT");
- accountUnRegister(&loginData);
+ Net::getLoginHandler()->unregisterAccount(
+ loginData.username, loginData.password);
break;
case STATE_UNREGISTER:
diff --git a/src/main.h b/src/main.h
index 7f13740c..ca5969d0 100644
--- a/src/main.h
+++ b/src/main.h
@@ -131,11 +131,8 @@ const short defaultMusicVolume = 60;
// Defines the number of usable player slots
const short maxSlot = 2;
-#ifdef TMWSERV_SUPPORT
extern std::string token;
-#else
extern char n_server, n_character;
-#endif
extern unsigned char state;
extern std::string errorMessage;
diff --git a/tmw.cbp b/tmw.cbp
index 684333b6..f4c7f863 100644
--- a/tmw.cbp
+++ b/tmw.cbp
@@ -203,10 +203,7 @@
<Unit filename="src/gui/button.h" />
<Unit filename="src/gui/buy.cpp" />
<Unit filename="src/gui/buy.h" />
- <Unit filename="src/gui/buysell.cpp">
- <Option target="eAthena" />
- <Option target="UNIX eAthena" />
- </Unit>
+ <Unit filename="src/gui/buysell.cpp" />
<Unit filename="src/gui/buysell.h" />
<Unit filename="src/gui/changeemaildialog.cpp">
<Option target="TMWServ" />
@@ -228,14 +225,6 @@
<Unit filename="src/gui/char_select.h" />
<Unit filename="src/gui/charcreate.cpp" />
<Unit filename="src/gui/charcreate.h" />
- <Unit filename="src/gui/char_server.cpp">
- <Option target="eAthena" />
- <Option target="UNIX eAthena" />
- </Unit>
- <Unit filename="src/gui/char_server.h">
- <Option target="eAthena" />
- <Option target="UNIX eAthena" />
- </Unit>
<Unit filename="src/gui/chat.cpp" />
<Unit filename="src/gui/chat.h" />
<Unit filename="src/gui/checkbox.cpp" />
@@ -321,14 +310,8 @@
<Unit filename="src/gui/npcintegerdialog.h" />
<Unit filename="src/gui/npclistdialog.cpp" />
<Unit filename="src/gui/npclistdialog.h" />
- <Unit filename="src/gui/npcpostdialog.cpp">
- <Option target="TMWServ" />
- <Option target="Unix TMWSERV" />
- </Unit>
- <Unit filename="src/gui/npcpostdialog.h">
- <Option target="TMWServ" />
- <Option target="Unix TMWSERV" />
- </Unit>
+ <Unit filename="src/gui/npcpostdialog.cpp" />
+ <Unit filename="src/gui/npcpostdialog.h" />
<Unit filename="src/gui/npcstringdialog.cpp" />
<Unit filename="src/gui/npcstringdialog.h" />
<Unit filename="src/gui/ok_dialog.cpp" />
@@ -375,6 +358,8 @@
<Option target="TMWServ" />
<Option target="Unix TMWSERV" />
</Unit>
+ <Unit filename="src/gui/serverselectdialog.cpp" />
+ <Unit filename="src/gui/serverselectdialog.h" />
<Unit filename="src/gui/setup.cpp" />
<Unit filename="src/gui/setup.h" />
<Unit filename="src/gui/setup_audio.cpp" />