Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-09-27 17:16:15 +0000
committerStijn Buys <ingar@osirion.org>2008-09-27 17:16:15 +0000
commitca0c1d3e6f8b5fa4eb2e0a86fcf47b12fb600786 (patch)
tree5d72e330f11350065806e83cc8712693241b9aad /src/client/client.cc
parent29984680d6e0e52efec489497b1796e056164442 (diff)
mission targets, texture unloading, private messages
Diffstat (limited to 'src/client/client.cc')
-rw-r--r--src/client/client.cc55
1 files changed, 37 insertions, 18 deletions
diff --git a/src/client/client.cc b/src/client/client.cc
index 7ba61d6..a8d4ca8 100644
--- a/src/client/client.cc
+++ b/src/client/client.cc
@@ -19,6 +19,8 @@
#include "client/input.h"
#include "client/view.h"
#include "core/core.h"
+#include "core/zone.h"
+#include "render/render.h"
namespace client
{
@@ -181,6 +183,8 @@ void Client::shutdown()
{
con_print << "^BShutting down client..." << std::endl;
+ if (connected()) disconnect();
+
core::Func::remove("r_restart");
core::Func::remove("snd_restart");
@@ -210,34 +214,49 @@ void Client::notify_remove_sound(size_t source)
audio::Sources::remove(source);
}
-void Client::notify_message(std::string const & message)
+void Client::notify_message(core::Message::Channel const channel, std::string const message)
{
- con_print << message << std::endl;
+
+ switch(channel) {
+
+ case core::Message::Info: // Info message
+ break;
+
+ case core::Message::Local: // Chat message in the local zone
+ break;
+
+ case core::Message::RCon: // RCon message
+ break;
+
+ case core::Message::Public: // Public chat message
+ audio::play("com/chat");
+ break;
+
+ case core::Message::Private: // Private chat message
+ audio::play("com/priv");
+ break;
+
+ default:
+ break;
+ }
+
+ con_print << message << std::endl;
console()->notify(message);
}
void Client::notify_zoneclear(core::Zone *zone)
{
- // FIXME unload zone textures
- /*
if (!zone)
return;
- for (core::Zone::Content::iterator it = zone->content().begin(); it != zone->content.end(); i++) {
- core:: Entity *entity = (*it);
-
- if (entity->type() == core::Entity::Globe) {
- core::EntityGlobe *globe = static_cast<core::EntityGlobe *>(entity);
- if (globe->render_texture)
- render::Textures::unload(render_texture);
-
- }
+ view::clear_zone(zone);
+}
- if (zone->sky_texture()) {
- render::Textures::unload(zone->sky_texture());
- zone->set_sky_texture(0);
- }
- */
+void Client::notify_disconnect()
+{
+ // FIXME unload sounds
+
+ render::unload();
}
} // namespace client