Exemplo n.º 1
0
    def player_joined(self):
        ServerProtocol.player_joined(self)

        self.ip = self.remote_addr.host
        self.eid = dats.getFreeId()
        self.fquid = self.username + "[/" + self.ip + "](" + str(self.uuid) + ")"
        self.base_scba_split = list("PyMINESERVER")
        self.anim_i = 0
        eobj_byid[self.eid] = self
        self.logger.info("UUID of player Dragon5232 is " + str(self.uuid))
        
        p.game(self, self.eid, 1, 0, 1, options.maxplayers, "default", False)
        p.spawn_pos(self, 0, 66, 0)
        p.abilities(self, True, True, True, True, 0.2, 0.2)
        p.pos_look(self, 0, 66, 0, 0, 0, False)
        p.rain(self, True)
        p.empty_chunk(self, 0, 0)
        p.block_change(self, 0, 64, 0, 1)
        if self.protocol_version == 47: p.plist_head_foot(self, u"§6P§2yMINESERVER§r", u"§eEnjoy the Test§r")
        if self.protocol_version == 47: self.tasks.add_loop(1.0/20, self.anim_frame_scb)
        relayPlayerList()
        self.logger.info(self.username + "[/" + self.ip + "] logged in with entity id " + str(self.eid) + " at ([nonexistent](0.0, 64.0, 0.0))")
        
        # Schedule 6-second sending of keep-alive packets.
        self.tasks.add_loop(6, self.keepalive_send)
        
        self.eobj_byid = eobj_byid
        pushChat(self, "\u00A7e" + self.username + " has joined the game\u00A7r", 1)
        
        # Send welcome title and subtitle
        p.title(self, options.wtitle)
        p.subtitle(self, options.wst)
        
        p.chat_json(self, dats.join_json(self), 1)
Exemplo n.º 2
0
 def anim_frame_scb(self):
     self.sstmp = self.base_scba_split
     if self.anim_i >= len(self.sstmp): self.anim_i = 0
     self.sstmp[self.anim_i] = u"§6" + self.sstmp[anim_i] + u"§2"
     p.plist_head_foot(self, u"§2" + sstmp + u"§r", u"§eEnjoy the Test§r")
     anim_i += 1