Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/gameserver.cc20
-rw-r--r--src/filesystem/inistream.cc14
2 files changed, 18 insertions, 16 deletions
diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc
index 37c486c..0eb9395 100644
--- a/src/core/gameserver.cc
+++ b/src/core/gameserver.cc
@@ -385,19 +385,19 @@ void GameServer::kick(Player *player, std::string const &reason)
// server sends a message on a specified channel to a single player
void GameServer::message(Player *player, const Message::Channel channel, const std::string text)
{
- if (!text.size())
+ if (!text.size()) {
return;
+ }
- NetClient *client = player->client();
-
- if (client) {
- // this player is a network client, send message over network
- server_network->send_message(client, channel, text);
+ NetClient *client = player->client();
+ if (client) {
+ // this player is a network client, send message over network
+ server_network->send_message(client, channel, text);
- } else if (player == localplayer()) {
- // local player, send message to the local application
- application()->notify_message(channel, text);
- }
+ } else if (player == localplayer()) {
+ // local player, send message to the local application
+ application()->notify_message(channel, text);
+ }
}
// server broadcasts a message on a specified channel to all players
diff --git a/src/filesystem/inistream.cc b/src/filesystem/inistream.cc
index 0235440..94cb032 100644
--- a/src/filesystem/inistream.cc
+++ b/src/filesystem/inistream.cc
@@ -66,17 +66,16 @@ bool IniStream::getline(std::istream & istream)
aux::trim(s);
line_number++;
- if (s.size() == 0) {
- // empty line
- } else
+ if (s.size() > 0) {
// strip trailing EOL / FF characters
- if ( (s[s.size() -1] == 0x0a) || (s[s.size() -1] == 0x0d))
+ if ( (s[s.size() -1] == 0x0a) || (s[s.size() -1] == 0x0d)) {
s.erase(s.size() -1);
+ }
// comment
if (s[0] == '#' || s[0] == ';') {
// condebug << "IniStream got comment " << s << std::endl;
- } else
+ } else {
// section header
if (s.size() > 2 && s[0] == '[' && s[s.size()-1] == ']') {
// condebug << "Inifile got section header " << s << std::endl;
@@ -107,9 +106,12 @@ bool IniStream::getline(std::istream & istream)
}
}
+ }
+ }
return true;
- } else
+ } else {
return false;
+ }
}
bool IniStream::got_key() const