internal User(IntPtr pointer) { Name = Functions.vp_string(pointer, StringAttributes.UserName); Email = Functions.vp_string(pointer, StringAttributes.UserEmail); ID = Functions.vp_int(pointer, IntAttributes.UserId); OnlineTime = TimeSpan.FromSeconds(Functions.vp_int(pointer, IntAttributes.UserOnlineTime)); RegistrationTime = DateTimeExt.FromUnixTimestampUTC(Functions.vp_int(pointer, IntAttributes.UserRegistrationTime)); LastLogin = DateTimeExt.FromUnixTimestampUTC(Functions.vp_int(pointer, IntAttributes.UserLastLogin)); }
/// <summary> /// Creates a VPObject from a native instance's attributes /// </summary> internal VPObject(IntPtr pointer) { Action = Functions.vp_string(pointer, StringAttributes.ObjectAction); Description = Functions.vp_string(pointer, StringAttributes.ObjectDescription); Id = Functions.vp_int(pointer, IntAttributes.ObjectId); Model = Functions.vp_string(pointer, StringAttributes.ObjectModel); Time = DateTimeExt.FromUnixTimestampUTC(Functions.vp_int(pointer, IntAttributes.ObjectTime)); Type = Functions.vp_int(pointer, IntAttributes.ObjectType); Owner = Functions.vp_int(pointer, IntAttributes.ObjectUserId); Data = DataHandlers.GetData(pointer, DataAttributes.ObjectData); Position = Vector3.FromObject(pointer); Rotation = Rotation.FromObject(pointer); }