| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package loopping
- import (
- actorRemote "f1-game/internal/actor_remote"
- cfacade "github.com/cherry-game/cherry/facade"
- clog "github.com/cherry-game/cherry/logger"
- )
- type component struct {
- cfacade.Component
- envs []string
- }
- func New() *component {
- return &component{
- envs: []string{
- "test",
- "su",
- },
- }
- }
- func (c *component) Name() string {
- return "loop_ping_component"
- }
- func (c *component) OnAfterInit() {
- // if slices.Contains(c.envs, cprofile.Env()) {
- // for range 128 {
- // go c.ping()
- // }
- // }
- }
- func (c *component) ping() {
- for {
- if actorRemote.CenterOps.Ping() {
- } else {
- clog.Warn("ping error")
- }
- }
- }
|