summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2005-03-24 21:24:31 +0000
committerYohann Ferreira <bertram@cegetel.net>2005-03-24 21:24:31 +0000
commitb5a9e699b9685e2a7d448171e282fd284754caf1 (patch)
tree4c8787fb30d28ec685bbcbb2ddca962b838a256d /src/gui
parentadf5fb5d45c11a0506d199d2cc672535c8418ce1 (diff)
downloadmana-client-b5a9e699b9685e2a7d448171e282fd284754caf1.tar.gz
mana-client-b5a9e699b9685e2a7d448171e282fd284754caf1.tar.bz2
mana-client-b5a9e699b9685e2a7d448171e282fd284754caf1.tar.xz
mana-client-b5a9e699b9685e2a7d448171e282fd284754caf1.zip
Logger Implemented. (3/3)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/char_select.cpp11
-rw-r--r--src/gui/char_server.cpp2
-rw-r--r--src/gui/login.cpp10
-rw-r--r--src/gui/setup.cpp8
-rw-r--r--src/gui/window.cpp4
5 files changed, 18 insertions, 17 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 431297e9..97c35a57 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -21,6 +21,7 @@
* $Id$
*/
+#include "../main.h"
#include "char_select.h"
#include "textfield.h"
#include "button.h"
@@ -195,7 +196,7 @@ void CharSelectDialog::serverCharDelete() {
RFIFOSKIP(3);
}
else {
- new OkDialog(this, "Error", "Unknown error");
+ new OkDialog(this, "Error", "Unknown");
}
}
@@ -210,11 +211,11 @@ void CharSelectDialog::serverCharSelect()
flush();
}
- log("CharSelect: Packet ID: %x, Length: %d, Packet_in_size %d",
+ logger.log("CharSelect: Packet ID: %x, Length: %d, Packet_in_size %d",
RFIFOW(0),
get_length(RFIFOW(0)),
RFIFOW(2));
- log("CharSelect: In_size: %d", in_size);
+ logger.log("CharSelect: In_size: %d", in_size);
if (RFIFOW(0) == 0x0071) {
while (in_size < 28) {
@@ -228,8 +229,8 @@ void CharSelectDialog::serverCharSelect()
map_port = RFIFOW(26);
state = GAME;
- log("CharSelect: Map: %s", map_name);
- log("CharSelect: Server: %s:%d", iptostring(map_address), map_port);
+ logger.log("CharSelect: Map: %s", map_name);
+ logger.log("CharSelect: Server: %s:%d", iptostring(map_address), map_port);
RFIFOSKIP(28);
close_session();
}
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index a4a433a7..e3835df7 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -204,7 +204,7 @@ void server_char_server(int serverIndex) {
}
state = CHAR_SELECT;
- log("CharServer: Player: %s (Packet ID: %x, Length: %d)",
+ logger.log("CharServer: Player: %s (Packet ID: %x, Length: %d)",
char_info->name, RFIFOW(0), RFIFOW(2));
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index f5e51d8d..ab06be75 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -106,7 +106,7 @@ void LoginDialog::action(const std::string& eventId)
{
if (eventId == "ok") {
const std::string user = userField->getText();
- log("Network: Username is %s", user.c_str());
+ logger.log("Network: Username is %s", user.c_str());
// Store config settings
config.setValue("remember", keepCheck->isMarked());
@@ -193,8 +193,8 @@ void server_login(const std::string& user, const std::string& pass) {
while ((in_size < 23) || (out_size > 0)) {
flush();
}
- log("Network: Packet ID: %x", RFIFOW(0));
- log("Network: Packet length: %d", get_packet_length(RFIFOW(0)));
+ logger.log("Network: Packet ID: %x", RFIFOW(0));
+ logger.log("Network: Packet length: %d", get_packet_length(RFIFOW(0)));
if (RFIFOW(0) == 0x0069) {
while (in_size < RFIFOW(2)) {
@@ -213,10 +213,10 @@ void server_login(const std::string& user, const std::string& pass) {
server_info[i].port = RFIFOW(47 + 32 * i + 4);
state = CHAR_SERVER;
}
- log("Network: Server: %s (%s:%d)", server_info[0].name,
+ logger.log("Network: Server: %s (%s:%d)", server_info[0].name,
iptostring(server_info[0].address),
server_info[0].port);
- log("Network: Users: %d", server_info[0].online_users);
+ logger.log("Network: Users: %d", server_info[0].online_users);
RFIFOSKIP(RFIFOW(2));
}
else if (RFIFOW(0) == 0x006a) {
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index 6e3197cd..13ba937d 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -50,12 +50,12 @@ ModeListModel::ModeListModel()
// Check if any modes available
if (modes == (SDL_Rect**)0) {
nmode = 0;
- log("No modes");
+ logger.log("No modes");
}
// Check if modes restricted
if (modes == (SDL_Rect**)-1) {
- log("Modes unrestricted");
+ logger.log("Modes unrestricted");
}
for (nmode = 0; modes[nmode]; ++nmode);
@@ -66,7 +66,7 @@ ModeListModel::ModeListModel()
char *temp = (char*)malloc(20 * sizeof(char));
mode[i] = temp;
if (sprintf(mode[i], "%d x %d", modes[i]->w, modes[i]->h) == -1) {
- log("Cannot allocate mode list");
+ logger.log("Cannot allocate mode list");
}
}
}
@@ -229,7 +229,7 @@ void Setup::action(const std::string &eventId)
}
catch (const char *err) {
new OkDialog(this, "Sound Engine", err);
- log("Warning: %s", err);
+ logger.log("Warning: %s", err);
}
} else {
config.setValue("sound", 0);
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 0d8ce5ff..817090ca 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -34,7 +34,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent):
snapSize(8),
modal(modal)
{
- log("Window::Window(\"%s\")", caption.c_str());
+ logger.log("Window::Window(\"%s\")", caption.c_str());
setBorderSize(0);
setPadding(3);
@@ -73,7 +73,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent):
Window::~Window()
{
- log("Window::~Window(\"%s\")", getCaption().c_str());
+ logger.log("Window::~Window(\"%s\")", getCaption().c_str());
// Free dialog bitmaps
//release_bitmap(dLeft);