Browse Source

slow down websocket send (from 100ms to 200ms)

jblanked 10 tháng trước cách đây
mục cha
commit
e4323e5607
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      game/player.c

+ 2 - 2
game/player.c

@@ -235,8 +235,8 @@ static void player_update(Entity *self, GameManager *manager, void *context)
         if (player->old_position.x != pos.x || player->old_position.y != pos.y)
         {
             elapsed_ws_timer++;
-            // only send the websocket update every 100ms
-            if (elapsed_ws_timer >= (game_context->fps / 10))
+            // only send the websocket update every 200ms
+            if (elapsed_ws_timer >= (game_context->fps / 5))
             {
                 if (game_context->fhttp)
                 {