Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
Перевод админки
#1
возникла проблема, я перевел все что находиться в папке (AE-go_GameServer\data\scripts\system\handlers\admincommands) , ну и получил одни вопросы, скажите как правильно перевести на русский?
Абсолютно счастливый человек лишь тот, который ни о чем не думает.
Ответ
#2
А на какой ты перевел?
Ответ
#3
русский и получились супер "квадратные вопросы" в чатеSad
допустим
Код:
/*
* This file is part of aion-unique <aion-unique.org>.
*
*  aion-unique is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  aion-unique is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with aion-unique.  If not, see <http://www.gnu.org/licenses/>.
*/
package admincommands;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.aionemu.gameserver.configs.administration.AdminConfig;
import com.aionemu.gameserver.model.gameobjects.Item;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.model.gameobjects.player.SkillListEntry;
import com.aionemu.gameserver.model.group.PlayerGroup;
import com.aionemu.gameserver.model.legion.Legion;
import com.aionemu.gameserver.model.legion.LegionMemberEx;
import com.aionemu.gameserver.services.LegionService;
import com.aionemu.gameserver.utils.PacketSendUtility;
import com.aionemu.gameserver.utils.Util;
import com.aionemu.gameserver.utils.chathandlers.AdminCommand;
import com.aionemu.gameserver.world.World;
import com.google.inject.Inject;

/**
* @author lyahim
*
*/
public class PlayerInfo extends AdminCommand
{
    @Inject
    private World    world;
    
    @Inject
    private LegionService legionService;
    
    private final static int showLineNumber = 20;

    public PlayerInfo()
    {
        super("playerinfo");
    }

