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(); }
public entProps(Wrapped.Wrapped socket, Form1 mainform) { int entId = socket.readInt(); int propCount = socket.readInt(); for (int b = 0; b < propCount; b++) { string key = socket.readString(); double value = socket.readDouble(); short listLength = socket.readShort(); for (int i = 0; i < listLength; i++) { long msb = socket.readLong(); long lsb = socket.readLong(); double ammount = socket.readDouble(); byte op = socket.readByte(); } } }
void handle() { // Server is setting our location. Handle, then respond..polietly. double X = Socket.readDouble(); double stance = Socket.readDouble(); double Y = Socket.readDouble(); double Z = Socket.readDouble(); float yaw = Socket.readFloat(); float pitch = Socket.readFloat(); bool onground = Socket.readBool(); mainform.location = new double[4] { X, Y, Z, stance }; mainform.position = new float[2] { yaw, pitch }; mainform.onground = onground; PPaL response = new PPaL(Socket, mainform, true); }