]> git.localhorst.tv Git - blank.git/blobdiff - src/client/client.cpp
measure packet round trip time
[blank.git] / src / client / client.cpp
index ae1bf7378f59f6ed12494a08de8bd692e3b49aa6..1cbf11ef86e679c6b3cdbc314a42e7cbe4d9f0f0 100644 (file)
@@ -105,6 +105,11 @@ void InteractiveState::Handle(const SDL_Event &event) {
                case SDL_KEYDOWN:
                        // TODO: move to interface
                        if (event.key.keysym.sym == SDLK_RETURN) {
+                               chat.Clear();
+                               master.GetEnv().state.Push(&chat);
+                               hud.KeepMessages(true);
+                       } else if (event.key.keysym.sym == SDLK_SLASH) {
+                               chat.Preset("/");
                                master.GetEnv().state.Push(&chat);
                                hud.KeepMessages(true);
                        } else {
@@ -191,8 +196,6 @@ void InteractiveState::Handle(const Packet::SpawnEntity &pack) {
        if (model_id > 0 && model_id <= res.models.size()) {
                res.models.Get(model_id).Instantiate(entity.GetModel());
        }
-       cout << "spawned entity #" << entity_id << "  (" << entity.Name()
-               << ") at " << entity.AbsolutePosition() << endl;
 }
 
 void InteractiveState::Handle(const Packet::DespawnEntity &pack) {
@@ -202,7 +205,6 @@ void InteractiveState::Handle(const Packet::DespawnEntity &pack) {
        for (Entity &entity : world.Entities()) {
                if (entity.ID() == entity_id) {
                        entity.Kill();
-                       cout << "despawned entity #" << entity_id << " (" << entity.Name() << ") at " << entity.AbsolutePosition() << endl;
                        return;
                }
        }