    /* (non-Javadoc)
     * @see com.aionemu.gameserver.utils.chathandlers.AdminCommand#executeCommand(com.aionemu.gameserver.model.gameobjects.player.Player, java.lang.String[])
     */
    @SuppressWarnings("unchecked")
    @Override
    public void executeCommand(Player admin, String[] params)
    {
        if (admin.getAccessLevel() < AdminConfig.COMMAND_PLAYERINFO)
        {
            PacketSendUtility.sendMessage(admin, "You dont have enough rights to execute this command");
            return;
        }        
        
        if(params == null || params.length < 1)
        {
            PacketSendUtility.sendMessage(admin, "syntax //playerinfo <playername> <loc | item | group | skill | legion> ");
            return;
        }
        
        Player target = world.findPlayer(Util.convertName(params[0]));
        
        if(target == null)
        {
            PacketSendUtility.sendMessage(admin, "Selected player cannot online!");
            return;
        }

        PacketSendUtility.sendMessage(admin, "\n[Info about " + target.getName() + "]\n-common: lv" + target.getLevel() + "(" + target.getCommonData().getExpShown()+ " xp), " + target.getCommonData().getRace() + ", " + target.getPlayerClass() +"\n-ip: " + target.getClientConnection().getIP() + "\n" + "-account name: " + target.getClientConnection().getAccount().getName() + "\n" + "-online: ~" + (System.currentTimeMillis() - target.getCommonData().getLastOnline().getTime())/60000 + " minute(s)\n");
        
        if(params.length < 2)
            return;
                
        if(params[1].equals("item"))
        {
            StringBuilder strbld = new StringBuilder("-items in inventory:\n");
            
            List<Item> items = target.getInventory().getAllItems();
            Iterator it = items.iterator();
            
            if(items.isEmpty())
                strbld.append("none\n");
            else
            {
                while(it.hasNext())
                {
                    
                    Item act = (Item)it.next();
                    strbld.append("    " + act.getItemCount() + "(s) of " + "[item:"+act.getItemTemplate().getTemplateId() + "]" + "\n");
                }
            }
            items.clear();
            items = target.getEquipment().getEquippedItems();
            it = items.iterator();
            strbld.append("-equipped items:\n");
            if(items.isEmpty())
                strbld.append("none\n");
            else
            {
                while(it.hasNext())
                {
                    Item act = (Item)it.next();
                    strbld.append("    " + act.getItemCount() + "(s) of " + "[item:"+act.getItemTemplate().getTemplateId() + "]" + "\n");
                }
            }
            
            items.clear();
            items = target.getWarehouse().getAllItems();
            it = items.iterator();
            strbld.append("-items in warehouse:\n");
            if(items.isEmpty())
                strbld.append("none\n");
            else
            {
                while(it.hasNext())
                {
                    Item act = (Item)it.next();
                    strbld.append("    " + act.getItemCount() + "(s) of " + "[item:"+act.getItemTemplate().getTemplateId() + "]" + "\n");
                }
            }
            showAllLines(admin, strbld.toString());
        }
        else if(params[1].equals("group"))
        {
            StringBuilder strbld = new StringBuilder("-group info:\n  Leader: ");
            
            PlayerGroup group = target.getPlayerGroup();
            if(group == null)
                PacketSendUtility.sendMessage(admin, "-group info: no group");
            else
            {
                Iterator it = group.getMembers().iterator();
                
                strbld.append(group.getGroupLeader().getName() + "\n  Members:\n");
                while(it.hasNext())
                {
                    Player act = (Player)it.next();
                    strbld.append("    " + act.getName() + "\n");
                }
                PacketSendUtility.sendMessage(admin, strbld.toString());
            }
        }
        else if(params[1].equals("skill"))
        {
            StringBuilder strbld = new StringBuilder("-list of skills:\n");
            
            SkillListEntry sle[] = target.getSkillList().getAllSkills();
            
            for(int i = 0; i < sle.length; i++)
            {
                strbld.append("    level " + sle[i].getSkillLevel() + " of " + sle[i].getSkillName()+ "\n");
            }
            showAllLines(admin, strbld.toString());
        }
        else if(params[1].equals("loc"))
        {
            PacketSendUtility.sendMessage(admin,"-location:\n  mapid: " + target.getWorldId() + "\n  X: " + target.getX() + " Y: " + target.getY() + "Z: " + target.getZ() + "heading: " + target.getHeading());
        }
        else if(params[1].equals("legion"))
        {
            StringBuilder strbld = new StringBuilder();

            Legion legion = target.getLegion();
            if(legion == null)
                PacketSendUtility.sendMessage(admin, "-legion info: no legion");
            else
            {
                ArrayList<LegionMemberEx> legionmemblist = legionService.loadLegionMemberExList(legion);
                Iterator it = legionmemblist.iterator();
                
                strbld.append("-legion info:\n  name: " + legion.getLegionName() + ", level: " + legion.getLegionLevel() + "\n  members(online):\n");
                while(it.hasNext())
                {
                    LegionMemberEx act = (LegionMemberEx)it.next();
                    strbld.append("    " + act.getName() + "(" + ((act.isOnline()==true)?"online":"offline") + ")" + act.getRank().toString() + "\n");
                }
            }
            showAllLines(admin, strbld.toString());
        }
        else
        {
            PacketSendUtility.sendMessage(admin, "bad switch!");
            PacketSendUtility.sendMessage(admin, "syntax //playerinfo <playername> <loc | item | group | skill | legion> ");
        }
    }
    private void showAllLines(Player admin, String str)
    {
        int index = 0;
        String[] strarray = str.split("\n");
        
        while(index < strarray.length - showLineNumber)
        {
            StringBuilder strbld = new StringBuilder();
            for(int i = 0;i < showLineNumber; i++, index++)
            {
                strbld.append(strarray[index]);
                if(i < showLineNumber - 1) strbld.append("\n");
            }
            PacketSendUtility.sendMessage(admin, strbld.toString());
        }
        int odd = strarray.length - index;
        StringBuilder strbld = new StringBuilder();
        for(int i = 0;i < odd; i++, index++)
        {
            strbld.append(strarray[index] + "\n");
        }
        PacketSendUtility.sendMessage(admin, strbld.toString());
    }
}

на

Код:
/*
* This file is part of aion-unique <aion-unique.org>.
*
*  aion-unique is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  aion-unique is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with aion-unique.  If not, see <http://www.gnu.org/licenses/>.
*/
package admincommands;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.aionemu.gameserver.configs.administration.AdminConfig;
import com.aionemu.gameserver.model.gameobjects.Item;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.model.gameobjects.player.SkillListEntry;
import com.aionemu.gameserver.model.group.PlayerGroup;
import com.aionemu.gameserver.model.legion.Legion;
import com.aionemu.gameserver.model.legion.LegionMemberEx;
import com.aionemu.gameserver.services.LegionService;
import com.aionemu.gameserver.utils.PacketSendUtility;
import com.aionemu.gameserver.utils.Util;
import com.aionemu.gameserver.utils.chathandlers.AdminCommand;
import com.aionemu.gameserver.world.World;
import com.google.inject.Inject;

