From 7add4dd07e17c5a6ba0a2a1d9700d72055b812ae Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Mon, 13 Jun 2011 13:19:01 +0200 Subject: Send players and updated positions to other players. --- connection.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'connection.cpp') diff --git a/connection.cpp b/connection.cpp index 3b5076c..613eed0 100644 --- a/connection.cpp +++ b/connection.cpp @@ -4,7 +4,10 @@ using std::min; using std::max; +uint32_t Connection::next_id = 0; + Connection::Connection(boost::asio::io_service& io_service_) : io_service(io_service_), socket(io_service_) { + id = ++next_id; } float Connection::distance(float px, float pz) { @@ -57,3 +60,7 @@ std::set > Connection::check_chunks() { return new_chunks; } + +uint32_t Connection::get_id() { + return id; +} -- cgit v1.2.3