本文整理汇总了Python中b3.fake.FakeClient.connections方法的典型用法代码示例。如果您正苦于以下问题:Python FakeClient.connections方法的具体用法?Python FakeClient.connections怎么用?Python FakeClient.connections使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类b3.fake.FakeClient
的用法示例。
在下文中一共展示了FakeClient.connections方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FakeClient
# 需要导入模块: from b3.fake import FakeClient [as 别名]
# 或者: from b3.fake.FakeClient import connections [as 别名]
client.message("^5%s ^7tu id es ^2%s^7. Pedi tu registro en www.codwar.com.ar" % (client.name, client.id))
time.sleep(3)
self.console.write('forceteam %s %s' % (client.cid, 'spectator'))
if client.connections < 3:
client.kick('Not registered', silent=True)
else:
client.tempban('Not registered', '', 5, None)
if __name__ == '__main__':
from b3.fake import fakeConsole
from b3.fake import FakeClient, superadmin
import time
# first time user
user0 = FakeClient(fakeConsole, name="New User", exactName="Joe", guid="1234", groupBits=0, team=b3.TEAM_RED)
user0.connections = 0
# second time user
user1 = FakeClient(fakeConsole, name="New User Again", exactName="Joe", guid="12384", groupBits=0, team=b3.TEAM_RED)
user1.connections = 1
# registered user
user2 = FakeClient(fakeConsole, name="Registered User", exactName="Joe", guid="1235", groupBits=1, team=b3.TEAM_RED)
# regular user
user3 = FakeClient(fakeConsole, name="Regular User", exactName="Joe", guid="12365", groupBits=2, team=b3.TEAM_RED)
p = RegisteredPlugin(fakeConsole)
p._warn = 1
p.onStartup()
time.sleep(2)