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.
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.
// 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
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
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
Off topic. I asked for how to use this de-serializating code thingy.
shh i have returned
Offline
Stop remaking the same topic: http://forums.everybodyedits.com/viewtopic.php?id=26529
Everybody edits, but some edit more than others
Offline
The Deserializer doesn't work yet. It needs to be updated to work. There are some specialblocks.
Offline
[ Started around 1732824563.7267 - Generated in 0.160 seconds, 12 queries executed - Memory usage: 1.44 MiB (Peak: 1.57 MiB) ]