NetChannelInfo get_time_connected ?

Please post any questions about developing your plugin here. Please use the search function before posting!
Alvarez
Junior Member
Posts: 2
Joined: Sun Dec 14, 2014 1:18 am

NetChannelInfo get_time_connected ?

Postby Alvarez » Wed Feb 10, 2016 1:19 pm

How would I take advantage of get_time_connected from NetChannelInfo?
Can't seem to figure it out being a total noob. Big thanks in advanced!
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Wed Feb 10, 2016 1:43 pm

You can use engine_server to retrieve a NetChannelInfo object.

Example:

Syntax: Select all

from engines.server import engine_server
from events import Event
from players.helpers import index_from_userid

@Event('player_say')
def on_player_say(event):
userid = event['userid']
index = index_from_userid(userid)
info = engine_server.get_player_net_info(index)
print(info.get_time_connected())
Alvarez
Junior Member
Posts: 2
Joined: Sun Dec 14, 2014 1:18 am

Postby Alvarez » Wed Feb 10, 2016 2:10 pm

Ayuto wrote:You can use engine_server to retrieve a NetChannelInfo object.

Example:

Syntax: Select all

from engines.server import engine_server
from events import Event
from players.helpers import index_from_userid

@Event('player_say')
def on_player_say(event):
userid = event['userid']
index = index_from_userid(userid)
info = engine_server.get_player_net_info(index)
print(info.get_time_connected())


Much thanks!

Return to “Plugin Development Support”

Who is online

Users browsing this forum: Bing [Bot] and 19 guests