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

Add /kills command with save state functionality #4

Merged
merged 4 commits into from
Aug 6, 2020

Conversation

ryukinix
Copy link
Member

@ryukinix ryukinix commented Aug 6, 2020

CHANGELOG:

  • Kills state it's loaded at session start, if doesn't exists set to 0.
  • Kills state it's saved in the file kills.txt
  • Kills state it's saved after each ban, to ensure that state is safe .
  • If /kills it's called will report the current kills state.

CHANGELOG:

- Kills state it's loaded at session start, if doesn't exists set to 0.
- Kills state it's saved on the file kills.txt
- Kills state it's saved after each ban, to ensure being saved.
- If /kills it's called will report the current kills state.
@ryukinix
Copy link
Member Author

ryukinix commented Aug 6, 2020

Codecov Report

Merging #4 into master will increase coverage by 14.53%.
The diff coverage is 95.65%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master       #4       +/-   ##
===========================================
+ Coverage   78.98%   93.52%   +14.53%     
===========================================
  Files           1        1               
  Lines         138      139        +1     
===========================================
+ Hits          109      130       +21     
+ Misses         29        9       -20     
Flag Coverage Δ
#unittests 93.52% <95.65%> (+14.53%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
troll_shield.go 93.52% <95.65%> (+14.53%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd460de...c943a3e. Read the comment docs.

Important fix: os.O_TRUNC should be set as flag in os.OpenFile to
overwrite the kills.txt file properly.

Otherwise, ff the kills.txt had initially "random-fuckups", writing 10
will turn out in: "10ndom-fuckups".

This is not the intended behavior.
This will make more easier to control the unit tests, since main is
not possible to test.
@mateusfccp mateusfccp merged commit 7015110 into master Aug 6, 2020
@ryukinix ryukinix deleted the feature/kill-counter branch August 6, 2020 13:30
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.

None yet

2 participants