Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1035031 // GazellePresenceListener

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (9593L) is out of date.

srecord noeq GazellePresenceListener(StefansOS_ConnectToServer connector) {
  new VarWithNotify<Int> userCount;
  settable bool verbose;
  
  void init {
    connector.onNewLine(line -> {
      new Matches m;
      if (swic(line, "gazellePresence:", m)) {
        userCount.set(parseInt(m.rest()));
        if (verbose) print("Gazelle presence count: " + get());
      }
    });
    
    connector.sub("gazellePresence");
  };
  
  Int get() { ret userCount!; }
}

Author comment

Began life as a copy of #1034092

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035031
Snippet name: GazellePresenceListener
Eternal ID of this version: #1035031/2
Text MD5: d844acaf40f6f3e57489487cb16ddeaf
Author: stefan
Category: javax / networking
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-24 14:37:42
Source code size: 480 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 168 / 260
Version history: 1 change(s)
Referenced in: [show references]