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

Implement server announcement #1420

Merged
3 commits merged into from Jul 2, 2022
Merged

Conversation

Akka0
Copy link
Contributor

@Akka0 Akka0 commented Jul 2, 2022

Description

Allow server admin to send the in-game announcement by command or auto announce by cron task.

Command Usage

This command can be used in both console or game chat
a <tpl templateId|refresh|revoke templateId|content>

Example

/a tpl 1 // send the template 1 announcement instantly
/a refresh // refresh Announcement.json config file (You can put it in ./data/Announcement.json outside the jar)
/a revoke 1 // revoke the template 1 announcement config
/a xxxxxx // send an announcement instantly

Config File

Announcement.json

[
{
    "templateId" : 2,
    "type" : "COUNTDOWN", // CENTER or COUNTDOWN
    "frequency" : 1,
    "content": "Welcome to grasscutter PS!",
    "beginTime": "2022-06-01T00:00:00+08:00",
    "endTime": "2022-06-01T00:08:00+08:00",
    "tick" : false, // if set to true, it will auto send by cron task, or you need to send it by /a tpl <id>
    "interval": 1 // interval of time (minutes)
  }
]

Preview

7

Issues fixed by this PR

Type of changes

  • Bug fix
  • New feature
  • Enhancement
  • Documentation

Checklist:

  • My code follows the style guidelines of this project
  • My pull request is unique and no other pull requests have been opened for these changes
  • I have read the Contributing note and Code of conduct
  • I am responsible for any copyright issues with my code if it occurs in the future.

Akka0 and others added 2 commits July 2, 2022 17:32
….java

Co-authored-by: Luke H-W <Birdulon@users.noreply.github.com>
@ghost ghost merged commit 1dc90c2 into Grasscutters:development Jul 2, 2022
4Benj pushed a commit to Grasscutter-Backrooms/Grasscutter that referenced this pull request Jul 12, 2022
* implement server announcement

* Update src/main/java/emu/grasscutter/command/commands/AnnounceCommand.java

Co-authored-by: Luke H-W <Birdulon@users.noreply.github.com>

* Added arg numbers check

Co-authored-by: Luke H-W <Birdulon@users.noreply.github.com>
Birdulon added a commit to Birdulon/Grasscutter that referenced this pull request Aug 21, 2022
* implement server announcement

* Update src/main/java/emu/grasscutter/command/commands/AnnounceCommand.java

Co-authored-by: Luke H-W <Birdulon@users.noreply.github.com>

* Added arg numbers check

Co-authored-by: Luke H-W <Birdulon@users.noreply.github.com>
This pull request was closed.
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