Example #1
0
 public itemData(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readShort();
     socket.readShort();
     int txtlength = socket.readShort();
     socket.readByteArray(txtlength);
 }
Example #2
0
        public entityEquipment(Wrapped.Wrapped sock, Form1 myform)
        {
            socket = sock;
            mainform = myform;

            handle();
        }
Example #3
0
        public EntTeleport(Wrapped.Wrapped socket, Form1 Mainform)
        {
            int EID = socket.readInt();
            int X = socket.readInt();
            int Y = socket.readInt();
            int Z = socket.readInt();
            byte yaw = socket.readByte();
            byte pitch = socket.readByte();
            functions helper = new functions();

            Classes.Entity thisEnt = helper.getEntbyID(EID, Mainform);

            if (thisEnt != null) {
                thisEnt.X = X ;
                thisEnt.Y = Y;
                thisEnt.Z = Z;
                thisEnt.yaw = yaw;
                thisEnt.pitch = pitch;

                if (Mainform.following == true && thisEnt.name == Mainform.fname) {
                    Mainform.location[0] = thisEnt.X / 32;
                    Mainform.location[1] = thisEnt.Y / 32;
                    Mainform.location[2] = thisEnt.Z / 32;
                    Mainform.location[3] = thisEnt.Y / 32 + 1;
                }
            }
        }
Example #4
0
 public Playerdigging(Wrapped.Wrapped socket, Form1 mainform, int option)
 {
     switch (option)
     {
         case 3:
             socket.writeByte(14);
             socket.writeByte((byte)option);
             socket.writeInt(0);
             socket.writeByte(0);
             socket.writeInt(0);
             socket.writeByte(0);
             break;
         case 4:
             socket.writeByte(14);
             socket.writeByte((byte)option);
             socket.writeInt(0);
             socket.writeByte(0);
             socket.writeInt(0);
             socket.writeByte(0);
             break;
         case 5:
             socket.writeByte(14);
             socket.writeByte((byte)option);
             socket.writeInt(0);
             socket.writeByte(0);
             socket.writeInt(0);
             socket.writeByte(255);
             break;
         default:
             break;
     }
 }
Example #5
0
        // Server-to-Client only
        public teams(Wrapped.Wrapped socket, Form1 Mainform)
        {
            List<string> players;
            string teamDisplayname;
            string teamPrefix;
            string teamSuffix;
            byte friendlyFire;
            short playerCount;

            string teamName = socket.readString();
            byte mode = socket.readByte();

            if (mode == 0 || mode == 2) {

                teamDisplayname = socket.readString();
                teamPrefix = socket.readString();
                teamSuffix = socket.readString();
                friendlyFire = socket.readByte();
            }
            if (mode == 0 || mode == 3 || mode == 4) {

                playerCount = socket.readShort();
                players = new List<string>();

                for (int i = 1; i < playerCount; i++) {
                    players.Add(socket.readString());
                }
            }
        }
Example #6
0
 public PluginMessage(Wrapped.Wrapped socket, Form1 Mainform)
 {
     socket.readString();
     int length = socket.readShort();
     if (length != 0)
         socket.readByteArray(length);
 }
Example #7
0
        public BulkChunks(Wrapped.Wrapped socket, Form1 mainform)
        {
            short columncount = socket.readShort();
            int Datalength = socket.readInt();
            bool skylight = socket.readBool();

            byte[] packdata = socket.readByteArray(Datalength);
            byte[] decompressed;

            byte[] trim = new byte[Datalength - 2];
            Chunk[] chunks = new Chunk[columncount];

            // Shoutout to BjorN64 for the simplification of this.
            Array.Copy(packdata, 2, trim, 0, Datalength - 2);

            // Decompress the data

            Classes.Decompressor dc = new Classes.Decompressor(trim);
            decompressed = dc.decompress();

            for (int i = 0; columncount > i; i++) {
                // Need to store this data so it's not lost as well..
                int x = socket.readInt();
                int z = socket.readInt();
                short pbitmap = socket.readShort();
                short abitmap = socket.readShort();

                chunks[i] = new Chunk(x, z, pbitmap, abitmap, skylight, true); // Assume true for Ground Up Continuous

                decompressed = chunks[i].getData(decompressed); // Calls the chunk class to take all of the bytes it needs, and return whats left.
                mainform.Chunks.Add(chunks[i]); // Add the chunk to the main form so we can use it later.
            }
        }