/**
* @author lyahim
*
*/
public class PlayerInfo extends AdminCommand
{
    @Inject
    private World    world;
    
    @Inject
    private LegionService legionService;
    
    private final static int showLineNumber = 20;

    public PlayerInfo()
    {
        super("playerinfo");
    }

    /* (non-Javadoc)
     * @see com.aionemu.gameserver.utils.chathandlers.AdminCommand#executeCommand(com.aionemu.gameserver.model.gameobjects.player.Player, java.lang.String[])
     */
    @SuppressWarnings("unchecked")
    @Override
    public void executeCommand(Player admin, String[] params)
    {
        if (admin.getAccessLevel() < AdminConfig.COMMAND_PLAYERINFO)
        {
            PacketSendUtility.sendMessage(admin, "Вы не имеете достаточно прав для выполнения этой команды!");
            return;
        }        
        
        if(params == null || params.length < 1)
        {
            PacketSendUtility.sendMessage(admin, "команда //playerinfo <имя персонажа> <loc | item | group | skill | legion> ");
            return;
        }
        
        Player target = world.findPlayer(Util.convertName(params[0]));
        
        if(target == null)
        {
            PacketSendUtility.sendMessage(admin, "Указаный игрок не в игре");
            return;
        }

        PacketSendUtility.sendMessage(admin, "\n[Информация персонажа" + target.getName() + "]\n-Персонаж: lv" + target.getLevel() + "(" + target.getCommonData().getExpShown()+ " xp), " + target.getCommonData().getRace() + ", " + target.getPlayerClass() +"\n-IP: " + target.getClientConnection().getIP() + "\n" + "-Имя аккаунта: " + target.getClientConnection().getAccount().getName() + "\n" + "-Онлайн: ~" + (System.currentTimeMillis() - target.getCommonData().getLastOnline().getTime())/60000 + " minute(s)\n");
        
        if(params.length < 2)
            return;
                
        if(params[1].equals("item"))
        {
            StringBuilder strbld = new StringBuilder("-Предметы в инвенторе персонажа:\n");
            
            List<Item> items = target.getInventory().getAllItems();
            Iterator it = items.iterator();
            
            if(items.isEmpty())
                strbld.append("нету\n");
            else
            {
                while(it.hasNext())
                {
                    
                    Item act = (Item)it.next();
                    strbld.append("    " + act.getItemCount() + "(s) of " + "[item:"+act.getItemTemplate().getTemplateId() + "]" + "\n");
                }
            }
            items.clear();
            items = target.getEquipment().getEquippedItems();
            it = items.iterator();
            strbld.append("-equipped items:\n");
            if(items.isEmpty())
                strbld.append("нету\n");
            else
            {
                while(it.hasNext())
                {
                    Item act = (Item)it.next();
                    strbld.append("    " + act.getItemCount() + "(s) of " + "[item:"+act.getItemTemplate().getTemplateId() + "]" + "\n");
                }
            }
            
            items.clear();
            items = target.getWarehouse().getAllItems();
            it = items.iterator();
            strbld.append("-Предметы в банке персонажа:\n");
            if(items.isEmpty())
                strbld.append("нету\n");
            else
            {
                while(it.hasNext())
                {
                    Item act = (Item)it.next();
                    strbld.append("    " + act.getItemCount() + "(s) of " + "[item:"+act.getItemTemplate().getTemplateId() + "]" + "\n");
                }
            }
            showAllLines(admin, strbld.toString());
        }
        else if(params[1].equals("group"))
        {
            StringBuilder strbld = new StringBuilder("-Информация группы:\n  Лидер: ");
            
            PlayerGroup group = target.getPlayerGroup();
            if(group == null)
                PacketSendUtility.sendMessage(admin, "-Информация группы: не в группе");
            else
            {
                Iterator it = group.getMembers().iterator();
                
                strbld.append(group.getGroupLeader().getName() + "\n  В группе:\n");
                while(it.hasNext())
                {
                    Player act = (Player)it.next();
                    strbld.append("    " + act.getName() + "\n");
                }
                PacketSendUtility.sendMessage(admin, strbld.toString());
            }
        }
        else if(params[1].equals("skill"))
        {
            StringBuilder strbld = new StringBuilder("-list of skills:\n");
            
            SkillListEntry sle[] = target.getSkillList().getAllSkills();
            
            for(int i = 0; i < sle.length; i++)
            {
                strbld.append("    level " + sle[i].getSkillLevel() + " of " + sle[i].getSkillName()+ "\n");
            }
            showAllLines(admin, strbld.toString());
        }
        else if(params[1].equals("loc"))
        {
            PacketSendUtility.sendMessage(admin,"-Локация:\n  mapid: " + target.getWorldId() + "\n  X: " + target.getX() + " Y: " + target.getY() + "Z: " + target.getZ() + "heading: " + target.getHeading());
        }
        else if(params[1].equals("legion"))
        {
            StringBuilder strbld = new StringBuilder();

            Legion legion = target.getLegion();
            if(legion == null)
                PacketSendUtility.sendMessage(admin, "-legion info: no legion");
            else
            {
                ArrayList<LegionMemberEx> legionmemblist = legionService.loadLegionMemberExList(legion);
                Iterator it = legionmemblist.iterator();
                
                strbld.append("-Информация легиона:\n  name: " + legion.getLegionName() + ", Левел: " + legion.getLegionLevel() + "\n  Легионеры(онлайн):\n");
                while(it.hasNext())
                {
                    LegionMemberEx act = (LegionMemberEx)it.next();
                    strbld.append("    " + act.getName() + "(" + ((act.isOnline()==true)?"online":"offline") + ")" + act.getRank().toString() + "\n");
                }
            }
            showAllLines(admin, strbld.toString());
        }
        else
        {
            PacketSendUtility.sendMessage(admin, "bad switch!");
            PacketSendUtility.sendMessage(admin, "команда //playerinfo <имя персонажа> <loc | item | group | skill | legion> ");
        }
    }
    private void showAllLines(Player admin, String str)
    {
        int index = 0;
        String[] strarray = str.split("\n");
        
        while(index < strarray.length - showLineNumber)
        {
            StringBuilder strbld = new StringBuilder();
            for(int i = 0;i < showLineNumber; i++, index++)
            {
                strbld.append(strarray[index]);
                if(i < showLineNumber - 1) strbld.append("\n");
            }
            PacketSendUtility.sendMessage(admin, strbld.toString());
        }
        int odd = strarray.length - index;
        StringBuilder strbld = new StringBuilder();
        for(int i = 0;i < odd; i++, index++)
        {
            strbld.append(strarray[index] + "\n");
        }
        PacketSendUtility.sendMessage(admin, strbld.toString());
    }
}
Абсолютно счастливый человек лишь тот, который ни о чем не думает.
Ответ
#4
а ютф 8 или 16 прописал?
Ответ
#5
там вообще кодировки я не видел Sad может подскажешь на этом примере?)
Абсолютно счастливый человек лишь тот, который ни о чем не думает.
Ответ
#6
через час смогу помочь, ща убегаю просто.
Ответ
#7
ну кто то может поможет, хотя сам щас практическую делаю
Абсолютно счастливый человек лишь тот, который ни о чем не думает.
Ответ
#8
Shema ты имел ввиду файл перевести в кодировку UTF-8? Или какой то код прописать в файле? Вроде если один файл будет в кодировке UTF-8, а другие в ANSI ошибки при компиляции будут...
Ответ
#9
ну в общем хочу перевести на русский, перевести перевел, а вот в чате вопросы, выручайтеSmile
Абсолютно счастливый человек лишь тот, который ни о чем не думает.
Ответ
#10
Скинь этот патч я гляну
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  перевод кнфигов credboy 15 4,276 03-10-2011, 07:52 PM
Последний пост: ruso
  Перевод сервера на NO-IP Или хамачи Fil 3 4,105 04-27-2010, 02:57 PM
Последний пост: Mr.TeRay

Перейти к форуму:


Пользователи, просматривающие эту тему: 1 Гость(ей)