本文整理汇总了Python中extendedstats.extendedstats.dbg函数的典型用法代码示例。如果您正苦于以下问题:Python dbg函数的具体用法?Python dbg怎么用?Python dbg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dbg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: vip_killed
def vip_killed(ev):
if not es.isbot(ev['attacker']):
dbg( 'vip killed')
players.increment(ev['attacker'],'vip_killed')
if not es.isbot(ev['userid']):
dbg( 'vip died')
players.increment(sid(ev),'vip_died')
开发者ID:laiello,项目名称:extendedstats,代码行数:7,代码来源:tf.py
示例2: player_jump
def player_jump(ev):
if not es.isbot(ev['userid']):
dbg( 'player jumped')
steamid = sid(ev)
players.increment(steamid,'jump')
vStartpos = vecmath.vector(es.getplayerlocation(ev['userid']))
players.update(steamid,'jump_startpos',str(vStartpos))
开发者ID:laiello,项目名称:extendedstats,代码行数:7,代码来源:dod.py
示例3: weapon_purchase
def weapon_purchase(ev):
if not es.isbot(ev['userid']):
extendedstats.dbg( 'weapon purchase')
steamid = extendedstats.sid(ev)
weapon = ev['weapon']
if 'bought_%s' in extendedstats.players.columns:
extendedstats.players.increment(steamid,'bought_%s' % weapon)
extendedstats.weapons.increment(weapon,'bought')
else:
extendedstats.dbg('custom weapon, not in database...')
开发者ID:laiello,项目名称:extendedstats,代码行数:10,代码来源:extendedevents.py
示例4: dod_round_win
def dod_round_win(ev):
wt,lt = 'ct','t'
dbg( 'round won')
if ev['team'] == '2':
wt,lt = lt,wt
for userid in playerlib.getUseridList('#human,#%s' % wt):
players.increment(es.getplayersteamid(userid),'win')
for userid in playerlib.getUseridList('#human,#%s' % lt):
players.increment(es.getplayersteamid(userid),'lose')
dcfg.sync()
updateTimes()
db.commit()
开发者ID:laiello,项目名称:extendedstats,代码行数:12,代码来源:dod.py
示例5: round_end
def round_end(ev):
dbg( 'round end')
wt,lt = 'ct','t'
if ev['winner'] == '2':
wt,lt = lt,wt
for userid in playerlib.getUseridList('#human,#%s' % wt):
players.increment(es.getplayersteamid(userid),'win')
for userid in playerlib.getUseridList('#human,#%s' % lt):
players.increment(es.getplayersteamid(userid),'lose')
dcfg.sync()
updateTimes()
db.commit()
开发者ID:laiello,项目名称:extendedstats,代码行数:12,代码来源:tf.py
示例6: player_spawn
def player_spawn(ev):
dbg('player_spawn')
if not es.isbot(ev['userid']):
steamid = es.getplayersteamid(ev['userid'])
if not steamid:
dbg('NO STEAM ID!!!')
return
if steamid == 'STEAM_ID_PENDING':
dbg('STEAM_ID_PENDING')
gamethread.delayedname(1, 'xs_delayed_%s' % ev['userid'], pendingCheck, kw={userid:ev['userid']})
pending.append(ev['userid'])
return
if not ev['userid'] in newconnected:
return
if not steamid in players:
players.newplayer(steamid)
if not steamid in toplist:
toplist.newplayer(steamid)
players.increment(steamid,'sessions')
players.update(steamid,'sessionstart',time.time())
players.update(steamid,'lastseen',time.time())
players.update(steamid,'teamchange_time',time.time())
newname = es.getplayername(ev['userid'])
players.name(steamid,newname)
newconnected.remove(ev['userid'])
if ev['userid'] in pending:
pending.remove(ev['userid'])
dbg('player spawned: %s' % steamid)
开发者ID:laiello,项目名称:extendedstats,代码行数:28,代码来源:dod.py
示例7: player_hurt
def player_hurt(ev):
victim = ev['es_steamid']
attacker = ev['es_attackersteamid']
weapon = ev['weapon']
damage = int(ev['damage'])
if weapon in weapons:
weapons.add(weapon,'damage',float(damage))
if not es.isbot(ev['userid']):
dbg( 'player hurt')
players.increment(victim,'hurt')
players.add(victim,'hurt_damage',damage)
if not es.isbot(ev['attacker']) and bool(int(ev['attacker'])):
dbg( 'player hurted')
players.increment(attacker,'attacked')
players.add(attacker,'attacked_damage',damage)
if 'damage_%s' % weapon in players.columns:
players.add(attacker,'damage_%s' % weapon,damage)
开发者ID:laiello,项目名称:extendedstats,代码行数:17,代码来源:dod.py
示例8: player_disconnect
def player_disconnect(ev):
if ev['userid'] in newconnected:
newconnected.remove(ev['userid'])
if ev['userid'] in pending:
pending.remove(ev['userid'])
return
if not es.isbot(ev['userid']):
dbg( 'player disconnected: %s' % ev['userid'])
dbg( 'finnishing player session')
steamid = ev['networkid']
if not steamid in players:
return
players.update(steamid,'lastseen',time.time())
players.add(steamid,'time',time.time() - players.query(steamid,'sessionstart'))
cteam = players.query(steamid,'current_team')
if not str(cteam) == '0':
players.add(steamid,'team_' + str(cteam) + '_time',time.time() - players.query(steamid,'teamchange_time'))
players.update(steamid,'teamchange_time',time.time())
players.update(steamid,'current_team',0)
for method in methods.keys():
toplist.update(steamid,method,methods[method](players,steamid))
开发者ID:laiello,项目名称:extendedstats,代码行数:21,代码来源:dod.py
示例9: player_team
def player_team(ev):
if not es.isbot(ev['userid']):
dbg( 'player_team')
steamid = sid(ev)
if steamid:
ot = ev['oldteam']
nt = ev['team']
if ot in ['1','0'] and nt in ['2','3']:
dbg( 'spec to play')
players.add(steamid,'team_1_time',time.time() - players.query(steamid,'teamchange_time'))
players.update(steamid,'teamchange_time',time.time())
if ot in ['2','3'] and nt in ['1','0']:
dbg( 'play to spec')
players.add(steamid,'team_%s_time' % ot,time.time() - players.query(steamid,'teamchange_time'))
players.update(steamid,'teamchange_time',time.time())
if ot in ['2','3'] and ot != nt:
dbg( 'teamswitch')
players.add(steamid,'team_%s_time' % ot,time.time() - players.query(steamid,'teamchange_time'))
players.update(steamid,'teamchange_time',time.time())
players.update(steamid,'current_team',nt)
else:
dbg( 'disconnected')
开发者ID:laiello,项目名称:extendedstats,代码行数:22,代码来源:dod.py
示例10: player_land
def player_land(ev):
if not es.isbot(ev['userid']):
steamid = extendedstats.sid(ev)
extendedstats.dbg('player land')
pos = vecmath.vector(es.getplayerlocation(ev['userid']))
startpos = extendedstats.players.query(steamid,'jump_startpos')
if startpos:
distance = vecmath.distance(pos, vecmath.vector(startpos))
extendedstats.players.add(steamid,'jump_distance',distance)
if distance > extendedstats.players.query(steamid,'jump_longest'):
extendedstats.players.update(steamid,'jump_longest',distance)
if dcfg['notify_longestjump'] == '1':
name = extendedstats.getName(steamid)
rank,allplayers = extendedstats.getRank(steamid,'jump_longest')
rSteamid, rDistance = extendedstats.getToplist(1,'jump_longest')[0]
rName = extendedstats.getName(rSteamid)
if dcfg['notify_longestjump_all'] == '1':
es.msg('%s just broke his record of his longest jump. His new record is: %.2f meters!' % (name,distance*0.01905))
es.msg('He is ranked %s of %s now. Longest jump overall is %.2f meters by %s' % (rank,allplayers,rDistance,rName))
else:
es.tell(ev['userid'],'You just broke your record of your longest jump! Your new record is: %.2f meters!' % (distance*0.01905))
es.tell(ev['userid'],'You are now ranked %s of %s. Longest jump overall is %.2f meters by %s' % (rank,allplayers,rDistance,rName))
extendedstats.players.update(steamid,'jump_startpos',None)
开发者ID:laiello,项目名称:extendedstats,代码行数:23,代码来源:extendedevents.py
示例11: player_changename
def player_changename(ev):
if not es.isbot(ev['userid']):
dbg( 'player changed name')
steamid = sid(ev)
newname = ev['newname']
players.name(steamid,newname)
开发者ID:laiello,项目名称:extendedstats,代码行数:6,代码来源:dod.py
示例12: vip_escaped
def vip_escaped(ev):
if not es.isbot(ev['userid']):
dbg( 'vip escaped')
players.increment(sid(ev),'vip_escaped')
开发者ID:laiello,项目名称:extendedstats,代码行数:4,代码来源:tf.py
示例13: dod_bomb_defused
def dod_bomb_defused(ev):
if not es.isbot(ev['userid']):
dbg( 'bomb defused')
players.increment(sid(ev),'bomb_defused')
开发者ID:laiello,项目名称:extendedstats,代码行数:4,代码来源:dod.py
示例14: bomb_dropped
def bomb_dropped(ev):
if not es.isbot(ev['userid']):
dbg( 'bomb dropped')
steamid = sid(ev)
if steamid:
players.increment(sid(ev),'bomb_dropped')
开发者ID:laiello,项目名称:extendedstats,代码行数:6,代码来源:tf.py
示例15: dod_capture_blocked
def dod_capture_blocked(ev):
if not es.isbot(ev['userid']):
dbg( 'capture blocked')
players.increment(sid(ev),'dod_blocks')
开发者ID:laiello,项目名称:extendedstats,代码行数:4,代码来源:dod.py
示例16: player_changeclass
def player_changeclass(ev):
dbg( 'player changed class')
dbg( ev['class'])
pass
开发者ID:laiello,项目名称:extendedstats,代码行数:4,代码来源:dod.py
示例17: load
def load():
dbg('XS: loading dod events...')
开发者ID:laiello,项目名称:extendedstats,代码行数:2,代码来源:dod.py
示例18: bomb_exploded
def bomb_exploded(ev):
if not es.isbot(ev['userid']):
dbg( 'bomb exploded')
players.increment(sid(ev),'bomb_exploded')
开发者ID:laiello,项目名称:extendedstats,代码行数:4,代码来源:tf.py
示例19: bomb_pickup
def bomb_pickup(ev):
if not es.isbot(ev['userid']):
dbg( 'bomb pickup')
players.increment(sid(ev),'bomb_pickup')
开发者ID:laiello,项目名称:extendedstats,代码行数:4,代码来源:tf.py
示例20: flashbang_detonate
def flashbang_detonate(ev):
if not es.isbot(ev['userid']):
dbg( 'flashbang detonate')
players.increment(sid(ev),'flashbang_detonate')
开发者ID:laiello,项目名称:extendedstats,代码行数:4,代码来源:tf.py
注:本文中的extendedstats.extendedstats.dbg函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论