Example #8
0
 public EntEffect(Wrapped.Wrapped socket, Form1 Mainform)
 {
     socket.readInt();
     socket.readByte();
     socket.readByte();
     socket.readShort();
 }
Example #9
0
 public EntVelocity(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readInt();
     socket.readShort();
     socket.readShort();
     socket.readShort();
 }
Example #10
0
        public EntlookRelmove(Wrapped.Wrapped socket, Form1 mainform)
        {
            int EID = socket.readInt();
            sbyte dx = (sbyte)socket.readByte();
            sbyte dy = (sbyte)socket.readByte();
            sbyte dz = (sbyte)socket.readByte();
            byte yaw = socket.readByte();
            byte pitch = socket.readByte();
            functions helper = new functions();

            Classes.Entity thisEnt = helper.getEntbyID(EID, mainform);

            if (thisEnt != null) {
                thisEnt.yaw = yaw;
                thisEnt.pitch = pitch;
                thisEnt.X += dx;
                thisEnt.Y += dy;
                thisEnt.Z += dz;

                if (mainform.following == true && thisEnt.name == mainform.fname) {
                    mainform.location[0] = thisEnt.X / 32;
                    mainform.location[1] = thisEnt.Y / 32;
                    mainform.location[2] = thisEnt.Z /32;
                    mainform.location[3] = thisEnt.Y / 32 + 1;
                }
            }
        }
Example #11
0
        public BlockChange(Wrapped.Wrapped socket, Form1 Mainform)
        {
            int chunkX, chunkZ;

            int x = socket.readInt();
            byte y = socket.readByte();
            int z = socket.readInt();
            short blockID = socket.readShort();
            socket.readByte();

            chunkX = (int)Math.Floor(decimal.Divide(x, 16));
            chunkZ = (int)Math.Floor(decimal.Divide(z, 16));

            Classes.Chunk thisChunk = null;

            foreach (Classes.Chunk b in Mainform.Chunks) {
                if (b.x == chunkX & b.z == chunkZ) {
                    thisChunk = b;
                    break;
                }
            }

            if (blockID == 15 && Mainform.importing == true) {
                Mainform.importing = false;
                Classes.Importer Importer = new Classes.Importer(Mainform, Mainform.importName, x, (int)y, z);
              //  Thread importThread = new Thread(Importer.import);
               // importThread.Start();
                Importer.import();
            }
            if (thisChunk != null)
                thisChunk.updateBlock(x, y, z, blockID);
        }
Example #12
0
 public SpawnGlobalEntity(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readInt();
     socket.readByte();
     socket.readInt();
     socket.readInt();
     socket.readInt();
 }
Example #13
0
 /// <summary>
 /// Get longest words from the Trie.
 /// </summary>
 public ICollection<string> GetLongestWords()
 {
     var longestWords = new List<string>();
     var buffer = new StringBuilder();
     var length = new Wrapped<int>(0);
     GetLongestWords(rootTrieNode, longestWords, buffer, length);
     return longestWords;
 }
Example #14
0
 // 0 - Start digging
 // 2 - Finish digging
 // 3 - drop item stack
 // 4 - drop item
 // 5 - shoot arrow / finish eating
 // Face:
 // 0 - -y
 // 1 - +y
 // 2 - -z
 // 3 - +z
 // 4 - -x
 // 5 - +x
 public Playerdigging(Wrapped.Wrapped socket, Form1 mainform, int option, int x, int y, int z,byte face)
 {
     socket.writeByte(14);
     socket.writeByte((byte)option);
     socket.writeInt(x);
     socket.writeByte((byte)y);
     socket.writeInt(z);
     socket.writeByte(face);
 }
