Ejemplo n.º 1
0
 public override void readPacketData(DataInputStream datainputstream)
 {
     protocolVersion = datainputstream.readInt();
     username        = datainputstream.readUTF();
     password        = datainputstream.readUTF();
     mapSeed         = datainputstream.readLong();
     dimension       = datainputstream.readByte();
 }
Ejemplo n.º 2
0
 public override void readPacketData(DataInputStream datainputstream)
 {
     windowId      = datainputstream.readByte();
     inventoryType = datainputstream.readByte();
     windowTitle   = datainputstream.readUTF();
     slotsCount    = datainputstream.readByte();
 }
Ejemplo n.º 3
0
        // Token: 0x060006E0 RID: 1760 RVA: 0x0005C1C4 File Offset: 0x0005A3C4
        public static void checkRMS()
        {
            MyVector myVector = new MyVector();

            sbyte[] array = Rms.loadRMS("ImageSource");
            if (array == null)
            {
                Service.gI().imageSource(myVector);
                return;
            }
            ImageSource.vRms = new MyVector();
            DataInputStream dataInputStream = new DataInputStream(array);

            if (dataInputStream == null)
            {
                return;
            }
            try
            {
                short    num    = dataInputStream.readShort();
                string[] array2 = new string[(int)num];
                sbyte[]  array3 = new sbyte[(int)num];
                for (int i = 0; i < (int)num; i++)
                {
                    array2[i] = dataInputStream.readUTF();
                    array3[i] = dataInputStream.readByte();
                    ImageSource.vRms.addElement(new ImageSource(array2[i], array3[i]));
                }
                dataInputStream.close();
            }
            catch (Exception ex)
            {
                ex.StackTrace.ToString();
            }
            Res.outz(string.Concat(new object[]
            {
                "vS size= ",
                ImageSource.vSource.size(),
                " vRMS size= ",
                ImageSource.vRms.size()
            }));
            for (int j = 0; j < ImageSource.vSource.size(); j++)
            {
                ImageSource imageSource = (ImageSource)ImageSource.vSource.elementAt(j);
                if (!ImageSource.isExistID(imageSource.id))
                {
                    myVector.addElement(imageSource);
                }
            }
            for (int k = 0; k < ImageSource.vRms.size(); k++)
            {
                ImageSource imageSource2 = (ImageSource)ImageSource.vRms.elementAt(k);
                if ((int)ImageSource.getVersionRMSByID(imageSource2.id) != (int)ImageSource.getCurrVersionByID(imageSource2.id))
                {
                    myVector.addElement(imageSource2);
                }
            }
            Service.gI().imageSource(myVector);
        }
Ejemplo n.º 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public String readUTF() throws java.io.IOException
        public override string readUTF()
        {
            if (currentOffset >= maxOffset)
            {
                throw new EOFException();
            }
            return(DataInputStream.readUTF(this));
        }
Ejemplo n.º 5
0
 public override void readPacketData(DataInputStream datainputstream)
 {
     entityId  = datainputstream.readInt();
     title     = datainputstream.readUTF();
     xPosition = datainputstream.readInt();
     yPosition = datainputstream.readInt();
     zPosition = datainputstream.readInt();
     direction = datainputstream.readInt();
 }
Ejemplo n.º 6
0
 public override void readPacketData(DataInputStream datainputstream)
 {
     xPosition = datainputstream.readInt();
     yPosition = datainputstream.readShort();
     zPosition = datainputstream.readInt();
     signLines = new string[4];
     for (int i = 0; i < 4; i++)
     {
         signLines[i] = datainputstream.readUTF();
     }
 }
Ejemplo n.º 7
0
 public override void readPacketData(DataInputStream datainputstream)
 {
     entityId    = datainputstream.readInt();
     name        = datainputstream.readUTF();
     xPosition   = datainputstream.readInt();
     yPosition   = datainputstream.readInt();
     zPosition   = datainputstream.readInt();
     rotation    = datainputstream.readByte();
     pitch       = datainputstream.readByte();
     currentItem = datainputstream.readShort();
 }
Ejemplo n.º 8
0
    // Token: 0x06000086 RID: 134 RVA: 0x00008864 File Offset: 0x00006A64
    public static string loadRMSString(string fileName)
    {
        sbyte[] array = Rms.loadRMS(fileName);
        if (array == null)
        {
            return(null);
        }
        DataInputStream dataInputStream = new DataInputStream(array);

        try
        {
            string result = dataInputStream.readUTF();
            dataInputStream.close();
            return(result);
        }
        catch (Exception ex)
        {
            Cout.println(ex.StackTrace);
        }
        return(null);
    }
Ejemplo n.º 9
0
 public virtual string readUTF()
 {
     return(input.readUTF());
 }
Ejemplo n.º 10
0
 public override void readPacketData(DataInputStream datainputstream)
 {
     message = datainputstream.readUTF();
 }
