Skip to content

Commit 476e219

Browse files
Merge pull request #29 from FabianTerhorst/dev
Merge beta in stable
2 parents 9e067cf + f5ca690 commit 476e219

File tree

75 files changed

+3294
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3294
-399
lines changed

Doc.Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM mono:latest
2+
3+
ENV DOCFX_VER 2.43.2
4+
5+
RUN apt-get update && apt-get install unzip wget git -y && \
6+
wget -q -P /tmp https://github.com/dotnet/docfx/releases/download/v${DOCFX_VER}/docfx.zip && \
7+
mkdir -p /opt/docfx && \
8+
unzip /tmp/docfx.zip -d /opt/docfx && \
9+
echo '#!/bin/bash\nmono /opt/docfx/docfx.exe $@' > /usr/bin/docfx && \
10+
chmod +x /usr/bin/docfx && \
11+
rm -f /tmp/*
12+
13+
WORKDIR /docs
14+
15+
COPY api/ .
16+
17+
CMD ["docfx", "-h"]

api/AltV.Net.Async/AltV.Net.Async.csproj

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,9 @@
1212
<RepositoryUrl>https://github.com/altmp-csharp/docs</RepositoryUrl>
1313
<RepositoryType>git</RepositoryType>
1414
<PackageTags>altv gta bridge</PackageTags>
15-
<PackageVersion>1.8.1</PackageVersion>
15+
<PackageVersion>1.10.0-beta</PackageVersion>
1616
<PackageLicenseFile>license.txt</PackageLicenseFile>
17-
<PackageReleaseNotes>Add Alt.CreateColShapeCylinder(Position pos, float radius, float height);
18-
Add Alt.CreateColShapeSphere(Position pos, float radius);
19-
Add Alt.CreateColShapeCircle(Position pos, float radius);
20-
Add Alt.CreateColShapeCube(Position pos, Position pos2);
21-
Add Alt.CreateColShapeRectangle(Position pos, Position pos2);
22-
Add Alt.OnColShape += (shape, entity, state) { }
23-
Add Alt.GetAllColShapes();
24-
Add AltAsync.OnColShape += (shape, entity, state) { }</PackageReleaseNotes>
17+
<PackageReleaseNotes>Update dependencies</PackageReleaseNotes>
2518
</PropertyGroup>
2619

2720
<ItemGroup>

api/AltV.Net.Async/ChannelTickScheduler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQu
3636

3737
public override void Tick()
3838
{
39-
if (reader.TryRead(out currentTask))
39+
while (reader.TryRead(out currentTask))
4040
{
4141
TryExecuteTask(currentTask);
4242
}

api/AltV.Net.Async/DefaultTickSchedulerFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class DefaultTickSchedulerFactory : ITickSchedulerFactory
66
{
77
public TickScheduler Create(Thread mainThread)
88
{
9-
return new ChannelTickScheduler(mainThread);
9+
return new QueueTickScheduler(mainThread);
1010
}
1111
}
1212
}

api/AltV.Net.ColShape.Tests/MockPlayer.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,39 @@ public class MockPlayer : IPlayer
1010
public IntPtr NativePointer { get; }
1111
public bool Exists { get; }
1212
public BaseObjectType Type { get; }
13+
public ushort MaxHealth { get; set; }
14+
public ushort MaxArmor { get; set; }
15+
public uint CurrentWeapon { get; set; }
16+
public IEntity EntityAimingAt { get; }
17+
public Position EntityAimOffset { get; }
18+
public bool IsFlashlightActive { get; }
19+
public string Ip { get; }
20+
21+
public void AddWeaponComponent(uint weapon, uint weaponComponent)
22+
{
23+
throw new NotImplementedException();
24+
}
25+
26+
public void RemoveWeaponComponent(uint weapon, uint weaponComponent)
27+
{
28+
throw new NotImplementedException();
29+
}
30+
31+
public void GetCurrentWeaponComponents(out uint[] weaponComponents)
32+
{
33+
throw new NotImplementedException();
34+
}
35+
36+
public void SetWeaponTintIndex(uint weapon, byte tintIndex)
37+
{
38+
throw new NotImplementedException();
39+
}
40+
41+
public byte GetCurrentWeaponTintIndex()
42+
{
43+
throw new NotImplementedException();
44+
}
45+
1346
public void SetMetaData(string key, object value)
1447
{
1548
throw new NotImplementedException();
@@ -95,6 +128,11 @@ public void GetSyncedMetaData(string key, ref MValue value)
95128
public IVehicle Vehicle { get; }
96129
public byte Seat { get; }
97130
public uint Ping { get; }
131+
public ulong SocialClubId { get; }
132+
public ulong HardwareIdHash { get; }
133+
public ulong HardwareIdExHash { get; }
134+
public string AuthToken { get; }
135+
98136
public void Spawn(Position position, uint delayMs = 0)
99137
{
100138
throw new NotImplementedException();

api/AltV.Net.ColShape/AltV.Net.ColShape.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageProjectUrl>https://github.com/fabianterhorst/coreclr-module</PackageProjectUrl>
1111
<RepositoryUrl>https://github.com/fabianterhorst/coreclr-module</RepositoryUrl>
1212
<RepositoryType>git</RepositoryType>
13-
<PackageVersion>1.1.1-dev-preview</PackageVersion>
13+
<PackageVersion>1.2.0-dev-preview</PackageVersion>
1414
<PackageLicenseFile>license.txt</PackageLicenseFile>
1515
<PackageReleaseNotes>update dependencies</PackageReleaseNotes>
1616
</PropertyGroup>

api/AltV.Net.ColShape/ColShapeModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public void Add(IColShape colShape)
264264
{
265265
var length = colShapeAreas[i][j].Length;
266266
Array.Resize(ref colShapeAreas[i][j], length + 1);
267-
colShapeAreas[i][j][length] = colShape;
267+
colShapeAreas[j][i][length] = colShape;
268268
}
269269
}
270270
}

api/AltV.Net.Example/ChildConvertibleObject.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void ToMValue(ChildConvertibleObject value, IMValueWriter writer)
3333
{
3434
writer.BeginObject();
3535
writer.Name("test");
36-
writer.Value(value.test);
36+
writer.Value(value.Test);
3737
writer.EndObject();
3838
}
3939

@@ -53,16 +53,16 @@ public void ToMValue(object obj, IMValueWriter writer)
5353

5454
public static readonly IMValueAdapter<ChildConvertibleObject> Adapter = new ChildConvertibleObjectAdapter();
5555

56-
private readonly string test;
56+
public readonly string Test;
5757

5858
public ChildConvertibleObject()
5959
{
60-
test = "123";
60+
Test = "123";
6161
}
6262

6363
private ChildConvertibleObject(string test)
6464
{
65-
this.test = test;
65+
this.Test = test;
6666
}
6767

6868
public IMValueBaseAdapter GetAdapter()

api/AltV.Net.Example/ConvertibleObject.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace AltV.Net.Example
55
{
66
public class ConvertibleObject : IMValueConvertible
77
{
8-
private class ConvertibleObjectAdapter : IMValueAdapter<ConvertibleObject>
8+
public class ConvertibleObjectAdapter : IMValueAdapter<ConvertibleObject>
99
{
1010
private readonly IMValueAdapter<List<ChildConvertibleObject>> listAdapter;
1111

@@ -43,9 +43,9 @@ public void ToMValue(ConvertibleObject value, IMValueWriter writer)
4343
{
4444
writer.BeginObject();
4545
writer.Name("test");
46-
writer.Value(value.test);
46+
writer.Value(value.Test);
4747
writer.Name("list");
48-
listAdapter.ToMValue(value.list, writer);
48+
listAdapter.ToMValue(value.List, writer);
4949
writer.EndObject();
5050
}
5151

@@ -65,23 +65,23 @@ public void ToMValue(object obj, IMValueWriter writer)
6565

6666
private static readonly IMValueBaseAdapter MyAdapter = new ConvertibleObjectAdapter();
6767

68-
private readonly string test;
68+
public readonly string Test;
6969

70-
private readonly List<ChildConvertibleObject> list;
70+
public readonly List<ChildConvertibleObject> List;
7171

7272
public ConvertibleObject()
7373
{
74-
test = "123";
75-
list = new List<ChildConvertibleObject>();
76-
list.Add(new ChildConvertibleObject());
77-
list.Add(new ChildConvertibleObject());
78-
list.Add(new ChildConvertibleObject());
74+
Test = "123";
75+
List = new List<ChildConvertibleObject>
76+
{
77+
new ChildConvertibleObject(), new ChildConvertibleObject(), new ChildConvertibleObject()
78+
};
7979
}
8080

8181
private ConvertibleObject(string test, List<ChildConvertibleObject> list)
8282
{
83-
this.test = test;
84-
this.list = list;
83+
this.Test = test;
84+
this.List = list;
8585
}
8686

8787
public IMValueBaseAdapter GetAdapter()

api/AltV.Net.Example/SampleResource.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,19 @@ async delegate(string s, string s1, long i1, string[] arg3, object[] arg4, IMyVe
207207

208208
Alt.Export("GetBla", () => { Alt.Log("GetBla called"); });
209209

210+
Action action;
211+
212+
Alt.Import("example", "GetBla", out action);
213+
214+
action();
215+
216+
Alt.Export("functionExport", delegate(string name) { Alt.Log("called with:" + name); });
217+
218+
Action<string> action2;
219+
220+
Alt.Import("example", "functionExport", out action2);
221+
222+
action2("123");
210223
/*if (Alt.Import("Bla", "GetBla", out Action value))
211224
{
212225
value();

0 commit comments

Comments
 (0)