Example #15
0
 public Namedsound(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.readString();
     socket.readInt();
     socket.readInt();
     socket.readInt();
     socket.readFloat();
     socket.readByte();
 }
Example #16
0
 public ClientSettings(Wrapped.Wrapped socket, Form1 mainform)
 {
     socket.writeByte(0xcc);
     socket.writeString("en_US");
     socket.writeByte(1);
     socket.writeByte(4);
     socket.writeByte(2);
     socket.writeBool(false);
 }
Example #17
0
 public SpawnPainting(Wrapped.Wrapped socket, Form1 Mainform)
 {
     socket.readInt();
     socket.readString();
     socket.readInt();
     socket.readInt();
     socket.readInt();
     socket.readInt();
 }
Example #18
0
 public PlayerPosition(Wrapped.Wrapped Socket, Form1 Mainform)
 {
     Socket.writeByte(11);
     Socket.writeDouble(Math.Round(Mainform.location[0],1));
     Socket.writeDouble(Math.Round(Mainform.location[1],1));
     Socket.writeDouble(Math.Round(Mainform.location[3],1));
     Socket.writeDouble(Math.Round(Mainform.location[2],1));
     Socket.writeBool(Mainform.onground);
 }
Example #19
0
 public Handshake(Wrapped.Wrapped socket, Form1 asdf, bool outgoing = false)
 {
     sock = socket;
     myform = asdf;
     if (outgoing) {
         send();
     } else {
         handle();
     }
 }
Example #20
0
 public updateSign(Wrapped.Wrapped socket, Form1 Mainform)
 {
     socket.readInt();
     socket.readShort();
     socket.readInt();
     socket.readString();
     socket.readString();
     socket.readString();
     socket.readString();
 }
Example #21
0
 public CloseWindow(Wrapped.Wrapped socket, Form1 mainform, bool outgoing = false)
 {
     if (outgoing)
     {
         socket.writeByte(0x65);
         socket.writeByte(0);
     }
     else
     {
         socket.readByte();
     }
 }
Example #22
0
        public Entlook(Wrapped.Wrapped socket, Form1 mainform)
        {
            int EID = socket.readInt();
            byte yaw = socket.readByte();
            byte pitch = socket.readByte();
            functions helper = new functions();

            Classes.Entity thisEnt = helper.getEntbyID(EID,mainform);
            if (thisEnt != null) {
                thisEnt.yaw = yaw;
                thisEnt.pitch = pitch;
            }
        }
Example #23
0
        public PPaL(Wrapped.Wrapped socket, Form1 Mainform, bool outgoing = false)
        {
            Socket = socket;
            mainform = Mainform;

            if (outgoing)
            {
                send();
            }
            else
            {
                handle();
            }
        }
Example #24
0
        // Client to server only
        public placeBlock(int x, byte y, int z, byte dir, Item block, Wrapped.Wrapped sock)
        {
            functions helper = new functions();

            sock.writeByte(0x0F);
            sock.writeInt(x);
            sock.writeByte(y);
            sock.writeInt(z);
            sock.writeByte(dir);
            helper.writeSlot(block, sock);
            sock.writeByte(9);
            sock.writeByte(9);
            sock.writeByte(9);
        }
Example #25
0
        public Animation(Wrapped.Wrapped socket, Form1 Mainform, bool outgoing = false)
        {
            Socket = socket;
            mainform = Mainform;

            if (outgoing)
            {

            }
            else
            {
                handle();
            }
        }
Example #26
0
        public HeldItemChange(Wrapped.Wrapped Socket, Form1 Myform, bool outgoing = false)
        {
            socket = Socket;
            myform = Myform;

            if (outgoing)
            {
                send();
            }
            else
            {
                handle();
            }
        }
