diff --git a/VpSharp.IntegrationTests/VPSDK.dll b/VpSharp.IntegrationTests/VPSDK.dll new file mode 100644 index 0000000..41753ab Binary files /dev/null and b/VpSharp.IntegrationTests/VPSDK.dll differ diff --git a/VpSharp.IntegrationTests/VpSharp.IntegrationTests.csproj b/VpSharp.IntegrationTests/VpSharp.IntegrationTests.csproj new file mode 100644 index 0000000..3b50734 --- /dev/null +++ b/VpSharp.IntegrationTests/VpSharp.IntegrationTests.csproj @@ -0,0 +1,23 @@ + + + + Exe + net6.0 + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/VpSharp.IntegrationTests/libvpsdk.so b/VpSharp.IntegrationTests/libvpsdk.so new file mode 100644 index 0000000..d93e0dc Binary files /dev/null and b/VpSharp.IntegrationTests/libvpsdk.so differ diff --git a/VpSharp.IntegrationTests/src/Program.cs b/VpSharp.IntegrationTests/src/Program.cs new file mode 100644 index 0000000..ff1bdaf --- /dev/null +++ b/VpSharp.IntegrationTests/src/Program.cs @@ -0,0 +1,45 @@ +using VpSharp; +using VpSharp.Entities; + +string? username = Environment.GetEnvironmentVariable("username"); +string? password = Environment.GetEnvironmentVariable("password"); + +if (string.IsNullOrWhiteSpace(username)) +{ + Console.Error.WriteLine("username env variable cannot be empty"); + return; +} + +if (string.IsNullOrWhiteSpace(password)) +{ + Console.Error.WriteLine("password env variable cannot be empty"); + return; +} + +var configuration = new VirtualParadiseConfiguration() +{ + Username = username, + Password = password, + Application = new Application("VpSharp.IntegrationTests", "1.0.0"), + AutoQuery = false, + BotName = "TestBot" +}; + +using var client = new VirtualParadiseClient(configuration); + +Console.WriteLine(@"Connecting to universe"); +await client.ConnectAsync().ConfigureAwait(false); + +Console.WriteLine(@"Logging in"); +await client.LoginAsync(); + +Console.WriteLine(@"Entering world"); +VirtualParadiseWorld world = await client.EnterAsync("Mutation"); +Console.WriteLine(@"Entered world!"); + +VirtualParadiseAvatar avatar = client.CurrentAvatar!; + +Console.WriteLine($@"My name is {avatar.Name} and I am at {avatar.Location}"); +Console.WriteLine($@"Entered {world.Name} with size {world.Size}"); + +await Task.Delay(-1); diff --git a/VpSharp.sln b/VpSharp.sln new file mode 100644 index 0000000..f212b22 --- /dev/null +++ b/VpSharp.sln @@ -0,0 +1,36 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VpSharp", "VpSharp\VpSharp.csproj", "{D061712E-3832-4272-B684-D0A8415D7FF9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VpSharp.IntegrationTests", "VpSharp.IntegrationTests\VpSharp.IntegrationTests.csproj", "{0269A076-0FE4-4769-A662-BDCA61B2E6B2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VpSharp.Tests", "VpSharp.Tests\VpSharp.Tests.csproj", "{87C0D19A-27C9-4041-9DD5-191B8D0FDEF8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{342BECE5-2E3B-4EC0-86D2-CC6A0FB30603}" + ProjectSection(SolutionItems) = preProject + CONTRIBUTING.md = CONTRIBUTING.md + LICENSE.md = LICENSE.md + README.md = README.md + .editorconfig = .editorconfig + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D061712E-3832-4272-B684-D0A8415D7FF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D061712E-3832-4272-B684-D0A8415D7FF9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D061712E-3832-4272-B684-D0A8415D7FF9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D061712E-3832-4272-B684-D0A8415D7FF9}.Release|Any CPU.Build.0 = Release|Any CPU + {0269A076-0FE4-4769-A662-BDCA61B2E6B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0269A076-0FE4-4769-A662-BDCA61B2E6B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0269A076-0FE4-4769-A662-BDCA61B2E6B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0269A076-0FE4-4769-A662-BDCA61B2E6B2}.Release|Any CPU.Build.0 = Release|Any CPU + {87C0D19A-27C9-4041-9DD5-191B8D0FDEF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {87C0D19A-27C9-4041-9DD5-191B8D0FDEF8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {87C0D19A-27C9-4041-9DD5-191B8D0FDEF8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {87C0D19A-27C9-4041-9DD5-191B8D0FDEF8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal