Jump to content

Return users, number of network users


Jent

Recommended Posts

This is a server-side mod!

 

I've checked the Javadocs without finding a method I could use.

 

I've tried getNumActivePlayers, but that's a local one, i.e. it always returns 1 no matter the number of networked users.

 

Is there a way to list all current active remote IDs?

 

I need to get the number of users currently connected to the server, and a way to reference each one. Any suggestions?

Link to comment
Share on other sites

You could try something like this (not tested - just an idea):

local players = {};for i = 0, maxPlayers do      local insert = getSpecificPlayer(i);      if insert then          table.insert(players, insert);      endend
Link to comment
Share on other sites

Darn it. I thought I followed to this thread, but that was not the case. Anyways...

 

I've tried something similar, but I can't seem to be able to get the player. getSpecificPlayer returns nil no matter what player ID I tried with (0..10 for example). I suspect networked players differ from local players (getSpecificPlayer is local?).

Link to comment
Share on other sites

getSpecificPlayer() was introduced with co-op so I thought they might have carried it over to multiplayer - obviously they didn't :P

 

Have you checked the farming code already?

 

Yeah, the hunt continues.

 

Farming code?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...