Package gwlpr.mapshard.models

Examples of gwlpr.mapshard.models.ClientBean


     */
    @Event.Handler
    public void onPingReply(P003_PingReply pingReply)
    {
        // update the client's latency
        ClientBean client = ClientBean.get(pingReply.getChannel());
       
        int latency = (int) (System.currentTimeMillis() - lastPingTimeStamp);
        client.setLatency(latency);
       
        TimeDeltaView.pingReply(client.getChannel(), latency);
    }
View Full Code Here


     * @param pingRequest
     */
    @Event.Handler
    public void onPingRequest(P005_PingRequest pingRequest)
    {
        ClientBean client = ClientBean.get(pingRequest.getChannel());
       
        TimeDeltaView.pingReply(client.getChannel(), client.getLatency());
    }
View Full Code Here

        else if (!senderChatOptions.availableCommands.contains(command))
        {
            // command is not available for the sender
           
            // try to get the client
            ClientBean client = clientRegistry.getObj(chatCmd.getSender().getUuid());
           
            if (client == null) { return; }

            // if the sender was a network client (as opposed to NPCs etc.)
            // we'll tell her that the execution failed:
            String cmdFailed = "The command does not exist or you dont have sufficient permissions to execute it.";
           
            ChatMessageView.sendMessage(
                    client.getChannel(),
                    0,
                    ChatColor.DarkOrange_DarkOrange,
                    Strings.CmdNotAvail.text());
           
            return;
View Full Code Here

    public void onValidateCreatedCharacter(P132_ValidateCreatedCharacter action)
    {
        LOGGER.debug("Got the validate created character packet");

        // extract the session and attachment...
        ClientBean client = ClientBean.get(action.getChannel());

        // extract the data of the new char
        String characterName = action.getCharName();

        // get character properties
        byte[] appearance = action.getAppearanceAndProfession();
       
        byte sex = (byte) (appearance[0] & 1);
        byte height = (byte) ((appearance[0] >> 1) & 0xF);
        byte skin = (byte) (((appearance[0] >> 5) | (appearance[1] << 3)) & 0x1F);
        byte haircolor = (byte) ((appearance[1] >> 2) & 0x1F);
        byte face = (byte) (((appearance[1] >> 7) | (appearance[2] << 1)) & 0x1F);
        byte hairstyle = (byte) (appearance[3] & 0x1F);
        byte campaign = (byte) ((appearance[3] >> 6) & 3);

        // extract the professions
        byte primary = (byte) ((appearance[2] >> 4) & 0xF);
        byte secondary = 0;

        // perform some unkown action...
        CharacterCreationView.unkownStep1(action.getChannel());

        Character chara = CharacterJpaController.get().findByName(characterName);
       
        // if name is in use ....
        if (chara != null)
        {
            CharacterCreationView.error(action.getChannel(), ErrorCode.CCNameInUse);
        }

        // if name is not in use create a new char in the db
        Character dbChar = new Character();
        dbChar.setName(characterName);
        dbChar.setAccountID(client.getAccount());
        dbChar.setSex((short)sex);
        dbChar.setHeight((short)height);
        dbChar.setHeight((short)skin);
        dbChar.setFace((short)face);
        dbChar.setHaircolor((short)haircolor);
View Full Code Here

     */
    @Event.Handler
    public void onEntityCanSeeOther(CanSeeEvent canSee)
    {
        // check if this entity is a network client
        ClientBean client = clientRegistry.getObj(canSee.getThisEntity().getUuid());
        if (client == null) { return; }

        Entity et = canSee.getOtherEntity();

        EntitySpawningView.spawnAgent(client.getChannel(), et);
    }
View Full Code Here

     */
    @Event.Handler
    public void onEntityLostSight(LostSightEvent lostSight)
    {
        // check if this entity is a network client
        ClientBean client = clientRegistry.getObj(lostSight.getThisEntity().getUuid());
        if (client == null) { return; }

        Entity et = lostSight.getOtherEntity();

        // send the despawn packets
        EntitySpawningView.despawnAgent(client.getChannel(), et);
    }
View Full Code Here

TOP

Related Classes of gwlpr.mapshard.models.ClientBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.