summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-09 22:30:00 +0100
committerIra Rice <irarice@gmail.com>2009-02-09 17:10:37 -0700
commit1db7d10787f462430054ba04110a8d4647bdbd0a (patch)
tree60dc4d04c738b1f54a41bc9d9b6d0e5ffb0fb1d4 /src/net
parent1ae95b709235ce811ce72437aa257bb7500e00d0 (diff)
downloadmana-1db7d10787f462430054ba04110a8d4647bdbd0a.tar.gz
mana-1db7d10787f462430054ba04110a8d4647bdbd0a.tar.bz2
mana-1db7d10787f462430054ba04110a8d4647bdbd0a.tar.xz
mana-1db7d10787f462430054ba04110a8d4647bdbd0a.zip
Mostly whitespace fixes
Removed tab characters and trailing spaces and added spaces between "if(", "for(", "while(" and "switch(".
Diffstat (limited to 'src/net')
-rw-r--r--src/net/beinghandler.cpp9
-rw-r--r--src/net/loginhandler.cpp2
-rw-r--r--src/net/npchandler.cpp2
-rw-r--r--src/net/partyhandler.cpp150
-rw-r--r--src/net/partyhandler.h6
-rw-r--r--src/net/playerhandler.cpp2
-rw-r--r--src/net/tradehandler.cpp4
7 files changed, 87 insertions, 88 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index 69f462ec..2f5f0fee 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -230,7 +230,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
switch (type)
{
case 0x0a: // Critical Damage
- if (dstBeing)
+ if (dstBeing)
dstBeing->showCrit();
case 0x00: // Damage
if (dstBeing)
@@ -240,7 +240,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
break;
case 0x02: // Sit
- if (srcBeing)
+ if (srcBeing)
{
srcBeing->mFrame = 0;
srcBeing->setAction(Being::SIT);
@@ -248,7 +248,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
break;
case 0x03: // Stand up
- if (srcBeing)
+ if (srcBeing)
{
srcBeing->mFrame = 0;
srcBeing->setAction(Being::STAND);
@@ -446,7 +446,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
switch (msg->readInt8())
{
case 1:
- if (dstBeing->getType() != Being::NPC)
+ if (dstBeing->getType() != Being::NPC)
dstBeing->setAction(Being::DEAD);
break;
@@ -511,4 +511,3 @@ void BeingHandler::handleMessage(MessageIn *msg)
break;
}
}
-
diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp
index 4f5f2acc..41314d16 100644
--- a/src/net/loginhandler.cpp
+++ b/src/net/loginhandler.cpp
@@ -113,7 +113,7 @@ void LoginHandler::handleMessage(MessageIn *msg)
iptostring(server_info[i]->address),
server_info[i]->port);
}
- state = CHAR_SERVER_STATE;
+ state = CHAR_SERVER_STATE;
break;
case 0x006a:
diff --git a/src/net/npchandler.cpp b/src/net/npchandler.cpp
index 4e17a27e..ea03537f 100644
--- a/src/net/npchandler.cpp
+++ b/src/net/npchandler.cpp
@@ -79,7 +79,7 @@ void NPCHandler::handleMessage(MessageIn *msg)
case SMSG_NPC_CLOSE:
id = msg->readInt32();
if (current_npc == dynamic_cast<NPC*>(beingManager->findBeing(id)))
- current_npc = NULL;
+ current_npc = NULL;
break;
case SMSG_NPC_NEXT:
diff --git a/src/net/partyhandler.cpp b/src/net/partyhandler.cpp
index 2437d0a0..03aca66d 100644
--- a/src/net/partyhandler.cpp
+++ b/src/net/partyhandler.cpp
@@ -34,17 +34,17 @@
PartyHandler::PartyHandler(Party *party) : mParty(party)
{
static const Uint16 _messages[] = {
- SMSG_PARTY_CREATE,
- SMSG_PARTY_INFO,
- SMSG_PARTY_INVITE,
- SMSG_PARTY_INVITED,
- SMSG_PARTY_SETTINGS,
- SMSG_PARTY_MEMBER_INFO,
- SMSG_PARTY_LEAVE,
- SMSG_PARTY_UPDATE_HP,
- SMSG_PARTY_UPDATE_COORDS,
- SMSG_PARTY_MESSAGE,
- 0
+ SMSG_PARTY_CREATE,
+ SMSG_PARTY_INFO,
+ SMSG_PARTY_INVITE,
+ SMSG_PARTY_INVITED,
+ SMSG_PARTY_SETTINGS,
+ SMSG_PARTY_MEMBER_INFO,
+ SMSG_PARTY_LEAVE,
+ SMSG_PARTY_UPDATE_HP,
+ SMSG_PARTY_UPDATE_COORDS,
+ SMSG_PARTY_MESSAGE,
+ 0
};
handledMessages = _messages;
}
@@ -53,70 +53,70 @@ void PartyHandler::handleMessage(MessageIn *msg)
{
switch (msg->getId())
{
- case SMSG_PARTY_CREATE:
- mParty->createResponse(msg->readInt8());
- break;
- case SMSG_PARTY_INFO:
- break;
- case SMSG_PARTY_INVITE:
- {
- std::string nick = msg->readString(24);
- int status = msg->readInt8();
- mParty->inviteResponse(nick, status);
- break;
- }
- case SMSG_PARTY_INVITED:
- {
- int id = msg->readInt32();
- Being *being = beingManager->findBeing(id);
- if (being == NULL)
- {
- break;
- }
- std::string nick;
+ case SMSG_PARTY_CREATE:
+ mParty->createResponse(msg->readInt8());
+ break;
+ case SMSG_PARTY_INFO:
+ break;
+ case SMSG_PARTY_INVITE:
+ {
+ std::string nick = msg->readString(24);
+ int status = msg->readInt8();
+ mParty->inviteResponse(nick, status);
+ break;
+ }
+ case SMSG_PARTY_INVITED:
+ {
+ int id = msg->readInt32();
+ Being *being = beingManager->findBeing(id);
+ if (being == NULL)
+ {
+ break;
+ }
+ std::string nick;
int gender = 0;
- std::string partyName = "";
- if (being->getType() != Being::PLAYER)
- {
- nick = "";
- }
- else
- {
- nick = being->getName();
- gender = being->getGender();
- partyName = msg->readString(24);
- }
- mParty->invitedAsk(nick, gender, partyName);
- break;
- }
- case SMSG_PARTY_SETTINGS:
- break;
- case SMSG_PARTY_MEMBER_INFO:
- break;
- case SMSG_PARTY_LEAVE:
- {
- /*int id = */msg->readInt32();
- std::string nick = msg->readString(24);
- /*int fail = */msg->readInt8();
- mParty->leftResponse(nick);
- break;
- }
- case SMSG_PARTY_UPDATE_HP:
- break;
- case SMSG_PARTY_UPDATE_COORDS:
- break;
- case SMSG_PARTY_MESSAGE:
- { // new block to enable local variables
- int msgLength = msg->readInt16() - 8;
- if (msgLength <= 0)
- {
- return;
- }
- int id = msg->readInt32();
- Being *being = beingManager->findBeing(id);
- std::string chatMsg = msg->readString(msgLength);
- mParty->receiveChat(being, chatMsg);
- }
- break;
+ std::string partyName = "";
+ if (being->getType() != Being::PLAYER)
+ {
+ nick = "";
+ }
+ else
+ {
+ nick = being->getName();
+ gender = being->getGender();
+ partyName = msg->readString(24);
+ }
+ mParty->invitedAsk(nick, gender, partyName);
+ break;
+ }
+ case SMSG_PARTY_SETTINGS:
+ break;
+ case SMSG_PARTY_MEMBER_INFO:
+ break;
+ case SMSG_PARTY_LEAVE:
+ {
+ /*int id = */msg->readInt32();
+ std::string nick = msg->readString(24);
+ /*int fail = */msg->readInt8();
+ mParty->leftResponse(nick);
+ break;
+ }
+ case SMSG_PARTY_UPDATE_HP:
+ break;
+ case SMSG_PARTY_UPDATE_COORDS:
+ break;
+ case SMSG_PARTY_MESSAGE:
+ { // new block to enable local variables
+ int msgLength = msg->readInt16() - 8;
+ if (msgLength <= 0)
+ {
+ return;
+ }
+ int id = msg->readInt32();
+ Being *being = beingManager->findBeing(id);
+ std::string chatMsg = msg->readString(msgLength);
+ mParty->receiveChat(being, chatMsg);
+ }
+ break;
}
}
diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h
index 08d85ad0..048da9b1 100644
--- a/src/net/partyhandler.h
+++ b/src/net/partyhandler.h
@@ -29,11 +29,11 @@ class Party;
class PartyHandler : public MessageHandler
{
public:
- PartyHandler(Party *party);
+ PartyHandler(Party *party);
- void handleMessage(MessageIn *msg);
+ void handleMessage(MessageIn *msg);
private:
- Party *mParty;
+ Party *mParty;
};
#endif
diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp
index d06f1108..46ded32e 100644
--- a/src/net/playerhandler.cpp
+++ b/src/net/playerhandler.cpp
@@ -146,7 +146,7 @@ void PlayerHandler::handleMessage(MessageIn *msg)
/* Scroll if neccessary */
if (!nearby
|| (abs(x - player_node->mX) > MAP_TELEPORT_SCROLL_DISTANCE)
- || (abs(y - player_node->mY) > MAP_TELEPORT_SCROLL_DISTANCE))
+ || (abs(y - player_node->mY) > MAP_TELEPORT_SCROLL_DISTANCE))
{
scrollOffsetX = (x - player_node->mX) * 32;
scrollOffsetY = (y - player_node->mY) * 32;
diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp
index 0c7c9205..c5465835 100644
--- a/src/net/tradehandler.cpp
+++ b/src/net/tradehandler.cpp
@@ -112,7 +112,7 @@ void TradeHandler::handleMessage(MessageIn *msg)
BY_SERVER);
break;
case 2: // Invite request check failed...
- chatWindow->chatLog(_("Trade cancelled due to an unknown reason."),
+ chatWindow->chatLog(_("Trade cancelled due to an unknown reason."),
BY_SERVER);
break;
case 3: // Trade accepted
@@ -191,7 +191,7 @@ void TradeHandler::handleMessage(MessageIn *msg)
BY_SERVER);
break;
default:
- chatWindow->chatLog(_("Failed adding item for unknown reason."),
+ chatWindow->chatLog(_("Failed adding item for unknown reason."),
BY_SERVER);
break;
}