コード例 #1
0
ファイル: commands.py プロジェクト: Herocraft/cuwo
def pm(script, name, *args):
    player = get_player(script.server, name)
    message = ' '.join(args)
    player.send_chat('%s (PM): %s' % (script.connection.name, message))
    print '%s to %s (PM): %s' % (script.connection.name, player.name, message)
    return 'PM sent to player.name'
    bot.me('%s to %s (PM): %s' % (script.connection.name, player.name, message))
コード例 #2
0
ファイル: commands.py プロジェクト: Herocraft/cuwo
def stun(script, name, stun_duration=500):
    player = get_player(script.server, name)
    damage_player(script, player, stun_duration=stun_duration)
    message = '%s was stunned' % player.name
    print message
    script.server.send_chat(message)
    bot.me(message)
コード例 #3
0
ファイル: commands.py プロジェクト: Herocraft/cuwo
def kill(script, name):
    player = get_player(script.server, name)
    damage_player(script, player, damange=player.entity_data.hp + 100.0)
    message = '%s was killed' % player.name
    print message
    script.server.send_chat(message)
    bot.me(message)
コード例 #4
0
ファイル: commands.py プロジェクト: xEnt22/cuwo
def whereis(script, name = None):
    if name is None:
        player = script.protocol
        message = 'You are at %s'
    else:
        player = get_player(script.factory, name)
        message = '%s is at %%s' % player.get_name()
    return message % (get_chunk(player.get_position()),)
コード例 #5
0
ファイル: commands.py プロジェクト: Herocraft/cuwo
def whereis(script, name=None):
    if name is None:
        player = script.connection
        message = 'You are at %s'
    else:
        player = get_player(script.server, name)
        message = '%s is at %%s' % player.name
    return message % (get_chunk(player.position),)
コード例 #6
0
ファイル: commands.py プロジェクト: IFraserAu/cuwo
def kill(script, name):
    player = get_player(script.server, name)
    packet = HitPacket()
    packet.entity_id = player.entity_id
    packet.target_id = player.entity_id
    packet.hit_type = HIT_NORMAL
    packet.damage = player.entity_data.hp + 1000.0
    packet.critical = 1
    packet.stun_duration = 0
    packet.something8 = 0
    packet.pos = player.position
    packet.hit_dir = Vector3()
    packet.skill_hit = 0
    packet.show_light = 0
    script.server.update_packet.player_hits.append(packet)
    message = '%s was killed' % player.name
    print message
    script.server.send_chat(message)
コード例 #7
0
ファイル: commands.py プロジェクト: xEnt22/cuwo
def kick(script, name):
    player = get_player(script.factory, name)
    player.kick()
コード例 #8
0
ファイル: ban.py プロジェクト: IFraserAu/cuwo
def ban(script, name, *args):
    player = get_player(script.server, name)
    reason = ' '.join(args) or DEFAULT_REASON
    script.parent.ban(player.address.host, reason)
コード例 #9
0
ファイル: web.py プロジェクト: MazeXD/cuwo-scripts
 def ban_player(self, player_id, *args):
     player = get_player(self.server, "#" + player_id)
     reason = ' '.join(args) or "No reason specified"
     self.server.call_scripts('ban', player.address.host, reason)
     return json.dumps({"response": "Success"})
コード例 #10
0
ファイル: web.py プロジェクト: MazeXD/cuwo-scripts
 def kick_player(self, player_id):
     player = get_player(self.server, "#" + player_id)
     player.kick()
     return json.dumps({"response": "Success"})
コード例 #11
0
ファイル: web.py プロジェクト: PrinzJuliano/cuwo-scripts
 def ban_player(self, player_id, *args):
     player = get_player(self.server, "#" + player_id)
     reason = ' '.join(args) or "No reason specified"
     self.server.call_scripts('ban', player.address.host, reason)
     return json.dumps({"response": "Success"})
コード例 #12
0
ファイル: web.py プロジェクト: PrinzJuliano/cuwo-scripts
 def kick_player(self, player_id):
     player = get_player(self.server, "#" + player_id)
     player.kick()
     return json.dumps({"response": "Success"})
コード例 #13
0
ファイル: commands.py プロジェクト: Herocraft/cuwo
def kick(script, name):
    player = get_player(script.server, name)
    player.kick()
コード例 #14
0
ファイル: commands.py プロジェクト: Herocraft/cuwo
def getip(script, name):
    player = get_player(script.server, name)
    playerIP = player.connection.host
    return playerIP
コード例 #15
0
ファイル: handler.py プロジェクト: MazeXD/cuwo-webapi
 def get_player(self, name):
     if not name or not isinstance(name, basestring):
         raise InvalidPlayer()
     return get_player(self.server, name)