Example #27
0
        public chatMessage(Wrapped.Wrapped sock, Form1 myform, bool outgoing = false)
        {
            socket = sock;
            mainform = myform;

            if (outgoing)
            {
                send();
            }
            else
            {
                handle();
            }
        }
Example #28
0
        public SpawnNamedEntity(Wrapped.Wrapped socket, Form1 mainform)
        {
            int EID = socket.readInt();
            string Name = socket.readString();
            int X = socket.readInt();
            int Y = socket.readInt();
            int Z = socket.readInt();
            byte Yaw = socket.readByte();
            byte Pitch = socket.readByte();
            short heldItem = socket.readShort();
            functions parser = new functions();
            parser.readMetadata(socket);

            Classes.Entity newPlayer = new Classes.Entity(EID, Name, X, Y, Z, Yaw, Pitch, heldItem);
            mainform.Entitys.Add(newPlayer);
        }
Example #29
0
        public Explosion(Wrapped.Wrapped socket, Form1 mainform)
        {
            double ex = socket.readDouble();
            double ey = socket.readDouble();
            double ez = socket.readDouble();
            socket.readFloat();
            int count = socket.readInt();

            while (count != 0)
            {
                int x = (int)socket.readByte();
                int y = (int)socket.readByte();
                int z = (int)socket.readByte();

                // Convert to Absolute coords

                x = (int)ex + x;
                y = (int)ey + y;
                z = (int)ez + z;

                decimal ChunkX = decimal.Divide(x, 16);
                decimal ChunkZ = decimal.Divide(z, 16);

                ChunkX = Math.Floor(ChunkX);
                ChunkZ = Math.Floor(ChunkZ);

                Chunk thisChunk = null;

                foreach (Classes.Chunk b in mainform.Chunks) {
                    if (b.x == ChunkX & b.z == ChunkZ) {
                        thisChunk = b;
                        break;
                    }
                }

                if (thisChunk != null)
                   thisChunk.updateBlock(x, y, z, 0);

                count--;
            }

            socket.readFloat();
            socket.readFloat();
            socket.readFloat();
        }
Example #30
0
        public SpawnObj(Wrapped.Wrapped socket, Form1 mainform)
        {
            socket.readInt();
            socket.readByte();
            socket.readInt();
            socket.readInt();
            socket.readInt();
            socket.readByte();
            socket.readByte();
            // --
            int value = socket.readInt();

            if (value != 0)
            {
            socket.readShort();
            socket.readShort();
            socket.readShort();
            }
        }
 public void Verifiable()
 {
     Wrapped.Verifiable();
     VerifiableWrapper.Verifiable();
 }
 void ICollection <KeyValuePair <TKey, TValue> > .Add(KeyValuePair <TKey, TValue> item)
 {
     Wrapped.Add(item);
 }
Example #33
0
 public LynxAthleteReader(Reader wrapped) : base(wrapped)
 {
     Wrapped.Read(); // Throw away first line of .ppl file
 }
 bool IDictionary <TKey, TValue> .TryGetValue(TKey key, out TValue value)
 {
     return(Wrapped.TryGetValue(key, out value));
 }
 void ICollection <KeyValuePair <TKey, TValue> > .CopyTo(KeyValuePair <TKey, TValue>[] array, int arrayIndex)
 {
     Wrapped.CopyTo(array, arrayIndex);
 }
Example #36
0
 /// <summary>
 /// Зарегистрировать провайдер модулей.
 /// </summary>
 /// <param name="moduleType">Тип модуля. Может быть NULL.</param>
 /// <param name="provider">Провайдер.</param>
 public void RegisterProvider(Type moduleType, IModuleProvider provider)
 {
     Wrapped.RegisterProvider(moduleType, provider.AsWinRTProvider());
 }
Example #37
0
 public override string Read()
 {
     return(Wrapped.Read());
 }
Example #38
0
 void DeleteEvent(object obj, Gtk.DeleteEventArgs args)
 {
     Wrapped.Hide();
     args.RetVal = true;
 }
