Author: suokko
Date: Mon Aug 25 00:29:53 2008
New Revision: 28948
URL: http://svn.gna.org/viewcvs/wesnoth?rev=28948&view=rev
Log:
Minor problems fixed in ban code:
write not setting dirty,
bans reporting useless info back to client
Modified:
trunk/src/server/ban.cpp
trunk/src/server/ban.hpp
trunk/src/server/server.cpp
Modified: trunk/src/server/ban.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/ban.cpp?rev=28948&r1=28947&r2=28948&view=diff
==============================================================================
--- trunk/src/server/ban.cpp (original)
+++ trunk/src/server/ban.cpp Mon Aug 25 00:29:53 2008
@@ -103,11 +103,12 @@
}
}
- void ban_manager::write() const
- {
- if (filename_.empty() || !dirty_)
+ void ban_manager::write()
+ {
+ if (filename_.empty() ||Â !dirty_)
return;
LOG_SERVER << "Writing bans to " << filename_ << "\n";
+ dirty_ = false;
config cfg;
for (ban_map::const_iterator itor = bans_.begin();
itor != bans_.end(); ++itor)
@@ -356,7 +357,7 @@
{
}
- ban_manager::ban_manager() : bans_(), time_queue_(), ban_times_(),
ban_help_(), filename_()
+ ban_manager::ban_manager() : bans_(), time_queue_(), ban_times_(),
ban_help_(), filename_(), dirty_(false)
{
init_ban_help();
}
Modified: trunk/src/server/ban.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/ban.hpp?rev=28948&r1=28947&r2=28948&view=diff
==============================================================================
--- trunk/src/server/ban.hpp (original)
+++ trunk/src/server/ban.hpp Mon Aug 25 00:29:53 2008
@@ -93,7 +93,7 @@
~ban_manager();
void read();
- void write() const;
+ void write();
time_t parse_time(std::string time_in) const;
Modified: trunk/src/server/server.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/server.cpp?rev=28948&r1=28947&r2=28948&view=diff
==============================================================================
--- trunk/src/server/server.cpp (original)
+++ trunk/src/server/server.cpp Mon Aug 25 00:29:53 2008
@@ -1271,7 +1271,7 @@
//! @todo FIXME: should also check for only numbers
if (std::count(target.begin(), target.end(), '.') >= 1)
{
banned_ = true;
- out << "Set ban on '" << target << "' with time
'" << time << "' with reason: '" << reason << "'.\n";
+ out << "Set ban on '" << target << "' with end
time '" << parsed_time << "' with reason: '" << reason << "'.\n";
ban_manager_.ban(target, parsed_time, reason);
@@ -1294,7 +1294,7 @@
const std::string& ip =
network::ip_address(pl->first);
if (!is_ip_banned(ip)) {
ban_manager_.ban(ip,parsed_time, reason);
- out << "Set ban on '"
<< ip << "' with time '" << time << "' with reason: '"
+ out << "Set ban on '"
<< ip << "' with end time '" << parsed_time << "' with reason: '"
<< reason <<
"'.\n";
}
if (kick) {
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits