Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show amount of pixels painted per ip adress #6

Open
wants to merge 1 commit into
base: stats_by_ip
Choose a base branch
from

Conversation

lkr0n
Copy link
Contributor

@lkr0n lkr0n commented Jan 26, 2024

Show the amount of pixels drawn by an ip on the canvas. The ip's are drawn in the upper left corner of over the pixelflut canvas.

  • This commit introduces an additional dependency on SDL2_ttf.h. You might have to install this header through your distros package managaer.
  • The drawing code was updated to support loading fonts into a glyph atlas.
  • To make this work this commit extends the existing connection tracker code to keep track of the amount of pixels painted by a connection.

This is a very hacky version because I am busy af.

Show the amount of pixels drawn by an ip on the canvas.
The ip's are drawn in the upper left corner of over the pixelflut
canvas.

* This commit introduces an additional dependency on SDL2_ttf.h.
  You might have to install this header through your distros package
  managaer.
* The drawing code was updated to support loading fonts into a glyph
  atlas.
* To make this work this commit extends the existing connection tracker
  code to keep track of the amount of pixels painted by a connection.

This is a very hacky version because I am busy af.
SDL_Texture * texture;
} fontTexture;

enum FontStatus {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern does not really fit into the codebase.
(I copied this from an earlier test-version of mine)


#define TEX_SIZE_X 512
#define TEX_SIZE_Y 512
#define SCREEN_SIZE_X 1024
#define SCREEN_SIZE_Y 1024
#define NET_MASK 0xff
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(context) This is supposed to be the subnetmask of your LAN. It is required for correctly grouping the connections by ip.

@luwae luwae changed the base branch from main to stats_by_ip January 26, 2024 18:02
@luwae
Copy link
Owner

luwae commented Jan 26, 2024

Currently we don't keep track of connections that have terminated, so if we had a client that drew a lot of pixels and then quit immediately, it would only show for a split second. Then later if another client is started from the same ip, the old information is lost and it starts again at 0.

I think before we can reasonably use this we need to write out the connection trackers of closing connections to a buffer somewhere (or to a file). This is why I dumped these trackers to the command line so far.

(Of course, this new approach is nicer because of the immediate feedback, which we don't have on the command line)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants