public void TestUuid()
		{
			var rfc4122Bytes = new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
			UUID uuid = new UUID(rfc4122Bytes);
			Assert.AreEqual(rfc4122Bytes, uuid.GetBytes());

			Skin skin = new Skin {Slim = false, Texture = Encoding.Default.GetBytes(new string('Z', 8192))};
			var packet = new McpeLogin()
			{
				username = "******",
				protocol = 34,
				protocol2 = 34,
				clientId = new Random().Next(),
				clientUuid = new UUID(Guid.NewGuid().ToByteArray()),
				serverAddress = "83.249.65.92:19132",
				clientSecret = "iwmvi45hm85oncyo58",
				skin = skin,
			};

			var bytes = packet.Encode();
			Console.WriteLine(Package.HexDump(bytes, 16));

			UUID uuid2 = new UUID(rfc4122Bytes);

			Dictionary<UUID, string> uuiDictionary = new Dictionary<UUID, string>();
			uuiDictionary.Add(uuid, "test");

			Assert.AreEqual("test", uuiDictionary[uuid2]);
			
		}
Exemple #2
0
		public PlayerMob(string name, Level level) : base(63, level)
		{
			Uuid = new UUID(Guid.NewGuid().ToByteArray());

			Width = 0.6;
			Length = 0.6;
			Height = 1.80;

			IsSpawned = false;

			Name = name;
			Skin = new Skin {Slim = false, Texture = Encoding.Default.GetBytes(new string('Z', 8192))};

			ItemInHand = new ItemStack();
		}
Exemple #3
0
		public void Write(UUID uuid)
		{
			if (uuid == null) throw new Exception("Expected UUID, required");
			Write(uuid.GetBytes());
		}
Exemple #4
0
 protected bool Equals(UUID other)
 {
     return Id.Equals(other.Id);
 }
Exemple #5
0
        public UUID ReadUUID()
        {
            UUID uuid = new UUID(ReadBytes(16));

            return(uuid);
        }