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

printColor rewrite #2937

Merged
merged 3 commits into from
Dec 24, 2023
Merged

printColor rewrite #2937

merged 3 commits into from
Dec 24, 2023

Conversation

Denneisk
Copy link
Member

@Denneisk Denneisk commented Dec 11, 2023

Add:

  • Dynamic perf on printColor (1 op per bit sent)
  • ConVar to disable warnings on printColor

Change:

  • Rewrote printColor to be faster and more robust
  • printColor now uses modified normal print max length to limit
  • Print max length now use server's max length in singleplayer
  • printColor warning now fires only once per session
  • printColor warning does not appear for your own E2s (? Maybe controversial)

Add:
- Dynamic perf on printColor (1 op per bit sent)
- ConVar to disable warnings on printColor
Change:
- Rewrote printColor
- printColor now uses modified normal print max length to limit
- Print max length now use server's maxlength in singleplayer
- printColor warning now fires only once per session
@Denneisk
Copy link
Member Author

Heh sorry thought the labels would be cool

Comment on lines 27 to 29
local head = net.ReadUInt(4)
if head == 0 then break end
msg[i] = printcolor_readers[head]()
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be safer from lua errors

local reader = printcolor_readers[net.ReadUInt(4)]
if not reader then break end
msg[i] = reader()

@thegrb93 thegrb93 merged commit aab46e3 into wiremod:master Dec 24, 2023
1 check passed
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