From 6979c74625d51897d99797b309974c2ee82a024b Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 6 Aug 2008 16:43:32 +0000 Subject: every player within 1024 game units is drawn as target --- src/core/Makefile.am | 6 +++--- src/core/core.h | 1 + src/core/netconnection.cc | 10 +++++----- src/core/range.h | 28 ++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 src/core/range.h (limited to 'src/core') diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 6c2c41e..3badbd9 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -10,7 +10,7 @@ libcore_la_LIBADD = $(top_builddir)/src/model/libmodel.la \ $(top_builddir)/src/auxiliary/libauxiliary.la noinst_LTLIBRARIES = libcore.la -noinst_HEADERS = application.h commandbuffer.h clientstate.h core.h cvar.h entity.h func.h \ - gameconnection.h gameinterface.h gameserver.h module.h net.h \ - netclient.h netconnection.h netserver.h player.h stats.h +noinst_HEADERS = application.h clientstate.h commandbuffer.h core.h cvar.h \ + entity.h func.h gameconnection.h gameinterface.h gameserver.h module.h net.h \ + netclient.h netconnection.h netserver.h player.h range.h stats.h diff --git a/src/core/core.h b/src/core/core.h index a3c9005..feca5fd 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -17,6 +17,7 @@ #include "core/gameinterface.h" #include "core/module.h" #include "core/player.h" +#include "core/range.h" #include "core/zone.h" /// core contains the basic functionality of the engine diff --git a/src/core/netconnection.cc b/src/core/netconnection.cc index 3b302dd..0b33652 100644 --- a/src/core/netconnection.cc +++ b/src/core/netconnection.cc @@ -451,7 +451,7 @@ void NetConnection::parse_incoming_message(const std::string & message) } else if (command == "die") { unsigned int id; if (msgstream >> id) { - con_debug << "Received die entity id " << id << std::endl; + //con_debug << "Received die entity id " << id << std::endl; Entity *e = Entity::find(id); if (localcontrol() == e) localplayer()->set_control(0); @@ -470,7 +470,7 @@ void NetConnection::parse_incoming_message(const std::string & message) con_warn << "Received create for NULL entity!" << std::endl; return; } - con_debug << "Received create entity id " << id << " type " << type << std::endl; + //con_debug << "Received create entity id " << id << " type " << type << std::endl; Entity *entity = Entity::find(id); @@ -508,7 +508,7 @@ void NetConnection::parse_incoming_message(const std::string & message) std::string label; if (msgstream >> id) { if (id) { - con_debug << "Received zone " << id << std::endl; + //con_debug << "Received zone " << id << std::endl; Zone * zone = Zone::find(id); // create the zone if necessary @@ -525,12 +525,12 @@ void NetConnection::parse_incoming_message(const std::string & message) } } else if (command == "pif") { - con_debug << "Received update player info" << std::endl; + //con_debug << "Received update player info" << std::endl; Zone *oldzone = connection()->localplayer()->zone(); connection()->localplayer()->receive_server_update(msgstream); - con_debug << "zone " << ( connection()->localplayer()->zone() ? connection()->localplayer()->zone()->id() : 0) << std::endl; + //con_debug << "zone " << ( connection()->localplayer()->zone() ? connection()->localplayer()->zone()->id() : 0) << std::endl; if (connection()->localplayer()->zonechange() && oldzone && (oldzone != connection()->localplayer()->zone())) { diff --git a/src/core/range.h b/src/core/range.h new file mode 100644 index 0000000..5921e70 --- /dev/null +++ b/src/core/range.h @@ -0,0 +1,28 @@ +/* + core/core.h + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#ifndef __INCLUDED_CORE_RANGE_H__ +#define __INCLUDED_CORE_RANGE_H__ + +namespace core { + +namespace range { + /// maximal range + /** This is the distance of the frustum far plane, + * the maximal distance at which non-controlable entities can be drawn. + * the maximal radar range for controlable entities, + * and the maximal range to send entity updates + */ + const float max = 1024.0f; + + /// maximal visible range for controlable entities + const float visible = 512.0f; +} + +} + +#endif // __INCLUDED_CORE_RANGE_H__ + -- cgit v1.2.3