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.

1  
srecord noeq GazellePresenceListener(StefansOS_ConnectToServer connector) {
2  
  new VarWithNotify<Int> userCount;
3  
  settable bool verbose;
4  
  
5  
  void init {
6  
    connector.onNewLine(line -> {
7  
      new Matches m;
8  
      if (swic(line, "gazellePresence:", m)) {
9  
        userCount.set(parseInt(m.rest()));
10  
        if (verbose) print("Gazelle presence count: " + get());
11  
      }
12  
    });
13  
    
14  
    connector.sub("gazellePresence");
15  
  };
16  
  
17  
  Int get() { ret userCount!; }
18  
}

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: 170 / 263
Version history: 1 change(s)
Referenced in: [show references]