Example #39
0
 public void Verifiable(string failMessage)
 {
     Wrapped.Verifiable(failMessage);
     VerifiableWrapper.Verifiable(failMessage);
 }
Example #40
0
 public void SendProcessMessage(CefProcessId processId, ICefProcessMessage message)
 {
     Wrapped.SendProcessMessage((Xilium.CefGlue.CefProcessId)processId, message.Unwrap <CefProcessMessage>());
 }
Example #41
0
 /// <summary>
 /// Получить сводный провайдер модулей.
 /// </summary>
 /// <returns>Провайдер модулей.</returns>
 public ModuleInterface.IModuleProvider GetModuleProvider()
 {
     return(Wrapped.GetModuleProvider().AsWinRTProvider());
 }
Example #42
0
 /// <summary>
 /// Зарегистрировать провайдер модулей.
 /// </summary>
 /// <param name="moduleType">Тип модуля. Может быть NULL.</param>
 /// <param name="provider">Провайдер.</param>
 public void RegisterProvider(Type moduleType, ModuleInterface.IModuleProvider provider)
 {
     Wrapped.RegisterProvider(moduleType, provider.AsDotnetProvider());
 }
 IEnumerator <KeyValuePair <TKey, TValue> > IEnumerable <KeyValuePair <TKey, TValue> > .GetEnumerator()
 {
     return(Wrapped.GetEnumerator());
 }
Example #44
0
 public override bool CanResetValue(object component)
 {
     return(Wrapped.CanResetValue(component));
 }
Example #45
0
 public override void Close()
 {
     Wrapped.Close();
 }
Example #46
0
 public void RemoveAll(Predicate <IClientId> search)
 {
     Wrapped.RemoveAll(search);
 }
 bool ICollection <KeyValuePair <TKey, TValue> > .Remove(KeyValuePair <TKey, TValue> item)
 {
     return(Wrapped.Remove(item));
 }
Example #48
0
 public void Clear()
 {
     Wrapped.Clear();
 }
 bool IDictionary <TKey, TValue> .Remove(TKey key)
 {
     return(Wrapped.Remove(key));
 }
 bool ICollection <KeyValuePair <TKey, TValue> > .Contains(KeyValuePair <TKey, TValue> item)
 {
     return(Wrapped.Contains(item));
 }
Example #51
0
 public IEnumerator <string> GetEnumerator()
 {
     return(Wrapped.FindAll(_matcher).Select(ext => Query.ExtractParamValue(ext)).GetEnumerator());
 }
 public IThrowsResult Throws(Exception exception)
 {
     return(VerifiableWrapper.WrapThrowsForVerification(Wrapped.Throws(exception)));
 }
 public ProgressData GetCurrentProgress()
 {
     return(Wrapped.GetCurrentProgress());
 }
 public IThrowsResult Throws <TException>() where TException : Exception, new()
 {
     return(VerifiableWrapper.WrapThrowsForVerification(Wrapped.Throws <TException>()));
 }
            // Method.

            public float CalculateDistance(VisionWrapper destination)
            {
                return(Wrapped.CalculateDistance(destination.Wrapped));
            }
Example #56
0
 public override object GetValue(object component)
 {
     return(Wrapped.GetValue(component));
 }
Example #57
0
 /// <summary>
 /// Получить сводный провайдер модулей.
 /// </summary>
 /// <returns>Провайдер модулей.</returns>
 public IModuleProvider GetModuleProvider()
 {
     return(Wrapped.GetModuleProvider().AsDotnetProvider());
 }
 void ICollection <KeyValuePair <TKey, TValue> > .Clear()
 {
     Wrapped.Clear();
 }
Example #59
0
            // Methods.

            public float GetDistance(RegionWrapper destination) => Wrapped.GetDistance(destination.Wrapped);
Example #60
0
 public override bool Done()
 {
     return(Wrapped.Done());
 }