Ejemplo n.º 11
0
            public virtual Void Run()
            {
                String homeDir = System.getProperty("java.home");

                try
                {
                    String dataFile = homeDir + File.separator + "lib" + File.separator + "currency.data";
                    using (DataInputStream dis = new DataInputStream(new BufferedInputStream(new FileInputStream(dataFile))))
                    {
                        if (dis.readInt() != MAGIC_NUMBER)
                        {
                            throw new InternalError("Currency data is possibly corrupted");
                        }
                        FormatVersion = dis.readInt();
                        if (FormatVersion != VALID_FORMAT_VERSION)
                        {
                            throw new InternalError("Currency data format is incorrect");
                        }
                        DataVersion = dis.readInt();
                        MainTable   = ReadIntArray(dis, A_TO_Z * A_TO_Z);
                        int scCount = dis.readInt();
                        ScCutOverTimes             = ReadLongArray(dis, scCount);
                        ScOldCurrencies            = ReadStringArray(dis, scCount);
                        ScNewCurrencies            = ReadStringArray(dis, scCount);
                        ScOldCurrenciesDFD         = ReadIntArray(dis, scCount);
                        ScNewCurrenciesDFD         = ReadIntArray(dis, scCount);
                        ScOldCurrenciesNumericCode = ReadIntArray(dis, scCount);
                        ScNewCurrenciesNumericCode = ReadIntArray(dis, scCount);
                        int ocCount = dis.readInt();
                        OtherCurrencies            = dis.readUTF();
                        OtherCurrenciesDFD         = ReadIntArray(dis, ocCount);
                        OtherCurrenciesNumericCode = ReadIntArray(dis, ocCount);
                    }
                }
                catch (IOException e)
                {
                    throw new InternalError(e);
                }

                // look for the properties file for overrides
                String propsFile = System.getProperty("java.util.currency.data");

                if (propsFile == null)
                {
                    propsFile = homeDir + File.separator + "lib" + File.separator + "currency.properties";
                }
                try
                {
                    File propFile = new File(propsFile);
                    if (propFile.Exists())
                    {
                        Properties props = new Properties();
                        using (FileReader fr = new FileReader(propFile))
                        {
                            props.Load(fr);
                        }
                        Set <String> keys = props.StringPropertyNames();
                        Pattern      propertiesPattern = Pattern.Compile("([A-Z]{3})\\s*,\\s*(\\d{3})\\s*,\\s*" + "(\\d+)\\s*,?\\s*(\\d{4}-\\d{2}-\\d{2}T\\d{2}:" + "\\d{2}:\\d{2})?");
                        foreach (String key in keys)
                        {
                            ReplaceCurrencyData(propertiesPattern, key.ToUpperCase(Locale.ROOT), props.GetProperty(key).ToUpperCase(Locale.ROOT));
                        }
                    }
                }
                catch (IOException e)
                {
                    Info("currency.properties is ignored because of an IOException", e);
                }
                return(null);
            }
Ejemplo n.º 12
0
 public override void readPacketData(DataInputStream datainputstream)
 {
     username = datainputstream.readUTF();
 }
Ejemplo n.º 13
0
        public static List readWatchableObjects(DataInputStream datainputstream)
        {
            ArrayList arraylist = null;

            for (byte byte0 = datainputstream.readByte(); byte0 != 127; byte0 = datainputstream.readByte())
            {
                if (arraylist == null)
                {
                    arraylist = new ArrayList();
                }
                int             i = (byte0 & 0xe0) >> 5;
                int             j = byte0 & 0x1f;
                WatchableObject watchableobject = null;
                switch (i)
                {
                case 0:     // '\0'
                    watchableobject = new WatchableObject(i, j, Byte.valueOf(datainputstream.readByte()));
                    break;

                case 1:     // '\001'
                    watchableobject = new WatchableObject(i, j, Short.valueOf(datainputstream.readShort()));
                    break;

                case 2:     // '\002'
                    watchableobject = new WatchableObject(i, j, Integer.valueOf(datainputstream.readInt()));
                    break;

                case 3:     // '\003'
                    watchableobject = new WatchableObject(i, j, Float.valueOf(datainputstream.readFloat()));
                    break;

                case 4:     // '\004'
                    watchableobject = new WatchableObject(i, j, datainputstream.readUTF());
                    break;

                case 5:     // '\005'
                    short word0 = datainputstream.readShort();
                    byte  byte1 = datainputstream.readByte();
                    short word1 = datainputstream.readShort();
                    watchableobject = new WatchableObject(i, j, new ItemStack(word0, byte1, word1));

                    // fall through (not.. c#..)

                    int k2  = datainputstream.readInt();
                    int l2  = datainputstream.readInt();
                    int i12 = datainputstream.readInt();
                    watchableobject = new WatchableObject(i, j, new ChunkCoordinates(k2, l2, i12));

                    break;

                case 6:     // '\006'
                    int k  = datainputstream.readInt();
                    int l  = datainputstream.readInt();
                    int i1 = datainputstream.readInt();
                    watchableobject = new WatchableObject(i, j, new ChunkCoordinates(k, l, i1));
                    break;
                }
                arraylist.add(watchableobject);
            }

            return(arraylist);
        }