Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-03-09 21:55:04

madiik
Member
From: floor above Yuuta
Joined: 2015-02-26
Posts: 514

WHAT IS THIS SORCERY OF DESERIALIZATION

Using capasha's de-serialization of the world but really confused how am I supposed to use it to read world data, to get where certain blocks are and what block IDs they have.

//forums.everybodyedits.com/img/smilies/sad

	

                           // Edited to work on newest version. Date: 2015-01-10
                     connection.OnMessage += delegate(object sender, PlayerIOClient.Message m)
                            {
                                if (m.Type == "init")
                                {
                                    uint loc4 = 19;
                                    var loc5 = m.Count;
                                    byte[] loc6 = m.GetByteArray(loc4 + 2);
                                    int loc7 = loc6.Length;
                                    int bid = m.GetInt(loc4);
                                    while (loc4 < loc5)
                                    {
                                        if (m[loc4].ToString() == "we")
                                        {
                                            break;
                                        }
                                        else
                                        {
                                            bid = m.GetInt(loc4);
                                            for (int n = 0; n < loc7; n += 2)
                                            {
                                                try
                                                {
     
                                                    int x = m.GetByteArray(loc4 + 2)[n] << 8 | m.GetByteArray(loc4 + 2)[n + 1];
                                                    int y = m.GetByteArray(loc4 + 3)[n] << 8 | m.GetByteArray(loc4 + 3)[n + 1];
     
                                                    if (bid == 242 || bid == 381) // Portal (0 down, 1 left, 2 up, 3 right)
                                                    {
                                                        var rotation = m.GetInt(loc4 + 4);
                                                        var sid = m.GetInt(loc4 + 5);
                                                        var eid = m.GetInt(loc4 + 6);
                                                    }
     
                                                    if (bid == 43 || bid == 165 || bid == 214 || bid == 213 ) //Coin door and gate
                                                    {
                                                        var coins = m.GetInt(loc4 + 4);
                                                    }
     
                                                    if (bid == 361) //Spikes
                                                    {
                                                        var rotation = m.GetInt(loc4 + 4); // (0 left, 1 up, 2 right, 3 down)
                                                    }
     
                                                    if (bid == 77 || bid == 83) //Piano or Drums
                                                    {
                                                        var note = m.GetInt(loc4 + 4);
                                                    }
     
                                                    if (bid == 1000 || bid == 385 || bid == 374) // Text, Sign, World Portal
                                                    {
                                                        var text = m.GetString(loc4 + 4);
                                                    }
     
                                                }
                                                catch (Exception ee)
                                                {
                                                    Console.WriteLine(bid + " " + ee.Message + "\n\n");
                                                }
                                            }
     
     
    if (bid == 43 || bid == 77 || bid == 83 || bid == 214 || bid == 213 || bid == 1000 || bid == 165 || bid == 361 || bid >= 374 && bid <= 380 || bid == 385) { loc4 += 5; }
                                else if (bid == 242 || bid == 381) { loc4 += 7; }
                                else { loc4 += 4; }
     
     
                                        }
                                    }
                                }
                            };

shh i have returned

Offline

#2 2015-03-09 21:59:51

ewoke
Member
Joined: 2015-02-20
Posts: 412

Re: WHAT IS THIS SORCERY OF DESERIALIZATION

it might not be updated but:

 // Edited to work on newest version. Date: 2015-01-10
                     connection.OnMessage += delegate(object sender, PlayerIOClient.Message m)
                            {
                                if (m.Type == "init")
                                {
                                    uint loc4 = 19;
                                    var loc5 = m.Count;
                                    byte[] loc6 = m.GetByteArray(loc4 + 2);
                                    int loc7 = loc6.Length;
                                    int bid = m.GetInt(loc4);
                                    while (loc4 < loc5)
                                    {
                                        if (m[loc4].ToString() == "we")
                                        {
                                            break;
                                        }
                                        else
                                        {
                                            bid = m.GetInt(loc4);
                                            for (int n = 0; n < loc7; n += 2)
                                            {
                                                try
                                                {
     
                                                    int x = m.GetByteArray(loc4 + 2)[n] << 8 | m.GetByteArray(loc4 + 2)[n + 1];
                                                    int y = m.GetByteArray(loc4 + 3)[n] << 8 | m.GetByteArray(loc4 + 3)[n + 1];
                                                    //here you can use the X and Y coords.
                                                    //example: blocks.add(new Block(x,y,bid));

                                                    if (bid == 242 || bid == 381) // Portal (0 down, 1 left, 2 up, 3 right)
                                                    {
                                                        var rotation = m.GetInt(loc4 + 4);
                                                        var sid = m.GetInt(loc4 + 5);
                                                        var eid = m.GetInt(loc4 + 6);
                                                        //here you can still use the X and Y but also the rotation etc
                                                        //example: blocks.add(new Block(x,y,bid));
                                                    }
     
                                                    if (bid == 43 || bid == 165 || bid == 214 || bid == 213 ) //Coin door and gate
                                                    {
                                                        var coins = m.GetInt(loc4 + 4);
                                                    }
     
                                                    if (bid == 361) //Spikes
                                                    {
                                                        var rotation = m.GetInt(loc4 + 4); // (0 left, 1 up, 2 right, 3 down)
                                                    }
     
                                                    if (bid == 77 || bid == 83) //Piano or Drums
                                                    {
                                                        var note = m.GetInt(loc4 + 4);
                                                    }
     
                                                    if (bid == 1000 || bid == 385 || bid == 374) // Text, Sign, World Portal
                                                    {
                                                        var text = m.GetString(loc4 + 4);
                                                    }
     
                                                }
                                                catch (Exception ee)
                                                {
                                                    Console.WriteLine(bid + " " + ee.Message + "\n\n");
                                                }
                                            }
     
     
    if (bid == 43 || bid == 77 || bid == 83 || bid == 214 || bid == 213 || bid == 1000 || bid == 165 || bid == 361 || bid >= 374 && bid <= 380 || bid == 385) { loc4 += 5; }
                                else if (bid == 242 || bid == 381) { loc4 += 7; }
                                else { loc4 += 4; }
     
     
                                        }
                                    }
                                }
                            };

if you can read this....good for you

Offline

#3 2015-03-09 23:44:16

Jabatheblob1
Member
Joined: 2015-03-01
Posts: 856

Re: WHAT IS THIS SORCERY OF DESERIALIZATION

Idk when the last time that was updated.... so i think it don't work cause bg


If you would like me to make a bot for you, go here.

Offline

#4 2015-03-10 14:45:12

madiik
Member
From: floor above Yuuta
Joined: 2015-02-26
Posts: 514

Re: WHAT IS THIS SORCERY OF DESERIALIZATION

Off topic. I asked for how to use this de-serializating code thingy.

//forums.everybodyedits.com/img/smilies/mad


shh i have returned

Offline

#5 2015-03-10 15:07:08

Zumza
Member
From: root
Joined: 2015-02-17
Posts: 4,656

Re: WHAT IS THIS SORCERY OF DESERIALIZATION


Everybody edits, but some edit more than others

Offline

#6 2015-03-10 17:55:12

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: WHAT IS THIS SORCERY OF DESERIALIZATION

The Deserializer doesn't work yet. It needs to be updated to work. There are some specialblocks.

Offline

capasha1426006512481137

Board footer

Powered by FluxBB

[ Started around 1732499470.096 - Generated in 0.092 seconds, 11 queries executed - Memory usage: 1.44 MiB (Peak: 1.57 MiB) ]