Camera centering and client drop message

This commit is contained in:
Kayne Ruse
2014-12-19 20:33:09 +11:00
parent 44a1edac30
commit 900f623f3b
3 changed files with 11 additions and 2 deletions
+3 -1
View File
@@ -26,7 +26,9 @@
class LocalCharacter: public BaseCharacter {
public:
//
LocalCharacter() = default;
virtual ~LocalCharacter() = default;
private:
//NOTE: NO MEMBERS
};
+6
View File
@@ -145,6 +145,12 @@ void InWorld::Update() {
it.second.Update();
}
//update the camera
if (localCharacter) {
camera.x = localCharacter->GetOrigin().x - camera.marginX;
camera.y = localCharacter->GetOrigin().y - camera.marginY;
}
//check the connection (heartbeat)
if (Clock::now() - lastBeat > std::chrono::seconds(3)) {
if (attemptedBeats > 2) {
+1
View File
@@ -183,6 +183,7 @@ void ServerApplication::Proc() {
int disconnected = clientMgr.CheckConnections();
if (disconnected != -1) {
FullClientUnload(disconnected);
std::cerr << "Client dropped: " << disconnected << std::endl;
}
//give the computer a break