Compare commits
195 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7bb5e4f343 | ||
![]() |
5be6a02d19 | ||
![]() |
822a8019d2 | ||
6175e87c9d | |||
0bf6b22717 | |||
![]() |
6aef964fa4 | ||
a4fa4b943a | |||
![]() |
2cee9b0942 | ||
![]() |
52c4b4e0ef | ||
![]() |
0b1146ea33 | ||
![]() |
231c60d0c5 | ||
![]() |
711a072d65 | ||
![]() |
c8160868f6 | ||
![]() |
020e60aedc | ||
![]() |
3624ec4809 | ||
![]() |
20b315b7fc | ||
![]() |
e0ee0862c6 | ||
![]() |
3abb311f82 | ||
![]() |
cb1bcaf14f | ||
![]() |
f5a7a83ccb | ||
![]() |
80b167ef48 | ||
![]() |
3ecd27d92b | ||
![]() |
7df402ca25 | ||
80399f387d | |||
54f0df852c | |||
![]() |
8c755307b1 | ||
![]() |
c8f0e74894 | ||
![]() |
0b3dec1bcf | ||
![]() |
916f4677f6 | ||
![]() |
5663285309 | ||
![]() |
5b2c77aec8 | ||
![]() |
4e16d9c913 | ||
![]() |
3f29b7d8ef | ||
![]() |
438f4fa9c2 | ||
![]() |
afc45981f3 | ||
![]() |
baa6518c0e | ||
![]() |
82f34e3817 | ||
![]() |
8e31dbe624 | ||
![]() |
f5ebe8315a | ||
![]() |
503964c475 | ||
![]() |
9df6316c59 | ||
![]() |
f45ac572ea | ||
![]() |
e8d58d292b | ||
![]() |
36e8c79cca | ||
![]() |
76e720d7e9 | ||
![]() |
c13f3cd64d | ||
![]() |
e342afe3ff | ||
![]() |
0e3e5ee392 | ||
![]() |
ae14871518 | ||
![]() |
cfd2ab51a4 | ||
![]() |
2acb20e8ea | ||
![]() |
39c262e9e0 | ||
![]() |
554010dbbc | ||
![]() |
d2d1b392f5 | ||
![]() |
4d28f3420e | ||
![]() |
85ecca2af9 | ||
![]() |
90c5a86fb0 | ||
![]() |
b799341f8a | ||
![]() |
df109debf4 | ||
![]() |
1838808860 | ||
![]() |
c96634f797 | ||
![]() |
a94acfe34d | ||
![]() |
2bde20bfdd | ||
![]() |
ef8ace51b4 | ||
![]() |
25a3abdde1 | ||
![]() |
c10e79a5e3 | ||
![]() |
045e458aa8 | ||
![]() |
7054220a40 | ||
![]() |
89e666d09a | ||
![]() |
f8057144dc | ||
![]() |
a588584673 | ||
![]() |
8e84391710 | ||
![]() |
21b5942106 | ||
435db1f14b | |||
![]() |
902fb77ed4 | ||
7951d6a0a5 | |||
![]() |
b124f5ed3e | ||
![]() |
45f82180d2 | ||
![]() |
18d965d562 | ||
![]() |
d5cf96d563 | ||
06fdaa97d8 | |||
13470efd55 | |||
![]() |
3b0d7b592c | ||
d6746064de | |||
![]() |
ac31f46089 | ||
![]() |
11c6890da2 | ||
1c9c92b43b | |||
baed45bad5 | |||
![]() |
47122c4c0e | ||
![]() |
b8e1e925d4 | ||
![]() |
5310c400c3 | ||
![]() |
07178c6bcf | ||
![]() |
a0157be9dd | ||
![]() |
f6c41db513 | ||
![]() |
f2c3662f63 | ||
![]() |
1d4cb9a347 | ||
![]() |
3d06ad177d | ||
![]() |
fba648c31a | ||
![]() |
32d9437bb4 | ||
![]() |
4151da4f49 | ||
![]() |
b66a351859 | ||
![]() |
b1c4cae028 | ||
![]() |
02e5b886e6 | ||
![]() |
0572ab1b13 | ||
![]() |
e1cc0b6fbd | ||
![]() |
6f1f035136 | ||
![]() |
17a594ee98 | ||
![]() |
4b8b88d550 | ||
![]() |
6ad088e46e | ||
![]() |
fd18634d32 | ||
![]() |
f258f0bb68 | ||
![]() |
5beac0f00c | ||
![]() |
ace1cee70e | ||
![]() |
2e1805a041 | ||
![]() |
37c10bb41f | ||
![]() |
0d064fa94e | ||
![]() |
6c716de014 | ||
![]() |
b6e36b0001 | ||
![]() |
f879c38334 | ||
![]() |
879c54b38f | ||
![]() |
c325dec973 | ||
![]() |
20310d44dd | ||
![]() |
679c56a62f | ||
![]() |
691fd26075 | ||
![]() |
b82507fc5c | ||
![]() |
fbae203b1c | ||
![]() |
27eff96223 | ||
![]() |
94b768e26c | ||
![]() |
901f87dfd5 | ||
![]() |
ea2aea6952 | ||
![]() |
8b95b7d888 | ||
![]() |
62fcfc06d0 | ||
![]() |
c2747de9c6 | ||
![]() |
7f5fa25b55 | ||
![]() |
435141c6a9 | ||
![]() |
0a922c74a6 | ||
![]() |
e80381c55f | ||
![]() |
03ea3cd935 | ||
![]() |
57b50af2ea | ||
![]() |
57f0575112 | ||
![]() |
0f16894795 | ||
![]() |
457666982e | ||
![]() |
b9822ef696 | ||
![]() |
d2f91cb62f | ||
![]() |
865c337e59 | ||
![]() |
9da70f0d16 | ||
![]() |
16ee90adfd | ||
![]() |
7079765b2c | ||
![]() |
7b42bbfd3a | ||
![]() |
d53179832d | ||
![]() |
ca82895691 | ||
![]() |
f61a668b02 | ||
![]() |
a99e1a589b | ||
![]() |
a27e4debe9 | ||
![]() |
cf34bc3313 | ||
![]() |
ec0ba47f7f | ||
![]() |
a9d5e6e571 | ||
![]() |
ff6f16a265 | ||
![]() |
8dd5a36b78 | ||
1184ecafe4 | |||
2a26b2417d | |||
![]() |
a793dc6fad | ||
![]() |
d54ec84209 | ||
![]() |
bd4b685e84 | ||
![]() |
8d389602af | ||
![]() |
207c3d60c7 | ||
![]() |
2e72a69bbf | ||
![]() |
214d55c1c9 | ||
![]() |
6ecd8e6e0b | ||
![]() |
f1eb686688 | ||
![]() |
169def681b | ||
![]() |
614a3a4f19 | ||
![]() |
a7dfddf621 | ||
![]() |
b618ec30fb | ||
![]() |
0593de44a5 | ||
![]() |
e41ced9e8f | ||
![]() |
368d719201 | ||
944def33e5 | |||
![]() |
cf4db381b7 | ||
![]() |
5d8c1ece0b | ||
1db4606ade | |||
![]() |
2442eab0cc | ||
![]() |
3d6795e4bf | ||
![]() |
6f2295bec1 | ||
![]() |
c46f268470 | ||
![]() |
7338299ff2 | ||
![]() |
27798000ba | ||
![]() |
020847a91b | ||
![]() |
6c799b0712 | ||
![]() |
8e2db5131a | ||
![]() |
0622ca7a37 | ||
![]() |
c7dd950954 | ||
![]() |
5f0eeab55e | ||
![]() |
6837391ace | ||
![]() |
64b3bedc62 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -258,4 +258,7 @@ paket-files/
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
*.pyc
|
||||
|
||||
# Docs
|
||||
docs/LastBuild.log
|
90
Docs.shfbproj
Normal file
90
Docs.shfbproj
Normal file
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<!-- The configuration and platform will be used to determine which assemblies to include from solution and
|
||||
project documentation sources -->
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{6bae2f52-652d-4268-923d-0e1198bdc825}</ProjectGuid>
|
||||
<SHFBSchemaVersion>2017.9.26.0</SHFBSchemaVersion>
|
||||
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual Studio adds them anyway -->
|
||||
<AssemblyName>Documentation</AssemblyName>
|
||||
<RootNamespace>Documentation</RootNamespace>
|
||||
<Name>Documentation</Name>
|
||||
<!-- SHFB properties -->
|
||||
<FrameworkVersion>.NET Framework 3.5</FrameworkVersion>
|
||||
<OutputPath>Docs\</OutputPath>
|
||||
<HtmlHelpName>Documentation</HtmlHelpName>
|
||||
<Language>en-US</Language>
|
||||
<HelpFileFormat>Website</HelpFileFormat>
|
||||
<SyntaxFilters>C#</SyntaxFilters>
|
||||
<PresentationStyle>VS2013</PresentationStyle>
|
||||
<CleanIntermediates>True</CleanIntermediates>
|
||||
<KeepLogFile>True</KeepLogFile>
|
||||
<DisableCodeBlockComponent>False</DisableCodeBlockComponent>
|
||||
<IndentHtml>False</IndentHtml>
|
||||
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
|
||||
<HelpTitle>MLAPI API Reference</HelpTitle>
|
||||
<HelpFileVersion>1.0.0.0</HelpFileVersion>
|
||||
<RootNamespaceContainer>False</RootNamespaceContainer>
|
||||
<NamespaceGrouping>False</NamespaceGrouping>
|
||||
<Preliminary>True</Preliminary>
|
||||
<SdkLinkTarget>Blank</SdkLinkTarget>
|
||||
<NamingMethod>MemberName</NamingMethod>
|
||||
<ContentPlacement>AboveNamespaces</ContentPlacement>
|
||||
<SourceCodeBasePath>MLAPI\</SourceCodeBasePath>
|
||||
<WarnOnMissingSourceContext>False</WarnOnMissingSourceContext>
|
||||
<DocumentationSources>
|
||||
<DocumentationSource sourceFile="MLAPI\bin\Debug\MLAPI.dll" />
|
||||
<DocumentationSource sourceFile="MLAPI\bin\Debug\MLAPI.xml" />
|
||||
</DocumentationSources>
|
||||
<MissingTags>Summary, Parameter, Returns, AutoDocumentCtors, TypeParameter, AutoDocumentDispose</MissingTags>
|
||||
<HeaderText>
|
||||
</HeaderText>
|
||||
<FooterText>
|
||||
</FooterText>
|
||||
<TransformComponentArguments>
|
||||
<Argument Key="logoFile" Value="MLAPI_Logo.png" />
|
||||
<Argument Key="logoHeight" Value="" />
|
||||
<Argument Key="logoWidth" Value="600" />
|
||||
<Argument Key="logoAltText" Value="" />
|
||||
<Argument Key="logoPlacement" Value="right" />
|
||||
<Argument Key="logoAlignment" Value="right" />
|
||||
<Argument Key="maxVersionParts" Value="" />
|
||||
<Argument Key="defaultLanguage" Value="cs" />
|
||||
<Argument Key="includeEnumValues" Value="true" />
|
||||
<Argument Key="baseSourceCodeUrl" Value="https://github.com/TwoTenPvP/MLAPI/blob/master/MLAPI/" />
|
||||
<Argument Key="requestExampleUrl" Value="https://github.com/TwoTenPvP/MLAPI/issues/new" />
|
||||
</TransformComponentArguments>
|
||||
</PropertyGroup>
|
||||
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform
|
||||
the build. The others are optional common platform types that may appear. -->
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' ">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
|
||||
</PropertyGroup>
|
||||
<!-- Import the SHFB build targets -->
|
||||
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
|
||||
<!-- The pre-build and post-build event properties must appear *after* the targets file import in order to be
|
||||
evaluated correctly. -->
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
8
MLAPI-Editor/GithubAsset.cs
Normal file
8
MLAPI-Editor/GithubAsset.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
[Serializable]
|
||||
public class GithubAsset
|
||||
{
|
||||
public string browser_download_url;
|
||||
public string name;
|
||||
}
|
13
MLAPI-Editor/GithubRelease.cs
Normal file
13
MLAPI-Editor/GithubRelease.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
[Serializable]
|
||||
public class GithubRelease
|
||||
{
|
||||
public string html_url;
|
||||
public string tag_name;
|
||||
public string name;
|
||||
public string body;
|
||||
public string published_at;
|
||||
public bool prerelease;
|
||||
public GithubAsset[] assets;
|
||||
}
|
8
MLAPI-Editor/JSONStructs/GithubAsset.cs
Normal file
8
MLAPI-Editor/JSONStructs/GithubAsset.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
[Serializable]
|
||||
public class GithubAsset
|
||||
{
|
||||
public string browser_download_url;
|
||||
public string name;
|
||||
}
|
13
MLAPI-Editor/JSONStructs/GithubRelease.cs
Normal file
13
MLAPI-Editor/JSONStructs/GithubRelease.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
[Serializable]
|
||||
public class GithubRelease
|
||||
{
|
||||
public string html_url;
|
||||
public string tag_name;
|
||||
public string name;
|
||||
public string body;
|
||||
public string published_at;
|
||||
public bool prerelease;
|
||||
public GithubAsset[] assets;
|
||||
}
|
66
MLAPI-Editor/MLAPI-Editor.csproj
Normal file
66
MLAPI-Editor/MLAPI-Editor.csproj
Normal file
@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{A45DBD43-D640-4562-9F24-6745269CEDF7}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MLAPI_Editor</RootNamespace>
|
||||
<AssemblyName>MLAPI-Editor</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UnityEditor">
|
||||
<HintPath>..\..\..\..\..\Program Files\Unity\Editor\Data\Managed\UnityEditor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\..\..\..\..\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GithubAsset.cs" />
|
||||
<Compile Include="GithubRelease.cs" />
|
||||
<Compile Include="MLAPIEditor.cs" />
|
||||
<Compile Include="NetworkedAnimatorEditor.cs" />
|
||||
<Compile Include="NetworkedBehaviourEditor.cs" />
|
||||
<Compile Include="NetworkedObjectEditor.cs" />
|
||||
<Compile Include="NetworkingManagerEditor.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TrackedObjectEditor.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MLAPI\MLAPI.csproj">
|
||||
<Project>{EE431720-A9ED-43DC-9E74-10B693816D38}</Project>
|
||||
<Name>MLAPI</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
173
MLAPI-Editor/MLAPIEditor.cs
Normal file
173
MLAPI-Editor/MLAPIEditor.cs
Normal file
@ -0,0 +1,173 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public class MLAPIEditor : EditorWindow
|
||||
{
|
||||
private GithubRelease[] releases = new GithubRelease[0];
|
||||
private bool[] foldoutStatus = new bool[0];
|
||||
private long lastUpdated = 0;
|
||||
private string currentVersion;
|
||||
|
||||
[MenuItem("Window/MLAPI")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
GetWindow<MLAPIEditor>();
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
lastUpdated = 0;
|
||||
|
||||
if (EditorPrefs.HasKey("MLAPI_version"))
|
||||
currentVersion = EditorPrefs.GetString("MLAPI_version");
|
||||
else
|
||||
currentVersion = "None";
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
private void OnFocus()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if(foldoutStatus != null)
|
||||
{
|
||||
for (int i = 0; i < foldoutStatus.Length; i++)
|
||||
{
|
||||
if (releases[i] == null)
|
||||
continue;
|
||||
foldoutStatus[i] = EditorGUILayout.Foldout(foldoutStatus[i], releases[i].tag_name + " - " + releases[i].name);
|
||||
if (foldoutStatus[i])
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.LabelField("Release notes", EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField(releases[i].body, EditorStyles.wordWrappedLabel);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.Space();
|
||||
if (releases[i].prerelease)
|
||||
{
|
||||
GUIStyle style = new GUIStyle(EditorStyles.boldLabel);
|
||||
style.normal.textColor = new Color(1f, 0.5f, 0f);
|
||||
EditorGUILayout.LabelField("Pre-release", style);
|
||||
}
|
||||
else
|
||||
{
|
||||
GUIStyle style = new GUIStyle(EditorStyles.boldLabel);
|
||||
style.normal.textColor = new Color(0f, 1f, 0f);
|
||||
EditorGUILayout.LabelField("Stable-release", style);
|
||||
}
|
||||
if (currentVersion == releases[i].tag_name)
|
||||
{
|
||||
GUIStyle boldStyle = new GUIStyle(EditorStyles.boldLabel);
|
||||
boldStyle.normal.textColor = new Color(0.3f, 1f, 0.3f);
|
||||
EditorGUILayout.LabelField("Installed", boldStyle);
|
||||
}
|
||||
EditorGUILayout.LabelField("Release date: " + DateTime.Parse(DateTime.Parse(releases[i].published_at).ToString()), EditorStyles.miniBoldLabel);
|
||||
|
||||
if(currentVersion != releases[i].tag_name && GUILayout.Button("Install"))
|
||||
InstallRelease(i);
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GUILayout.BeginArea(new Rect(5, position.height - 20, position.width, 20));
|
||||
|
||||
if (GUILayout.Button("Check for updates"))
|
||||
GetReleases();
|
||||
|
||||
GUILayout.EndArea();
|
||||
|
||||
string lastUpdatedString = lastUpdated == 0 ? "Never" : new DateTime(lastUpdated).ToShortTimeString();
|
||||
EditorGUI.LabelField(new Rect(5, position.height - 40, position.width, 20), "Last checked: " + lastUpdatedString, EditorStyles.centeredGreyMiniLabel);
|
||||
|
||||
if ((DateTime.Now - new DateTime(lastUpdated)).Seconds > 3600)
|
||||
GetReleases();
|
||||
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void InstallRelease(int index)
|
||||
{
|
||||
for (int i = 0; i < releases[index].assets.Length; i++)
|
||||
{
|
||||
WWW www = new WWW(releases[index].assets[i].browser_download_url);
|
||||
while (!www.isDone && string.IsNullOrEmpty(www.error))
|
||||
{
|
||||
EditorGUI.ProgressBar(new Rect(5, position.height - 60, position.width, 20), www.progress, "Installing " + i + "/" + releases[index].assets.Length);
|
||||
}
|
||||
|
||||
if(!Directory.Exists(Application.dataPath + "/MLAPI/Lib/"))
|
||||
Directory.CreateDirectory(Application.dataPath + "/MLAPI/Lib/");
|
||||
|
||||
File.WriteAllBytes(Application.dataPath + "/MLAPI/Lib/" + releases[index].assets[i].name, www.bytes);
|
||||
|
||||
if (releases[index].assets[i].name.EndsWith(".unitypackage"))
|
||||
AssetDatabase.ImportPackage(Application.dataPath + "/MLAPI/Lib/" + releases[index].assets[i].name, false);
|
||||
}
|
||||
|
||||
EditorPrefs.SetString("MLAPI_version", releases[index].tag_name);
|
||||
currentVersion = releases[index].tag_name;
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
private void GetReleases()
|
||||
{
|
||||
lastUpdated = DateTime.Now.Ticks;
|
||||
|
||||
WWW www = new WWW("https://api.github.com/repos/TwoTenPvP/MLAPI/releases");
|
||||
while(!www.isDone && string.IsNullOrEmpty(www.error))
|
||||
{
|
||||
EditorGUI.ProgressBar(new Rect(5, position.height - 60, position.width, 20), www.progress, "Fetching...");
|
||||
}
|
||||
string json = www.text;
|
||||
|
||||
//This makes it from a json array to the individual objects in the array.
|
||||
//The JSON serializer cant take arrays. We have to split it up outselves.
|
||||
List<string> releasesJson = new List<string>();
|
||||
int depth = 0;
|
||||
string currentObject = "";
|
||||
for (int i = 1; i < json.Length - 1; i++)
|
||||
{
|
||||
if (json[i] == '[')
|
||||
depth++;
|
||||
else if (json[i] == ']')
|
||||
depth--;
|
||||
else if (json[i] == '{')
|
||||
depth++;
|
||||
else if (json[i] == '}')
|
||||
depth--;
|
||||
|
||||
if ((depth == 0 && json[i] != ',') || depth > 0)
|
||||
currentObject += json[i];
|
||||
|
||||
if (depth == 0 && json[i] == ',')
|
||||
{
|
||||
releasesJson.Add(currentObject);
|
||||
currentObject = "";
|
||||
}
|
||||
}
|
||||
|
||||
releases = new GithubRelease[releasesJson.Count];
|
||||
foldoutStatus = new bool[releasesJson.Count];
|
||||
|
||||
for (int i = 0; i < releasesJson.Count; i++)
|
||||
{
|
||||
releases[i] = JsonUtility.FromJson<GithubRelease>(releasesJson[i]);
|
||||
if (i == 0)
|
||||
foldoutStatus[i] = true;
|
||||
else
|
||||
foldoutStatus[i] = false;
|
||||
}
|
||||
}
|
||||
}
|
97
MLAPI-Editor/NetworkedAnimatorEditor.cs
Normal file
97
MLAPI-Editor/NetworkedAnimatorEditor.cs
Normal file
@ -0,0 +1,97 @@
|
||||
using MLAPI.MonoBehaviours.Prototyping;
|
||||
using System;
|
||||
using UnityEditor.Animations;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor
|
||||
{
|
||||
[CustomEditor(typeof(NetworkedAnimator), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class NetworkAnimatorEditor : Editor
|
||||
{
|
||||
private NetworkedAnimator networkedAnimatorTarget;
|
||||
[NonSerialized]
|
||||
private bool initialized;
|
||||
|
||||
private SerializedProperty animatorProperty;
|
||||
private GUIContent animatorLabel;
|
||||
|
||||
void Init()
|
||||
{
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
initialized = true;
|
||||
networkedAnimatorTarget = target as NetworkedAnimator;
|
||||
|
||||
animatorProperty = serializedObject.FindProperty("_animator");
|
||||
animatorLabel = new GUIContent("Animator", "The Animator component to synchronize.");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
Init();
|
||||
serializedObject.Update();
|
||||
DrawControls();
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
void DrawControls()
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(animatorProperty, animatorLabel);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
networkedAnimatorTarget.ResetParameterOptions();
|
||||
|
||||
if (networkedAnimatorTarget.animator == null)
|
||||
return;
|
||||
|
||||
var controller = networkedAnimatorTarget.animator.runtimeAnimatorController as AnimatorController;
|
||||
if (controller != null)
|
||||
{
|
||||
var showWarning = false;
|
||||
EditorGUI.indentLevel += 1;
|
||||
int i = 0;
|
||||
|
||||
foreach (var p in controller.parameters)
|
||||
{
|
||||
if (i >= 32)
|
||||
{
|
||||
showWarning = true;
|
||||
break;
|
||||
}
|
||||
|
||||
bool oldSend = networkedAnimatorTarget.GetParameterAutoSend(i);
|
||||
bool send = EditorGUILayout.Toggle(p.name, oldSend);
|
||||
if (send != oldSend)
|
||||
{
|
||||
networkedAnimatorTarget.SetParameterAutoSend(i, send);
|
||||
EditorUtility.SetDirty(target);
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
|
||||
if (showWarning)
|
||||
EditorGUILayout.HelpBox("NetworkAnimator can only select between the first 32 parameters in a mecanim controller", MessageType.Warning);
|
||||
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
EditorGUILayout.Separator();
|
||||
if (networkedAnimatorTarget.param0 != "")
|
||||
EditorGUILayout.LabelField("Param 0", networkedAnimatorTarget.param0);
|
||||
if (networkedAnimatorTarget.param1 != "")
|
||||
EditorGUILayout.LabelField("Param 1", networkedAnimatorTarget.param1);
|
||||
if (networkedAnimatorTarget.param2 != "")
|
||||
EditorGUILayout.LabelField("Param 2", networkedAnimatorTarget.param2);
|
||||
if (networkedAnimatorTarget.param3 != "")
|
||||
EditorGUILayout.LabelField("Param 3", networkedAnimatorTarget.param3);
|
||||
if (networkedAnimatorTarget.param4 != "")
|
||||
EditorGUILayout.LabelField("Param 4", networkedAnimatorTarget.param4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
84
MLAPI-Editor/NetworkedBehaviourEditor.cs
Normal file
84
MLAPI-Editor/NetworkedBehaviourEditor.cs
Normal file
@ -0,0 +1,84 @@
|
||||
using MLAPI.Attributes;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor
|
||||
{
|
||||
[CustomEditor(typeof(NetworkedBehaviour), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class NetworkedBehaviourInspector : Editor
|
||||
{
|
||||
private bool initialized;
|
||||
protected List<string> syncedVarNames = new List<string>();
|
||||
|
||||
private GUIContent syncedVarLabelGuiContent;
|
||||
|
||||
private void Init(MonoScript script)
|
||||
{
|
||||
initialized = true;
|
||||
|
||||
syncedVarLabelGuiContent = new GUIContent("SyncedVar", "This variable has been marked with the [SyncedVar] attribute.");
|
||||
|
||||
FieldInfo[] fields = script.GetClass().GetFields(BindingFlags.Public | BindingFlags.Instance | BindingFlags.FlattenHierarchy | BindingFlags.NonPublic);
|
||||
for (int i = 0; i < fields.Length; i++)
|
||||
{
|
||||
Attribute[] attributes = (Attribute[])fields[i].GetCustomAttributes(typeof(SyncedVar), true);
|
||||
if (attributes.Length > 0)
|
||||
syncedVarNames.Add(fields[i].Name);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (!initialized)
|
||||
{
|
||||
serializedObject.Update();
|
||||
SerializedProperty scriptProperty = serializedObject.FindProperty("m_Script");
|
||||
if (scriptProperty == null)
|
||||
return;
|
||||
|
||||
MonoScript targetScript = scriptProperty.objectReferenceValue as MonoScript;
|
||||
Init(targetScript);
|
||||
}
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
serializedObject.Update();
|
||||
|
||||
SerializedProperty property = serializedObject.GetIterator();
|
||||
bool expanded = true;
|
||||
while (property.NextVisible(expanded))
|
||||
{
|
||||
bool isSyncVar = syncedVarNames.Contains(property.name);
|
||||
if (property.propertyType == SerializedPropertyType.ObjectReference)
|
||||
{
|
||||
if (property.name == "m_Script")
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
|
||||
EditorGUILayout.PropertyField(property, true);
|
||||
|
||||
if (isSyncVar)
|
||||
GUILayout.Label(syncedVarLabelGuiContent, EditorStyles.miniLabel, GUILayout.Width(EditorStyles.miniLabel.CalcSize(syncedVarLabelGuiContent).x));
|
||||
|
||||
if (property.name == "m_Script")
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.PropertyField(property, true);
|
||||
|
||||
if (isSyncVar)
|
||||
GUILayout.Label(syncedVarLabelGuiContent, EditorStyles.miniLabel, GUILayout.Width(EditorStyles.miniLabel.CalcSize(syncedVarLabelGuiContent).x));
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
expanded = false;
|
||||
}
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
EditorGUI.EndChangeCheck();
|
||||
}
|
||||
}
|
||||
}
|
68
MLAPI-Editor/NetworkedObjectEditor.cs
Normal file
68
MLAPI-Editor/NetworkedObjectEditor.cs
Normal file
@ -0,0 +1,68 @@
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor
|
||||
{
|
||||
[CustomEditor(typeof(NetworkedObject), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class NetworkedObjectEditor : Editor
|
||||
{
|
||||
private bool initialized;
|
||||
private NetworkedObject networkedObject;
|
||||
private bool showObservers;
|
||||
|
||||
private void Init()
|
||||
{
|
||||
if (initialized)
|
||||
return;
|
||||
initialized = true;
|
||||
networkedObject = (NetworkedObject)target;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
Init();
|
||||
if (NetworkingManager.singleton == null || (!NetworkingManager.singleton.isServer && !NetworkingManager.singleton.isClient))
|
||||
base.OnInspectorGUI(); //Only run this if we are NOT running server. This is where the ServerOnly box is drawn
|
||||
|
||||
if (!networkedObject.isSpawned && NetworkingManager.singleton != null && NetworkingManager.singleton.isServer)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.LabelField(new GUIContent("Spawn", "Spawns the object across the network"));
|
||||
if (GUILayout.Toggle(false, "Spawn", EditorStyles.miniButtonLeft))
|
||||
{
|
||||
networkedObject.Spawn();
|
||||
EditorUtility.SetDirty(target);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
else if(networkedObject.isSpawned)
|
||||
{
|
||||
EditorGUILayout.LabelField("NetworkId: ", networkedObject.NetworkId.ToString(), EditorStyles.label);
|
||||
EditorGUILayout.LabelField("OwnerId: ", networkedObject.OwnerClientId.ToString(), EditorStyles.label);
|
||||
EditorGUILayout.LabelField("isSpawned: ", networkedObject.isSpawned.ToString(), EditorStyles.label);
|
||||
EditorGUILayout.LabelField("isLocalPlayer: ", networkedObject.isLocalPlayer.ToString(), EditorStyles.label);
|
||||
EditorGUILayout.LabelField("isOwner: ", networkedObject.isOwner.ToString(), EditorStyles.label);
|
||||
EditorGUILayout.LabelField("isPoolObject: ", networkedObject.isPlayerObject.ToString(), EditorStyles.label);
|
||||
EditorGUILayout.LabelField("isPlayerObject: ", networkedObject.isPlayerObject.ToString(), EditorStyles.label);
|
||||
|
||||
if (networkedObject.observers != null && networkedObject.observers.Count > 0)
|
||||
{
|
||||
showObservers = EditorGUILayout.Foldout(showObservers, "Observers");
|
||||
if (showObservers)
|
||||
{
|
||||
EditorGUI.indentLevel += 1;
|
||||
foreach (var o in networkedObject.observers)
|
||||
{
|
||||
if (NetworkingManager.singleton.ConnectedClients[o].PlayerObject != null)
|
||||
EditorGUILayout.ObjectField("ClientId: " + o, NetworkingManager.singleton.ConnectedClients[o].PlayerObject, typeof(GameObject), false);
|
||||
else
|
||||
EditorGUILayout.TextField("ClientId: " + o, EditorStyles.label);
|
||||
}
|
||||
EditorGUI.indentLevel -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
75
MLAPI-Editor/NetworkingManagerEditor.cs
Normal file
75
MLAPI-Editor/NetworkingManagerEditor.cs
Normal file
@ -0,0 +1,75 @@
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEditorInternal;
|
||||
|
||||
[CustomEditor(typeof(NetworkingManager), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class NetworkingManagerEditor : Editor
|
||||
{
|
||||
private ReorderableList networkedObjectList;
|
||||
|
||||
private NetworkingManager networkingManager;
|
||||
private bool initialized;
|
||||
|
||||
private void Init()
|
||||
{
|
||||
if (initialized)
|
||||
return;
|
||||
initialized = true;
|
||||
networkingManager = (NetworkingManager)target;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
networkedObjectList = new ReorderableList(serializedObject, serializedObject.FindProperty("NetworkConfig").FindPropertyRelative("NetworkedPrefabs"), true, true, true, true);
|
||||
networkedObjectList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
|
||||
{
|
||||
var element = networkedObjectList.serializedProperty.GetArrayElementAtIndex(index);
|
||||
rect.y += 2;
|
||||
EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width - 30, EditorGUIUtility.singleLineHeight),
|
||||
element.FindPropertyRelative("prefab"), GUIContent.none);
|
||||
EditorGUI.PropertyField(new Rect(rect.x + rect.width - 30, rect.y, 30, EditorGUIUtility.singleLineHeight),
|
||||
element.FindPropertyRelative("playerPrefab"), GUIContent.none);
|
||||
};
|
||||
|
||||
networkedObjectList.drawHeaderCallback = (Rect rect) => {
|
||||
EditorGUI.LabelField(rect, "Networked Prefabs");
|
||||
};
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
Init();
|
||||
if (!networkingManager.isServer && !networkingManager.isClient)
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
serializedObject.Update();
|
||||
networkedObjectList.DoLayoutList();
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
base.OnInspectorGUI(); //Only draw if we don't have a running client or server
|
||||
}
|
||||
else
|
||||
{
|
||||
string instanceType = "";
|
||||
if (networkingManager.isHost)
|
||||
instanceType = "Host";
|
||||
else if (networkingManager.isServer)
|
||||
instanceType = "Server";
|
||||
else if (networkingManager.isClient)
|
||||
instanceType = "Client";
|
||||
|
||||
EditorGUILayout.HelpBox("You cannot edit the NetworkConfig when a " + instanceType + " is running", MessageType.Info);
|
||||
if (GUILayout.Toggle(false, "Stop " + instanceType, EditorStyles.miniButtonMid))
|
||||
{
|
||||
if (networkingManager.isHost)
|
||||
networkingManager.StopHost();
|
||||
else if (networkingManager.isServer)
|
||||
networkingManager.StopServer();
|
||||
else if (networkingManager.isClient)
|
||||
networkingManager.StopClient();
|
||||
}
|
||||
}
|
||||
Repaint();
|
||||
}
|
||||
}
|
36
MLAPI-Editor/Properties/AssemblyInfo.cs
Normal file
36
MLAPI-Editor/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MLAPI-Editor")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MLAPI-Editor")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("a45dbd43-d640-4562-9f24-6745269cedf7")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
35
MLAPI-Editor/TrackedObjectEditor.cs
Normal file
35
MLAPI-Editor/TrackedObjectEditor.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor
|
||||
{
|
||||
[CustomEditor(typeof(TrackedObject), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class TrackedObjectEditor : Editor
|
||||
{
|
||||
private TrackedObject trackedObject;
|
||||
private bool initialized;
|
||||
|
||||
private void Init()
|
||||
{
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
trackedObject = (TrackedObject)target;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
Init();
|
||||
base.OnInspectorGUI();
|
||||
if(NetworkingManager.singleton != null && NetworkingManager.singleton.isServer)
|
||||
{
|
||||
EditorGUILayout.LabelField("Total points: ", trackedObject.TotalPoints.ToString(), EditorStyles.label);
|
||||
EditorGUILayout.LabelField("Avg time between points: ", trackedObject.AvgTimeBetweenPointsMs.ToString() + " ms", EditorStyles.label);
|
||||
EditorGUILayout.LabelField("Total history: ", trackedObject.TotalTimeHistory.ToString() + " seconds", EditorStyles.label);
|
||||
}
|
||||
Repaint();
|
||||
}
|
||||
}
|
||||
}
|
@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.27130.2027
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MLAPI", "MLAPI\MLAPI.csproj", "{EE431720-A9ED-43DC-9E74-10B693816D38}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MLAPI-Editor", "MLAPI-Editor\MLAPI-Editor.csproj", "{A45DBD43-D640-4562-9F24-6745269CEDF7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -18,6 +20,12 @@ Global
|
||||
{EE431720-A9ED-43DC-9E74-10B693816D38}.Development|Any CPU.Build.0 = Development|Any CPU
|
||||
{EE431720-A9ED-43DC-9E74-10B693816D38}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE431720-A9ED-43DC-9E74-10B693816D38}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A45DBD43-D640-4562-9F24-6745269CEDF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A45DBD43-D640-4562-9F24-6745269CEDF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A45DBD43-D640-4562-9F24-6745269CEDF7}.Development|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A45DBD43-D640-4562-9F24-6745269CEDF7}.Development|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A45DBD43-D640-4562-9F24-6745269CEDF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A45DBD43-D640-4562-9F24-6745269CEDF7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
13
MLAPI/Attributes/BinaryIgnore.cs
Normal file
13
MLAPI/Attributes/BinaryIgnore.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace MLAPI.Attributes
|
||||
{
|
||||
/// <summary>
|
||||
/// The attribute to use for fields that should be ignored by the BinarySerializer
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class BinaryIgnore : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
}
|
13
MLAPI/Attributes/ClientRpc.cs
Normal file
13
MLAPI/Attributes/ClientRpc.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace MLAPI.Attributes
|
||||
{
|
||||
/// <summary>
|
||||
/// This attribute is used to specify that this is a remote Client RPC
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class ClientRpc : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
}
|
13
MLAPI/Attributes/Command.cs
Normal file
13
MLAPI/Attributes/Command.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace MLAPI.Attributes
|
||||
{
|
||||
/// <summary>
|
||||
/// This attribute is used to specify that this is a remote Command
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class Command : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -2,14 +2,19 @@
|
||||
|
||||
namespace MLAPI.Attributes
|
||||
{
|
||||
/// <summary>
|
||||
/// The attribute to use for variables that should be automatically. replicated from Server to Client.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class SyncedVar : Attribute
|
||||
{
|
||||
public string hook;
|
||||
|
||||
public SyncedVar()
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// The method name to invoke when the SyncVar get's updated.
|
||||
/// </summary>
|
||||
public string hookMethodName;
|
||||
/// <summary>
|
||||
/// If true, the syncedVar will only be synced to the owner.
|
||||
/// </summary>
|
||||
public bool target;
|
||||
}
|
||||
}
|
||||
|
13
MLAPI/Attributes/TargetRpc.cs
Normal file
13
MLAPI/Attributes/TargetRpc.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace MLAPI.Attributes
|
||||
{
|
||||
/// <summary>
|
||||
/// This attribute is used to specify that this is a remote Target RPC
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class TargetRpc : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
}
|
40
MLAPI/Data/Cache.cs
Normal file
40
MLAPI/Data/Cache.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using MLAPI.NetworkingManagerComponents.Binary;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
internal static class Cache
|
||||
{
|
||||
internal static Dictionary<string, ulong> messageAttributeHashes = new Dictionary<string, ulong>();
|
||||
internal static Dictionary<ulong, string> messageAttributeNames = new Dictionary<ulong, string>();
|
||||
|
||||
internal static ulong GetMessageAttributeHash(string name)
|
||||
{
|
||||
if (messageAttributeHashes.ContainsKey(name))
|
||||
return messageAttributeHashes[name];
|
||||
|
||||
ulong value = PrimitiveHasher.GetULongHash(name);
|
||||
messageAttributeHashes.Add(name, value);
|
||||
messageAttributeNames.Add(value, name);
|
||||
return value;
|
||||
}
|
||||
|
||||
internal static string GetAttributeMethodName(ulong hash)
|
||||
{
|
||||
if (messageAttributeNames.ContainsKey(hash))
|
||||
return messageAttributeNames[hash];
|
||||
else
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
internal static void RegisterMessageAttributeName(string name)
|
||||
{
|
||||
if (messageAttributeHashes.ContainsKey(name))
|
||||
return;
|
||||
|
||||
ulong value = PrimitiveHasher.GetULongHash(name);
|
||||
messageAttributeHashes.Add(name, value);
|
||||
messageAttributeNames.Add(value, name);
|
||||
}
|
||||
}
|
||||
}
|
24
MLAPI/Data/Channel.cs
Normal file
24
MLAPI/Data/Channel.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// A data object that represents a NetworkTransport channel
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class Channel
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the channel
|
||||
/// </summary>
|
||||
public string Name;
|
||||
/// <summary>
|
||||
/// The Transport QOS type
|
||||
/// </summary>
|
||||
public ChannelType Type;
|
||||
/// <summary>
|
||||
/// Wheter or not the channel should be encrypted
|
||||
/// </summary>
|
||||
public bool Encrypted;
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
struct ClientIdKey
|
||||
{
|
||||
internal readonly int hostId;
|
||||
internal readonly int connectionId;
|
||||
|
||||
internal ClientIdKey (int hostId, int connectionId)
|
||||
{
|
||||
this.hostId = hostId;
|
||||
this.connectionId = connectionId;
|
||||
}
|
||||
|
||||
public override bool Equals (object obj)
|
||||
{
|
||||
if (obj == null || GetType() != obj.GetType())
|
||||
return false;
|
||||
|
||||
ClientIdKey key = (ClientIdKey)obj;
|
||||
return (hostId == key.hostId) && (connectionId == key.hostId);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return hostId ^ connectionId;
|
||||
}
|
||||
|
||||
public static bool operator ==(ClientIdKey x, ClientIdKey y)
|
||||
{
|
||||
return x.hostId == y.hostId && x.connectionId == y.connectionId;
|
||||
}
|
||||
|
||||
public static bool operator !=(ClientIdKey x, ClientIdKey y)
|
||||
{
|
||||
return !(x == y);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +1,17 @@
|
||||
namespace MLAPI.Data
|
||||
using MLAPI.NetworkingManagerComponents.Binary;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// The datatype used to classify SyncedVars
|
||||
/// </summary>
|
||||
internal enum FieldType
|
||||
{
|
||||
Bool,
|
||||
Byte,
|
||||
Char,
|
||||
Double,
|
||||
Single,
|
||||
Int,
|
||||
@ -18,6 +25,622 @@
|
||||
Vector3,
|
||||
Vector2,
|
||||
Quaternion,
|
||||
ByteArray
|
||||
BoolArray,
|
||||
ByteArray,
|
||||
DoubleArray,
|
||||
SingleArray,
|
||||
IntArray,
|
||||
LongArray,
|
||||
SByteArray,
|
||||
ShortArray,
|
||||
UIntArray,
|
||||
ULongArray,
|
||||
UShortArray,
|
||||
StringArray,
|
||||
Vector3Array,
|
||||
Vector2Array,
|
||||
QuaternionArray,
|
||||
Invalid
|
||||
}
|
||||
|
||||
internal static class FieldTypeHelper
|
||||
{
|
||||
internal static object ReadFieldType(BitReader reader, FieldType fieldType)
|
||||
{
|
||||
switch (fieldType)
|
||||
{
|
||||
case FieldType.Bool:
|
||||
return reader.ReadBool();
|
||||
case FieldType.Byte:
|
||||
return reader.ReadByte();
|
||||
case FieldType.Double:
|
||||
return reader.ReadDouble();
|
||||
case FieldType.Single:
|
||||
return reader.ReadFloat();
|
||||
case FieldType.Int:
|
||||
return reader.ReadInt();
|
||||
case FieldType.Long:
|
||||
return reader.ReadLong();
|
||||
case FieldType.SByte:
|
||||
return reader.ReadSByte();
|
||||
case FieldType.Short:
|
||||
return reader.ReadShort();
|
||||
case FieldType.UInt:
|
||||
return reader.ReadUInt();
|
||||
case FieldType.ULong:
|
||||
return reader.ReadULong();
|
||||
case FieldType.UShort:
|
||||
return reader.ReadUShort();
|
||||
case FieldType.String:
|
||||
return reader.ReadString();
|
||||
case FieldType.Vector3:
|
||||
Vector3 vector3 = Vector3.zero;
|
||||
vector3.x = reader.ReadFloat();
|
||||
vector3.y = reader.ReadFloat();
|
||||
vector3.z = reader.ReadFloat();
|
||||
return vector3;
|
||||
case FieldType.Vector2:
|
||||
Vector2 vector2 = Vector2.zero;
|
||||
vector2.x = reader.ReadFloat();
|
||||
vector2.y = reader.ReadFloat();
|
||||
return vector2;
|
||||
case FieldType.Quaternion:
|
||||
Vector3 eulerAngle = Vector3.zero;
|
||||
eulerAngle.x = reader.ReadFloat();
|
||||
eulerAngle.y = reader.ReadFloat();
|
||||
eulerAngle.z = reader.ReadFloat();
|
||||
return Quaternion.Euler(eulerAngle);
|
||||
case FieldType.BoolArray:
|
||||
ushort boolCount = reader.ReadUShort();
|
||||
bool[] bools = new bool[boolCount];
|
||||
for (int j = 0; j < boolCount; j++)
|
||||
bools[j] = reader.ReadBool();
|
||||
return bools;
|
||||
case FieldType.ByteArray:
|
||||
return reader.ReadByteArray();
|
||||
case FieldType.DoubleArray:
|
||||
return reader.ReadDoubleArray();
|
||||
case FieldType.SingleArray:
|
||||
return reader.ReadFloatArray();
|
||||
case FieldType.IntArray:
|
||||
return reader.ReadIntArray();
|
||||
case FieldType.LongArray:
|
||||
return reader.ReadLongArray();
|
||||
case FieldType.SByteArray:
|
||||
return reader.ReadSByteArray();
|
||||
case FieldType.ShortArray:
|
||||
return reader.ReadShortArray();
|
||||
case FieldType.UIntArray:
|
||||
return reader.ReadUIntArray();
|
||||
case FieldType.ULongArray:
|
||||
return reader.ReadULongArray();
|
||||
case FieldType.UShortArray:
|
||||
return reader.ReadUShortArray();
|
||||
case FieldType.StringArray:
|
||||
ushort stringCount = reader.ReadUShort();
|
||||
string[] strings = new string[stringCount];
|
||||
for (int j = 0; j < stringCount; j++)
|
||||
strings[j] = reader.ReadString();
|
||||
return strings;
|
||||
case FieldType.Vector3Array:
|
||||
ushort vector3Count = reader.ReadUShort();
|
||||
Vector3[] vector3s = new Vector3[vector3Count];
|
||||
for (int j = 0; j < vector3Count; j++)
|
||||
{
|
||||
Vector3 vec3 = Vector3.zero;
|
||||
vec3.x = reader.ReadFloat();
|
||||
vec3.y = reader.ReadFloat();
|
||||
vec3.z = reader.ReadFloat();
|
||||
vector3s[j] = vec3;
|
||||
}
|
||||
return vector3s;
|
||||
case FieldType.Vector2Array:
|
||||
ushort vector2Count = reader.ReadUShort();
|
||||
Vector2[] vector2s = new Vector2[vector2Count];
|
||||
for (int j = 0; j < vector2Count; j++)
|
||||
{
|
||||
Vector2 vec2 = Vector2.zero;
|
||||
vec2.x = reader.ReadFloat();
|
||||
vec2.y = reader.ReadFloat();
|
||||
vector2s[j] = vec2;
|
||||
}
|
||||
return vector2s;
|
||||
case FieldType.QuaternionArray:
|
||||
ushort quaternionCount = reader.ReadUShort();
|
||||
Quaternion[] quaternions = new Quaternion[quaternionCount];
|
||||
for (int j = 0; j < quaternionCount; j++)
|
||||
{
|
||||
Vector3 vec3 = Vector3.zero;
|
||||
vec3.x = reader.ReadFloat();
|
||||
vec3.y = reader.ReadFloat();
|
||||
vec3.z = reader.ReadFloat();
|
||||
quaternions[j] = Quaternion.Euler(vec3);
|
||||
}
|
||||
return quaternions;
|
||||
case FieldType.Invalid:
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
internal static void WriteFieldType(BitWriter writer, object value, FieldType fieldType)
|
||||
{
|
||||
switch (fieldType)
|
||||
{
|
||||
case FieldType.Bool:
|
||||
writer.WriteBool((bool)value);
|
||||
break;
|
||||
case FieldType.Byte:
|
||||
writer.WriteByte((byte)value);
|
||||
break;
|
||||
case FieldType.Double:
|
||||
writer.WriteDouble((double)value);
|
||||
break;
|
||||
case FieldType.Single:
|
||||
writer.WriteFloat((float)value);
|
||||
break;
|
||||
case FieldType.Int:
|
||||
writer.WriteInt((int)value);
|
||||
break;
|
||||
case FieldType.Long:
|
||||
writer.WriteLong((long)value);
|
||||
break;
|
||||
case FieldType.SByte:
|
||||
writer.WriteSByte((sbyte)value);
|
||||
break;
|
||||
case FieldType.Short:
|
||||
writer.WriteShort((short)value);
|
||||
break;
|
||||
case FieldType.UInt:
|
||||
writer.WriteUInt((uint)value);
|
||||
break;
|
||||
case FieldType.ULong:
|
||||
writer.WriteULong((ulong)value);
|
||||
break;
|
||||
case FieldType.UShort:
|
||||
writer.WriteUShort((ushort)value);
|
||||
break;
|
||||
case FieldType.String:
|
||||
writer.WriteString((string)value);
|
||||
break;
|
||||
case FieldType.Vector3:
|
||||
Vector3 vector3 = (Vector3)value;
|
||||
writer.WriteFloat(vector3.x);
|
||||
writer.WriteFloat(vector3.y);
|
||||
writer.WriteFloat(vector3.z);
|
||||
break;
|
||||
case FieldType.Vector2:
|
||||
Vector2 vector2 = (Vector2)value;
|
||||
writer.WriteFloat(vector2.x);
|
||||
writer.WriteFloat(vector2.y);
|
||||
break;
|
||||
case FieldType.Quaternion:
|
||||
Vector3 euler = ((Quaternion)value).eulerAngles;
|
||||
writer.WriteFloat(euler.x);
|
||||
writer.WriteFloat(euler.y);
|
||||
writer.WriteFloat(euler.z);
|
||||
break;
|
||||
case FieldType.BoolArray:
|
||||
bool[] bools = (bool[])value;
|
||||
writer.WriteUShort((ushort)bools.Length);
|
||||
for (int j = 0; j < bools.Length; j++)
|
||||
writer.WriteBool(bools[j]);
|
||||
break;
|
||||
case FieldType.ByteArray:
|
||||
writer.WriteByteArray((byte[])value);
|
||||
break;
|
||||
case FieldType.DoubleArray:
|
||||
writer.WriteDoubleArray((double[])value);
|
||||
break;
|
||||
case FieldType.SingleArray:
|
||||
writer.WriteFloatArray((float[])value);
|
||||
break;
|
||||
case FieldType.IntArray:
|
||||
writer.WriteIntArray((int[])value);
|
||||
break;
|
||||
case FieldType.LongArray:
|
||||
writer.WriteLongArray((long[])value);
|
||||
break;
|
||||
case FieldType.SByteArray:
|
||||
writer.WriteSByteArray((sbyte[])value);
|
||||
break;
|
||||
case FieldType.ShortArray:
|
||||
writer.WriteShortArray((short[])value);
|
||||
break;
|
||||
case FieldType.UIntArray:
|
||||
writer.WriteUIntArray((uint[])value);
|
||||
break;
|
||||
case FieldType.ULongArray:
|
||||
writer.WriteULongArray((ulong[])value);
|
||||
break;
|
||||
case FieldType.UShortArray:
|
||||
writer.WriteUShortArray((ushort[])value);
|
||||
break;
|
||||
case FieldType.StringArray:
|
||||
string[] strings = (string[])value;
|
||||
writer.WriteUShort((ushort)strings.Length);
|
||||
for (int j = 0; j < strings.Length; j++)
|
||||
writer.WriteString(strings[j]);
|
||||
break;
|
||||
case FieldType.Vector3Array:
|
||||
Vector3[] vector3s = (Vector3[])value;
|
||||
writer.WriteUShort((ushort)vector3s.Length);
|
||||
for (int j = 0; j < vector3s.Length; j++)
|
||||
{
|
||||
writer.WriteFloat(vector3s[j].x);
|
||||
writer.WriteFloat(vector3s[j].y);
|
||||
writer.WriteFloat(vector3s[j].z);
|
||||
}
|
||||
break;
|
||||
case FieldType.Vector2Array:
|
||||
Vector2[] vector2s = (Vector2[])value;
|
||||
writer.WriteUShort((ushort)vector2s.Length);
|
||||
for (int j = 0; j < vector2s.Length; j++)
|
||||
{
|
||||
writer.WriteFloat(vector2s[j].x);
|
||||
writer.WriteFloat(vector2s[j].y);
|
||||
}
|
||||
break;
|
||||
case FieldType.QuaternionArray:
|
||||
Quaternion[] quaternions = (Quaternion[])value;
|
||||
writer.WriteUShort((ushort)quaternions.Length);
|
||||
for (int j = 0; j < quaternions.Length; j++)
|
||||
{
|
||||
writer.WriteFloat(quaternions[j].eulerAngles.x);
|
||||
writer.WriteFloat(quaternions[j].eulerAngles.y);
|
||||
writer.WriteFloat(quaternions[j].eulerAngles.z);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void WriteFieldType(BitWriter writer, FieldInfo field, object fieldInstance, FieldType fieldType)
|
||||
{
|
||||
switch (fieldType)
|
||||
{
|
||||
case FieldType.Bool:
|
||||
writer.WriteBool((bool)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.Byte:
|
||||
writer.WriteByte((byte)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.Double:
|
||||
writer.WriteDouble((double)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.Single:
|
||||
writer.WriteFloat((float)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.Int:
|
||||
writer.WriteInt((int)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.Long:
|
||||
writer.WriteLong((long)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.SByte:
|
||||
writer.WriteSByte((sbyte)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.Short:
|
||||
writer.WriteShort((short)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.UInt:
|
||||
writer.WriteUInt((uint)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.ULong:
|
||||
writer.WriteULong((ulong)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.UShort:
|
||||
writer.WriteUShort((ushort)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.String:
|
||||
writer.WriteString((string)field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.Vector3:
|
||||
Vector3 vector3 = (Vector3)field.GetValue(fieldInstance);
|
||||
writer.WriteFloat(vector3.x);
|
||||
writer.WriteFloat(vector3.y);
|
||||
writer.WriteFloat(vector3.z);
|
||||
break;
|
||||
case FieldType.Vector2:
|
||||
Vector2 vector2 = (Vector2)field.GetValue(fieldInstance);
|
||||
writer.WriteFloat(vector2.x);
|
||||
writer.WriteFloat(vector2.y);
|
||||
break;
|
||||
case FieldType.Quaternion:
|
||||
Vector3 euler = ((Quaternion)field.GetValue(fieldInstance)).eulerAngles;
|
||||
writer.WriteFloat(euler.x);
|
||||
writer.WriteFloat(euler.y);
|
||||
writer.WriteFloat(euler.z);
|
||||
break;
|
||||
case FieldType.BoolArray:
|
||||
bool[] bools = (bool[])field.GetValue(fieldInstance);
|
||||
writer.WriteUShort((ushort)bools.Length);
|
||||
for (int j = 0; j < bools.Length; j++)
|
||||
writer.WriteBool(bools[j]);
|
||||
break;
|
||||
case FieldType.ByteArray:
|
||||
writer.WriteByteArray((byte[])field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.DoubleArray:
|
||||
writer.WriteDoubleArray((double[])field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.SingleArray:
|
||||
writer.WriteFloatArray((float[])field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.IntArray:
|
||||
writer.WriteIntArray((int[])field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.LongArray:
|
||||
writer.WriteLongArray((long[])field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.SByteArray:
|
||||
writer.WriteSByteArray((sbyte[])field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.ShortArray:
|
||||
writer.WriteShortArray((short[])field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.UIntArray:
|
||||
writer.WriteUIntArray((uint[])field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.ULongArray:
|
||||
writer.WriteULongArray((ulong[])field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.UShortArray:
|
||||
writer.WriteUShortArray((ushort[])field.GetValue(fieldInstance));
|
||||
break;
|
||||
case FieldType.StringArray:
|
||||
string[] strings = (string[])field.GetValue(fieldInstance);
|
||||
writer.WriteUShort((ushort)strings.Length);
|
||||
for (int j = 0; j < strings.Length; j++)
|
||||
writer.WriteString(strings[j]);
|
||||
break;
|
||||
case FieldType.Vector3Array:
|
||||
Vector3[] vector3s = (Vector3[])field.GetValue(fieldInstance);
|
||||
writer.WriteUShort((ushort)vector3s.Length);
|
||||
for (int j = 0; j < vector3s.Length; j++)
|
||||
{
|
||||
writer.WriteFloat(vector3s[j].x);
|
||||
writer.WriteFloat(vector3s[j].y);
|
||||
writer.WriteFloat(vector3s[j].z);
|
||||
}
|
||||
break;
|
||||
case FieldType.Vector2Array:
|
||||
Vector2[] vector2s = (Vector2[])field.GetValue(fieldInstance);
|
||||
writer.WriteUShort((ushort)vector2s.Length);
|
||||
for (int j = 0; j < vector2s.Length; j++)
|
||||
{
|
||||
writer.WriteFloat(vector2s[j].x);
|
||||
writer.WriteFloat(vector2s[j].y);
|
||||
}
|
||||
break;
|
||||
case FieldType.QuaternionArray:
|
||||
Quaternion[] quaternions = (Quaternion[])field.GetValue(fieldInstance);
|
||||
writer.WriteUShort((ushort)quaternions.Length);
|
||||
for (int j = 0; j < quaternions.Length; j++)
|
||||
{
|
||||
writer.WriteFloat(quaternions[j].eulerAngles.x);
|
||||
writer.WriteFloat(quaternions[j].eulerAngles.y);
|
||||
writer.WriteFloat(quaternions[j].eulerAngles.z);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
internal static FieldType GetFieldType(Type type)
|
||||
{
|
||||
if (type == typeof(bool))
|
||||
return FieldType.Bool;
|
||||
else if (type == typeof(byte))
|
||||
return FieldType.Byte;
|
||||
else if (type == typeof(double))
|
||||
return FieldType.Double;
|
||||
else if (type == typeof(float))
|
||||
return FieldType.Single;
|
||||
else if (type == typeof(int))
|
||||
return FieldType.Int;
|
||||
else if (type == typeof(long))
|
||||
return FieldType.Long;
|
||||
else if (type == typeof(sbyte))
|
||||
return FieldType.SByte;
|
||||
else if (type == typeof(short))
|
||||
return FieldType.Short;
|
||||
else if (type == typeof(uint))
|
||||
return FieldType.UInt;
|
||||
else if (type == typeof(ulong))
|
||||
return FieldType.ULong;
|
||||
else if (type == typeof(ushort))
|
||||
return FieldType.UShort;
|
||||
else if (type == typeof(string))
|
||||
return FieldType.String;
|
||||
else if (type == typeof(Vector3))
|
||||
return FieldType.Vector3;
|
||||
else if (type == typeof(Vector2))
|
||||
return FieldType.Vector2;
|
||||
else if (type == typeof(Quaternion))
|
||||
return FieldType.Quaternion;
|
||||
else if (type == typeof(bool[]))
|
||||
return FieldType.BoolArray;
|
||||
else if (type == typeof(byte[]))
|
||||
return FieldType.ByteArray;
|
||||
else if (type == typeof(double[]))
|
||||
return FieldType.DoubleArray;
|
||||
else if (type == typeof(float[]))
|
||||
return FieldType.SingleArray;
|
||||
else if (type == typeof(int[]))
|
||||
return FieldType.IntArray;
|
||||
else if (type == typeof(long[]))
|
||||
return FieldType.LongArray;
|
||||
else if (type == typeof(sbyte[]))
|
||||
return FieldType.SByteArray;
|
||||
else if (type == typeof(short[]))
|
||||
return FieldType.ShortArray;
|
||||
else if (type == typeof(uint[]))
|
||||
return FieldType.UIntArray;
|
||||
else if (type == typeof(ulong[]))
|
||||
return FieldType.ULongArray;
|
||||
else if (type == typeof(ushort[]))
|
||||
return FieldType.UShortArray;
|
||||
else if (type == typeof(string[]))
|
||||
return FieldType.StringArray;
|
||||
else if (type == typeof(Vector3[]))
|
||||
return FieldType.Vector3Array;
|
||||
else if (type == typeof(Vector2[]))
|
||||
return FieldType.Vector2Array;
|
||||
else if (type == typeof(Quaternion[]))
|
||||
return FieldType.QuaternionArray;
|
||||
else
|
||||
return FieldType.Invalid;
|
||||
}
|
||||
|
||||
internal static object[] ReadObjects(BitReader reader, byte paramCount)
|
||||
{
|
||||
object[] returnVal = new object[paramCount];
|
||||
for (int i = 0; i < paramCount; i++)
|
||||
{
|
||||
FieldType fieldType = (FieldType)reader.ReadBits(5);
|
||||
|
||||
switch (fieldType)
|
||||
{
|
||||
case FieldType.Bool:
|
||||
returnVal[i] = reader.ReadBool();
|
||||
break;
|
||||
case FieldType.Byte:
|
||||
returnVal[i] = reader.ReadByte();
|
||||
break;
|
||||
case FieldType.Double:
|
||||
returnVal[i] = reader.ReadDouble();
|
||||
break;
|
||||
case FieldType.Single:
|
||||
returnVal[i] = reader.ReadFloat();
|
||||
break;
|
||||
case FieldType.Int:
|
||||
returnVal[i] = reader.ReadInt();
|
||||
break;
|
||||
case FieldType.Long:
|
||||
returnVal[i] = reader.ReadLong();
|
||||
break;
|
||||
case FieldType.SByte:
|
||||
returnVal[i] = reader.ReadSByte();
|
||||
break;
|
||||
case FieldType.Short:
|
||||
returnVal[i] = reader.ReadShort();
|
||||
break;
|
||||
case FieldType.UInt:
|
||||
returnVal[i] = reader.ReadUInt();
|
||||
break;
|
||||
case FieldType.ULong:
|
||||
returnVal[i] = reader.ReadULong();
|
||||
break;
|
||||
case FieldType.UShort:
|
||||
returnVal[i] = reader.ReadUShort();
|
||||
break;
|
||||
case FieldType.String:
|
||||
returnVal[i] = reader.ReadString();
|
||||
break;
|
||||
case FieldType.Vector3:
|
||||
Vector3 vector3 = Vector3.zero;
|
||||
vector3.x = reader.ReadFloat();
|
||||
vector3.y = reader.ReadFloat();
|
||||
vector3.z = reader.ReadFloat();
|
||||
returnVal[i] = vector3;
|
||||
break;
|
||||
case FieldType.Vector2:
|
||||
Vector2 vector2 = Vector2.zero;
|
||||
vector2.x = reader.ReadFloat();
|
||||
vector2.y = reader.ReadFloat();
|
||||
returnVal[i] = vector2;
|
||||
break;
|
||||
case FieldType.Quaternion:
|
||||
Vector3 eulerAngle = Vector3.zero;
|
||||
eulerAngle.x = reader.ReadFloat();
|
||||
eulerAngle.y = reader.ReadFloat();
|
||||
eulerAngle.z = reader.ReadFloat();
|
||||
returnVal[i] = Quaternion.Euler(eulerAngle);
|
||||
break;
|
||||
case FieldType.BoolArray:
|
||||
ushort boolCount = reader.ReadUShort();
|
||||
bool[] bools = new bool[boolCount];
|
||||
for (int j = 0; j < boolCount; j++)
|
||||
bools[j] = reader.ReadBool();
|
||||
returnVal[i] = bools;
|
||||
break;
|
||||
case FieldType.ByteArray:
|
||||
returnVal[i] = reader.ReadByteArray();
|
||||
break;
|
||||
case FieldType.DoubleArray:
|
||||
returnVal[i] = reader.ReadDoubleArray();
|
||||
break;
|
||||
case FieldType.SingleArray:
|
||||
returnVal[i] = reader.ReadFloatArray();
|
||||
break;
|
||||
case FieldType.IntArray:
|
||||
returnVal[i] = reader.ReadIntArray();
|
||||
break;
|
||||
case FieldType.LongArray:
|
||||
returnVal[i] = reader.ReadLongArray();
|
||||
break;
|
||||
case FieldType.SByteArray:
|
||||
returnVal[i] = reader.ReadSByteArray();
|
||||
break;
|
||||
case FieldType.ShortArray:
|
||||
returnVal[i] = reader.ReadShortArray();
|
||||
break;
|
||||
case FieldType.UIntArray:
|
||||
returnVal[i] = reader.ReadUIntArray();
|
||||
break;
|
||||
case FieldType.ULongArray:
|
||||
returnVal[i] = reader.ReadULongArray();
|
||||
break;
|
||||
case FieldType.UShortArray:
|
||||
returnVal[i] = reader.ReadUShortArray();
|
||||
break;
|
||||
case FieldType.StringArray:
|
||||
ushort stringCount = reader.ReadUShort();
|
||||
string[] strings = new string[stringCount];
|
||||
for (int j = 0; j < stringCount; j++)
|
||||
strings[j] = reader.ReadString();
|
||||
returnVal[i] = strings;
|
||||
break;
|
||||
case FieldType.Vector3Array:
|
||||
ushort vector3Count = reader.ReadUShort();
|
||||
Vector3[] vector3s = new Vector3[vector3Count];
|
||||
for (int j = 0; j < vector3Count; j++)
|
||||
{
|
||||
Vector3 vec3 = Vector3.zero;
|
||||
vec3.x = reader.ReadFloat();
|
||||
vec3.y = reader.ReadFloat();
|
||||
vec3.z = reader.ReadFloat();
|
||||
vector3s[j] = vec3;
|
||||
}
|
||||
returnVal[i] = vector3s;
|
||||
break;
|
||||
case FieldType.Vector2Array:
|
||||
ushort vector2Count = reader.ReadUShort();
|
||||
Vector2[] vector2s = new Vector2[vector2Count];
|
||||
for (int j = 0; j < vector2Count; j++)
|
||||
{
|
||||
Vector2 vec2 = Vector2.zero;
|
||||
vec2.x = reader.ReadFloat();
|
||||
vec2.y = reader.ReadFloat();
|
||||
vector2s[j] = vec2;
|
||||
}
|
||||
returnVal[i] = vector2s;
|
||||
break;
|
||||
case FieldType.QuaternionArray:
|
||||
ushort quaternionCount = reader.ReadUShort();
|
||||
Quaternion[] quaternions = new Quaternion[quaternionCount];
|
||||
for (int j = 0; j < quaternionCount; j++)
|
||||
{
|
||||
Vector3 vec3 = Vector3.zero;
|
||||
vec3.x = reader.ReadFloat();
|
||||
vec3.y = reader.ReadFloat();
|
||||
vec3.z = reader.ReadFloat();
|
||||
quaternions[j] = Quaternion.Euler(vec3);
|
||||
}
|
||||
returnVal[i] = quaternions;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return returnVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
65
MLAPI/Data/FixedQueue.cs
Normal file
65
MLAPI/Data/FixedQueue.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using System;
|
||||
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Queue with a fixed size
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the queue</typeparam>
|
||||
public sealed class FixedQueue<T>
|
||||
{
|
||||
private readonly T[] queue;
|
||||
private int queueCount = 0;
|
||||
private int queueStart;
|
||||
|
||||
/// <summary>
|
||||
/// The amount of enqueued objects
|
||||
/// </summary>
|
||||
public int Count { get => queueCount; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new FixedQueue with a given size
|
||||
/// </summary>
|
||||
/// <param name="maxSize">The size of the queue</param>
|
||||
public FixedQueue(int maxSize)
|
||||
{
|
||||
queue = new T[maxSize];
|
||||
queueStart = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enqueues an object
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <returns></returns>
|
||||
public bool Enqueue(T t)
|
||||
{
|
||||
queue[(queueStart + queueCount) % queue.Length] = t;
|
||||
if (++queueCount > queue.Length)
|
||||
{
|
||||
--queueCount;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dequeues an object
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public T Dequeue()
|
||||
{
|
||||
if (--queueCount == -1) throw new IndexOutOfRangeException("Cannot dequeue empty queue!");
|
||||
T res = queue[queueStart];
|
||||
queueStart = (queueStart + 1) % queue.Length;
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the element at a given virtual index
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <returns></returns>
|
||||
public T ElementAt(int index) => queue[(queueStart + index) % queue.Length];
|
||||
}
|
||||
}
|
19
MLAPI/Data/MessageType.cs
Normal file
19
MLAPI/Data/MessageType.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a MLAPI message type
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class MessageType
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the messageType
|
||||
/// </summary>
|
||||
public string Name;
|
||||
/// <summary>
|
||||
/// Wheter or not the channel should have passthrough support.
|
||||
/// </summary>
|
||||
public bool Passthrough;
|
||||
}
|
||||
}
|
217
MLAPI/Data/NetworkConfig.cs
Normal file
217
MLAPI/Data/NetworkConfig.cs
Normal file
@ -0,0 +1,217 @@
|
||||
using MLAPI.NetworkingManagerComponents.Binary;
|
||||
using MLAPI.NetworkingManagerComponents.Cryptography;
|
||||
using MLAPI.Data.Transports.UNET;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// The configuration object used to start server, client and hosts
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class NetworkConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// The protocol version. Different versions doesn't talk to each other.
|
||||
/// </summary>
|
||||
public ushort ProtocolVersion = 0;
|
||||
/// <summary>
|
||||
/// The transport hosts the sever uses
|
||||
/// </summary>
|
||||
public IUDPTransport NetworkTransport = new UnetTransport();
|
||||
/// <summary>
|
||||
/// Channels used by the NetworkedTransport
|
||||
/// </summary>
|
||||
public List<Channel> Channels = new List<Channel>();
|
||||
/// <summary>
|
||||
/// Registered MessageTypes
|
||||
/// </summary>
|
||||
public List<MessageType> MessageTypes = new List<MessageType>();
|
||||
internal HashSet<ushort> PassthroughMessageHashSet = new HashSet<ushort>();
|
||||
internal HashSet<string> EncryptedChannelsHashSet = new HashSet<string>();
|
||||
internal List<string> EncryptedChannels = new List<string>();
|
||||
/// <summary>
|
||||
/// A list of SceneNames that can be used during networked games.
|
||||
/// </summary>
|
||||
public List<string> RegisteredScenes = new List<string>();
|
||||
/// <summary>
|
||||
/// A list of spawnable prefabs
|
||||
/// </summary>
|
||||
[HideInInspector]
|
||||
public List<NetworkedPrefab> NetworkedPrefabs = new List<NetworkedPrefab>();
|
||||
internal Dictionary<string, int> NetworkPrefabIds;
|
||||
internal Dictionary<int, string> NetworkPrefabNames;
|
||||
/// <summary>
|
||||
/// The default player prefab
|
||||
/// </summary>
|
||||
[SerializeField]
|
||||
[HideInInspector]
|
||||
internal string PlayerPrefabName;
|
||||
/// <summary>
|
||||
/// The size of the receive message buffer. This is the max message size.
|
||||
/// </summary>
|
||||
public int MessageBufferSize = 65535;
|
||||
/// <summary>
|
||||
/// Amount of times per second the receive queue is emptied and all messages inside are processed.
|
||||
/// </summary>
|
||||
public int ReceiveTickrate = 64;
|
||||
/// <summary>
|
||||
/// The max amount of messages to process per ReceiveTickrate. This is to prevent flooding.
|
||||
/// </summary>
|
||||
public int MaxReceiveEventsPerTickRate = 500;
|
||||
/// <summary>
|
||||
/// The amount of times per second every pending message will be sent away.
|
||||
/// </summary>
|
||||
public int SendTickrate = 64;
|
||||
/// <summary>
|
||||
/// The amount of times per second internal frame events will occur, examples include SyncedVar send checking.
|
||||
/// </summary>
|
||||
public int EventTickrate = 64;
|
||||
/// <summary>
|
||||
/// The max amount of Clients that can connect.
|
||||
/// </summary>
|
||||
public int MaxConnections = 100;
|
||||
/// <summary>
|
||||
/// The port for the NetworkTransport to use when connecting
|
||||
/// </summary>
|
||||
public int ConnectPort = 7777;
|
||||
/// <summary>
|
||||
/// The address to connect to
|
||||
/// </summary>
|
||||
public string ConnectAddress = "127.0.0.1";
|
||||
/// <summary>
|
||||
/// The amount of seconds to wait for handshake to complete before timing out a client
|
||||
/// </summary>
|
||||
public int ClientConnectionBufferTimeout = 10;
|
||||
/// <summary>
|
||||
/// Wheter or not to use connection approval
|
||||
/// </summary>
|
||||
public bool ConnectionApproval = false;
|
||||
/// <summary>
|
||||
/// The data to send during connection which can be used to decide on if a client should get accepted
|
||||
/// </summary>
|
||||
[HideInInspector]
|
||||
public byte[] ConnectionData = new byte[0];
|
||||
/// <summary>
|
||||
/// The amount of seconds to keep a lag compensation position history
|
||||
/// </summary>
|
||||
public int SecondsHistory = 5;
|
||||
/// <summary>
|
||||
/// Wheter or not to make the library handle object spawning
|
||||
/// </summary>
|
||||
public bool HandleObjectSpawning = true;
|
||||
/// <summary>
|
||||
/// Wheter or not to enable encryption
|
||||
/// </summary>
|
||||
public bool EnableEncryption = true;
|
||||
/// <summary>
|
||||
/// Wheter or not to enable signed diffie hellman key exchange.
|
||||
/// </summary>
|
||||
public bool SignKeyExchange = true;
|
||||
/// <summary>
|
||||
/// Private RSA XML key to use for signing key exchange
|
||||
/// </summary>
|
||||
[TextArea]
|
||||
public string RSAPrivateKey = "<RSAKeyValue><Modulus>vBEvOQki/EftWOgwh4G8/nFRvcDJLylc8P7Dhz5m/hpkkNtAMzizNKYUrGbs7sYWlEuMYBOWrzkIDGOMoOsYc9uCi+8EcmNoHDlIhK5yNfZUexYBF551VbvZ625LSBR7kmBxkyo4IPuA09fYCHeUFm3prt4h6aTD0Hjc7ZsJHUU=</Modulus><Exponent>EQ==</Exponent><P>ydgcrq5qLJOdDQibD3m9+o3/dkKoFeCC110dnMgdpEteCruyBdL0zjGKKvjjgy3XTSSp43EN591NiXaBp0JtDw==</P><Q>7obHrUnUCsSHUsIJ7+JOrupcGrQ0XaYcQ+Uwb2v7d2YUzwZ46U4gI9snfD2J0tc3DGEh3v3G0Q8q7bxEe3H4aw==</Q><DP>L34k3c6vkgSdbHp+1nb/hj+HZx6+I0PijQbZyolwYuSOmR0a1DGjA1bzVWe9D86NAxevgM9OkOjG8yrxVIgZqQ==</DP><DQ>OB+2gyBuIKa2bdNNodrlVlVC2RtXnZB/HwjAGjeGdnJfP8VJoE6eJo3rLEq3BG7fxq1xYaUfuLhGVg4uOyngGQ==</DQ><InverseQ>o97PimYu58qH5eFmySRCIsyhBr/tK2GM17Zd9QQPJZRSorrhIJn1m6gwQ/G5aJLIM/3Yl04CoyqmQGsPXMzW2w==</InverseQ><D>CxAR1i22w4vCquB7U0Pd8Nl9R2Wxez6rHTwpnoszPB+rkAzlqKj7e5FMgpykhoQfciKPyWqQZKkAeTMIRbN56JinvpAt5POId/28HDd5xjGymHE81k3RzoHqzQXFIOF1TSYKUWzjPPF/TU4nn7auD4i6lOODATsMqtLr5DRBN/0=</D></RSAKeyValue>"; //CHANGE THESE FOR PRODUCTION!
|
||||
/// <summary>
|
||||
/// Public RSA XML key to use for signing key exchange
|
||||
/// </summary>
|
||||
[TextArea]
|
||||
public string RSAPublicKey = "<RSAKeyValue><Modulus>vBEvOQki/EftWOgwh4G8/nFRvcDJLylc8P7Dhz5m/hpkkNtAMzizNKYUrGbs7sYWlEuMYBOWrzkIDGOMoOsYc9uCi+8EcmNoHDlIhK5yNfZUexYBF551VbvZ625LSBR7kmBxkyo4IPuA09fYCHeUFm3prt4h6aTD0Hjc7ZsJHUU=</Modulus><Exponent>EQ==</Exponent></RSAKeyValue>"; //CHANGE THESE FOR PRODUCTION!
|
||||
/// <summary>
|
||||
/// Wheter or not to allow any type of passthrough messages
|
||||
/// </summary>
|
||||
public bool AllowPassthroughMessages = true;
|
||||
/// <summary>
|
||||
/// Wheter or not to enable scene switching
|
||||
/// </summary>
|
||||
public bool EnableSceneSwitching = true;
|
||||
/// <summary>
|
||||
/// If your logic uses the NetwokrTime, this should probably be turned off. If however it's needed to maximize accuracy, this is recommended to be turned on
|
||||
/// </summary>
|
||||
public bool EnableTimeResync = false;
|
||||
|
||||
private byte[] ConfigHash = null;
|
||||
/// <summary>
|
||||
/// Gets a SHA256 hash of parts of the NetworkingConfiguration instance
|
||||
/// </summary>
|
||||
/// <param name="cache"></param>
|
||||
/// <returns></returns>
|
||||
public byte[] GetConfig(bool cache = true)
|
||||
{
|
||||
if (ConfigHash != null && cache)
|
||||
return ConfigHash;
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUShort(ProtocolVersion);
|
||||
for (int i = 0; i < Channels.Count; i++)
|
||||
{
|
||||
writer.WriteString(Channels[i].Name);
|
||||
writer.WriteByte((byte)Channels[i].Type);
|
||||
if (EnableEncryption)
|
||||
writer.WriteBool(Channels[i].Encrypted);
|
||||
}
|
||||
for (int i = 0; i < MessageTypes.Count; i++)
|
||||
{
|
||||
writer.WriteString(MessageTypes[i].Name);
|
||||
if (AllowPassthroughMessages)
|
||||
writer.WriteBool(MessageTypes[i].Passthrough);
|
||||
}
|
||||
if (EnableSceneSwitching)
|
||||
{
|
||||
for (int i = 0; i < RegisteredScenes.Count; i++)
|
||||
{
|
||||
writer.WriteString(RegisteredScenes[i]);
|
||||
}
|
||||
}
|
||||
if (HandleObjectSpawning)
|
||||
{
|
||||
for (int i = 0; i < NetworkedPrefabs.Count; i++)
|
||||
{
|
||||
writer.WriteString(NetworkedPrefabs[i].name);
|
||||
}
|
||||
}
|
||||
writer.WriteBool(HandleObjectSpawning);
|
||||
writer.WriteBool(EnableEncryption);
|
||||
writer.WriteBool(AllowPassthroughMessages);
|
||||
writer.WriteBool(EnableSceneSwitching);
|
||||
writer.WriteBool(SignKeyExchange);
|
||||
|
||||
//using (SHA256Managed sha256 = new SHA256Managed())
|
||||
//{
|
||||
// Returns a 160 bit / 20 byte / 5 int checksum of the config
|
||||
if (cache)
|
||||
{
|
||||
ConfigHash = MessageDigest.SHA1_Opt(writer.Finalize()).ToArray(); //sha256.ComputeHash(writer.Finalize());
|
||||
return ConfigHash;
|
||||
}
|
||||
return MessageDigest.SHA1_Opt(writer.Finalize()).ToArray(); //sha256.ComputeHash(writer.Finalize());
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares a SHA256 hash with the current NetworkingConfiguration instances hash
|
||||
/// </summary>
|
||||
/// <param name="hash"></param>
|
||||
/// <returns></returns>
|
||||
public bool CompareConfig(byte[] hash)
|
||||
{
|
||||
byte[] localConfigHash = GetConfig();
|
||||
|
||||
if (hash.Length != localConfigHash.Length)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < hash.Length; i++)
|
||||
{
|
||||
if (hash[i] != localConfigHash[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
@ -7,15 +8,15 @@ namespace MLAPI.Data
|
||||
internal GameObject[] objects;
|
||||
internal ushort poolId;
|
||||
|
||||
internal NetworkPool(int prefabIndex, uint size, ushort poolIndex)
|
||||
internal NetworkPool(int prefabId, uint size, ushort poolIndex)
|
||||
{
|
||||
objects = new GameObject[size];
|
||||
poolId = poolIndex;
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
GameObject go = Object.Instantiate(NetworkingManager.singleton.SpawnablePrefabs[prefabIndex], Vector3.zero, Quaternion.identity);
|
||||
go.GetComponent<NetworkedObject>().isPooledObject = true;
|
||||
go.GetComponent<NetworkedObject>().PoolId = poolId;
|
||||
GameObject go = MonoBehaviour.Instantiate(NetworkingManager.singleton.NetworkConfig.NetworkedPrefabs[prefabId].prefab, Vector3.zero, Quaternion.identity);
|
||||
go.GetComponent<NetworkedObject>()._isPooledObject = true;
|
||||
go.GetComponent<NetworkedObject>().poolId = poolId;
|
||||
go.GetComponent<NetworkedObject>().Spawn();
|
||||
go.name = "Pool Id: " + poolId + " #" + i;
|
||||
go.SetActive(false);
|
||||
|
@ -1,12 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// A NetworkedClient
|
||||
/// </summary>
|
||||
public class NetworkedClient
|
||||
{
|
||||
public int ClientId;
|
||||
/// <summary>
|
||||
/// The Id of the NetworkedClient
|
||||
/// </summary>
|
||||
public uint ClientId;
|
||||
/// <summary>
|
||||
/// The PlayerObject of the Client
|
||||
/// </summary>
|
||||
public GameObject PlayerObject;
|
||||
/// <summary>
|
||||
/// The NetworkedObject's owned by this Client
|
||||
/// </summary>
|
||||
public List<NetworkedObject> OwnedObjects = new List<NetworkedObject>();
|
||||
/// <summary>
|
||||
/// The encryption key used for this client
|
||||
/// </summary>
|
||||
public byte[] AesKey;
|
||||
}
|
||||
}
|
||||
|
29
MLAPI/Data/NetworkedPrefab.cs
Normal file
29
MLAPI/Data/NetworkedPrefab.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// A class that represents a NetworkedPrefab
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class NetworkedPrefab
|
||||
{
|
||||
internal string name
|
||||
{
|
||||
get
|
||||
{
|
||||
return prefab.GetComponent<NetworkedObject>().NetworkedPrefabName;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// The gameobject of the prefab
|
||||
/// </summary>
|
||||
public GameObject prefab;
|
||||
/// <summary>
|
||||
/// Wheter or not this is a playerPrefab
|
||||
/// </summary>
|
||||
public bool playerPrefab;
|
||||
}
|
||||
}
|
@ -1,108 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace MLAPI
|
||||
{
|
||||
public class NetworkingConfiguration
|
||||
{
|
||||
public ushort ProtocolVersion = 0;
|
||||
public SortedDictionary<string, QosType> Channels = new SortedDictionary<string, QosType>();
|
||||
public List<string> MessageTypes = new List<string>();
|
||||
public List<string> PassthroughMessageTypes = new List<string>();
|
||||
internal HashSet<ushort> RegisteredPassthroughMessageTypes = new HashSet<ushort>();
|
||||
public List<string> RegisteredScenes = new List<string>();
|
||||
public int MessageBufferSize = 65535;
|
||||
public int ReceiveTickrate = 64;
|
||||
public int MaxReceiveEventsPerTickRate = 500;
|
||||
public int SendTickrate = 64;
|
||||
public int EventTickrate = 64;
|
||||
public int MaxConnections = 100;
|
||||
public int Port = 7777;
|
||||
public string Address = "127.0.0.1";
|
||||
public int ClientConnectionBufferTimeout = 10;
|
||||
public bool ConnectionApproval = false;
|
||||
public Action<byte[], int, Action<int, bool>> ConnectionApprovalCallback = null;
|
||||
public byte[] ConnectionData = new byte[0];
|
||||
public float SecondsHistory = 5;
|
||||
public bool HandleObjectSpawning = true;
|
||||
//TODO
|
||||
public bool CompressMessages = false;
|
||||
//Should only be used for dedicated servers and will require the servers RSA keypair being hard coded into clients in order to exchange a AES key
|
||||
//TODO
|
||||
public bool EncryptMessages = false;
|
||||
public bool AllowPassthroughMessages = true;
|
||||
public bool EnableSceneSwitching = false;
|
||||
|
||||
//Cached config hash
|
||||
private byte[] ConfigHash = null;
|
||||
public byte[] GetConfig(bool cache = true)
|
||||
{
|
||||
if (ConfigHash != null && cache)
|
||||
return ConfigHash;
|
||||
|
||||
using(MemoryStream writeStream = new MemoryStream())
|
||||
{
|
||||
using(BinaryWriter writer = new BinaryWriter(writeStream))
|
||||
{
|
||||
writer.Write(ProtocolVersion);
|
||||
foreach (KeyValuePair<string, QosType> pair in Channels)
|
||||
{
|
||||
writer.Write(pair.Key);
|
||||
writer.Write((int)pair.Value);
|
||||
}
|
||||
for (int i = 0; i < MessageTypes.Count; i++)
|
||||
{
|
||||
writer.Write(MessageTypes[i]);
|
||||
}
|
||||
if(AllowPassthroughMessages)
|
||||
{
|
||||
for (int i = 0; i < PassthroughMessageTypes.Count; i++)
|
||||
{
|
||||
writer.Write(PassthroughMessageTypes[i]);
|
||||
}
|
||||
}
|
||||
if(EnableSceneSwitching)
|
||||
{
|
||||
for (int i = 0; i < RegisteredScenes.Count; i++)
|
||||
{
|
||||
writer.Write(RegisteredScenes[i]);
|
||||
}
|
||||
}
|
||||
writer.Write(HandleObjectSpawning);
|
||||
writer.Write(CompressMessages);
|
||||
writer.Write(EncryptMessages);
|
||||
writer.Write(AllowPassthroughMessages);
|
||||
writer.Write(EnableSceneSwitching);
|
||||
}
|
||||
using(SHA256Managed sha256 = new SHA256Managed())
|
||||
{
|
||||
//Returns a 256 bit / 32 byte long checksum of the config
|
||||
if (cache)
|
||||
{
|
||||
ConfigHash = sha256.ComputeHash(writeStream.ToArray());
|
||||
return ConfigHash;
|
||||
}
|
||||
return sha256.ComputeHash(writeStream.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool CompareConfig(byte[] hash)
|
||||
{
|
||||
byte[] localConfigHash = GetConfig();
|
||||
|
||||
if (hash.Length != localConfigHash.Length)
|
||||
return false;
|
||||
|
||||
for (int i = 0; i < hash.Length; i++)
|
||||
{
|
||||
if (hash[i] != localConfigHash[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
15
MLAPI/Data/SyncedVarField.cs
Normal file
15
MLAPI/Data/SyncedVarField.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
internal class SyncedVarField
|
||||
{
|
||||
internal FieldInfo FieldInfo;
|
||||
internal FieldType FieldType;
|
||||
internal object FieldValue;
|
||||
internal MethodInfo HookMethod;
|
||||
internal bool Dirty;
|
||||
internal bool Target;
|
||||
}
|
||||
}
|
17
MLAPI/Data/Transports/ChannelType.cs
Normal file
17
MLAPI/Data/Transports/ChannelType.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
public enum ChannelType
|
||||
{
|
||||
Unreliable,
|
||||
UnreliableFragmented,
|
||||
UnreliableSequenced,
|
||||
Reliable,
|
||||
ReliableFragmented,
|
||||
ReliableSequenced,
|
||||
StateUpdate,
|
||||
ReliableStateUpdate,
|
||||
AllCostDelivery,
|
||||
UnreliableFragmentedSequenced,
|
||||
ReliableFragmentedSequenced
|
||||
}
|
||||
}
|
23
MLAPI/Data/Transports/IUDPTransport.cs
Normal file
23
MLAPI/Data/Transports/IUDPTransport.cs
Normal file
@ -0,0 +1,23 @@
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
public interface IUDPTransport
|
||||
{
|
||||
ChannelType InternalChannel { get; }
|
||||
uint ServerNetId { get; }
|
||||
uint HostDummyId { get; }
|
||||
uint InvalidDummyId { get; }
|
||||
void QueueMessageForSending(uint clientId, ref byte[] dataBuffer, int dataSize, int channelId, bool skipQueue, out byte error);
|
||||
void SendQueue(uint clientId, out byte error);
|
||||
NetEventType PollReceive(out uint clientId, out int channelId, ref byte[] data, int bufferSize, out int receivedSize, out byte error);
|
||||
int AddChannel(ChannelType type, object settings);
|
||||
void Connect(string address, int port, object settings, out byte error);
|
||||
void RegisterServerListenSocket(object settings);
|
||||
void DisconnectClient(uint clientId);
|
||||
void DisconnectFromServer();
|
||||
int GetCurrentRTT(uint clientId, out byte error);
|
||||
int GetRemoteDelayTimeMS(uint clientId, int remoteTimestamp, out byte error);
|
||||
int GetNetworkTimestamp();
|
||||
object GetSettings();
|
||||
void Shutdown();
|
||||
}
|
||||
}
|
10
MLAPI/Data/Transports/NetEventType.cs
Normal file
10
MLAPI/Data/Transports/NetEventType.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace MLAPI.Data
|
||||
{
|
||||
public enum NetEventType
|
||||
{
|
||||
Data,
|
||||
Connect,
|
||||
Disconnect,
|
||||
Nothing
|
||||
}
|
||||
}
|
121
MLAPI/Data/Transports/UNET/NetId.cs
Normal file
121
MLAPI/Data/Transports/UNET/NetId.cs
Normal file
@ -0,0 +1,121 @@
|
||||
namespace MLAPI.Data.Transports.UNET
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a ClientId structure
|
||||
/// </summary>
|
||||
public struct NetId
|
||||
{
|
||||
/// <summary>
|
||||
/// The hostId this client is on
|
||||
/// </summary>
|
||||
public byte HostId;
|
||||
/// <summary>
|
||||
/// The connectionId this client is assigned
|
||||
/// </summary>
|
||||
public ushort ConnectionId;
|
||||
/// <summary>
|
||||
/// Meta data about hte client
|
||||
/// </summary>
|
||||
public byte Meta;
|
||||
|
||||
/// <summary>
|
||||
/// Returns wheter or not the clientId represents a -1
|
||||
/// </summary>
|
||||
/// <returns><c>true</c>, if host, <c>false</c> otherwise.</returns>
|
||||
public bool IsHost()
|
||||
{
|
||||
return Meta == 1;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns if this is a invalid clientId, (-2)
|
||||
/// </summary>
|
||||
/// <returns><c>true</c>, if invalid, <c>false</c> otherwise.</returns>
|
||||
public bool IsInvalid()
|
||||
{
|
||||
return Meta == 2;
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the netId struct from transport values
|
||||
/// </summary>
|
||||
/// <param name="hostId">Host identifier.</param>
|
||||
/// <param name="connectionId">Connection identifier.</param>
|
||||
/// <param name="isHost">If set to <c>true</c> is host.</param>
|
||||
/// <param name="isInvalid">If set to <c>true</c> is invalid.</param>
|
||||
public NetId(byte hostId, ushort connectionId, bool isHost, bool isInvalid)
|
||||
{
|
||||
HostId = hostId;
|
||||
ConnectionId = connectionId;
|
||||
if (isHost)
|
||||
Meta = 1;
|
||||
else if (isInvalid)
|
||||
Meta = 2;
|
||||
else
|
||||
Meta = 0;
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the netId struct from a clientId
|
||||
/// </summary>
|
||||
/// <param name="clientId">Client identifier.</param>
|
||||
public NetId(uint clientId)
|
||||
{
|
||||
HostId = (byte)(clientId & 0xFF);
|
||||
ConnectionId = (ushort)((byte)((clientId >> 8) & 0xFF) | (ushort)(((clientId >> 16) & 0xFF) << 8));
|
||||
Meta = (byte)((clientId >> 24) & 0xFF);
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the clientId.
|
||||
/// </summary>
|
||||
/// <returns>The client identifier.</returns>
|
||||
public uint GetClientId()
|
||||
{
|
||||
return HostId | (uint)((ConnectionId & 0xFF) << 8) | (uint)(((ConnectionId >> 8) & 0xFF) << 16) | (uint)(Meta << 24);
|
||||
}
|
||||
// Rider generated vvv
|
||||
/// <summary>
|
||||
/// Determines whether the specified <see cref="object"/> is equal to the current <see cref="T:MLAPI.Data.NetId"/>.
|
||||
/// </summary>
|
||||
/// <param name="obj">The <see cref="object"/> to compare with the current <see cref="T:MLAPI.Data.NetId"/>.</param>
|
||||
/// <returns><c>true</c> if the specified <see cref="object"/> is equal to the current <see cref="T:MLAPI.Data.NetId"/>;
|
||||
/// otherwise, <c>false</c>.</returns>
|
||||
public override bool Equals (object obj)
|
||||
{
|
||||
if (obj == null || GetType() != obj.GetType())
|
||||
return false;
|
||||
|
||||
NetId key = (NetId)obj;
|
||||
return (HostId == key.HostId) && (ConnectionId == key.ConnectionId);
|
||||
}
|
||||
// Rider generated vvv
|
||||
/// <summary>
|
||||
/// Serves as a hash function for a <see cref="T:MLAPI.Data.NetId"/> object.
|
||||
/// </summary>
|
||||
/// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
|
||||
/// hash table.</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (int)GetClientId();
|
||||
}
|
||||
// Rider generated vvv
|
||||
/// <summary>
|
||||
/// Determines whether a specified instance of <see cref="MLAPI.Data.NetId"/> is equal to another specified <see cref="MLAPI.Data.NetId"/>.
|
||||
/// </summary>
|
||||
/// <param name="client1">The first <see cref="MLAPI.Data.NetId"/> to compare.</param>
|
||||
/// <param name="client2">The second <see cref="MLAPI.Data.NetId"/> to compare.</param>
|
||||
/// <returns><c>true</c> if <c>client1</c> and <c>client2</c> are equal; otherwise, <c>false</c>.</returns>
|
||||
public static bool operator ==(NetId client1, NetId client2)
|
||||
{
|
||||
return (client1.HostId == client2.HostId && client1.ConnectionId == client2.ConnectionId) || (client1.IsHost() == client2.IsHost());
|
||||
}
|
||||
// Rider generated vvv
|
||||
/// <summary>
|
||||
/// Determines whether a specified instance of <see cref="MLAPI.Data.NetId"/> is not equal to another specified <see cref="MLAPI.Data.NetId"/>.
|
||||
/// </summary>
|
||||
/// <param name="client1">The first <see cref="MLAPI.Data.NetId"/> to compare.</param>
|
||||
/// <param name="client2">The second <see cref="MLAPI.Data.NetId"/> to compare.</param>
|
||||
/// <returns><c>true</c> if <c>client1</c> and <c>client2</c> are not equal; otherwise, <c>false</c>.</returns>
|
||||
public static bool operator !=(NetId client1, NetId client2)
|
||||
{
|
||||
return !(client1 == client2);
|
||||
}
|
||||
}
|
||||
}
|
24
MLAPI/Data/Transports/UNET/TransportHost.cs
Normal file
24
MLAPI/Data/Transports/UNET/TransportHost.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace MLAPI.Data.Transports.UNET
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Transport host
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class TransportHost
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the host
|
||||
/// </summary>
|
||||
public string Name = Guid.NewGuid().ToString().Replace("-", "");
|
||||
/// <summary>
|
||||
/// The port the host should listen to
|
||||
/// </summary>
|
||||
public int Port = 7777;
|
||||
/// <summary>
|
||||
/// If true, the socket will listen on TCP-Websockets, otherwise UDP
|
||||
/// </summary>
|
||||
public bool Websockets = false;
|
||||
}
|
||||
}
|
183
MLAPI/Data/Transports/UNET/UnetTransport.cs
Normal file
183
MLAPI/Data/Transports/UNET/UnetTransport.cs
Normal file
@ -0,0 +1,183 @@
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace MLAPI.Data.Transports.UNET
|
||||
{
|
||||
[Serializable]
|
||||
public class UnetTransport : IUDPTransport
|
||||
{
|
||||
public ChannelType InternalChannel { get => ChannelType.ReliableFragmentedSequenced; }
|
||||
|
||||
public uint HostDummyId { get => new NetId(0,0,true,false).GetClientId(); }
|
||||
|
||||
public uint InvalidDummyId { get => new NetId(0, 0, false, true).GetClientId(); }
|
||||
|
||||
public uint ServerNetId { get => new NetId((byte)serverHostId, (ushort)serverConnectionId, false, false).GetClientId(); }
|
||||
|
||||
public int serverConnectionId;
|
||||
public int serverHostId;
|
||||
|
||||
public List<TransportHost> ServerTransports = new List<TransportHost>()
|
||||
{
|
||||
new TransportHost()
|
||||
{
|
||||
Name = "UDP Socket",
|
||||
Port = 7777,
|
||||
Websockets = false
|
||||
}
|
||||
};
|
||||
|
||||
public int Connect(string address, int port, object settings, bool websocket, out byte error)
|
||||
{
|
||||
NetworkTransport.Init();
|
||||
int hostId = NetworkTransport.AddHost((HostTopology)settings);
|
||||
return NetworkTransport.Connect(hostId, address, port, 0, out error);
|
||||
}
|
||||
|
||||
public void DisconnectClient(uint clientId)
|
||||
{
|
||||
NetId netId = new NetId(clientId);
|
||||
if (netId.IsHost() || netId.IsInvalid())
|
||||
return;
|
||||
byte error;
|
||||
NetworkTransport.Disconnect(netId.HostId, netId.ConnectionId, out error);
|
||||
}
|
||||
|
||||
public void DisconnectFromServer()
|
||||
{
|
||||
byte error;
|
||||
NetworkTransport.Disconnect(serverHostId, serverConnectionId, out error);
|
||||
}
|
||||
|
||||
public int GetCurrentRTT(uint clientId, out byte error)
|
||||
{
|
||||
NetId netId = new NetId(clientId);
|
||||
return NetworkTransport.GetCurrentRTT(netId.HostId, netId.ConnectionId, out error);
|
||||
}
|
||||
|
||||
public int GetNetworkTimestamp()
|
||||
{
|
||||
return NetworkTransport.GetNetworkTimestamp();
|
||||
}
|
||||
|
||||
public int GetRemoteDelayTimeMS(uint clientId, int remoteTimestamp, out byte error)
|
||||
{
|
||||
NetId netId = new NetId(clientId);
|
||||
return NetworkTransport.GetRemoteDelayTimeMS(netId.HostId, netId.ConnectionId, remoteTimestamp, out error);
|
||||
}
|
||||
|
||||
public NetEventType PollReceive(out uint clientId, out int channelId, ref byte[] data, int bufferSize, out int receivedSize, out byte error)
|
||||
{
|
||||
int hostId;
|
||||
int connectionId;
|
||||
byte err;
|
||||
NetworkEventType eventType = NetworkTransport.Receive(out hostId, out connectionId, out channelId, data, bufferSize, out receivedSize, out err);
|
||||
clientId = new NetId((byte)hostId, (ushort)connectionId, false, false).GetClientId();
|
||||
NetworkError errorType = (NetworkError)err;
|
||||
if (errorType == NetworkError.Timeout)
|
||||
eventType = NetworkEventType.DisconnectEvent; //In UNET. Timeouts are not disconnects. We have to translate that here.
|
||||
error = 0;
|
||||
|
||||
//Translate NetworkEventType to NetEventType
|
||||
switch (eventType)
|
||||
{
|
||||
case NetworkEventType.DataEvent:
|
||||
return NetEventType.Data;
|
||||
case NetworkEventType.ConnectEvent:
|
||||
return NetEventType.Connect;
|
||||
case NetworkEventType.DisconnectEvent:
|
||||
return NetEventType.Disconnect;
|
||||
case NetworkEventType.Nothing:
|
||||
return NetEventType.Nothing;
|
||||
case NetworkEventType.BroadcastEvent:
|
||||
return NetEventType.Nothing;
|
||||
}
|
||||
return NetEventType.Nothing;
|
||||
}
|
||||
|
||||
public void QueueMessageForSending(uint clientId, ref byte[] dataBuffer, int dataSize, int channelId, bool skipqueue, out byte error)
|
||||
{
|
||||
NetId netId = new NetId(clientId);
|
||||
if (netId.IsHost() || netId.IsInvalid())
|
||||
{
|
||||
error = 0;
|
||||
return;
|
||||
}
|
||||
if (skipqueue)
|
||||
NetworkTransport.Send(netId.HostId, netId.ConnectionId, channelId, dataBuffer, dataSize, out error);
|
||||
else
|
||||
NetworkTransport.QueueMessageForSending(netId.HostId, netId.ConnectionId, channelId, dataBuffer, dataSize, out error);
|
||||
}
|
||||
|
||||
public void Shutdown()
|
||||
{
|
||||
NetworkTransport.Shutdown();
|
||||
}
|
||||
|
||||
public void SendQueue(uint clientId, out byte error)
|
||||
{
|
||||
NetId netId = new NetId(clientId);
|
||||
NetworkTransport.SendQueuedMessages(netId.HostId, netId.ConnectionId, out error);
|
||||
}
|
||||
|
||||
public void RegisterServerListenSocket(object settings)
|
||||
{
|
||||
HostTopology topology = new HostTopology((ConnectionConfig)settings, NetworkingManager.singleton.NetworkConfig.MaxConnections);
|
||||
for (int i = 0; i < ServerTransports.Count; i++)
|
||||
{
|
||||
if (ServerTransports[i].Websockets)
|
||||
NetworkTransport.AddWebsocketHost(topology, ServerTransports[i].Port);
|
||||
else
|
||||
NetworkTransport.AddHost(topology, ServerTransports[i].Port);
|
||||
}
|
||||
}
|
||||
|
||||
public int AddChannel(ChannelType type, object settings)
|
||||
{
|
||||
ConnectionConfig config = (ConnectionConfig)settings;
|
||||
switch (type)
|
||||
{
|
||||
case ChannelType.Unreliable:
|
||||
return config.AddChannel(QosType.Unreliable);
|
||||
case ChannelType.UnreliableFragmented:
|
||||
return config.AddChannel(QosType.UnreliableFragmented);
|
||||
case ChannelType.UnreliableSequenced:
|
||||
return config.AddChannel(QosType.UnreliableSequenced);
|
||||
case ChannelType.Reliable:
|
||||
return config.AddChannel(QosType.Reliable);
|
||||
case ChannelType.ReliableFragmented:
|
||||
return config.AddChannel(QosType.ReliableFragmented);
|
||||
case ChannelType.ReliableSequenced:
|
||||
return config.AddChannel(QosType.ReliableSequenced);
|
||||
case ChannelType.StateUpdate:
|
||||
return config.AddChannel(QosType.StateUpdate);
|
||||
case ChannelType.ReliableStateUpdate:
|
||||
return config.AddChannel(QosType.ReliableStateUpdate);
|
||||
case ChannelType.AllCostDelivery:
|
||||
return config.AddChannel(QosType.AllCostDelivery);
|
||||
case ChannelType.UnreliableFragmentedSequenced:
|
||||
return config.AddChannel(QosType.UnreliableFragmentedSequenced);
|
||||
case ChannelType.ReliableFragmentedSequenced:
|
||||
return config.AddChannel(QosType.ReliableFragmentedSequenced);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public object GetSettings()
|
||||
{
|
||||
NetworkTransport.Init();
|
||||
return new ConnectionConfig()
|
||||
{
|
||||
SendDelay = 0
|
||||
};
|
||||
}
|
||||
|
||||
public void Connect(string address, int port, object settings, out byte error)
|
||||
{
|
||||
serverHostId = NetworkTransport.AddHost(new HostTopology((ConnectionConfig)settings, 1));
|
||||
serverConnectionId = NetworkTransport.Connect(serverHostId, address, port, 0, out error);
|
||||
}
|
||||
}
|
||||
}
|
29
MLAPI/GlobalSuppressions.cs
Normal file
29
MLAPI/GlobalSuppressions.cs
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
// a specific target and scoped to a namespace, type, member, etc.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.StartClient")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.StartClientWebsocket")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.StopServer")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.StopClient")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.Update")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.HandleIncomingData(System.UInt32,System.Byte[],System.Int32)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.PassthroughSend(System.UInt32,System.UInt32,System.UInt16,System.Int32,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.Send(System.Collections.Generic.List{System.UInt32},System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.HandleApproval(System.UInt32,System.Boolean)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.DisconnectClient(System.UInt32)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.Send(System.String,System.String,System.Byte[],System.UInt32,System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.Send(System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.Send(System.UInt32[],System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.MonoBehaviours.Core.NetworkingManager.HandleApproval(System.UInt32,System.Boolean,UnityEngine.Vector3,UnityEngine.Quaternion)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.HandleConnectionApproved(System.UInt32,System.Byte[],System.Int32)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.HandleTimeSync(System.UInt32,System.Byte[],System.Int32)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.PassthroughSend(System.UInt32,System.UInt32,System.UInt16,System.Int32,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.Send(System.Collections.Generic.List{System.UInt32},System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.Send(System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.Send(System.String,System.String,System.Byte[],System.UInt32,System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0018:Inline variable declaration", Justification = "Not supported in Unity Mono version", Scope = "member", Target = "~M:MLAPI.NetworkingManagerComponents.Core.InternalMessageHandler.Send(System.UInt32[],System.String,System.String,System.Byte[],System.Nullable{System.UInt32},System.Nullable{System.UInt16})")]
|
@ -24,6 +24,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
||||
<DocumentationFile>bin\Debug\MLAPI.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@ -35,15 +36,24 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Development|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\..\MLAPI-Examples\Assets\</OutputPath>
|
||||
<OutputPath>..\..\MLAPI-Examples\Assets\MLAPI\Lib\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="IntXLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1744b76c74eaee1e, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\IntX.1.0.1.0\lib\net20\IntXLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@ -56,26 +66,59 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Attributes\BinaryIgnore.cs" />
|
||||
<Compile Include="Attributes\ClientRpc.cs" />
|
||||
<Compile Include="Attributes\Command.cs" />
|
||||
<Compile Include="Attributes\TargetRpc.cs" />
|
||||
<Compile Include="Data\Cache.cs" />
|
||||
<Compile Include="Data\Channel.cs" />
|
||||
<Compile Include="Data\Transports\ChannelType.cs" />
|
||||
<Compile Include="Data\FieldType.cs" />
|
||||
<Compile Include="Attributes\SyncedVar.cs" />
|
||||
<Compile Include="Data\FixedQueue.cs" />
|
||||
<Compile Include="Data\Transports\IUDPTransport.cs" />
|
||||
<Compile Include="Data\Transports\NetEventType.cs" />
|
||||
<Compile Include="Data\NetworkConfig.cs" />
|
||||
<Compile Include="Data\NetworkedPrefab.cs" />
|
||||
<Compile Include="Data\NetworkPool.cs" />
|
||||
<Compile Include="Data\SyncedVarField.cs" />
|
||||
<Compile Include="Data\TrackedPointData.cs" />
|
||||
<Compile Include="Data\Transports\UNET\TransportHost.cs" />
|
||||
<Compile Include="Data\Transports\UNET\UnetTransport.cs" />
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="MonoBehaviours\Prototyping\NetworkedAnimator.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\LagCompensationManager.cs" />
|
||||
<Compile Include="MonoBehaviours\Prototyping\NetworkedNavMeshAgent.cs" />
|
||||
<Compile Include="MonoBehaviours\Prototyping\NetworkedProximity.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Binary\BitWriter.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Binary\BitReader.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Binary\BinaryHelpers.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Binary\BinarySerializer.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Binary\PrimitiveHasher.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Cryptography\CryptographyHelper.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Cryptography\DiffieHellman.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Cryptography\EllipticCurve.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Core\LagCompensationManager.cs" />
|
||||
<Compile Include="MonoBehaviours\Core\NetworkedBehaviour.cs" />
|
||||
<Compile Include="Data\NetworkedClient.cs" />
|
||||
<Compile Include="MonoBehaviours\Core\NetworkedObject.cs" />
|
||||
<Compile Include="Data\NetworkingConfiguration.cs" />
|
||||
<Compile Include="MonoBehaviours\Core\NetworkingManager.cs" />
|
||||
<Compile Include="MonoBehaviours\Core\TrackedObject.cs" />
|
||||
<Compile Include="MonoBehaviours\Prototyping\NetworkedTransform.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\MessageManager.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\NetworkPoolManager.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\NetworkSceneManager.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\SpawnManager.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Core\MessageManager.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Core\NetworkPoolManager.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Core\NetworkSceneManager.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Core\SpawnManager.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Cryptography\MessageDigest.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\ClientIdManager.cs" />
|
||||
<Compile Include="Data\ClientIdKey.cs" />
|
||||
<Compile Include="Data\Transports\UNET\NetId.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Binary\MessageChunker.cs" />
|
||||
<Compile Include="Data\MessageType.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Core\InternalMessageHandler.Send.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Core\InternalMessageHandler.Receive.cs" />
|
||||
<Compile Include="NetworkingManagerComponents\Core\InternalMessageHandler.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
File diff suppressed because it is too large
Load Diff
@ -1,63 +1,240 @@
|
||||
using MLAPI.NetworkingManagerComponents;
|
||||
using MLAPI.Data;
|
||||
using MLAPI.NetworkingManagerComponents.Binary;
|
||||
using MLAPI.NetworkingManagerComponents.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI
|
||||
namespace MLAPI.MonoBehaviours.Core
|
||||
{
|
||||
public class NetworkedObject : MonoBehaviour
|
||||
/// <summary>
|
||||
/// A component used to identify that a GameObject is networked
|
||||
/// </summary>
|
||||
[AddComponentMenu("MLAPI/NetworkedObject", -99)]
|
||||
public sealed class NetworkedObject : MonoBehaviour
|
||||
{
|
||||
[HideInInspector]
|
||||
public uint NetworkId;
|
||||
[HideInInspector]
|
||||
public int OwnerClientId = -2;
|
||||
[HideInInspector]
|
||||
public int SpawnablePrefabIndex;
|
||||
[HideInInspector]
|
||||
public bool isPlayerObject = false;
|
||||
public bool ServerOnly = false;
|
||||
[HideInInspector]
|
||||
public bool isPooledObject = false;
|
||||
[HideInInspector]
|
||||
public ushort PoolId;
|
||||
private void OnValidate()
|
||||
{
|
||||
if(string.IsNullOrEmpty(NetworkedPrefabName))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: The NetworkedObject " + gameObject.name + " does not have a NetworkedPrefabName. It has been set to the gameObject name");
|
||||
NetworkedPrefabName = gameObject.name;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the unique ID of this object that is synced across the network
|
||||
/// </summary>
|
||||
public uint NetworkId
|
||||
{
|
||||
get
|
||||
{
|
||||
return networkId;
|
||||
}
|
||||
}
|
||||
internal uint networkId;
|
||||
/// <summary>
|
||||
/// Gets the clientId of the owner of this NetworkedObject
|
||||
/// </summary>
|
||||
public uint OwnerClientId
|
||||
{
|
||||
get
|
||||
{
|
||||
return ownerClientId;
|
||||
}
|
||||
}
|
||||
private uint? _ownerClientId = null;
|
||||
//internal uint ownerClientId = new NetId(0, 0, false, true).GetClientId();
|
||||
internal uint ownerClientId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ownerClientId == null)
|
||||
return NetworkingManager.singleton.NetworkConfig.NetworkTransport.InvalidDummyId;
|
||||
else
|
||||
return _ownerClientId.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == NetworkingManager.singleton.NetworkConfig.NetworkTransport.InvalidDummyId)
|
||||
_ownerClientId = null;
|
||||
else
|
||||
_ownerClientId = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// The name of the NetworkedPrefab
|
||||
/// </summary>
|
||||
public string NetworkedPrefabName = string.Empty;
|
||||
/// <summary>
|
||||
/// Gets if this object is a player object
|
||||
/// </summary>
|
||||
public bool isPlayerObject
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isPlayerObject;
|
||||
}
|
||||
}
|
||||
internal bool _isPlayerObject = false;
|
||||
/// <summary>
|
||||
/// Gets if this object is part of a pool
|
||||
/// </summary>
|
||||
public bool isPooledObject
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isPooledObject;
|
||||
}
|
||||
}
|
||||
internal bool _isPooledObject = false;
|
||||
/// <summary>
|
||||
/// Gets the poolId this object is part of
|
||||
/// </summary>
|
||||
public ushort PoolId
|
||||
{
|
||||
get
|
||||
{
|
||||
return poolId;
|
||||
}
|
||||
}
|
||||
internal ushort poolId;
|
||||
/// <summary>
|
||||
/// Gets if the object is the the personal clients player object
|
||||
/// </summary>
|
||||
public bool isLocalPlayer
|
||||
{
|
||||
get
|
||||
{
|
||||
return isPlayerObject && (OwnerClientId == NetworkingManager.singleton.MyClientId || (OwnerClientId == -1 && NetworkingManager.singleton.isHost));
|
||||
return isPlayerObject && (OwnerClientId == NetworkingManager.singleton.MyClientId || (ownerClientId == NetworkingManager.singleton.NetworkConfig.NetworkTransport.HostDummyId && NetworkingManager.singleton.isHost));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets if the object is owned by the local player
|
||||
/// </summary>
|
||||
public bool isOwner
|
||||
{
|
||||
get
|
||||
{
|
||||
return !isPlayerObject && (OwnerClientId == NetworkingManager.singleton.MyClientId || (OwnerClientId == -1 && NetworkingManager.singleton.isHost));
|
||||
return !isPlayerObject && (OwnerClientId == NetworkingManager.singleton.MyClientId || (ownerClientId == NetworkingManager.singleton.NetworkConfig.NetworkTransport.HostDummyId && NetworkingManager.singleton.isHost));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets if the object has yet been spawned across the network
|
||||
/// </summary>
|
||||
public bool isSpawned
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isSpawned;
|
||||
}
|
||||
}
|
||||
internal bool _isSpawned = false;
|
||||
internal bool? sceneObject = null;
|
||||
|
||||
public HashSet<uint> observers = new HashSet<uint>();
|
||||
|
||||
internal void RebuildObservers(uint? clientId = null)
|
||||
{
|
||||
bool initial = clientId != null;
|
||||
if (initial)
|
||||
{
|
||||
bool shouldBeAdded = true;
|
||||
for (int i = 0; i < childNetworkedBehaviours.Count; i++)
|
||||
{
|
||||
bool state = childNetworkedBehaviours[i].OnCheckObserver(clientId.Value);
|
||||
if (state == false)
|
||||
{
|
||||
shouldBeAdded = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shouldBeAdded)
|
||||
observers.Add(clientId.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
HashSet<uint> previousObservers = new HashSet<uint>(observers);
|
||||
HashSet<uint> newObservers = new HashSet<uint>();
|
||||
bool update = false;
|
||||
for (int i = 0; i < childNetworkedBehaviours.Count; i++)
|
||||
{
|
||||
bool changed = childNetworkedBehaviours[i].OnRebuildObservers(newObservers);
|
||||
if (changed)
|
||||
{
|
||||
observers = newObservers;
|
||||
update = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (update)
|
||||
{
|
||||
foreach (KeyValuePair<uint, NetworkedClient> pair in NetworkingManager.singleton.connectedClients)
|
||||
{
|
||||
if (pair.Key == NetworkingManager.singleton.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
continue;
|
||||
if ((previousObservers.Contains(pair.Key) && !newObservers.Contains(pair.Key)) ||
|
||||
(!previousObservers.Contains(pair.Key) && newObservers.Contains(pair.Key)))
|
||||
{
|
||||
//Something changed for this client.
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUInt(networkId);
|
||||
writer.WriteBool(observers.Contains(pair.Key));
|
||||
|
||||
InternalMessageHandler.Send(pair.Key, "MLAPI_SET_VISIBILITY", "MLAPI_INTERNAL", writer.Finalize(), null);
|
||||
}
|
||||
FlushToClient(pair.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetLocalVisibility(bool visibility)
|
||||
{
|
||||
for (int i = 0; i < childNetworkedBehaviours.Count; i++)
|
||||
{
|
||||
childNetworkedBehaviours[i].OnSetLocalVisibility(visibility);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
SpawnManager.OnDestroyObject(NetworkId, false);
|
||||
if (NetworkingManager.singleton != null)
|
||||
SpawnManager.OnDestroyObject(NetworkId, false);
|
||||
}
|
||||
|
||||
internal bool isSpawned = false;
|
||||
|
||||
/// <summary>
|
||||
/// Spawns this GameObject across the network. Can only be called from the Server
|
||||
/// </summary>
|
||||
public void Spawn()
|
||||
{
|
||||
SpawnManager.OnSpawnObject(this);
|
||||
if (NetworkingManager.singleton != null)
|
||||
SpawnManager.SpawnPrefabIndexServer(this);
|
||||
}
|
||||
|
||||
public void SpawnWithOwnership(int clientId)
|
||||
/// <summary>
|
||||
/// Spawns an object across the network with a given owner. Can only be called from server
|
||||
/// </summary>
|
||||
/// <param name="clientId">The clientId to own the object</param>
|
||||
public void SpawnWithOwnership(uint clientId)
|
||||
{
|
||||
SpawnManager.OnSpawnObject(this, clientId);
|
||||
if (NetworkingManager.singleton != null)
|
||||
SpawnManager.SpawnPrefabIndexServer(this, clientId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes all ownership of an object from any client. Can only be called from server
|
||||
/// </summary>
|
||||
public void RemoveOwnership()
|
||||
{
|
||||
SpawnManager.RemoveOwnership(NetworkId);
|
||||
}
|
||||
|
||||
public void ChangeOwnership(int newOwnerClientId)
|
||||
/// <summary>
|
||||
/// Changes the owner of the object. Can only be called from server
|
||||
/// </summary>
|
||||
/// <param name="newOwnerClientId">The new owner clientId</param>
|
||||
public void ChangeOwnership(uint newOwnerClientId)
|
||||
{
|
||||
SpawnManager.ChangeOwnership(NetworkId, newOwnerClientId);
|
||||
}
|
||||
@ -87,6 +264,7 @@ namespace MLAPI
|
||||
{
|
||||
childNetworkedBehaviours[i].NetworkStart();
|
||||
childNetworkedBehaviours[i].SyncVarInit();
|
||||
childNetworkedBehaviours[i].networkedStartInvoked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -120,7 +298,7 @@ namespace MLAPI
|
||||
}
|
||||
|
||||
//Flushes all syncVars to client
|
||||
internal void FlushToClient(int clientId)
|
||||
internal void FlushToClient(uint clientId)
|
||||
{
|
||||
for (int i = 0; i < childNetworkedBehaviours.Count; i++)
|
||||
{
|
||||
@ -143,5 +321,8 @@ namespace MLAPI
|
||||
//TODO index out of bounds
|
||||
return childNetworkedBehaviours[index];
|
||||
}
|
||||
|
||||
//Key: behaviourOrderId, value key: messageType, value value callback
|
||||
internal Dictionary<ushort, Dictionary<ushort, Action<uint, byte[]>>> targetMessageActions = new Dictionary<ushort, Dictionary<ushort, Action<uint, byte[]>>>();
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
using MLAPI.Data;
|
||||
using MLAPI.NetworkingManagerComponents;
|
||||
using MLAPI.NetworkingManagerComponents.Core;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
@ -7,38 +7,82 @@ namespace MLAPI.MonoBehaviours.Core
|
||||
{
|
||||
//Based on: https://twotenpvp.github.io/lag-compensation-in-unity.html
|
||||
//Modified to be used with latency rather than fixed frames and subframes. Thus it will be less accrurate but more modular.
|
||||
|
||||
/// <summary>
|
||||
/// A component used for lag compensation. Each object with this component will get tracked
|
||||
/// </summary>
|
||||
[AddComponentMenu("MLAPI/TrackedObject", -98)]
|
||||
public class TrackedObject : MonoBehaviour
|
||||
{
|
||||
internal Dictionary<float, TrackedPointData> FrameData = new Dictionary<float, TrackedPointData>();
|
||||
internal LinkedList<float> Framekeys = new LinkedList<float>();
|
||||
internal FixedQueue<float> Framekeys;
|
||||
private Vector3 savedPosition;
|
||||
private Quaternion savedRotation;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the total amount of points stored in the component
|
||||
/// </summary>
|
||||
public int TotalPoints
|
||||
{
|
||||
get
|
||||
{
|
||||
return Framekeys.Count;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the average amount of time between the points in miliseconds
|
||||
/// </summary>
|
||||
public float AvgTimeBetweenPointsMs
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Framekeys.Count < 2)
|
||||
return 0;
|
||||
float totalSpan = Framekeys.ElementAt(Framekeys.Count - 1) - Framekeys.ElementAt(0);
|
||||
return (totalSpan / Framekeys.Count) * 1000f;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the total time history we have for this object
|
||||
/// </summary>
|
||||
public float TotalTimeHistory
|
||||
{
|
||||
get
|
||||
{
|
||||
return Framekeys.ElementAt(Framekeys.Count - 1) - Framekeys.ElementAt(0);
|
||||
}
|
||||
}
|
||||
|
||||
private int maxPoints
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)(NetworkingManager.singleton.NetworkConfig.SecondsHistory / (1f / NetworkingManager.singleton.NetworkConfig.EventTickrate));
|
||||
}
|
||||
}
|
||||
|
||||
internal void ReverseTransform(float secondsAgo)
|
||||
{
|
||||
savedPosition = transform.position;
|
||||
savedRotation = transform.rotation;
|
||||
float currentTime = Time.time;
|
||||
|
||||
float currentTime = NetworkingManager.singleton.NetworkTime;
|
||||
float targetTime = currentTime - secondsAgo;
|
||||
float previousTime = 0;
|
||||
float nextTime = 0;
|
||||
LinkedListNode<float> node = Framekeys.First;
|
||||
float previousValue = 0f;
|
||||
while(node != null)
|
||||
|
||||
float previousTime = 0f;
|
||||
float nextTime = 0f;
|
||||
for (int i = 0; i < Framekeys.Count; i++)
|
||||
{
|
||||
if(previousValue <= targetTime && node.Value >= targetTime)
|
||||
if (previousTime <= targetTime && Framekeys.ElementAt(i) >= targetTime)
|
||||
{
|
||||
previousTime = previousValue;
|
||||
nextTime = node.Value;
|
||||
nextTime = Framekeys.ElementAt(i);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
previousValue = node.Value;
|
||||
node = node.Next;
|
||||
}
|
||||
previousTime = Framekeys.ElementAt(i);
|
||||
}
|
||||
|
||||
float timeBetweenFrames = nextTime - previousTime;
|
||||
float timeAwayFromPrevious = currentTime - previousTime;
|
||||
float lerpProgress = timeAwayFromPrevious / timeBetweenFrames;
|
||||
@ -54,35 +98,27 @@ namespace MLAPI.MonoBehaviours.Core
|
||||
|
||||
void Start()
|
||||
{
|
||||
Framekeys.AddFirst(0);
|
||||
LagCompensationManager.SimulationObjects.Add(this);
|
||||
Framekeys = new FixedQueue<float>(maxPoints);
|
||||
Framekeys.Enqueue(0);
|
||||
LagCompensationManager.simulationObjects.Add(this);
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
Framekeys.Clear();
|
||||
FrameData.Clear();
|
||||
LagCompensationManager.SimulationObjects.Remove(this);
|
||||
LagCompensationManager.simulationObjects.Remove(this);
|
||||
}
|
||||
|
||||
internal void AddFrame()
|
||||
{
|
||||
float currentTime = Time.time;
|
||||
LinkedListNode<float> node = Framekeys.First;
|
||||
LinkedListNode<float> nextNode = node.Next;
|
||||
while (currentTime - node.Value >= NetworkingManager.singleton.NetworkConfig.SecondsHistory)
|
||||
{
|
||||
nextNode = node.Next;
|
||||
FrameData.Remove(node.Value);
|
||||
Framekeys.RemoveFirst();
|
||||
node = nextNode;
|
||||
}
|
||||
FrameData.Add(Time.time, new TrackedPointData()
|
||||
if (Framekeys.Count == maxPoints)
|
||||
FrameData.Remove(Framekeys.Dequeue());
|
||||
|
||||
FrameData.Add(NetworkingManager.singleton.NetworkTime, new TrackedPointData()
|
||||
{
|
||||
position = transform.position,
|
||||
rotation = transform.rotation
|
||||
});
|
||||
Framekeys.AddLast(Time.time);
|
||||
Framekeys.Enqueue(NetworkingManager.singleton.NetworkTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,40 @@
|
||||
using System.IO;
|
||||
using MLAPI.Data;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.MonoBehaviours.Prototyping
|
||||
{
|
||||
/// <summary>
|
||||
/// A prototype component for syncing animations
|
||||
/// </summary>
|
||||
[AddComponentMenu("MLAPI/NetworkedAnimator")]
|
||||
public class NetworkedAnimator : NetworkedBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Is proximity enabled
|
||||
/// </summary>
|
||||
public bool EnableProximity = false;
|
||||
/// <summary>
|
||||
/// The proximity range
|
||||
/// </summary>
|
||||
public float ProximityRange = 50f;
|
||||
|
||||
[SerializeField]
|
||||
private Animator _animator;
|
||||
[SerializeField]
|
||||
private uint parameterSendBits;
|
||||
[SerializeField]
|
||||
private float sendRate = 0.1f;
|
||||
private readonly float sendRate = 0.1f;
|
||||
private AnimatorControllerParameter[] animatorParameters;
|
||||
|
||||
private int animationHash;
|
||||
private int transitionHash;
|
||||
private float sendTimer;
|
||||
|
||||
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
// tracking - these should probably move to a Preview component. -- Comment from HLAPI. Needs clarification
|
||||
public string param0;
|
||||
public string param1;
|
||||
@ -24,7 +42,11 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
public string param3;
|
||||
public string param4;
|
||||
public string param5;
|
||||
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the animator component used for syncing the animations
|
||||
/// </summary>
|
||||
public Animator animator
|
||||
{
|
||||
get { return _animator; }
|
||||
@ -34,7 +56,11 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
ResetParameterOptions();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="value"></param>
|
||||
public void SetParameterAutoSend(int index, bool value)
|
||||
{
|
||||
if (value)
|
||||
@ -46,7 +72,11 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
parameterSendBits &= (uint)(~(1 << index));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <returns></returns>
|
||||
public bool GetParameterAutoSend(int index)
|
||||
{
|
||||
return (parameterSendBits & (uint)(1 << index)) != 0;
|
||||
@ -60,6 +90,9 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers message handlers
|
||||
/// </summary>
|
||||
public override void NetworkStart()
|
||||
{
|
||||
RegisterMessageHandler("MLAPI_HandleAnimationMessage", HandleAnimMsg);
|
||||
@ -67,6 +100,9 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
RegisterMessageHandler("MLAPI_HandleAnimationTriggerMessage", HandleAnimTriggerMsg);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public void ResetParameterOptions()
|
||||
{
|
||||
Debug.Log("ResetParameterOptions");
|
||||
@ -81,8 +117,10 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
|
||||
CheckSendRate();
|
||||
|
||||
#pragma warning disable IDE0018 // Inline variable declaration, Unity's Mono version doesn't support it
|
||||
int stateHash;
|
||||
float normalizedTime;
|
||||
#pragma warning restore IDE0018 // Inline variable declaration, Unity's Mono version doesn't support it
|
||||
if (!CheckAnimStateChanged(out stateHash, out normalizedTime))
|
||||
{
|
||||
return;
|
||||
@ -98,7 +136,18 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
}
|
||||
if(isServer)
|
||||
{
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationMessage", "MLAPI_ANIMATION_UPDATE", stream.ToArray());
|
||||
if(EnableProximity)
|
||||
{
|
||||
List<uint> clientsInProximity = new List<uint>();
|
||||
foreach (KeyValuePair<uint, NetworkedClient> client in NetworkingManager.singleton.connectedClients)
|
||||
{
|
||||
if (Vector3.Distance(transform.position, client.Value.PlayerObject.transform.position) <= ProximityRange)
|
||||
clientsInProximity.Add(client.Key);
|
||||
}
|
||||
SendToClientsTarget(clientsInProximity ,"MLAPI_HandleAnimationMessage", "MLAPI_ANIMATION_UPDATE", stream.ToArray());
|
||||
}
|
||||
else
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationMessage", "MLAPI_ANIMATION_UPDATE", stream.ToArray());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -144,9 +193,9 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
|
||||
private void CheckSendRate()
|
||||
{
|
||||
if (sendMessagesAllowed && sendRate != 0 && sendTimer < Time.time)
|
||||
if (sendMessagesAllowed && sendRate != 0 && sendTimer < NetworkingManager.singleton.NetworkTime)
|
||||
{
|
||||
sendTimer = Time.time + sendRate;
|
||||
sendTimer = NetworkingManager.singleton.NetworkTime + sendRate;
|
||||
|
||||
using(MemoryStream stream = new MemoryStream())
|
||||
{
|
||||
@ -156,7 +205,18 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
}
|
||||
if (isServer)
|
||||
{
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationParameterMessage", "MLAPI_ANIMATION_UPDATE", stream.ToArray());
|
||||
if (EnableProximity)
|
||||
{
|
||||
List<uint> clientsInProximity = new List<uint>();
|
||||
foreach (KeyValuePair<uint, NetworkedClient> client in NetworkingManager.singleton.connectedClients)
|
||||
{
|
||||
if (Vector3.Distance(transform.position, client.Value.PlayerObject.transform.position) <= ProximityRange)
|
||||
clientsInProximity.Add(client.Key);
|
||||
}
|
||||
SendToClientsTarget(clientsInProximity, "MLAPI_HandleAnimationParameterMessage", "MLAPI_ANIMATION_UPDATE", stream.ToArray());
|
||||
}
|
||||
else
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationParameterMessage", "MLAPI_ANIMATION_UPDATE", stream.ToArray());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -188,7 +248,7 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
if (i == 5) param5 = p;
|
||||
}
|
||||
|
||||
private void HandleAnimMsg(int clientId, byte[] data)
|
||||
private void HandleAnimMsg(uint clientId, byte[] data)
|
||||
{
|
||||
// usually transitions will be triggered by parameters, if not, play anims directly.
|
||||
// NOTE: this plays "animations", not transitions, so any transitions will be skipped.
|
||||
@ -196,7 +256,18 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
|
||||
if(isServer)
|
||||
{
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationMessage", "MLAPI_ANIMATION_UPDATE", data);
|
||||
if (EnableProximity)
|
||||
{
|
||||
List<uint> clientsInProximity = new List<uint>();
|
||||
foreach (KeyValuePair<uint, NetworkedClient> client in NetworkingManager.singleton.connectedClients)
|
||||
{
|
||||
if (Vector3.Distance(transform.position, client.Value.PlayerObject.transform.position) <= ProximityRange)
|
||||
clientsInProximity.Add(client.Key);
|
||||
}
|
||||
SendToClientsTarget(clientsInProximity, "MLAPI_HandleAnimationMessage", "MLAPI_ANIMATION_UPDATE", data);
|
||||
}
|
||||
else
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationMessage", "MLAPI_ANIMATION_UPDATE", data);
|
||||
}
|
||||
using(MemoryStream stream = new MemoryStream(data))
|
||||
{
|
||||
@ -213,11 +284,22 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleAnimParamsMsg(int clientId, byte[] data)
|
||||
private void HandleAnimParamsMsg(uint clientId, byte[] data)
|
||||
{
|
||||
if (isServer)
|
||||
{
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationParameterMessage", "MLAPI_ANIMATION_UPDATE", data);
|
||||
if (EnableProximity)
|
||||
{
|
||||
List<uint> clientsInProximity = new List<uint>();
|
||||
foreach (KeyValuePair<uint, NetworkedClient> client in NetworkingManager.singleton.connectedClients)
|
||||
{
|
||||
if (Vector3.Distance(transform.position, client.Value.PlayerObject.transform.position) <= ProximityRange)
|
||||
clientsInProximity.Add(client.Key);
|
||||
}
|
||||
SendToClientsTarget(clientsInProximity, "MLAPI_HandleAnimationParameterMessage", "MLAPI_ANIMATION_UPDATE", data);
|
||||
}
|
||||
else
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationParameterMessage", "MLAPI_ANIMATION_UPDATE", data);
|
||||
}
|
||||
using (MemoryStream stream = new MemoryStream(data))
|
||||
{
|
||||
@ -228,11 +310,22 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleAnimTriggerMsg(int clientId, byte[] data)
|
||||
private void HandleAnimTriggerMsg(uint clientId, byte[] data)
|
||||
{
|
||||
if (isServer)
|
||||
{
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationTriggerMessage", "MLAPI_ANIMATION_UPDATE", data);
|
||||
if (EnableProximity)
|
||||
{
|
||||
List<uint> clientsInProximity = new List<uint>();
|
||||
foreach (KeyValuePair<uint, NetworkedClient> client in NetworkingManager.singleton.connectedClients)
|
||||
{
|
||||
if (Vector3.Distance(transform.position, client.Value.PlayerObject.transform.position) <= ProximityRange)
|
||||
clientsInProximity.Add(client.Key);
|
||||
}
|
||||
SendToClientsTarget(clientsInProximity, "MLAPI_HandleAnimationTriggerMessage", "MLAPI_ANIMATION_UPDATE", data);
|
||||
}
|
||||
else
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationTriggerMessage", "MLAPI_ANIMATION_UPDATE", data);
|
||||
}
|
||||
using (MemoryStream stream = new MemoryStream(data))
|
||||
{
|
||||
@ -314,11 +407,19 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
/// <param name="triggerName"></param>
|
||||
public void SetTrigger(string triggerName)
|
||||
{
|
||||
SetTrigger(Animator.StringToHash(triggerName));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
/// <param name="hash"></param>
|
||||
public void SetTrigger(int hash)
|
||||
{
|
||||
if (isLocalPlayer || isOwner)
|
||||
@ -331,7 +432,18 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
}
|
||||
if (isServer)
|
||||
{
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationTriggerMessage", "MLAPI_ANIMATION_UPDATE", stream.ToArray());
|
||||
if (EnableProximity)
|
||||
{
|
||||
List<uint> clientsInProximity = new List<uint>();
|
||||
foreach (KeyValuePair<uint, NetworkedClient> client in NetworkingManager.singleton.connectedClients)
|
||||
{
|
||||
if (Vector3.Distance(transform.position, client.Value.PlayerObject.transform.position) <= ProximityRange)
|
||||
clientsInProximity.Add(client.Key);
|
||||
}
|
||||
SendToClientsTarget(clientsInProximity, "MLAPI_HandleAnimationTriggerMessage", "MLAPI_ANIMATION_UPDATE", stream.ToArray());
|
||||
}
|
||||
else
|
||||
SendToNonLocalClientsTarget("MLAPI_HandleAnimationTriggerMessage", "MLAPI_ANIMATION_UPDATE", stream.ToArray());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
192
MLAPI/MonoBehaviours/Prototyping/NetworkedNavMeshAgent.cs
Normal file
192
MLAPI/MonoBehaviours/Prototyping/NetworkedNavMeshAgent.cs
Normal file
@ -0,0 +1,192 @@
|
||||
using MLAPI.Data;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
namespace MLAPI.MonoBehaviours.Prototyping
|
||||
{
|
||||
/// <summary>
|
||||
/// A prototype component for syncing navmeshagents
|
||||
/// </summary>
|
||||
[AddComponentMenu("MLAPI/NetworkedNavMeshAgent")]
|
||||
public class NetworkedNavMeshAgent : NetworkedBehaviour
|
||||
{
|
||||
private NavMeshAgent agent;
|
||||
/// <summary>
|
||||
/// Is proximity enabled
|
||||
/// </summary>
|
||||
public bool EnableProximity = false;
|
||||
/// <summary>
|
||||
/// The proximity range
|
||||
/// </summary>
|
||||
public float ProximityRange = 50f;
|
||||
/// <summary>
|
||||
/// The delay in seconds between corrections
|
||||
/// </summary>
|
||||
public float CorrectionDelay = 3f;
|
||||
//TODO rephrase.
|
||||
/// <summary>
|
||||
/// The percentage to lerp on corrections
|
||||
/// </summary>
|
||||
[Tooltip("Everytime a correction packet is recieved. This is the percentage (between 0 & 1) that we will move towards the goal.")]
|
||||
public float DriftCorrectionPercentage = 0.1f;
|
||||
/// <summary>
|
||||
/// Should we warp on destination change
|
||||
/// </summary>
|
||||
public bool WarpOnDestinationChange = false;
|
||||
|
||||
private static byte[] stateUpdateBuffer = new byte[36];
|
||||
private static byte[] correctionBuffer = new byte[24];
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
agent = GetComponent<NavMeshAgent>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers message handlers
|
||||
/// </summary>
|
||||
public override void NetworkStart()
|
||||
{
|
||||
if (isClient)
|
||||
{
|
||||
RegisterMessageHandler("MLAPI_OnNavMeshStateUpdate", OnNavMeshStateUpdate);
|
||||
RegisterMessageHandler("MLAPI_OnNavMeshCorrectionUpdate", OnNavMeshCorrectionUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
private Vector3 lastDestination = Vector3.zero;
|
||||
private float lastCorrectionTime = 0f;
|
||||
private void Update()
|
||||
{
|
||||
if (!isServer)
|
||||
return;
|
||||
|
||||
if(agent.destination != lastDestination)
|
||||
{
|
||||
lastDestination = agent.destination;
|
||||
using (MemoryStream stream = new MemoryStream(stateUpdateBuffer))
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(agent.destination.x);
|
||||
writer.Write(agent.destination.y);
|
||||
writer.Write(agent.destination.z);
|
||||
|
||||
writer.Write(agent.velocity.x);
|
||||
writer.Write(agent.velocity.y);
|
||||
writer.Write(agent.velocity.z);
|
||||
|
||||
writer.Write(transform.position.x);
|
||||
writer.Write(transform.position.y);
|
||||
writer.Write(transform.position.z);
|
||||
}
|
||||
if (!EnableProximity)
|
||||
{
|
||||
SendToClientsTarget("MLAPI_OnNavMeshStateUpdate", "MLAPI_NAV_AGENT_STATE", stateUpdateBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<uint> proximityClients = new List<uint>();
|
||||
foreach (KeyValuePair<uint, NetworkedClient> client in NetworkingManager.singleton.connectedClients)
|
||||
{
|
||||
if (Vector3.Distance(client.Value.PlayerObject.transform.position, transform.position) <= ProximityRange)
|
||||
proximityClients.Add(client.Key);
|
||||
}
|
||||
SendToClientsTarget(proximityClients, "MLAPI_OnNavMeshStateUpdate", "MLAPI_NAV_AGENT_STATE", stateUpdateBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(NetworkingManager.singleton.NetworkTime - lastCorrectionTime >= CorrectionDelay)
|
||||
{
|
||||
using (MemoryStream stream = new MemoryStream(correctionBuffer))
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(agent.velocity.x);
|
||||
writer.Write(agent.velocity.y);
|
||||
writer.Write(agent.velocity.z);
|
||||
|
||||
writer.Write(transform.position.x);
|
||||
writer.Write(transform.position.y);
|
||||
writer.Write(transform.position.z);
|
||||
}
|
||||
|
||||
if (!EnableProximity)
|
||||
{
|
||||
SendToClientsTarget("MLAPI_OnNavMeshCorrectionUpdate", "MLAPI_NAV_AGENT_CORRECTION", correctionBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<uint> proximityClients = new List<uint>();
|
||||
foreach (KeyValuePair<uint, NetworkedClient> client in NetworkingManager.singleton.connectedClients)
|
||||
{
|
||||
if (Vector3.Distance(client.Value.PlayerObject.transform.position, transform.position) <= ProximityRange)
|
||||
proximityClients.Add(client.Key);
|
||||
}
|
||||
SendToClientsTarget(proximityClients, "MLAPI_OnNavMeshCorrectionUpdate", "MLAPI_NAV_AGENT_CORRECTION", correctionBuffer);
|
||||
}
|
||||
}
|
||||
lastCorrectionTime = NetworkingManager.singleton.NetworkTime;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnNavMeshStateUpdate(uint clientId, byte[] data)
|
||||
{
|
||||
using (MemoryStream stream = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader reader = new BinaryReader(stream))
|
||||
{
|
||||
float xDestination = reader.ReadSingle();
|
||||
float yDestination = reader.ReadSingle();
|
||||
float zDestination = reader.ReadSingle();
|
||||
|
||||
float xVel = reader.ReadSingle();
|
||||
float yVel = reader.ReadSingle();
|
||||
float zVel = reader.ReadSingle();
|
||||
|
||||
float xPos = reader.ReadSingle();
|
||||
float yPos = reader.ReadSingle();
|
||||
float zPos = reader.ReadSingle();
|
||||
|
||||
Vector3 destination = new Vector3(xDestination, yDestination, zDestination);
|
||||
Vector3 velocity = new Vector3(xVel, yVel, zVel);
|
||||
Vector3 position = new Vector3(xPos, yPos, zPos);
|
||||
|
||||
agent.SetDestination(destination);
|
||||
agent.velocity = velocity;
|
||||
if (WarpOnDestinationChange)
|
||||
agent.Warp(position);
|
||||
else
|
||||
agent.Warp(Vector3.Lerp(transform.position, position, DriftCorrectionPercentage));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnNavMeshCorrectionUpdate(uint clientId, byte[] data)
|
||||
{
|
||||
using (MemoryStream stream = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader reader = new BinaryReader(stream))
|
||||
{
|
||||
float xVel = reader.ReadSingle();
|
||||
float yVel = reader.ReadSingle();
|
||||
float zVel = reader.ReadSingle();
|
||||
|
||||
float xPos = reader.ReadSingle();
|
||||
float yPos = reader.ReadSingle();
|
||||
float zPos = reader.ReadSingle();
|
||||
|
||||
Vector3 velocity = new Vector3(xVel, yVel, zVel);
|
||||
Vector3 position = new Vector3(xPos, yPos, zPos);
|
||||
|
||||
agent.velocity = velocity;
|
||||
agent.Warp(Vector3.Lerp(transform.position, position, DriftCorrectionPercentage));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
88
MLAPI/MonoBehaviours/Prototyping/NetworkedProximity.cs
Normal file
88
MLAPI/MonoBehaviours/Prototyping/NetworkedProximity.cs
Normal file
@ -0,0 +1,88 @@
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.MonoBehaviours.Prototyping
|
||||
{
|
||||
//This class based on the code from the UNET HLAPI Proximity
|
||||
public class NetworkedProximity : NetworkedBehaviour
|
||||
{
|
||||
public enum CheckMethod
|
||||
{
|
||||
Physics3D,
|
||||
Physics2D
|
||||
};
|
||||
|
||||
[Tooltip("The maximum range that objects will be visible at.")]
|
||||
public int Range = 10;
|
||||
|
||||
[Tooltip("How often (in seconds) that this object should update the set of players that can see it.")]
|
||||
public float VisibilityUpdateInterval = 1.0f; // in seconds
|
||||
|
||||
[Tooltip("Which method to use for checking proximity of players.\n\nPhysics3D uses 3D physics to determine proximity.\n\nPhysics2D uses 2D physics to determine proximity.")]
|
||||
public CheckMethod CheckType = CheckMethod.Physics3D;
|
||||
|
||||
[Tooltip("Enable to force this object to be hidden from players.")]
|
||||
public bool ForceHidden = false;
|
||||
|
||||
private float lastUpdateTime;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!isServer)
|
||||
return;
|
||||
|
||||
if (Time.time - lastUpdateTime > VisibilityUpdateInterval)
|
||||
{
|
||||
RebuildObservers();
|
||||
lastUpdateTime = NetworkingManager.singleton.NetworkTime;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnCheckObserver(uint newClientId)
|
||||
{
|
||||
if (ForceHidden)
|
||||
return false;
|
||||
Vector3 pos = NetworkingManager.singleton.ConnectedClients[newClientId].PlayerObject.transform.position;
|
||||
return (pos - transform.position).magnitude < Range;
|
||||
}
|
||||
|
||||
public override bool OnRebuildObservers(HashSet<uint> observers)
|
||||
{
|
||||
if (ForceHidden)
|
||||
{
|
||||
// ensure player can still see themself
|
||||
if (networkedObject != null && networkedObject.isPlayerObject)
|
||||
observers.Add(networkedObject.OwnerClientId);
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (CheckType)
|
||||
{
|
||||
case CheckMethod.Physics3D:
|
||||
{
|
||||
var hits = Physics.OverlapSphere(transform.position, Range);
|
||||
for (int i = 0; i < hits.Length; i++)
|
||||
{
|
||||
var uv = hits[i].GetComponent<NetworkedObject>();
|
||||
if (uv != null && uv.isPlayerObject)
|
||||
observers.Add(uv.OwnerClientId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case CheckMethod.Physics2D:
|
||||
{
|
||||
var hits = Physics2D.OverlapCircleAll(transform.position, Range);
|
||||
for (int i = 0; i < hits.Length; i++)
|
||||
{
|
||||
var uv = hits[i].GetComponent<NetworkedObject>();
|
||||
if (uv != null && (uv.isPlayerObject))
|
||||
observers.Add(uv.OwnerClientId);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +1,47 @@
|
||||
using System.IO;
|
||||
using MLAPI.Data;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.MonoBehaviours.Prototyping
|
||||
{
|
||||
/// <summary>
|
||||
/// A prototype component for syncing transforms
|
||||
/// </summary>
|
||||
[AddComponentMenu("MLAPI/NetworkedTransform")]
|
||||
public class NetworkedTransform : NetworkedBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends per second
|
||||
/// </summary>
|
||||
[Range(0f, 120f)]
|
||||
public float SendsPerSecond = 20;
|
||||
/// <summary>
|
||||
/// Is the sends per second assumed to be the same across all instances
|
||||
/// </summary>
|
||||
[Tooltip("This assumes that the SendsPerSecond is synced across clients")]
|
||||
public bool AssumeSyncedSends = true;
|
||||
/// <summary>
|
||||
/// Enable interpolation
|
||||
/// </summary>
|
||||
[Tooltip("This requires AssumeSyncedSends to be true")]
|
||||
public bool InterpolatePosition = true;
|
||||
/// <summary>
|
||||
/// The distance before snaping to the position
|
||||
/// </summary>
|
||||
[Tooltip("The transform will snap if the distance is greater than this distance")]
|
||||
public float SnapDistance = 10f;
|
||||
/// <summary>
|
||||
/// Should the server interpolate
|
||||
/// </summary>
|
||||
public bool InterpolateServer = true;
|
||||
/// <summary>
|
||||
/// The min meters to move before a send is sent
|
||||
/// </summary>
|
||||
public float MinMeters = 0.15f;
|
||||
/// <summary>
|
||||
/// The min degrees to rotate before a send it sent
|
||||
/// </summary>
|
||||
public float MinDegrees = 1.5f;
|
||||
private float timeForLerp;
|
||||
private float lerpT;
|
||||
@ -26,11 +53,18 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
private float lastSendTime;
|
||||
private Vector3 lastSentPos;
|
||||
private Quaternion lastSentRot;
|
||||
|
||||
/// <summary>
|
||||
/// Should proximity be enabled
|
||||
/// </summary>
|
||||
public bool EnableProximity = false;
|
||||
/// <summary>
|
||||
/// The distance to use for proximity
|
||||
/// </summary>
|
||||
[Tooltip("If enable proximity is turned on, on clients within this range will be recieving position updates from the server")]
|
||||
public float ProximityRange = 50;
|
||||
|
||||
private static byte[] positionUpdateBuffer = new byte[24];
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
if (!AssumeSyncedSends && InterpolatePosition)
|
||||
@ -42,7 +76,10 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
if (MinMeters < 0)
|
||||
MinMeters = 0;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Registers message handlers
|
||||
/// </summary>
|
||||
public override void NetworkStart()
|
||||
{
|
||||
if (isServer)
|
||||
@ -57,33 +94,43 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
{
|
||||
timeForLerp = 1f / SendsPerSecond;
|
||||
}
|
||||
|
||||
lastSentRot = transform.rotation;
|
||||
lastSentPos = transform.position;
|
||||
|
||||
lerpStartPos = transform.position;
|
||||
lerpStartRot = transform.rotation;
|
||||
|
||||
lerpEndPos = transform.position;
|
||||
lerpEndRot = transform.rotation;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if(isOwner || isLocalPlayer || (ownerClientId == -2 && isServer))
|
||||
if(isOwner || isLocalPlayer || (ownerClientId == NetworkingManager.singleton.NetworkConfig.NetworkTransport.InvalidDummyId && isServer))
|
||||
{
|
||||
//We own the object OR we are server and the object is not owned by anyone OR we are the object.
|
||||
if(Time.time - lastSendTime >= timeForLerp && (Vector3.Distance(transform.position, lastSentPos) > MinMeters || Quaternion.Angle(transform.rotation, lastSentRot) > MinDegrees))
|
||||
if(NetworkingManager.singleton.NetworkTime - lastSendTime >= timeForLerp && (Vector3.Distance(transform.position, lastSentPos) > MinMeters || Quaternion.Angle(transform.rotation, lastSentRot) > MinDegrees))
|
||||
{
|
||||
lastSendTime = Time.time;
|
||||
lastSendTime = NetworkingManager.singleton.NetworkTime;
|
||||
lastSentPos = transform.position;
|
||||
lastSentRot = transform.rotation;
|
||||
using (MemoryStream writeStream = new MemoryStream(24))
|
||||
using (MemoryStream writeStream = new MemoryStream(positionUpdateBuffer))
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(writeStream))
|
||||
{
|
||||
writer.Write(transform.position.x);
|
||||
writer.Write(transform.position.y);
|
||||
writer.Write(transform.position.z);
|
||||
|
||||
writer.Write(transform.rotation.eulerAngles.x);
|
||||
writer.Write(transform.rotation.eulerAngles.y);
|
||||
writer.Write(transform.rotation.eulerAngles.z);
|
||||
}
|
||||
if (isServer)
|
||||
SendToClientsTarget("MLAPI_OnRecieveTransformFromServer", "MLAPI_POSITION_UPDATE", writeStream.GetBuffer());
|
||||
SendToClientsTarget("MLAPI_OnRecieveTransformFromServer", "MLAPI_POSITION_UPDATE", positionUpdateBuffer, true);
|
||||
else
|
||||
SendToServerTarget("MLAPI_OnRecieveTransformFromClient", "MLAPI_POSITION_UPDATE", writeStream.GetBuffer());
|
||||
SendToServerTarget("MLAPI_OnRecieveTransformFromClient", "MLAPI_POSITION_UPDATE", positionUpdateBuffer);
|
||||
}
|
||||
|
||||
}
|
||||
@ -98,14 +145,14 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
//Snap, set T to 1 (100% of the lerp)
|
||||
lerpT = 1f;
|
||||
}
|
||||
lerpT += Time.deltaTime / timeForLerp;
|
||||
lerpT += Time.unscaledDeltaTime / timeForLerp;
|
||||
transform.position = Vector3.Lerp(lerpStartPos, lerpEndPos, lerpT);
|
||||
transform.rotation = Quaternion.Slerp(lerpStartRot, lerpEndRot, lerpT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRecieveTransformFromServer(int clientId, byte[] data)
|
||||
private void OnRecieveTransformFromServer(uint clientId, byte[] data)
|
||||
{
|
||||
using (MemoryStream stream = new MemoryStream(data))
|
||||
{
|
||||
@ -114,9 +161,11 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
float xPos = reader.ReadSingle();
|
||||
float yPos = reader.ReadSingle();
|
||||
float zPos = reader.ReadSingle();
|
||||
|
||||
float xRot = reader.ReadSingle();
|
||||
float yRot = reader.ReadSingle();
|
||||
float zRot = reader.ReadSingle();
|
||||
|
||||
lerpStartPos = transform.position;
|
||||
lerpStartRot = transform.rotation;
|
||||
lerpEndPos = new Vector3(xPos, yPos, zPos);
|
||||
@ -126,18 +175,20 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRecieveTransformFromClient(int clientId, byte[] data)
|
||||
private void OnRecieveTransformFromClient(uint clientId, byte[] data)
|
||||
{
|
||||
using(MemoryStream readStream = new MemoryStream(data))
|
||||
using (MemoryStream readStream = new MemoryStream(data))
|
||||
{
|
||||
using(BinaryReader reader = new BinaryReader(readStream))
|
||||
{
|
||||
float xPos = reader.ReadSingle();
|
||||
float yPos = reader.ReadSingle();
|
||||
float zPos = reader.ReadSingle();
|
||||
|
||||
float xRot = reader.ReadSingle();
|
||||
float yRot = reader.ReadSingle();
|
||||
float zRot = reader.ReadSingle();
|
||||
|
||||
if (InterpolateServer)
|
||||
{
|
||||
lerpStartPos = transform.position;
|
||||
@ -151,7 +202,7 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
transform.position = new Vector3(xPos, yPos, zPos);
|
||||
transform.rotation = Quaternion.Euler(new Vector3(xRot, yRot, zRot));
|
||||
}
|
||||
using (MemoryStream writeStream = new MemoryStream(24))
|
||||
using (MemoryStream writeStream = new MemoryStream(positionUpdateBuffer))
|
||||
{
|
||||
using(BinaryWriter writer = new BinaryWriter(writeStream))
|
||||
{
|
||||
@ -164,17 +215,18 @@ namespace MLAPI.MonoBehaviours.Prototyping
|
||||
}
|
||||
if(EnableProximity)
|
||||
{
|
||||
for (int i = 0; i < NetworkingManager.singleton.connectedClients.Count; i++)
|
||||
// For instead of Foreach?! TODO!!!
|
||||
for (uint i = 0; i < NetworkingManager.singleton.connectedClients.Count; i++)
|
||||
{
|
||||
if (Vector3.Distance(NetworkingManager.singleton.connectedClients[i].PlayerObject.transform.position, transform.position) <= ProximityRange)
|
||||
{
|
||||
SendToClientTarget(NetworkingManager.singleton.connectedClients[i].ClientId, "MLAPI_OnRecieveTransformFromServer", "MLAPI_POSITION_UPDATE", writeStream.GetBuffer());
|
||||
SendToClientTarget(NetworkingManager.singleton.connectedClients[i].ClientId, "MLAPI_OnRecieveTransformFromServer", "MLAPI_POSITION_UPDATE", positionUpdateBuffer, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SendToNonLocalClientsTarget("MLAPI_OnRecieveTransformFromServer", "MLAPI_POSITION_UPDATE", writeStream.GetBuffer());
|
||||
SendToNonLocalClientsTarget("MLAPI_OnRecieveTransformFromServer", "MLAPI_POSITION_UPDATE", positionUpdateBuffer, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
19
MLAPI/NetworkingManagerComponents/Binary/BinaryHelpers.cs
Normal file
19
MLAPI/NetworkingManagerComponents/Binary/BinaryHelpers.cs
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
namespace MLAPI.NetworkingManagerComponents.Binary
|
||||
{
|
||||
public static class BinaryHelpers
|
||||
{
|
||||
// Swap endianness of a given integer
|
||||
public static uint SwapEndian(uint value) => (uint)(((value >> 24) & (255 << 0)) | ((value >> 8) & (255 << 8)) | ((value << 8) & (255 << 16)) | ((value << 24) & (255 << 24)));
|
||||
public static ulong SwapEndian(ulong value) =>
|
||||
((value >> 56) & 0xFF) |
|
||||
((value >> 40) & (0xFFUL << 8)) |
|
||||
((value >> 24) & (0xFFUL << 16)) |
|
||||
((value >> 8) & (0xFFUL << 24)) |
|
||||
((value << 56) & (0xFFUL << 56)) |
|
||||
((value << 40) & (0xFFUL << 48)) |
|
||||
((value << 24) & (0xFFUL << 40)) |
|
||||
((value << 8) & (0xFFUL << 32)) ;
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
|
93
MLAPI/NetworkingManagerComponents/Binary/BinarySerializer.cs
Normal file
93
MLAPI/NetworkingManagerComponents/Binary/BinarySerializer.cs
Normal file
@ -0,0 +1,93 @@
|
||||
using MLAPI.Attributes;
|
||||
using MLAPI.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Binary
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper class for serializing classes to binary
|
||||
/// </summary>
|
||||
public static class BinarySerializer
|
||||
{
|
||||
private static Dictionary<string, FieldInfo[]> cachedFields = new Dictionary<string, FieldInfo[]>();
|
||||
|
||||
/// <summary>
|
||||
/// Clears the cache of the serializer
|
||||
/// </summary>
|
||||
public static void ClearCache()
|
||||
{
|
||||
cachedFields.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serializes a class instance to binary
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The class type to serialize</typeparam>
|
||||
/// <param name="instance">The instance to serialize</param>
|
||||
/// <returns>Binary serialized version of the instance</returns>
|
||||
public static byte[] Serialize<T>(T instance)
|
||||
{
|
||||
FieldInfo[] sortedFields;
|
||||
|
||||
if (cachedFields.ContainsKey(instance.GetType().FullName))
|
||||
sortedFields = cachedFields[instance.GetType().FullName];
|
||||
else
|
||||
{
|
||||
sortedFields = instance.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).OrderBy(x => x.Name).Where(x => !x.IsDefined(typeof(BinaryIgnore), true)).ToArray();
|
||||
cachedFields.Add(instance.GetType().FullName, sortedFields);
|
||||
}
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
for (int i = 0; i < sortedFields.Length; i++)
|
||||
{
|
||||
FieldType fieldType = FieldTypeHelper.GetFieldType(sortedFields[i].FieldType);
|
||||
if (fieldType == FieldType.Invalid)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: The field " + sortedFields[i].Name + " will not be serialized as it's not of a supported type. Add the BinaryIgnore attribute to prevent this message from shwoing up.");
|
||||
continue;
|
||||
}
|
||||
FieldTypeHelper.WriteFieldType(writer, sortedFields[i].GetValue(instance), fieldType);
|
||||
}
|
||||
return writer.Finalize();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes binary and turns it back into the original class
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type to return</typeparam>
|
||||
/// <param name="binary">The binary to deserialize</param>
|
||||
/// <returns>An instance of T</returns>
|
||||
public static T Deserialize<T>(byte[] binary) where T : new()
|
||||
{
|
||||
T instance = new T();
|
||||
|
||||
FieldInfo[] sortedFields;
|
||||
|
||||
if (cachedFields.ContainsKey(instance.GetType().FullName))
|
||||
sortedFields = cachedFields[instance.GetType().FullName];
|
||||
else
|
||||
{
|
||||
sortedFields = instance.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).OrderBy(x => x.Name).Where(x => !x.IsDefined(typeof(BinaryIgnore), true)).ToArray();
|
||||
cachedFields.Add(instance.GetType().FullName, sortedFields);
|
||||
}
|
||||
|
||||
BitReader reader = new BitReader(binary);
|
||||
for (int i = 0; i < sortedFields.Length; i++)
|
||||
{
|
||||
FieldType fieldType = FieldTypeHelper.GetFieldType(sortedFields[i].FieldType);
|
||||
if (fieldType == FieldType.Invalid)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: The field " + sortedFields[i].Name + " will not be deserialized as it's not of a supported type. Add the BinaryIgnore attribute to prevent this message from shwoing up.");
|
||||
continue;
|
||||
}
|
||||
sortedFields[i].SetValue(instance, FieldTypeHelper.ReadFieldType(reader, fieldType));
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
118
MLAPI/NetworkingManagerComponents/Binary/BitReader.cs
Normal file
118
MLAPI/NetworkingManagerComponents/Binary/BitReader.cs
Normal file
@ -0,0 +1,118 @@
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Binary
|
||||
{
|
||||
public class BitReader
|
||||
{
|
||||
private delegate T Getter<T>();
|
||||
private static readonly float[] holder_f = new float[1];
|
||||
private static readonly double[] holder_d = new double[1];
|
||||
private static readonly ulong[] holder_u = new ulong[1];
|
||||
private static readonly uint[] holder_i = new uint[1];
|
||||
|
||||
private readonly byte[] readFrom;
|
||||
private long bitCount = 0;
|
||||
public BitReader(byte[] readFrom) => this.readFrom = readFrom;
|
||||
|
||||
public bool ReadBool()
|
||||
{
|
||||
bool result = (readFrom[bitCount / 8] & (byte)(1 << (int)(bitCount % 8))) != 0;
|
||||
++bitCount;
|
||||
return result;
|
||||
}
|
||||
|
||||
public float ReadFloat() => ReadFloating<float>();
|
||||
public double ReadDouble() => ReadFloating<double>();
|
||||
public byte ReadByte()
|
||||
{
|
||||
int shift = (int)(bitCount % 8);
|
||||
int index = (int)(bitCount / 8);
|
||||
byte lower_mask = (byte)(0xFF << shift);
|
||||
byte upper_mask = (byte)~lower_mask;
|
||||
byte result = (byte)(((readFrom[index] & lower_mask) >> shift) | (shift == 0 ? 0 : (readFrom[index + 1] & upper_mask) << (8 - shift)));
|
||||
bitCount += 8;
|
||||
return result;
|
||||
}
|
||||
public void SkipPadded() => bitCount += (8 - (bitCount % 8)) % 8;
|
||||
public ushort ReadUShort() => (ushort)ReadULong();
|
||||
public uint ReadUInt() => (uint)ReadULong();
|
||||
public sbyte ReadSByte() => (sbyte)ZigZagDecode(ReadByte(), 1);
|
||||
public short ReadShort() => (short)ZigZagDecode(ReadUShort(), 2);
|
||||
public int ReadInt() => (int)ZigZagDecode(ReadUInt(), 4);
|
||||
public long ReadLong() => ZigZagDecode(ReadULong(), 8);
|
||||
public float[] ReadFloatArray(int known = -1) => ReadArray(ReadFloat, known);
|
||||
public double[] ReadDoubleArray(int known = -1) => ReadArray(ReadDouble, known);
|
||||
public byte[] ReadByteArray(int known = -1) => ReadArray(ReadByte, known);
|
||||
public ushort[] ReadUShortArray(int known = -1) => ReadArray(ReadUShort, known);
|
||||
public uint[] ReadUIntArray(int known = -1) => ReadArray(ReadUInt, known);
|
||||
public ulong[] ReadULongArray(int known = -1) => ReadArray(ReadULong, known);
|
||||
public sbyte[] ReadSByteArray(int known = -1) => ReadArray(ReadSByte, known);
|
||||
public short[] ReadShortArray(int known = -1) => ReadArray(ReadShort, known);
|
||||
public int[] ReadIntArray(int known = -1) => ReadArray(ReadInt, known);
|
||||
public long[] ReadLongArray(int known = -1) => ReadArray(ReadLong, known);
|
||||
public string ReadString() => Encoding.UTF8.GetString(ReadByteArray());
|
||||
public byte ReadBits(int bits)
|
||||
{
|
||||
byte b = 0;
|
||||
for (int i = 0; --bits >= 0; ++i)
|
||||
b |= (byte)((ReadBool() ? 1 : 0) << i);
|
||||
return b;
|
||||
}
|
||||
|
||||
public ulong ReadULong()
|
||||
{
|
||||
ulong header = ReadByte();
|
||||
if (header <= 240) return header;
|
||||
if (header <= 248) return 240 + 256 * (header - 241) + ReadByte();
|
||||
if (header == 249) return 2288 + 256UL * ReadByte() + ReadByte();
|
||||
ulong res = ReadByte() | ((ulong)ReadByte() << 8) | ((ulong)ReadByte() << 16);
|
||||
if(header > 250)
|
||||
{
|
||||
res |= (ulong) ReadByte() << 24;
|
||||
if(header > 251)
|
||||
{
|
||||
res |= (ulong)ReadByte() << 32;
|
||||
if(header > 252)
|
||||
{
|
||||
res |= (ulong)ReadByte() << 40;
|
||||
if (header > 253)
|
||||
{
|
||||
res |= (ulong)ReadByte() << 48;
|
||||
if (header > 254) res |= (ulong)ReadByte() << 56;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
private T[] ReadArray<T>(Getter<T> g, int knownSize = -1)
|
||||
{
|
||||
T[] result = new T[knownSize > 0 ? (uint)knownSize : ReadUInt()];
|
||||
for (ushort s = 0; s < result.Length; ++s)
|
||||
result[s] = g();
|
||||
return result;
|
||||
}
|
||||
|
||||
private T ReadFloating<T>()
|
||||
{
|
||||
int size = Marshal.SizeOf(typeof(T));
|
||||
Array type_holder = size == 4 ? holder_f as Array : holder_d as Array;
|
||||
Array result_holder = size == 4 ? holder_i as Array : holder_u as Array;
|
||||
T result;
|
||||
lock(result_holder)
|
||||
lock (type_holder)
|
||||
{
|
||||
if (size == 4) result_holder.SetValue(BinaryHelpers.SwapEndian(ReadUInt()), 0);
|
||||
else result_holder.SetValue(BinaryHelpers.SwapEndian(ReadULong()), 0);
|
||||
Buffer.BlockCopy(result_holder, 0, type_holder, 0, size);
|
||||
result = (T)type_holder.GetValue(0);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private static long ZigZagDecode(ulong d, int bytes) => (long)(((d << (bytes * 8 - 1)) & 1) | (d >> 1));
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
|
432
MLAPI/NetworkingManagerComponents/Binary/BitWriter.cs
Normal file
432
MLAPI/NetworkingManagerComponents/Binary/BitWriter.cs
Normal file
@ -0,0 +1,432 @@
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Binary
|
||||
{
|
||||
public sealed class BitWriter : IDisposable
|
||||
{
|
||||
private struct Partial
|
||||
{
|
||||
public byte value;
|
||||
public byte count;
|
||||
public static readonly FieldInfo value_info = typeof(Partial).GetField("value");
|
||||
public static readonly FieldInfo count_info = typeof(Partial).GetField("count");
|
||||
|
||||
public Partial(byte value, byte count)
|
||||
{
|
||||
this.value = value;
|
||||
this.count = count;
|
||||
}
|
||||
}
|
||||
private static readonly Queue<List<object>> listPool = new Queue<List<object>>();
|
||||
|
||||
private static readonly float[] holder_f = new float[1];
|
||||
private static readonly double[] holder_d = new double[1];
|
||||
private static readonly ulong[] holder_u = new ulong[1];
|
||||
private static readonly uint[] holder_i = new uint[1];
|
||||
private static readonly List<Type> supportedTypes = new List<Type>()
|
||||
{
|
||||
typeof(bool),
|
||||
typeof(byte),
|
||||
typeof(sbyte),
|
||||
typeof(char),
|
||||
typeof(short),
|
||||
typeof(ushort),
|
||||
typeof(int),
|
||||
typeof(uint),
|
||||
typeof(long),
|
||||
typeof(ulong),
|
||||
typeof(float),
|
||||
typeof(double),
|
||||
typeof(decimal),
|
||||
typeof(Partial)
|
||||
};
|
||||
|
||||
private static readonly FieldInfo
|
||||
dec_lo,
|
||||
dec_mid,
|
||||
dec_hi,
|
||||
dec_flags;
|
||||
|
||||
static BitWriter()
|
||||
{
|
||||
dec_lo = typeof(decimal).GetField("lo", BindingFlags.NonPublic);
|
||||
dec_mid = typeof(decimal).GetField("mid", BindingFlags.NonPublic);
|
||||
dec_hi = typeof(decimal).GetField("hi", BindingFlags.NonPublic);
|
||||
dec_flags = typeof(decimal).GetField("flags", BindingFlags.NonPublic);
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
listPool.Enqueue(new List<object>());
|
||||
}
|
||||
}
|
||||
|
||||
private List<object> collect = null;
|
||||
private bool tempAlloc = false;
|
||||
|
||||
/// <summary>
|
||||
/// Allocates a new binary collector.
|
||||
/// </summary>
|
||||
public BitWriter()
|
||||
{
|
||||
if (listPool.Count == 0)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: There can be no more than 10 BitWriters. Have you forgotten do dispose? (It will still work with worse performance)");
|
||||
collect = new List<object>();
|
||||
tempAlloc = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
collect = listPool.Dequeue();
|
||||
}
|
||||
}
|
||||
|
||||
private void Push<T>(T b)
|
||||
{
|
||||
if (b == null) collect.Add(b);
|
||||
else if (b is string || b.GetType().IsArray || IsSupportedType(b.GetType()))
|
||||
collect.Add(b is string ? Encoding.UTF8.GetBytes(b as string) : b as object);
|
||||
else
|
||||
Debug.LogWarning("MLAPI: The type \"" + b.GetType() + "\" is not supported by the Binary Serializer. It will be ignored");
|
||||
}
|
||||
|
||||
|
||||
public void WriteBool(bool b) => Push(b);
|
||||
public void WriteFloat(float f) => Push(f);
|
||||
public void WriteDouble(double d) => Push(d);
|
||||
public void WriteByte(byte b) => Push(b);
|
||||
public void WriteUShort(ushort s) => Push(s);
|
||||
public void WriteUInt(uint i) => Push(i);
|
||||
public void WriteULong(ulong l) => Push(l);
|
||||
public void WriteSByte(sbyte b) => Push(ZigZagEncode(b, 8));
|
||||
public void WriteShort(short s) => Push(ZigZagEncode(s, 8));
|
||||
public void WriteInt(int i) => Push(ZigZagEncode(i, 8));
|
||||
public void WriteLong(long l) => Push(ZigZagEncode(l, 8));
|
||||
public void WriteString(string s) => Push(s);
|
||||
public void WriteAlignBits() => Push<object>(null);
|
||||
public void WriteFloatArray(float[] f, bool known = false) => PushArray(f, known);
|
||||
public void WriteDoubleArray(double[] d, bool known = false) => PushArray(d, known);
|
||||
public void WriteByteArray(byte[] b, bool known = false) => PushArray(b, known);
|
||||
public void WriteUShortArray(ushort[] s, bool known = false) => PushArray(s, known);
|
||||
public void WriteUIntArray(uint[] i, bool known = false) => PushArray(i, known);
|
||||
public void WriteULongArray(ulong[] l, bool known = false) => PushArray(l, known);
|
||||
public void WriteSByteArray(sbyte[] b, bool known = false) => PushArray(b, known);
|
||||
public void WriteShortArray(short[] s, bool known = false) => PushArray(s, known);
|
||||
public void WriteIntArray(int[] i, bool known = false) => PushArray(i, known);
|
||||
public void WriteLongArray(long[] l, bool known = false) => PushArray(l, known);
|
||||
public void WriteBits(byte value, int bits) => Push(new Partial(ReadNBits(value, 0, bits % 8), (byte)(bits%8))); // Suggestion: store (bits % 8) result?
|
||||
|
||||
private void PushArray<T>(T[] t, bool knownSize = false)
|
||||
{
|
||||
if (!knownSize) Push((uint)t.Length);
|
||||
bool signed = IsSigned(t.GetType().GetElementType());
|
||||
int size = Marshal.SizeOf(t.GetType().GetElementType());
|
||||
foreach (T t1 in t) Push(signed ? (object)ZigZagEncode(t1 as long? ?? t1 as int? ?? t1 as short? ?? t1 as sbyte? ?? 0, size) : (object)t1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serializes data, allocates an array and returns it
|
||||
/// </summary>
|
||||
/// <returns>Allocated array with written data</returns>
|
||||
public byte[] Finalize()
|
||||
{
|
||||
long bitCount = 0;
|
||||
for (int i = 0; i < collect.Count; ++i) bitCount += collect[i] == null ? (8 - (bitCount % 8)) % 8 : GetBitCount(collect[i]);
|
||||
byte[] buffer = new byte[((bitCount / 8) + (bitCount % 8 == 0 ? 0 : 1))];
|
||||
|
||||
long bitOffset = 0;
|
||||
bool isAligned = true;
|
||||
foreach (var item in collect)
|
||||
if (item == null)
|
||||
{
|
||||
bitOffset += (8 - (bitOffset % 8)) % 8;
|
||||
isAligned = true;
|
||||
}
|
||||
else Serialize(item, buffer, ref bitOffset, ref isAligned);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
//The ref is not needed. It's purley there to indicate that it's treated as a reference inside the method.
|
||||
/// <summary>
|
||||
/// Writes data to the given buffer
|
||||
/// </summary>
|
||||
/// <param name="buffer"></param>
|
||||
/// <returns>The amount of bytes written</returns>
|
||||
public long Finalize(ref byte[] buffer)
|
||||
{
|
||||
if(buffer == null)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: no buffer provided");
|
||||
return 0;
|
||||
}
|
||||
long bitCount = 0;
|
||||
for (int i = 0; i < collect.Count; ++i) bitCount += collect[i] == null ? (8 - (bitCount % 8)) % 8 : GetBitCount(collect[i]);
|
||||
|
||||
if (buffer.Length < ((bitCount / 8) + (bitCount % 8 == 0 ? 0 : 1)))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: The buffer size is not large enough");
|
||||
return 0;
|
||||
}
|
||||
long bitOffset = 0;
|
||||
bool isAligned = true;
|
||||
foreach (var item in collect)
|
||||
if (item == null)
|
||||
{
|
||||
bitOffset += (8 - (bitOffset % 8)) % 8;
|
||||
isAligned = true;
|
||||
}
|
||||
else Serialize(item, buffer, ref bitOffset, ref isAligned);
|
||||
|
||||
return (bitCount / 8) + (bitCount % 8 == 0 ? 0 : 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size in bytes if you were to serialize now
|
||||
/// </summary>
|
||||
/// <returns>The size in bytes</returns>
|
||||
public long GetFinalizeSize()
|
||||
{
|
||||
long bitCount = 0;
|
||||
for (int i = 0; i < collect.Count; ++i) bitCount += collect[i] == null ? (8 - (bitCount % 8)) % 8 : GetBitCount(collect[i]);
|
||||
return ((bitCount / 8) + (bitCount % 8 == 0 ? 0 : 1));
|
||||
}
|
||||
|
||||
private static void Serialize<T>(T t, byte[] writeTo, ref long bitOffset, ref bool isAligned)
|
||||
{
|
||||
Type type = t.GetType();
|
||||
bool size = false;
|
||||
if (type.IsArray)
|
||||
{
|
||||
var array = t as Array;
|
||||
Serialize((uint)array.Length, writeTo, ref bitOffset, ref isAligned);
|
||||
foreach (var element in array)
|
||||
Serialize(element, writeTo, ref bitOffset, ref isAligned);
|
||||
}
|
||||
else if (type == typeof(Partial))
|
||||
{
|
||||
byte count;
|
||||
WriteByte(writeTo, (byte)Partial.value_info.GetValue(t), bitOffset, isAligned, count = (byte)Partial.count_info.GetValue(t));
|
||||
bitOffset += count;
|
||||
isAligned = bitOffset % 8 == 0;
|
||||
return;
|
||||
}
|
||||
else if (IsSupportedType(type))
|
||||
{
|
||||
long offset = t is bool ? 1 : BytesToRead(t) * 8;
|
||||
if (type == typeof(bool))
|
||||
{
|
||||
WriteBit(writeTo, t as bool? ?? false, bitOffset);
|
||||
bitOffset += offset;
|
||||
isAligned = bitOffset % 8 == 0;
|
||||
}
|
||||
else if (type == typeof(decimal))
|
||||
{
|
||||
WriteDynamic(writeTo, (int)dec_lo.GetValue(t), 4, bitOffset, isAligned);
|
||||
WriteDynamic(writeTo, (int)dec_mid.GetValue(t), 4, bitOffset + 32, isAligned);
|
||||
WriteDynamic(writeTo, (int)dec_hi.GetValue(t), 4, bitOffset + 64, isAligned);
|
||||
WriteDynamic(writeTo, (int)dec_flags.GetValue(t), 4, bitOffset + 96, isAligned);
|
||||
bitOffset += offset;
|
||||
}
|
||||
else if ((size = type == typeof(float)) || type == typeof(double))
|
||||
{
|
||||
int bytes = size ? 4 : 8;
|
||||
Array type_holder = size ? holder_f as Array : holder_d as Array; // Fetch the preallocated array
|
||||
Array result_holder = size ? holder_i as Array : holder_u as Array;
|
||||
lock (result_holder)
|
||||
lock (type_holder)
|
||||
{
|
||||
// Clear artifacts
|
||||
if (size) result_holder.SetValue(0U, 0);
|
||||
else result_holder.SetValue(0UL, 0);
|
||||
type_holder.SetValue(t, 0); // Insert the value to convert into the preallocated holder array
|
||||
Buffer.BlockCopy(type_holder, 0, result_holder, 0, bytes); // Perform an internal copy to the byte-based holder
|
||||
|
||||
// Since floating point flag bits are seemingly the highest bytes of the floating point values
|
||||
// and even very small values have them, we swap the endianness in the hopes of reducing the size
|
||||
if (size) Serialize(BinaryHelpers.SwapEndian((uint)result_holder.GetValue(0)), writeTo, ref bitOffset, ref isAligned);
|
||||
else Serialize(BinaryHelpers.SwapEndian((ulong)result_holder.GetValue(0)), writeTo, ref bitOffset, ref isAligned);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ulong value;
|
||||
if (t is byte)
|
||||
{
|
||||
WriteByte(writeTo, t as byte? ?? 0, bitOffset, isAligned);
|
||||
bitOffset += 8;
|
||||
return;
|
||||
}
|
||||
else if (t is ushort) value = t as ushort? ?? 0;
|
||||
else if (t is uint) value = t as uint? ?? 0;
|
||||
else value = t as ulong? ?? 0;
|
||||
|
||||
if (value <= 240) WriteByte(writeTo, (byte)value, bitOffset, isAligned);
|
||||
else if (value <= 2287)
|
||||
{
|
||||
WriteByte(writeTo, (value - 240) / 256 + 241, bitOffset, isAligned);
|
||||
WriteByte(writeTo, (value - 240) % 256, bitOffset + 8, isAligned);
|
||||
}
|
||||
else if (value <= 67823)
|
||||
{
|
||||
WriteByte(writeTo, 249, bitOffset, isAligned);
|
||||
WriteByte(writeTo, (value - 2288) / 256, bitOffset + 8, isAligned);
|
||||
WriteByte(writeTo, (value - 2288) % 256, bitOffset + 16, isAligned);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteByte(writeTo, value & 255, bitOffset + 8, isAligned);
|
||||
WriteByte(writeTo, (value >> 8) & 255, bitOffset + 16, isAligned);
|
||||
WriteByte(writeTo, (value >> 16) & 255, bitOffset + 24, isAligned);
|
||||
if (value > 16777215)
|
||||
{
|
||||
WriteByte(writeTo, (value >> 24) & 255, bitOffset + 32, isAligned);
|
||||
if (value > 4294967295)
|
||||
{
|
||||
WriteByte(writeTo, (value >> 32) & 255, bitOffset + 40, isAligned);
|
||||
if (value > 1099511627775)
|
||||
{
|
||||
WriteByte(writeTo, (value >> 40) & 255, bitOffset + 48, isAligned);
|
||||
if (value > 281474976710655)
|
||||
{
|
||||
WriteByte(writeTo, (value >> 48) & 255, bitOffset + 56, isAligned);
|
||||
if (value > 72057594037927935)
|
||||
{
|
||||
WriteByte(writeTo, 255, bitOffset, isAligned);
|
||||
WriteByte(writeTo, (value >> 56) & 255, bitOffset + 64, isAligned);
|
||||
}
|
||||
else WriteByte(writeTo, 254, bitOffset, isAligned);
|
||||
}
|
||||
else WriteByte(writeTo, 253, bitOffset, isAligned);
|
||||
}
|
||||
else WriteByte(writeTo, 252, bitOffset, isAligned);
|
||||
}
|
||||
else WriteByte(writeTo, 251, bitOffset, isAligned);
|
||||
}
|
||||
else WriteByte(writeTo, 250, bitOffset, isAligned);
|
||||
}
|
||||
bitOffset += BytesToRead(value) * 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static byte Read7BitRange(byte higher, byte lower, int bottomBits) => (byte)((higher << bottomBits) & (lower & (0xFF << (8-bottomBits))));
|
||||
private static byte ReadNBits(byte from, int offset, int count) => (byte)(from & ((0xFF >> (8-count)) << offset));
|
||||
|
||||
private static bool IsSigned(Type t) => t == typeof(sbyte) || t == typeof(short) || t == typeof(int) || t == typeof(long);
|
||||
|
||||
private static Type GetUnsignedType(Type t) =>
|
||||
t == typeof(sbyte) ? typeof(byte) :
|
||||
t == typeof(short) ? typeof(ushort) :
|
||||
t == typeof(int) ? typeof(uint) :
|
||||
t == typeof(long) ? typeof(ulong) :
|
||||
null;
|
||||
|
||||
private static ulong ZigZagEncode(long d, int bytes) => (ulong)(((d >> (bytes * 8 - 1))&1) | (d << 1));
|
||||
|
||||
private static long GetBitCount<T>(T t)
|
||||
{
|
||||
Type type = t.GetType();
|
||||
long count = 0;
|
||||
if (type.IsArray)
|
||||
{
|
||||
Type elementType = type.GetElementType();
|
||||
|
||||
count += BytesToRead((t as Array).Length) * 8; // Int16 array size. Arrays shouldn't be syncing more than 65k elements
|
||||
|
||||
if (elementType == typeof(bool)) count += (t as Array).Length;
|
||||
else
|
||||
foreach (var element in t as Array)
|
||||
count += GetBitCount(element);
|
||||
}
|
||||
else if (type == typeof(Partial)) return (byte)Partial.count_info.GetValue(t);
|
||||
else if (IsSupportedType(type))
|
||||
{
|
||||
long ba = t is bool ? 1 : BytesToRead(t)*8;
|
||||
if (ba == 0) count += Encoding.UTF8.GetByteCount(t as string);
|
||||
else if (t is bool || t is decimal) count += ba;
|
||||
else count += BytesToRead(t) * 8;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
private static void WriteBit(byte[] b, bool bit, long index)
|
||||
=> b[index / 8] = (byte)((b[index / 8] & ~(1 << (int)(index % 8))) | (bit ? 1 << (int)(index % 8) : 0));
|
||||
private static void WriteByte(byte[] b, ulong value, long index, bool isAligned) => WriteByte(b, (byte)value, index, isAligned);
|
||||
private static void WriteByte(byte[] b, byte value, long index, bool isAligned, byte bits = 8)
|
||||
{
|
||||
if (isAligned) b[index / 8] = value;
|
||||
else
|
||||
{
|
||||
int byteIndex = (int)(index / 8);
|
||||
int shift = (int)(index % 8);
|
||||
byte upper_mask = (byte)(0xFF << shift);
|
||||
|
||||
b[byteIndex] = (byte)((b[byteIndex] & (byte)~upper_mask) | (value << shift));
|
||||
if((8-shift)<bits) b[byteIndex + 1] = (byte)((b[byteIndex + 1] & upper_mask) | (value >> (8 - shift)));
|
||||
}
|
||||
}
|
||||
private static void WriteDynamic(byte[] b, int value, int byteCount, long index, bool isAligned)
|
||||
{
|
||||
for (int i = 0; i < byteCount; ++i)
|
||||
WriteByte(b, (byte)((value >> (8 * i)) & 0xFF), index + (8 * i), isAligned);
|
||||
}
|
||||
|
||||
private static int BytesToRead(object i)
|
||||
{
|
||||
if (i is byte) return 1;
|
||||
bool size;
|
||||
ulong integer;
|
||||
if (i is decimal) return BytesToRead((int)dec_flags.GetValue(i)) + BytesToRead((int)dec_lo.GetValue(i)) + BytesToRead((int)dec_mid.GetValue(i)) + BytesToRead((int)dec_hi.GetValue(i));
|
||||
if ((size = i is float) || i is double)
|
||||
{
|
||||
int bytes = size ? 4 : 8;
|
||||
Array type_holder = size ? holder_f as Array : holder_d as Array; // Fetch the preallocated array
|
||||
Array result_holder = size ? holder_i as Array : holder_u as Array;
|
||||
lock (result_holder)
|
||||
lock (type_holder)
|
||||
{
|
||||
// Clear artifacts
|
||||
if (size) result_holder.SetValue(0U, 0);
|
||||
else result_holder.SetValue(0UL, 0);
|
||||
|
||||
type_holder.SetValue(i, 0); // Insert the value to convert into the preallocated holder array
|
||||
Buffer.BlockCopy(type_holder, 0, result_holder, 0, bytes); // Perform an internal copy to the byte-based holder
|
||||
if(size) integer = BinaryHelpers.SwapEndian((uint)result_holder.GetValue(0));
|
||||
else integer = BinaryHelpers.SwapEndian((ulong)result_holder.GetValue(0));
|
||||
}
|
||||
}
|
||||
else integer = i as ulong? ?? i as uint? ?? i as ushort? ?? i as byte? ?? 0;
|
||||
return
|
||||
integer <= 240 ? 1 :
|
||||
integer <= 2287 ? 2 :
|
||||
integer <= 67823 ? 3 :
|
||||
integer <= 16777215 ? 4 :
|
||||
integer <= 4294967295 ? 5 :
|
||||
integer <= 1099511627775 ? 6 :
|
||||
integer <= 281474976710655 ? 7 :
|
||||
integer <= 72057594037927935 ? 8 :
|
||||
9;
|
||||
}
|
||||
|
||||
// Supported datatypes for serialization
|
||||
private static bool IsSupportedType(Type t) => supportedTypes.Contains(t);
|
||||
|
||||
// Creates a weak reference to the allocated collector so that reuse may be possible
|
||||
public void Dispose()
|
||||
{
|
||||
if (!tempAlloc)
|
||||
{
|
||||
collect.Clear();
|
||||
listPool.Enqueue(collect);
|
||||
}
|
||||
collect = null; //GC picks this
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
|
176
MLAPI/NetworkingManagerComponents/Binary/MessageChunker.cs
Normal file
176
MLAPI/NetworkingManagerComponents/Binary/MessageChunker.cs
Normal file
@ -0,0 +1,176 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Binary
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper class to chunk messages
|
||||
/// </summary>
|
||||
public static class MessageChunker
|
||||
{
|
||||
/// <summary>
|
||||
/// Chunks a large byte array to smaller chunks
|
||||
/// </summary>
|
||||
/// <param name="message">The large byte array</param>
|
||||
/// <param name="chunkSize">The amount of bytes of non header data to use for each chunk</param>
|
||||
/// <returns>List of chunks</returns>
|
||||
public static List<byte[]> GetChunkedMessage(ref byte[] message, int chunkSize)
|
||||
{
|
||||
List<byte[]> chunks = new List<byte[]>((int)Math.Ceiling((double)message.Length / chunkSize));
|
||||
//The extra 4 bytes is the chunkIndex
|
||||
byte[] chunk = new byte[chunkSize + 4];
|
||||
|
||||
for (int i = 0; i < message.Length; i++)
|
||||
{
|
||||
uint currentChunkIndex = (uint)Math.Floor((double)i / (double)chunkSize);
|
||||
int currentByteIndex = i % chunkSize;
|
||||
|
||||
if (currentByteIndex == 0)
|
||||
{
|
||||
byte[] chunkIndexBytes = BitConverter.GetBytes(currentChunkIndex);
|
||||
if (BitConverter.IsLittleEndian)
|
||||
Array.Reverse(chunkIndexBytes);
|
||||
chunk[0] = chunkIndexBytes[0];
|
||||
chunk[1] = chunkIndexBytes[1];
|
||||
chunk[2] = chunkIndexBytes[2];
|
||||
chunk[3] = chunkIndexBytes[3];
|
||||
}
|
||||
chunk[4 + currentByteIndex] = message[i];
|
||||
if(currentByteIndex == (chunkSize -1) || i == (message.Length -1))
|
||||
{
|
||||
//This is the last byte in the chunk
|
||||
chunks.Add(chunk);
|
||||
}
|
||||
}
|
||||
return chunks;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a list of chunks has missing parts
|
||||
/// </summary>
|
||||
/// <param name="chunks">The list of chunks</param>
|
||||
/// <param name="expectedChunksCount">The expected amount of chunks</param>
|
||||
/// <returns>If list of chunks has missing parts</returns>
|
||||
public static bool HasMissingParts(ref List<byte[]> chunks, uint expectedChunksCount)
|
||||
{
|
||||
if (chunks.Count < expectedChunksCount)
|
||||
return true;
|
||||
|
||||
HashSet<uint> chunkIndexes = new HashSet<uint>();
|
||||
uint duplicateCount = 0;
|
||||
for (int i = 0; i < chunks.Count; i++)
|
||||
{
|
||||
uint chunkIndex = BitConverter.ToUInt32(chunks[i], 0);
|
||||
if (chunkIndexes.Contains(chunkIndex))
|
||||
duplicateCount++;
|
||||
else
|
||||
chunkIndexes.Add(chunkIndex);
|
||||
}
|
||||
return chunks.Count - duplicateCount != expectedChunksCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a list of chunks is in correct order
|
||||
/// </summary>
|
||||
/// <param name="chunks">The list of chunks</param>
|
||||
/// <returns>If all chunks are in order</returns>
|
||||
public static bool IsOrdered(ref List<byte[]> chunks)
|
||||
{
|
||||
uint lastChunkIndex = 0;
|
||||
for (int i = 0; i < chunks.Count; i++)
|
||||
{
|
||||
uint chunkIndex = BitConverter.ToUInt32(chunks[i], 0);
|
||||
//This can't be right?
|
||||
if (chunkIndex <= lastChunkIndex)
|
||||
lastChunkIndex++;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a list of chunks have any duplicates inside of it
|
||||
/// </summary>
|
||||
/// <param name="chunks">The list of chunks</param>
|
||||
/// <param name="expectedChunksCount">The expected amount of chunks</param>
|
||||
/// <returns>If a list of chunks has duplicate chunks in it</returns>
|
||||
public static bool HasDuplicates(ref List<byte[]> chunks, uint expectedChunksCount)
|
||||
{
|
||||
if (chunks.Count > expectedChunksCount)
|
||||
return true;
|
||||
|
||||
HashSet<uint> chunkIndexes = new HashSet<uint>();
|
||||
for (int i = 0; i < chunks.Count; i++)
|
||||
{
|
||||
uint chunkIndex = BitConverter.ToUInt32(chunks[i], 0);
|
||||
if (chunkIndexes.Contains(chunkIndex))
|
||||
return true;
|
||||
else
|
||||
chunkIndexes.Add(chunkIndex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a list of chunks back into the original buffer, this requires the list to be in correct order and properly verified
|
||||
/// </summary>
|
||||
/// <param name="chunks">The list of chunks</param>
|
||||
/// <param name="chunkSize">The size of each chunk. Optional</param>
|
||||
/// <returns></returns>
|
||||
public static byte[] GetMessageOrdered(ref List<byte[]> chunks, int chunkSize = -1)
|
||||
{
|
||||
if (chunks.Count == 0)
|
||||
return new byte[0];
|
||||
if (chunkSize == -1)
|
||||
chunkSize = chunks[0].Length - 4;
|
||||
|
||||
uint messageSize = 0;
|
||||
for (int i = 0; i < chunks.Count; i++)
|
||||
{
|
||||
messageSize += Convert.ToUInt32(chunks[i].Length - 4);
|
||||
}
|
||||
byte[] message = new byte[messageSize];
|
||||
for (int i = 0; i < chunks.Count; i++)
|
||||
{
|
||||
Array.Copy(chunks[i], 3, message, i * chunkSize, chunkSize);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a list of chunks back into the original buffer, this does not require the list to be in correct order and properly verified
|
||||
/// </summary>
|
||||
/// <param name="chunks">The list of chunks</param>
|
||||
/// <param name="chunkSize">The size of each chunk. Optional</param>
|
||||
/// <returns></returns>
|
||||
public static byte[] GetMessageUnordered(ref List<byte[]> chunks, int chunkSize = -1)
|
||||
{
|
||||
if (chunks.Count == 0)
|
||||
return new byte[0];
|
||||
if (chunkSize == -1)
|
||||
chunkSize = chunks[0].Length - 4;
|
||||
|
||||
uint messageSize = 0;
|
||||
for (int i = 0; i < chunks.Count; i++)
|
||||
{
|
||||
messageSize += Convert.ToUInt32(chunks[i].Length - 4);
|
||||
}
|
||||
byte[] message = new byte[messageSize];
|
||||
uint nextIndex = 0;
|
||||
//Loop as many times as there are chunks.
|
||||
for (int i = 0; i < chunks.Count; i++)
|
||||
{
|
||||
//For each chunk, find the right chunk
|
||||
for (int j = 0; j < chunks.Count; j++)
|
||||
{
|
||||
if(BitConverter.ToUInt32(chunks[j], 0) == nextIndex)
|
||||
{
|
||||
Array.Copy(chunks[j], 3, message, nextIndex * chunkSize, chunkSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
}
|
||||
}
|
59
MLAPI/NetworkingManagerComponents/Binary/PrimitiveHasher.cs
Normal file
59
MLAPI/NetworkingManagerComponents/Binary/PrimitiveHasher.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using MLAPI.NetworkingManagerComponents.Cryptography;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Binary
|
||||
{
|
||||
public static class PrimitiveHasher
|
||||
{
|
||||
private static Dictionary<string, ulong> ulongCachedHashes = new Dictionary<string, ulong>();
|
||||
private static Dictionary<string, ushort> ushortCachedHashes = new Dictionary<string, ushort>();
|
||||
private static Dictionary<string, uint> uintCachedHashes = new Dictionary<string, uint>();
|
||||
|
||||
public static ulong GetULongHash(string input, bool cache = false)
|
||||
{
|
||||
if (cache && ulongCachedHashes.ContainsKey(input))
|
||||
return ulongCachedHashes[input];
|
||||
|
||||
//using (SHA256Managed sha = new SHA256Managed())
|
||||
//{
|
||||
//byte[] hash = sha.ComputeHash(Encoding.UTF8.GetBytes(input));
|
||||
ulong value = MessageDigest.SHA1_Opt(Encoding.UTF8.GetBytes(input)).CastULong(); //hash[0] | ((ulong)hash[1] << 8) | ((ulong)hash[2] << 16) | ((ulong)hash[3] << 24) | ((ulong)hash[4] << 32) | ((ulong)hash[5] << 40) | ((ulong)hash[6] << 48) | ((ulong)hash[7] << 56);
|
||||
if (cache)
|
||||
ulongCachedHashes.Add(input, value);
|
||||
return value;
|
||||
//}
|
||||
}
|
||||
|
||||
public static ulong GetUIntHash(string input, bool cache = false)
|
||||
{
|
||||
if (cache && uintCachedHashes.ContainsKey(input))
|
||||
return uintCachedHashes[input];
|
||||
|
||||
//using (SHA256Managed sha = new SHA256Managed())
|
||||
//{
|
||||
//byte[] hash = sha.ComputeHash(Encoding.UTF8.GetBytes(input));
|
||||
uint value = MessageDigest.SHA1_Opt(Encoding.UTF8.GetBytes(input)).CastUInt(); //hash[0] | ((uint)hash[1] << 8) | ((uint)hash[2] << 16) | ((uint)hash[3] << 24);
|
||||
if (cache)
|
||||
uintCachedHashes.Add(input, value);
|
||||
return value;
|
||||
//}
|
||||
}
|
||||
|
||||
public static ushort GetUShortHash(string input, bool cache = false)
|
||||
{
|
||||
if (cache && ushortCachedHashes.ContainsKey(input))
|
||||
return ushortCachedHashes[input];
|
||||
|
||||
//using (SHA256Managed sha = new SHA256Managed())
|
||||
//{
|
||||
//byte[] hash = sha.ComputeHash(Encoding.UTF8.GetBytes(input));
|
||||
ushort value = MessageDigest.SHA1_Opt(Encoding.UTF8.GetBytes(input)).CastUShort(); //(ushort)(hash[0] | (ushort)(hash[1] << 8));
|
||||
if (cache)
|
||||
ushortCachedHashes.Add(input, value);
|
||||
return value;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MLAPI.Data;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents
|
||||
{
|
||||
internal static class ClientIdManager
|
||||
{
|
||||
internal static int clientIdCounter;
|
||||
// Use a queue instead of stack to (hopefully) reduce the chance of a clientId being re taken to quickly.
|
||||
internal static Queue<int> releasedClientIds;
|
||||
internal static Dictionary<int, ClientIdKey> clientIdToKey;
|
||||
internal static Dictionary<ClientIdKey, int> keyToClientId;
|
||||
|
||||
internal static int GetClientId(int connectionId, int hostId)
|
||||
{
|
||||
int clientId;
|
||||
if (releasedClientIds.Count > 0)
|
||||
{
|
||||
clientId = releasedClientIds.Dequeue();
|
||||
}
|
||||
else
|
||||
{
|
||||
clientId = clientIdCounter;
|
||||
clientIdCounter++;
|
||||
}
|
||||
clientIdToKey.Add(clientId, new ClientIdKey(hostId, connectionId));
|
||||
keyToClientId.Add(new ClientIdKey(hostId, connectionId), clientId);
|
||||
return clientId;
|
||||
}
|
||||
|
||||
internal static void ReleaseClientId(int clientId)
|
||||
{
|
||||
ClientIdKey key = clientIdToKey[clientId];
|
||||
if (clientIdToKey.ContainsKey(clientId))
|
||||
clientIdToKey.Remove(clientId);
|
||||
if (keyToClientId.ContainsKey(key))
|
||||
keyToClientId.Remove(key);
|
||||
|
||||
releasedClientIds.Enqueue(clientId);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,450 @@
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using MLAPI.Data;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using MLAPI.NetworkingManagerComponents.Binary;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Core
|
||||
{
|
||||
internal static partial class InternalMessageHandler
|
||||
{
|
||||
internal static void HandleConnectionRequest(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
byte[] configHash = reader.ReadByteArray(32);
|
||||
if (!netManager.NetworkConfig.CompareConfig(configHash))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: NetworkConfiguration missmatch. The configuration between the server and client does not match.");
|
||||
netManager.DisconnectClient(clientId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (netManager.NetworkConfig.EnableEncryption)
|
||||
{
|
||||
byte[] diffiePublic = reader.ReadByteArray();
|
||||
netManager.diffieHellmanPublicKeys.Add(clientId, diffiePublic);
|
||||
|
||||
}
|
||||
if (netManager.NetworkConfig.ConnectionApproval)
|
||||
{
|
||||
byte[] connectionBuffer = reader.ReadByteArray();
|
||||
netManager.ConnectionApprovalCallback(connectionBuffer, clientId, netManager.HandleApproval);
|
||||
}
|
||||
else
|
||||
{
|
||||
netManager.HandleApproval(clientId, true, Vector3.zero, Quaternion.identity);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void HandleConnectionApproved(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
netManager.myClientId = reader.ReadUInt();
|
||||
uint sceneIndex = 0;
|
||||
if (netManager.NetworkConfig.EnableSceneSwitching)
|
||||
sceneIndex = reader.ReadUInt();
|
||||
|
||||
if (netManager.NetworkConfig.EnableEncryption)
|
||||
{
|
||||
byte[] serverPublicKey = reader.ReadByteArray();
|
||||
netManager.clientAesKey = netManager.clientDiffieHellman.GetSharedSecret(serverPublicKey);
|
||||
if (netManager.NetworkConfig.SignKeyExchange)
|
||||
{
|
||||
byte[] publicKeySignature = reader.ReadByteArray();
|
||||
using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
|
||||
{
|
||||
rsa.PersistKeyInCsp = false;
|
||||
rsa.FromXmlString(netManager.NetworkConfig.RSAPublicKey);
|
||||
if (!rsa.VerifyData(serverPublicKey, new SHA512CryptoServiceProvider(), publicKeySignature))
|
||||
{
|
||||
//Man in the middle.
|
||||
Debug.LogWarning("MLAPI: Signature doesnt match for the key exchange public part. Disconnecting");
|
||||
netManager.StopClient();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float netTime = reader.ReadFloat();
|
||||
int remoteStamp = reader.ReadInt();
|
||||
byte error;
|
||||
int msDelay = NetworkingManager.singleton.NetworkConfig.NetworkTransport.GetRemoteDelayTimeMS(clientId, remoteStamp, out error);
|
||||
netManager.networkTime = netTime + (msDelay / 1000f);
|
||||
|
||||
netManager.connectedClients.Add(netManager.MyClientId, new NetworkedClient() { ClientId = netManager.MyClientId });
|
||||
int clientCount = reader.ReadInt();
|
||||
for (int i = 0; i < clientCount; i++)
|
||||
{
|
||||
uint _clientId = reader.ReadUInt();
|
||||
netManager.connectedClients.Add(_clientId, new NetworkedClient() { ClientId = _clientId });
|
||||
}
|
||||
if (netManager.NetworkConfig.HandleObjectSpawning)
|
||||
{
|
||||
SpawnManager.DestroySceneObjects();
|
||||
int objectCount = reader.ReadInt();
|
||||
for (int i = 0; i < objectCount; i++)
|
||||
{
|
||||
bool isPlayerObject = reader.ReadBool();
|
||||
uint networkId = reader.ReadUInt();
|
||||
uint ownerId = reader.ReadUInt();
|
||||
int prefabId = reader.ReadInt();
|
||||
bool isActive = reader.ReadBool();
|
||||
bool sceneObject = reader.ReadBool();
|
||||
bool visible = reader.ReadBool();
|
||||
|
||||
float xPos = reader.ReadFloat();
|
||||
float yPos = reader.ReadFloat();
|
||||
float zPos = reader.ReadFloat();
|
||||
|
||||
float xRot = reader.ReadFloat();
|
||||
float yRot = reader.ReadFloat();
|
||||
float zRot = reader.ReadFloat();
|
||||
|
||||
if (isPlayerObject)
|
||||
{
|
||||
GameObject go = SpawnManager.SpawnPlayerObject(ownerId, networkId, new Vector3(xPos, yPos, zPos), Quaternion.Euler(xRot, yRot, zRot));
|
||||
go.GetComponent<NetworkedObject>().SetLocalVisibility(visible);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameObject go = SpawnManager.SpawnPrefabIndexClient(prefabId, networkId, ownerId,
|
||||
new Vector3(xPos, yPos, zPos), Quaternion.Euler(xRot, yRot, zRot));
|
||||
|
||||
go.GetComponent<NetworkedObject>().SetLocalVisibility(visible);
|
||||
go.GetComponent<NetworkedObject>().sceneObject = sceneObject;
|
||||
go.SetActive(isActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (netManager.NetworkConfig.EnableSceneSwitching)
|
||||
{
|
||||
NetworkSceneManager.OnSceneSwitch(sceneIndex);
|
||||
}
|
||||
|
||||
netManager._isClientConnected = true;
|
||||
if (netManager.OnClientConnectedCallback != null)
|
||||
netManager.OnClientConnectedCallback.Invoke(netManager.MyClientId);
|
||||
}
|
||||
|
||||
internal static void HandleAddObject(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
if (netManager.NetworkConfig.HandleObjectSpawning)
|
||||
{
|
||||
bool isPlayerObject = reader.ReadBool();
|
||||
uint networkId = reader.ReadUInt();
|
||||
uint ownerId = reader.ReadUInt();
|
||||
int prefabId = reader.ReadInt();
|
||||
bool sceneObject = reader.ReadBool();
|
||||
bool visible = reader.ReadBool();
|
||||
|
||||
float xPos = reader.ReadFloat();
|
||||
float yPos = reader.ReadFloat();
|
||||
float zPos = reader.ReadFloat();
|
||||
|
||||
float xRot = reader.ReadFloat();
|
||||
float yRot = reader.ReadFloat();
|
||||
float zRot = reader.ReadFloat();
|
||||
|
||||
if (isPlayerObject)
|
||||
{
|
||||
netManager.connectedClients.Add(ownerId, new NetworkedClient() { ClientId = ownerId });
|
||||
GameObject go = SpawnManager.SpawnPlayerObject(ownerId, networkId, new Vector3(xPos, yPos, zPos), Quaternion.Euler(xRot, yRot, zRot));
|
||||
go.GetComponent<NetworkedObject>().SetLocalVisibility(visible);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameObject go = SpawnManager.SpawnPrefabIndexClient(prefabId, networkId, ownerId,
|
||||
new Vector3(xPos, yPos, zPos), Quaternion.Euler(xRot, yRot, zRot));
|
||||
|
||||
go.GetComponent<NetworkedObject>().SetLocalVisibility(visible);
|
||||
go.GetComponent<NetworkedObject>().sceneObject = sceneObject;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint ownerId = reader.ReadUInt();
|
||||
netManager.connectedClients.Add(ownerId, new NetworkedClient() { ClientId = ownerId });
|
||||
}
|
||||
}
|
||||
|
||||
internal static void HandleClientDisconnect(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
uint disconnectedClientId = reader.ReadUInt();
|
||||
netManager.OnClientDisconnect(disconnectedClientId);
|
||||
}
|
||||
|
||||
internal static void HandleDestroyObject(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
uint netId = reader.ReadUInt();
|
||||
SpawnManager.OnDestroyObject(netId, true);
|
||||
}
|
||||
|
||||
internal static void HandleSwitchScene(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
NetworkSceneManager.OnSceneSwitch(reader.ReadUInt());
|
||||
}
|
||||
|
||||
internal static void HandleSpawnPoolObject(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
uint netId = reader.ReadUInt();
|
||||
|
||||
float xPos = reader.ReadFloat();
|
||||
float yPos = reader.ReadFloat();
|
||||
float zPos = reader.ReadFloat();
|
||||
|
||||
float xRot = reader.ReadFloat();
|
||||
float yRot = reader.ReadFloat();
|
||||
float zRot = reader.ReadFloat();
|
||||
|
||||
SpawnManager.spawnedObjects[netId].transform.position = new Vector3(xPos, yPos, zPos);
|
||||
SpawnManager.spawnedObjects[netId].transform.rotation = Quaternion.Euler(xRot, yRot, zRot);
|
||||
SpawnManager.spawnedObjects[netId].gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
internal static void HandleDestroyPoolObject(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
uint netId = reader.ReadUInt();
|
||||
SpawnManager.spawnedObjects[netId].gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
internal static void HandleChangeOwner(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
uint netId = reader.ReadUInt();
|
||||
uint ownerClientId = reader.ReadUInt();
|
||||
if (SpawnManager.spawnedObjects[netId].OwnerClientId == netManager.MyClientId)
|
||||
{
|
||||
//We are current owner.
|
||||
SpawnManager.spawnedObjects[netId].InvokeBehaviourOnLostOwnership();
|
||||
}
|
||||
if (ownerClientId == netManager.MyClientId)
|
||||
{
|
||||
//We are new owner.
|
||||
SpawnManager.spawnedObjects[netId].InvokeBehaviourOnGainedOwnership();
|
||||
}
|
||||
SpawnManager.spawnedObjects[netId].ownerClientId = ownerClientId;
|
||||
}
|
||||
|
||||
internal static void HandleSyncVarUpdate(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
byte dirtyCount = reader.ReadByte();
|
||||
uint netId = reader.ReadUInt();
|
||||
ushort orderIndex = reader.ReadUShort();
|
||||
if (dirtyCount > 0)
|
||||
{
|
||||
for (int i = 0; i < dirtyCount; i++)
|
||||
{
|
||||
byte fieldIndex = reader.ReadByte();
|
||||
if (!SpawnManager.spawnedObjects.ContainsKey(netId))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Sync message recieved for a non existant object with id: " + netId);
|
||||
return;
|
||||
}
|
||||
else if (SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex) == null)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Sync message recieved for a non existant behaviour");
|
||||
return;
|
||||
}
|
||||
else if (fieldIndex > (SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).syncedVarFields.Count - 1))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Sync message recieved for field out of bounds");
|
||||
return;
|
||||
}
|
||||
FieldType type = SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).syncedVarFields[fieldIndex].FieldType;
|
||||
switch (type)
|
||||
{
|
||||
case FieldType.Bool:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadBool(), fieldIndex);
|
||||
break;
|
||||
case FieldType.Byte:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadByte(), fieldIndex);
|
||||
break;
|
||||
case FieldType.Double:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadDouble(), fieldIndex);
|
||||
break;
|
||||
case FieldType.Single:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadFloat(), fieldIndex);
|
||||
break;
|
||||
case FieldType.Int:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadInt(), fieldIndex);
|
||||
break;
|
||||
case FieldType.Long:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadLong(), fieldIndex);
|
||||
break;
|
||||
case FieldType.SByte:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadSByte(), fieldIndex);
|
||||
break;
|
||||
case FieldType.Short:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadShort(), fieldIndex);
|
||||
break;
|
||||
case FieldType.UInt:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadUInt(), fieldIndex);
|
||||
break;
|
||||
case FieldType.ULong:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadULong(), fieldIndex);
|
||||
break;
|
||||
case FieldType.UShort:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadUShort(), fieldIndex);
|
||||
break;
|
||||
case FieldType.String:
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(reader.ReadString(), fieldIndex);
|
||||
break;
|
||||
case FieldType.Vector3:
|
||||
{ //Cases aren't their own scope. Therefor we create a scope for them as they share the X,Y,Z local variables otherwise.
|
||||
float x = reader.ReadFloat();
|
||||
float y = reader.ReadFloat();
|
||||
float z = reader.ReadFloat();
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(new Vector3(x, y, z), fieldIndex);
|
||||
}
|
||||
break;
|
||||
case FieldType.Vector2:
|
||||
{
|
||||
float x = reader.ReadFloat();
|
||||
float y = reader.ReadFloat();
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(new Vector2(x, y), fieldIndex);
|
||||
}
|
||||
break;
|
||||
case FieldType.Quaternion:
|
||||
{
|
||||
float x = reader.ReadFloat();
|
||||
float y = reader.ReadFloat();
|
||||
float z = reader.ReadFloat();
|
||||
SpawnManager.spawnedObjects[netId].GetBehaviourAtOrderIndex(orderIndex).OnSyncVarUpdate(Quaternion.Euler(x, y, z), fieldIndex);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static void HandleAddObjects(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
if (netManager.NetworkConfig.HandleObjectSpawning)
|
||||
{
|
||||
ushort objectCount = reader.ReadUShort();
|
||||
for (int i = 0; i < objectCount; i++)
|
||||
{
|
||||
bool isPlayerObject = reader.ReadBool();
|
||||
uint networkId = reader.ReadUInt();
|
||||
uint ownerId = reader.ReadUInt();
|
||||
int prefabId = reader.ReadInt();
|
||||
bool sceneObject = reader.ReadBool();
|
||||
bool visible = reader.ReadBool();
|
||||
|
||||
float xPos = reader.ReadFloat();
|
||||
float yPos = reader.ReadFloat();
|
||||
float zPos = reader.ReadFloat();
|
||||
|
||||
float xRot = reader.ReadFloat();
|
||||
float yRot = reader.ReadFloat();
|
||||
float zRot = reader.ReadFloat();
|
||||
|
||||
if (isPlayerObject)
|
||||
{
|
||||
netManager.connectedClients.Add(ownerId, new NetworkedClient() { ClientId = ownerId });
|
||||
GameObject go = SpawnManager.SpawnPlayerObject(ownerId, networkId, new Vector3(xPos, yPos, zPos), Quaternion.Euler(xRot, yRot, zRot));
|
||||
|
||||
go.GetComponent<NetworkedObject>().SetLocalVisibility(visible);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameObject go = SpawnManager.SpawnPrefabIndexClient(prefabId, networkId, ownerId,
|
||||
new Vector3(xPos, yPos, zPos), Quaternion.Euler(xRot, yRot, zRot));
|
||||
|
||||
go.GetComponent<NetworkedObject>().SetLocalVisibility(visible);
|
||||
go.GetComponent<NetworkedObject>().sceneObject = sceneObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static void HandleTimeSync(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
|
||||
float netTime = reader.ReadFloat();
|
||||
int timestamp = reader.ReadInt();
|
||||
|
||||
byte error;
|
||||
int msDelay = NetworkingManager.singleton.NetworkConfig.NetworkTransport.GetRemoteDelayTimeMS(clientId, timestamp, out error);
|
||||
netManager.networkTime = netTime + (msDelay / 1000f);
|
||||
}
|
||||
|
||||
internal static void HandleCommand(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
uint networkId = reader.ReadUInt();
|
||||
ushort orderId = reader.ReadUShort();
|
||||
ulong hash = reader.ReadULong();
|
||||
NetworkedBehaviour behaviour = SpawnManager.spawnedObjects[networkId].GetBehaviourAtOrderIndex(orderId);
|
||||
if (clientId != behaviour.ownerClientId)
|
||||
return; // Not owner
|
||||
MethodInfo targetMethod = null;
|
||||
if (behaviour.cachedMethods.ContainsKey(Data.Cache.GetAttributeMethodName(hash)))
|
||||
targetMethod = behaviour.cachedMethods[Data.Cache.GetAttributeMethodName(hash)];
|
||||
byte paramCount = reader.ReadBits(5);
|
||||
object[] methodParams = FieldTypeHelper.ReadObjects(reader, paramCount);
|
||||
targetMethod.Invoke(behaviour, methodParams);
|
||||
}
|
||||
|
||||
internal static void HandleRpc(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
uint networkId = reader.ReadUInt();
|
||||
ushort orderId = reader.ReadUShort();
|
||||
ulong hash = reader.ReadULong();
|
||||
NetworkedBehaviour behaviour = SpawnManager.spawnedObjects[networkId].GetBehaviourAtOrderIndex(orderId);
|
||||
MethodInfo targetMethod = null;
|
||||
if (behaviour.cachedMethods.ContainsKey(Data.Cache.GetAttributeMethodName(hash)))
|
||||
targetMethod = behaviour.cachedMethods[Data.Cache.GetAttributeMethodName(hash)];
|
||||
byte paramCount = reader.ReadBits(5);
|
||||
object[] methodParams = FieldTypeHelper.ReadObjects(reader, paramCount);
|
||||
targetMethod.Invoke(behaviour, methodParams);
|
||||
}
|
||||
|
||||
internal static void HandleTargetRpc(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
uint networkId = reader.ReadUInt();
|
||||
ushort orderId = reader.ReadUShort();
|
||||
ulong hash = reader.ReadULong();
|
||||
NetworkedBehaviour behaviour = SpawnManager.spawnedObjects[networkId].GetBehaviourAtOrderIndex(orderId);
|
||||
MethodInfo targetMethod = null;
|
||||
if (behaviour.cachedMethods.ContainsKey(Data.Cache.GetAttributeMethodName(hash)))
|
||||
targetMethod = behaviour.cachedMethods[Data.Cache.GetAttributeMethodName(hash)];
|
||||
byte paramCount = reader.ReadBits(5);
|
||||
object[] methodParams = FieldTypeHelper.ReadObjects(reader, paramCount);
|
||||
targetMethod.Invoke(behaviour, methodParams);
|
||||
}
|
||||
|
||||
internal static void HandleSetVisibility(uint clientId, byte[] incommingData, int channelId)
|
||||
{
|
||||
BitReader reader = new BitReader(incommingData);
|
||||
uint networkId = reader.ReadUInt();
|
||||
bool visibility = reader.ReadBool();
|
||||
SpawnManager.spawnedObjects[networkId].SetLocalVisibility(visibility);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,350 @@
|
||||
using System.Collections.Generic;
|
||||
using MLAPI.Data;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using MLAPI.NetworkingManagerComponents.Binary;
|
||||
using MLAPI.NetworkingManagerComponents.Cryptography;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Core
|
||||
{
|
||||
internal static partial class InternalMessageHandler
|
||||
{
|
||||
internal static byte[] FinalMessageBuffer;
|
||||
internal static void PassthroughSend(uint targetId, uint sourceId, ushort messageType, int channelId, byte[] data, uint? networkId = null, ushort? orderId = null)
|
||||
{
|
||||
if (netManager.isHost && targetId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Host trying to send data to it's own client
|
||||
Debug.LogWarning("MLAPI: Send method got message aimed at server from the server?");
|
||||
return;
|
||||
}
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUShort(messageType);
|
||||
writer.WriteBool(networkId != null);
|
||||
|
||||
if (networkId != null)
|
||||
writer.WriteUInt(networkId.Value);
|
||||
|
||||
if (orderId != null)
|
||||
writer.WriteUShort(orderId.Value);
|
||||
|
||||
writer.WriteBool(true);
|
||||
writer.WriteUInt(sourceId);
|
||||
|
||||
writer.WriteAlignBits();
|
||||
|
||||
if (netManager.NetworkConfig.EncryptedChannelsHashSet.Contains(MessageManager.reverseChannels[channelId]))
|
||||
writer.WriteByteArray(CryptographyHelper.Encrypt(data, netManager.connectedClients[targetId].AesKey));
|
||||
else
|
||||
writer.WriteByteArray(data);
|
||||
|
||||
writer.Finalize(ref FinalMessageBuffer);
|
||||
|
||||
byte error;
|
||||
netManager.NetworkConfig.NetworkTransport.QueueMessageForSending(targetId, ref FinalMessageBuffer, (int)writer.GetFinalizeSize(), channelId, false, out error);
|
||||
}
|
||||
}
|
||||
|
||||
//RETURNS IF IT SUCCEDED OR FAILED BECAUSE OF NON-OBSERVER. ANY OTHER FAIL WILL RETURN TRUE
|
||||
internal static bool Send(uint clientId, string messageType, string channelName, byte[] data, uint? fromNetId, uint? networkId = null, ushort? orderId = null, bool skipQueue = false)
|
||||
{
|
||||
uint targetClientId = clientId;
|
||||
if (netManager.isHost && targetClientId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Don't invoke the message on our own machine. Instant stack overflow.
|
||||
Debug.LogWarning("MLAPI: Cannot send message to own client");
|
||||
return true;
|
||||
}
|
||||
else if (targetClientId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Client trying to send data to host
|
||||
targetClientId = netManager.NetworkConfig.NetworkTransport.ServerNetId;
|
||||
}
|
||||
//If we respect the observers, and the message is targeted (networkId != null) and the targetedNetworkId isnt observing the receiver. Then we return
|
||||
if (netManager.isServer && fromNetId != null && !SpawnManager.spawnedObjects[fromNetId.Value].observers.Contains(clientId))
|
||||
return false;
|
||||
|
||||
bool isPassthrough = (!netManager.isServer && clientId != netManager.NetworkConfig.NetworkTransport.ServerNetId && netManager.NetworkConfig.AllowPassthroughMessages);
|
||||
if (isPassthrough && !netManager.NetworkConfig.PassthroughMessageHashSet.Contains(MessageManager.messageTypes[messageType]))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: The The MessageType " + messageType + " is not registered as an allowed passthrough message type.");
|
||||
return true;
|
||||
}
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUShort(MessageManager.messageTypes[messageType]);
|
||||
writer.WriteBool(networkId != null);
|
||||
|
||||
if (networkId != null)
|
||||
writer.WriteUInt(networkId.Value);
|
||||
|
||||
if (orderId != null)
|
||||
writer.WriteUShort(orderId.Value);
|
||||
|
||||
writer.WriteBool(isPassthrough);
|
||||
|
||||
if (isPassthrough)
|
||||
writer.WriteUInt(clientId);
|
||||
|
||||
writer.WriteAlignBits();
|
||||
|
||||
if (netManager.NetworkConfig.EncryptedChannelsHashSet.Contains(channelName))
|
||||
{
|
||||
//This is an encrypted message.
|
||||
byte[] encrypted;
|
||||
if (netManager.isServer)
|
||||
encrypted = CryptographyHelper.Encrypt(data, netManager.connectedClients[clientId].AesKey);
|
||||
else
|
||||
encrypted = CryptographyHelper.Encrypt(data, netManager.clientAesKey);
|
||||
|
||||
writer.WriteByteArray(encrypted);
|
||||
}
|
||||
else
|
||||
writer.WriteByteArray(data);
|
||||
|
||||
if (isPassthrough)
|
||||
targetClientId = netManager.NetworkConfig.NetworkTransport.ServerNetId;
|
||||
|
||||
writer.Finalize(ref FinalMessageBuffer);
|
||||
|
||||
byte error;
|
||||
if (skipQueue)
|
||||
netManager.NetworkConfig.NetworkTransport.QueueMessageForSending(targetClientId, ref FinalMessageBuffer, (int)writer.GetFinalizeSize(), MessageManager.channels[channelName], true, out error);
|
||||
else
|
||||
netManager.NetworkConfig.NetworkTransport.QueueMessageForSending(targetClientId, ref FinalMessageBuffer, (int)writer.GetFinalizeSize(), MessageManager.channels[channelName], false, out error);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void Send(uint[] clientIds, string messageType, string channelName, byte[] data, uint? fromNetId, uint? networkId = null, ushort? orderId = null)
|
||||
{
|
||||
if (netManager.NetworkConfig.EncryptedChannelsHashSet.Contains(channelName))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Cannot send messages over encrypted channel to multiple clients.");
|
||||
return;
|
||||
}
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUShort(MessageManager.messageTypes[messageType]);
|
||||
writer.WriteBool(networkId != null);
|
||||
|
||||
if (networkId != null)
|
||||
writer.WriteUInt(networkId.Value);
|
||||
|
||||
if (orderId != null)
|
||||
writer.WriteUShort(orderId.Value);
|
||||
|
||||
writer.WriteBool(false);
|
||||
|
||||
writer.WriteAlignBits();
|
||||
|
||||
writer.WriteByteArray(data);
|
||||
|
||||
int channel = MessageManager.channels[channelName];
|
||||
for (int i = 0; i < clientIds.Length; i++)
|
||||
{
|
||||
uint targetClientId = clientIds[i];
|
||||
if (netManager.isHost && targetClientId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Don't invoke the message on our own machine. Instant stack overflow.
|
||||
continue;
|
||||
}
|
||||
else if (targetClientId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Client trying to send data to host
|
||||
targetClientId = netManager.NetworkConfig.NetworkTransport.ServerNetId;
|
||||
}
|
||||
|
||||
//If we respect the observers, and the message is targeted (networkId != null) and the targetedNetworkId isnt observing the receiver. Then we continue
|
||||
if (netManager.isServer && fromNetId != null && !SpawnManager.spawnedObjects[fromNetId.Value].observers.Contains(clientIds[i]))
|
||||
continue;
|
||||
|
||||
writer.Finalize(ref FinalMessageBuffer);
|
||||
|
||||
byte error;
|
||||
netManager.NetworkConfig.NetworkTransport.QueueMessageForSending(targetClientId, ref FinalMessageBuffer, (int)writer.GetFinalizeSize(), channel, false, out error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static void Send(List<uint> clientIds, string messageType, string channelName, byte[] data, uint? fromNetId, uint? networkId = null, ushort? orderId = null)
|
||||
{
|
||||
if (netManager.NetworkConfig.EncryptedChannelsHashSet.Contains(channelName))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Cannot send messages over encrypted channel to multiple clients.");
|
||||
return;
|
||||
}
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUShort(MessageManager.messageTypes[messageType]);
|
||||
writer.WriteBool(networkId != null);
|
||||
|
||||
if (networkId != null)
|
||||
writer.WriteUInt(networkId.Value);
|
||||
|
||||
if (orderId != null)
|
||||
writer.WriteUShort(orderId.Value);
|
||||
|
||||
writer.WriteBool(false);
|
||||
|
||||
writer.WriteAlignBits();
|
||||
|
||||
writer.WriteByteArray(data);
|
||||
|
||||
int channel = MessageManager.channels[channelName];
|
||||
for (int i = 0; i < clientIds.Count; i++)
|
||||
{
|
||||
uint targetClientId = clientIds[i];
|
||||
if (netManager.isHost && targetClientId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Don't invoke the message on our own machine. Instant stack overflow.
|
||||
continue;
|
||||
}
|
||||
else if (targetClientId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Client trying to send data to host
|
||||
targetClientId = netManager.NetworkConfig.NetworkTransport.ServerNetId;
|
||||
}
|
||||
|
||||
//If we respect the observers, and the message is targeted (networkId != null) and the targetedNetworkId isnt observing the receiver. Then we continue
|
||||
if (netManager.isServer && fromNetId != null && !SpawnManager.spawnedObjects[fromNetId.Value].observers.Contains(clientIds[i]))
|
||||
continue;
|
||||
|
||||
writer.Finalize(ref FinalMessageBuffer);
|
||||
|
||||
byte error;
|
||||
netManager.NetworkConfig.NetworkTransport.QueueMessageForSending(targetClientId, ref FinalMessageBuffer, (int)writer.GetFinalizeSize(), channel, false, out error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//RETURNS THE CLIENTIDS WHICH WAS NOT BEING OBSERVED
|
||||
internal static List<uint> Send(string messageType, string channelName, byte[] data, uint? fromNetId, uint? networkId = null, ushort? orderId = null)
|
||||
{
|
||||
if (netManager.connectedClients.Count == 0)
|
||||
return null;
|
||||
if (netManager.NetworkConfig.EncryptedChannels.Contains(channelName))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Cannot send messages over encrypted channel to multiple clients.");
|
||||
return null;
|
||||
}
|
||||
|
||||
List<uint> nonObservedIds = new List<uint>();
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUShort(MessageManager.messageTypes[messageType]);
|
||||
writer.WriteBool(networkId != null);
|
||||
|
||||
if (networkId != null)
|
||||
writer.WriteUInt(networkId.Value);
|
||||
|
||||
if (orderId != null)
|
||||
writer.WriteUShort(orderId.Value);
|
||||
|
||||
writer.WriteBool(false);
|
||||
|
||||
writer.WriteAlignBits();
|
||||
|
||||
writer.WriteByteArray(data);
|
||||
|
||||
int channel = MessageManager.channels[channelName];
|
||||
foreach (KeyValuePair<uint, NetworkedClient> pair in netManager.connectedClients)
|
||||
{
|
||||
uint targetClientId = pair.Key;
|
||||
if (netManager.isHost && targetClientId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Don't invoke the message on our own machine. Instant stack overflow.
|
||||
continue;
|
||||
}
|
||||
else if (targetClientId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Client trying to send data to host
|
||||
targetClientId = netManager.NetworkConfig.NetworkTransport.ServerNetId;
|
||||
}
|
||||
|
||||
//If we respect the observers, and the message is targeted (networkId != null) and the targetedNetworkId isnt observing the receiver. Then we continue
|
||||
if (netManager.isServer && fromNetId != null && !SpawnManager.spawnedObjects[fromNetId.Value].observers.Contains(pair.Key))
|
||||
{
|
||||
nonObservedIds.Add(pair.Key);
|
||||
continue;
|
||||
}
|
||||
|
||||
writer.Finalize(ref FinalMessageBuffer);
|
||||
|
||||
byte error;
|
||||
netManager.NetworkConfig.NetworkTransport.QueueMessageForSending(targetClientId, ref FinalMessageBuffer, (int)writer.GetFinalizeSize(), channel, false, out error);
|
||||
}
|
||||
return nonObservedIds;
|
||||
}
|
||||
}
|
||||
|
||||
//RETURNS THE CLIENTIDS WHICH WAS NOT BEING OBSERVED
|
||||
internal static List<uint> Send(string messageType, string channelName, byte[] data, uint clientIdToIgnore, uint? fromNetId, uint? networkId = null, ushort? orderId = null)
|
||||
{
|
||||
if (netManager.NetworkConfig.EncryptedChannels.Contains(channelName))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Cannot send messages over encrypted channel to multiple clients.");
|
||||
return null;
|
||||
}
|
||||
|
||||
List<uint> nonObservedIds = new List<uint>();
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUShort(MessageManager.messageTypes[messageType]);
|
||||
writer.WriteBool(networkId != null);
|
||||
|
||||
if (networkId != null)
|
||||
writer.WriteUInt(networkId.Value);
|
||||
|
||||
if (orderId != null)
|
||||
writer.WriteUShort(orderId.Value);
|
||||
|
||||
writer.WriteBool(false);
|
||||
|
||||
writer.WriteAlignBits();
|
||||
|
||||
writer.WriteByteArray(data);
|
||||
|
||||
int channel = MessageManager.channels[channelName];
|
||||
foreach (KeyValuePair<uint, NetworkedClient> pair in netManager.connectedClients)
|
||||
{
|
||||
if (pair.Key == clientIdToIgnore)
|
||||
continue;
|
||||
|
||||
uint targetClientId = pair.Key;
|
||||
if (netManager.isHost && targetClientId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Don't invoke the message on our own machine. Instant stack overflow.
|
||||
continue;
|
||||
}
|
||||
else if (targetClientId == netManager.NetworkConfig.NetworkTransport.HostDummyId)
|
||||
{
|
||||
//Client trying to send data to host
|
||||
targetClientId = netManager.NetworkConfig.NetworkTransport.ServerNetId;
|
||||
}
|
||||
|
||||
//If we respect the observers, and the message is targeted (networkId != null) and the targetedNetworkId isnt observing the receiver. Then we continue
|
||||
if (netManager.isServer && fromNetId != null && !SpawnManager.spawnedObjects[fromNetId.Value].observers.Contains(pair.Key))
|
||||
{
|
||||
nonObservedIds.Add(pair.Key);
|
||||
continue;
|
||||
}
|
||||
|
||||
writer.Finalize(ref FinalMessageBuffer);
|
||||
|
||||
byte error;
|
||||
netManager.NetworkConfig.NetworkTransport.QueueMessageForSending(targetClientId, ref FinalMessageBuffer, (int)writer.GetFinalizeSize(), channel, false, out error);
|
||||
}
|
||||
return nonObservedIds;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Core
|
||||
{
|
||||
internal static partial class InternalMessageHandler
|
||||
{
|
||||
private static NetworkingManager netManager
|
||||
{
|
||||
get
|
||||
{
|
||||
return NetworkingManager.singleton;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// The main class for controlling lag compensation
|
||||
/// </summary>
|
||||
public static class LagCompensationManager
|
||||
{
|
||||
internal static List<TrackedObject> simulationObjects = new List<TrackedObject>();
|
||||
/// <summary>
|
||||
/// Simulation objects
|
||||
/// </summary>
|
||||
public static List<TrackedObject> SimulationObjects
|
||||
{
|
||||
get
|
||||
{
|
||||
return simulationObjects;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns time back a given amount of seconds, invokes an action and turns it back
|
||||
/// </summary>
|
||||
/// <param name="secondsAgo">The amount of seconds</param>
|
||||
/// <param name="action">The action to invoke when time is turned back</param>
|
||||
public static void Simulate(float secondsAgo, Action action)
|
||||
{
|
||||
if(!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Lag compensation simulations are only to be ran on the server.");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < simulationObjects.Count; i++)
|
||||
{
|
||||
simulationObjects[i].ReverseTransform(secondsAgo);
|
||||
}
|
||||
|
||||
action.Invoke();
|
||||
|
||||
for (int i = 0; i < simulationObjects.Count; i++)
|
||||
{
|
||||
simulationObjects[i].ResetStateTransform();
|
||||
}
|
||||
}
|
||||
|
||||
private static byte error = 0;
|
||||
/// <summary>
|
||||
/// Turns time back a given amount of seconds, invokes an action and turns it back. The time is based on the estimated RTT of a clientId
|
||||
/// </summary>
|
||||
/// <param name="clientId">The clientId's RTT to use</param>
|
||||
/// <param name="action">The action to invoke when time is turned back</param>
|
||||
public static void Simulate(uint clientId, Action action)
|
||||
{
|
||||
if (!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Lag compensation simulations are only to be ran on the server.");
|
||||
return;
|
||||
}
|
||||
float milisecondsDelay = NetworkingManager.singleton.NetworkConfig.NetworkTransport.GetCurrentRTT(clientId, out error) / 2f;
|
||||
Simulate(milisecondsDelay * 1000f, action);
|
||||
}
|
||||
|
||||
internal static void AddFrames()
|
||||
{
|
||||
for (int i = 0; i < simulationObjects.Count; i++)
|
||||
{
|
||||
simulationObjects[i].AddFrame();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +1,9 @@
|
||||
using System;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents
|
||||
namespace MLAPI.NetworkingManagerComponents.Core
|
||||
{
|
||||
internal static class MessageManager
|
||||
{
|
||||
@ -10,11 +11,10 @@ namespace MLAPI.NetworkingManagerComponents
|
||||
internal static Dictionary<int, string> reverseChannels;
|
||||
internal static Dictionary<string, ushort> messageTypes;
|
||||
internal static Dictionary<ushort, string> reverseMessageTypes;
|
||||
internal static Dictionary<ushort, Dictionary<int, Action<int, byte[]>>> messageCallbacks;
|
||||
|
||||
internal static Dictionary<ushort, Dictionary<int, Action<uint, byte[]>>> messageCallbacks;
|
||||
internal static Dictionary<ushort, int> messageHandlerCounter;
|
||||
internal static Dictionary<ushort, Stack<int>> releasedMessageHandlerCounters;
|
||||
//Key: messageType, Value key: networkId, value value: handlerId
|
||||
internal static Dictionary<ushort, Dictionary<uint, List<int>>> targetedMessages;
|
||||
|
||||
private static NetworkingManager netManager
|
||||
{
|
||||
@ -24,18 +24,11 @@ namespace MLAPI.NetworkingManagerComponents
|
||||
}
|
||||
}
|
||||
|
||||
internal static int AddIncomingMessageHandler(string name, Action<int, byte[]> action, uint networkId)
|
||||
|
||||
internal static int AddIncomingMessageHandler(string name, Action<uint, byte[]> action, uint networkId)
|
||||
{
|
||||
if (messageTypes.ContainsKey(name))
|
||||
{
|
||||
if(!targetedMessages.ContainsKey(messageTypes[name]))
|
||||
{
|
||||
targetedMessages.Add(messageTypes[name], new Dictionary<uint, List<int>>());
|
||||
}
|
||||
if(!targetedMessages[messageTypes[name]].ContainsKey(networkId))
|
||||
{
|
||||
targetedMessages[messageTypes[name]].Add(networkId, new List<int>());
|
||||
}
|
||||
if (messageCallbacks.ContainsKey(messageTypes[name]))
|
||||
{
|
||||
int handlerId = 0;
|
||||
@ -59,15 +52,13 @@ namespace MLAPI.NetworkingManagerComponents
|
||||
messageHandlerCounter.Add(messageTypes[name], handlerId + 1);
|
||||
}
|
||||
messageCallbacks[messageTypes[name]].Add(handlerId, action);
|
||||
targetedMessages[messageTypes[name]][networkId].Add(handlerId);
|
||||
return handlerId;
|
||||
}
|
||||
else
|
||||
{
|
||||
messageCallbacks.Add(messageTypes[name], new Dictionary<int, Action<int, byte[]>>());
|
||||
messageCallbacks.Add(messageTypes[name], new Dictionary<int, Action<uint, byte[]>>());
|
||||
messageHandlerCounter.Add(messageTypes[name], 1);
|
||||
messageCallbacks[messageTypes[name]].Add(0, action);
|
||||
targetedMessages[messageTypes[name]][networkId].Add(0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -89,8 +80,8 @@ namespace MLAPI.NetworkingManagerComponents
|
||||
if (!releasedMessageHandlerCounters.ContainsKey(messageTypes[name]))
|
||||
releasedMessageHandlerCounters.Add(messageTypes[name], new Stack<int>());
|
||||
releasedMessageHandlerCounters[messageTypes[name]].Push(counter);
|
||||
targetedMessages[messageTypes[name]][networkId].Remove(counter);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
106
MLAPI/NetworkingManagerComponents/Core/NetworkPoolManager.cs
Normal file
106
MLAPI/NetworkingManagerComponents/Core/NetworkPoolManager.cs
Normal file
@ -0,0 +1,106 @@
|
||||
using MLAPI.Data;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using MLAPI.NetworkingManagerComponents.Binary;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Main class for managing network pools
|
||||
/// </summary>
|
||||
public static class NetworkPoolManager
|
||||
{
|
||||
internal static Dictionary<ushort, NetworkPool> Pools;
|
||||
private static ushort PoolIndex = 0;
|
||||
internal static Dictionary<string, ushort> PoolNamesToIndexes;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a networked object pool. Can only be called from the server
|
||||
/// </summary>
|
||||
/// <param name="poolName">Name of the pool</param>
|
||||
/// <param name="spawnablePrefabIndex">The index of the prefab to use in the spawnablePrefabs array</param>
|
||||
/// <param name="size">The amount of objects in the pool</param>
|
||||
public static void CreatePool(string poolName, int spawnablePrefabIndex, uint size = 16)
|
||||
{
|
||||
if(!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Pools can only be created on the server");
|
||||
return;
|
||||
}
|
||||
NetworkPool pool = new NetworkPool(spawnablePrefabIndex, size, PoolIndex);
|
||||
PoolNamesToIndexes.Add(poolName, PoolIndex);
|
||||
PoolIndex++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This destroys an object pool and all of it's objects. Can only be called from the server
|
||||
/// </summary>
|
||||
/// <param name="poolName">The name of the pool</param>
|
||||
public static void DestroyPool(string poolName)
|
||||
{
|
||||
if (!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Pools can only be destroyed on the server");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < Pools[PoolNamesToIndexes[poolName]].objects.Length; i++)
|
||||
{
|
||||
MonoBehaviour.Destroy(Pools[PoolNamesToIndexes[poolName]].objects[i]);
|
||||
}
|
||||
Pools.Remove(PoolNamesToIndexes[poolName]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Spawns a object from the pool at a given position and rotation. Can only be called from server.
|
||||
/// </summary>
|
||||
/// <param name="poolName">The name of the pool</param>
|
||||
/// <param name="position">The position to spawn the object at</param>
|
||||
/// <param name="rotation">The rotation to spawn the object at</param>
|
||||
/// <returns></returns>
|
||||
public static GameObject SpawnPoolObject(string poolName, Vector3 position, Quaternion rotation)
|
||||
{
|
||||
if (!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Object spawning can only occur on server");
|
||||
return null;
|
||||
}
|
||||
GameObject go = Pools[PoolNamesToIndexes[poolName]].SpawnObject(position, rotation);
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUInt(go.GetComponent<NetworkedObject>().NetworkId);
|
||||
|
||||
writer.WriteFloat(position.x);
|
||||
writer.WriteFloat(position.y);
|
||||
writer.WriteFloat(position.z);
|
||||
|
||||
writer.WriteFloat(rotation.eulerAngles.x);
|
||||
writer.WriteFloat(rotation.eulerAngles.y);
|
||||
writer.WriteFloat(rotation.eulerAngles.z);
|
||||
|
||||
InternalMessageHandler.Send("MLAPI_SPAWN_POOL_OBJECT", "MLAPI_INTERNAL", writer.Finalize(), null);
|
||||
}
|
||||
return go;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destroys a NetworkedObject if it's part of a pool. Use this instead of the MonoBehaviour Destroy method. Can only be called from Server.
|
||||
/// </summary>
|
||||
/// <param name="netObject">The NetworkedObject instance to destroy</param>
|
||||
public static void DestroyPoolObject(NetworkedObject netObject)
|
||||
{
|
||||
if (!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Objects can only be destroyed on the server");
|
||||
return;
|
||||
}
|
||||
netObject.gameObject.SetActive(false);
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUInt(netObject.NetworkId);
|
||||
|
||||
InternalMessageHandler.Send("MLAPI_DESTROY_POOL_OBJECT", "MLAPI_INTERNAL", writer.Finalize(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using MLAPI.NetworkingManagerComponents.Binary;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents
|
||||
namespace MLAPI.NetworkingManagerComponents.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Main class for managing network scenes
|
||||
/// </summary>
|
||||
public static class NetworkSceneManager
|
||||
{
|
||||
internal static HashSet<string> registeredSceneNames;
|
||||
@ -26,6 +30,10 @@ namespace MLAPI.NetworkingManagerComponents
|
||||
CurrentSceneIndex = sceneNameToIndex[SceneManager.GetActiveScene().name];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Switches to a scene with a given name. Can only be called from Server
|
||||
/// </summary>
|
||||
/// <param name="sceneName">The name of the scene to switch to</param>
|
||||
public static void SwitchScene(string sceneName)
|
||||
{
|
||||
if(!NetworkingManager.singleton.NetworkConfig.EnableSceneSwitching)
|
||||
@ -43,22 +51,25 @@ namespace MLAPI.NetworkingManagerComponents
|
||||
Debug.LogWarning("MLAPI: The scene " + sceneName + " is not registered as a switchable scene.");
|
||||
return;
|
||||
}
|
||||
SpawnManager.DestroySceneObjects(); //Destroy current scene objects before switching.
|
||||
CurrentSceneIndex = sceneNameToIndex[sceneName];
|
||||
isSwitching = true;
|
||||
lastScene = SceneManager.GetActiveScene();
|
||||
AsyncOperation sceneLoad = SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive);
|
||||
sceneLoad.completed += OnSceneLoaded;
|
||||
|
||||
using(MemoryStream stream = new MemoryStream(4))
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(sceneNameToIndex[sceneName]);
|
||||
}
|
||||
NetworkingManager.singleton.Send("MLAPI_SWITCH_SCENE", "MLAPI_INTERNAL", stream.GetBuffer());
|
||||
writer.WriteUInt(sceneNameToIndex[sceneName]);
|
||||
|
||||
InternalMessageHandler.Send("MLAPI_SWITCH_SCENE", "MLAPI_INTERNAL", writer.Finalize(), null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called on client
|
||||
/// </summary>
|
||||
/// <param name="sceneIndex"></param>
|
||||
internal static void OnSceneSwitch(uint sceneIndex)
|
||||
{
|
||||
if (!NetworkingManager.singleton.NetworkConfig.EnableSceneSwitching)
|
||||
@ -66,11 +77,16 @@ namespace MLAPI.NetworkingManagerComponents
|
||||
Debug.LogWarning("MLAPI: Scene switching is not enabled but was requested by the server");
|
||||
return;
|
||||
}
|
||||
else if (!sceneIndexToString.ContainsKey(sceneIndex) || registeredSceneNames.Contains(sceneIndexToString[sceneIndex]))
|
||||
else if (!sceneIndexToString.ContainsKey(sceneIndex) || !registeredSceneNames.Contains(sceneIndexToString[sceneIndex]))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Server requested a scene switch to a non registered scene");
|
||||
return;
|
||||
}
|
||||
else if(SceneManager.GetActiveScene().name == sceneIndexToString[sceneIndex])
|
||||
{
|
||||
return; //This scene is already loaded. This usually happends at first load
|
||||
}
|
||||
SpawnManager.DestroySceneObjects();
|
||||
lastScene = SceneManager.GetActiveScene();
|
||||
AsyncOperation sceneLoad = SceneManager.LoadSceneAsync(sceneIndexToString[sceneIndex], LoadSceneMode.Additive);
|
||||
sceneLoad.completed += OnSceneLoaded;
|
||||
@ -92,6 +108,16 @@ namespace MLAPI.NetworkingManagerComponents
|
||||
private static void OnSceneUnload(AsyncOperation operation)
|
||||
{
|
||||
isSwitching = false;
|
||||
if(NetworkingManager.singleton.isServer)
|
||||
{
|
||||
SpawnManager.MarkSceneObjects();
|
||||
SpawnManager.FlushSceneObjects();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("DESTROING OBJECTS");
|
||||
SpawnManager.DestroySceneObjects();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
277
MLAPI/NetworkingManagerComponents/Core/SpawnManager.cs
Normal file
277
MLAPI/NetworkingManagerComponents/Core/SpawnManager.cs
Normal file
@ -0,0 +1,277 @@
|
||||
using MLAPI.Data;
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using MLAPI.NetworkingManagerComponents.Binary;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Core
|
||||
{
|
||||
internal static class SpawnManager
|
||||
{
|
||||
internal static Dictionary<uint, NetworkedObject> spawnedObjects;
|
||||
internal static Stack<uint> releasedNetworkObjectIds;
|
||||
private static uint networkObjectIdCounter;
|
||||
internal static uint GetNetworkObjectId()
|
||||
{
|
||||
if (releasedNetworkObjectIds.Count > 0)
|
||||
{
|
||||
return releasedNetworkObjectIds.Pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
networkObjectIdCounter++;
|
||||
return networkObjectIdCounter;
|
||||
}
|
||||
}
|
||||
|
||||
private static NetworkingManager netManager
|
||||
{
|
||||
get
|
||||
{
|
||||
return NetworkingManager.singleton;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void RemoveOwnership(uint netId)
|
||||
{
|
||||
NetworkedObject netObject = SpawnManager.spawnedObjects[netId];
|
||||
NetworkingManager.singleton.connectedClients[netObject.OwnerClientId].OwnedObjects.RemoveAll(x => x.NetworkId == netId);
|
||||
netObject.ownerClientId = NetworkingManager.singleton.NetworkConfig.NetworkTransport.InvalidDummyId;
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUInt(netId);
|
||||
writer.WriteUInt(netObject.ownerClientId);
|
||||
|
||||
InternalMessageHandler.Send("MLAPI_CHANGE_OWNER", "MLAPI_INTERNAL", writer.Finalize(), null);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void ChangeOwnership(uint netId, uint clientId)
|
||||
{
|
||||
NetworkedObject netObject = SpawnManager.spawnedObjects[netId];
|
||||
NetworkingManager.singleton.connectedClients[netObject.OwnerClientId].OwnedObjects.RemoveAll(x => x.NetworkId == netId);
|
||||
NetworkingManager.singleton.connectedClients[clientId].OwnedObjects.Add(netObject);
|
||||
netObject.ownerClientId = clientId;
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUInt(netId);
|
||||
writer.WriteUInt(clientId);
|
||||
|
||||
InternalMessageHandler.Send("MLAPI_CHANGE_OWNER", "MLAPI_INTERNAL", writer.Finalize(), null);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void DestroyNonSceneObjects()
|
||||
{
|
||||
if(spawnedObjects != null)
|
||||
{
|
||||
foreach (KeyValuePair<uint, NetworkedObject> netObject in spawnedObjects)
|
||||
{
|
||||
if (netObject.Value.sceneObject != null && netObject.Value.sceneObject.Value == false)
|
||||
MonoBehaviour.Destroy(netObject.Value.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static void DestroySceneObjects()
|
||||
{
|
||||
NetworkedObject[] netObjects = MonoBehaviour.FindObjectsOfType<NetworkedObject>();
|
||||
for (int i = 0; i < netObjects.Length; i++)
|
||||
{
|
||||
if (netObjects[i].sceneObject == null || netObjects[i].sceneObject.Value == true)
|
||||
MonoBehaviour.Destroy(netObjects[i].gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void MarkSceneObjects()
|
||||
{
|
||||
NetworkedObject[] netObjects = MonoBehaviour.FindObjectsOfType<NetworkedObject>();
|
||||
for (int i = 0; i < netObjects.Length; i++)
|
||||
{
|
||||
if (netObjects[i].sceneObject == null)
|
||||
{
|
||||
netObjects[i].InvokeBehaviourNetworkSpawn();
|
||||
netObjects[i].sceneObject = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static void FlushSceneObjects()
|
||||
{
|
||||
if (!NetworkingManager.singleton.isServer)
|
||||
return;
|
||||
|
||||
List<NetworkedObject> sceneObjectsToSync = new List<NetworkedObject>();
|
||||
foreach (KeyValuePair<uint, NetworkedObject> pair in SpawnManager.spawnedObjects)
|
||||
{
|
||||
if (pair.Value.sceneObject == null || pair.Value.sceneObject == true)
|
||||
sceneObjectsToSync.Add(pair.Value);
|
||||
}
|
||||
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUShort((ushort)sceneObjectsToSync.Count);
|
||||
for (int i = 0; i < sceneObjectsToSync.Count; i++)
|
||||
{
|
||||
writer.WriteBool(false); //isLocalPlayer
|
||||
writer.WriteUInt(sceneObjectsToSync[i].NetworkId);
|
||||
writer.WriteUInt(sceneObjectsToSync[i].OwnerClientId);
|
||||
writer.WriteInt(NetworkingManager.singleton.NetworkConfig.NetworkPrefabIds[sceneObjectsToSync[i].NetworkedPrefabName]);
|
||||
writer.WriteBool(sceneObjectsToSync[i].sceneObject == null ? true : sceneObjectsToSync[i].sceneObject.Value);
|
||||
|
||||
writer.WriteFloat(sceneObjectsToSync[i].transform.position.x);
|
||||
writer.WriteFloat(sceneObjectsToSync[i].transform.position.y);
|
||||
writer.WriteFloat(sceneObjectsToSync[i].transform.position.z);
|
||||
|
||||
writer.WriteFloat(sceneObjectsToSync[i].transform.rotation.eulerAngles.x);
|
||||
writer.WriteFloat(sceneObjectsToSync[i].transform.rotation.eulerAngles.y);
|
||||
writer.WriteFloat(sceneObjectsToSync[i].transform.rotation.eulerAngles.z);
|
||||
}
|
||||
|
||||
InternalMessageHandler.Send("MLAPI_ADD_OBJECTS", "MLAPI_INTERNAL", writer.Finalize(), null);
|
||||
}
|
||||
}
|
||||
|
||||
internal static GameObject SpawnPrefabIndexClient(int networkedPrefabId, uint networkId, uint owner, Vector3 position, Quaternion rotation)
|
||||
{
|
||||
if (!netManager.NetworkConfig.NetworkPrefabNames.ContainsKey(networkedPrefabId))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Cannot spawn the object, invalid prefabIndex");
|
||||
return null;
|
||||
}
|
||||
|
||||
GameObject go = MonoBehaviour.Instantiate(netManager.NetworkConfig.NetworkedPrefabs[networkedPrefabId].prefab, position, rotation);
|
||||
NetworkedObject netObject = go.GetComponent<NetworkedObject>();
|
||||
if (netObject == null)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Please add a NetworkedObject component to the root of all spawnable objects");
|
||||
netObject = go.AddComponent<NetworkedObject>();
|
||||
}
|
||||
netObject.NetworkedPrefabName = netManager.NetworkConfig.NetworkPrefabNames[networkedPrefabId];
|
||||
netObject._isSpawned = true;
|
||||
netObject._isPooledObject = false;
|
||||
netObject.networkId = networkId;
|
||||
netObject.ownerClientId = owner;
|
||||
netObject.transform.position = position;
|
||||
netObject.transform.rotation = rotation;
|
||||
spawnedObjects.Add(netObject.NetworkId, netObject);
|
||||
netObject.InvokeBehaviourNetworkSpawn();
|
||||
return go;
|
||||
}
|
||||
|
||||
internal static void SpawnPrefabIndexServer(NetworkedObject netObject, uint? clientOwnerId = null)
|
||||
{
|
||||
if (netObject.isSpawned)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Object already spawned");
|
||||
return;
|
||||
}
|
||||
else if (!netManager.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Only server can spawn objects");
|
||||
return;
|
||||
}
|
||||
else if (!netManager.NetworkConfig.NetworkPrefabIds.ContainsKey(netObject.NetworkedPrefabName))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: The prefab name " + netObject.NetworkedPrefabName + " does not exist as a networkedPrefab");
|
||||
return;
|
||||
}
|
||||
else if (!netManager.NetworkConfig.HandleObjectSpawning)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: NetworkConfig is set to not handle object spawning");
|
||||
return;
|
||||
}
|
||||
uint netId = GetNetworkObjectId();
|
||||
netObject.networkId = netId;
|
||||
spawnedObjects.Add(netId, netObject);
|
||||
netObject._isSpawned = true;
|
||||
netObject.sceneObject = false;
|
||||
netObject.InvokeBehaviourNetworkSpawn();
|
||||
if (clientOwnerId != null)
|
||||
{
|
||||
netObject.ownerClientId = clientOwnerId.Value;
|
||||
NetworkingManager.singleton.connectedClients[clientOwnerId.Value].OwnedObjects.Add(netObject);
|
||||
}
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteBool(false);
|
||||
writer.WriteUInt(netObject.NetworkId);
|
||||
writer.WriteUInt(netObject.OwnerClientId);
|
||||
writer.WriteInt(netManager.NetworkConfig.NetworkPrefabIds[netObject.NetworkedPrefabName]);
|
||||
writer.WriteBool(netObject.sceneObject == null ? true : netObject.sceneObject.Value);
|
||||
|
||||
writer.WriteFloat(netObject.transform.position.x);
|
||||
writer.WriteFloat(netObject.transform.position.y);
|
||||
writer.WriteFloat(netObject.transform.position.z);
|
||||
|
||||
writer.WriteFloat(netObject.transform.rotation.eulerAngles.x);
|
||||
writer.WriteFloat(netObject.transform.rotation.eulerAngles.y);
|
||||
writer.WriteFloat(netObject.transform.rotation.eulerAngles.z);
|
||||
|
||||
|
||||
InternalMessageHandler.Send("MLAPI_ADD_OBJECT", "MLAPI_INTERNAL", writer.Finalize(), null);
|
||||
}
|
||||
}
|
||||
|
||||
internal static GameObject SpawnPlayerObject(uint clientId, uint networkId, Vector3 position, Quaternion rotation)
|
||||
{
|
||||
if (string.IsNullOrEmpty(netManager.NetworkConfig.PlayerPrefabName) || !netManager.NetworkConfig.NetworkPrefabIds.ContainsKey(netManager.NetworkConfig.PlayerPrefabName))
|
||||
{
|
||||
Debug.LogWarning("MLAPI: There is no player prefab in the NetworkConfig, or it's not registered at as a spawnable prefab");
|
||||
return null;
|
||||
}
|
||||
GameObject go = MonoBehaviour.Instantiate(netManager.NetworkConfig.NetworkedPrefabs[netManager.NetworkConfig.NetworkPrefabIds[netManager.NetworkConfig.PlayerPrefabName]].prefab, position, rotation);
|
||||
NetworkedObject netObject = go.GetComponent<NetworkedObject>();
|
||||
if (netObject == null)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Please add a NetworkedObject component to the root of the player prefab");
|
||||
netObject = go.AddComponent<NetworkedObject>();
|
||||
}
|
||||
|
||||
if (NetworkingManager.singleton.isServer)
|
||||
netObject.networkId = GetNetworkObjectId();
|
||||
else
|
||||
netObject.networkId = networkId;
|
||||
|
||||
netObject._isPooledObject = false;
|
||||
netObject.ownerClientId = clientId;
|
||||
netObject._isPlayerObject = true;
|
||||
netObject._isSpawned = true;
|
||||
netObject.sceneObject = false;
|
||||
netManager.connectedClients[clientId].PlayerObject = go;
|
||||
spawnedObjects.Add(netObject.NetworkId, netObject);
|
||||
netObject.InvokeBehaviourNetworkSpawn();
|
||||
return go;
|
||||
}
|
||||
|
||||
internal static void OnDestroyObject(uint networkId, bool destroyGameObject)
|
||||
{
|
||||
if (!spawnedObjects.ContainsKey(networkId) || (netManager != null && !netManager.NetworkConfig.HandleObjectSpawning))
|
||||
return;
|
||||
if (spawnedObjects[networkId].OwnerClientId != NetworkingManager.singleton.NetworkConfig.NetworkTransport.InvalidDummyId && !spawnedObjects[networkId].isPlayerObject)
|
||||
{
|
||||
//Someone owns it.
|
||||
NetworkingManager.singleton.connectedClients[spawnedObjects[networkId].OwnerClientId].OwnedObjects.RemoveAll(x => x.NetworkId == networkId);
|
||||
}
|
||||
GameObject go = spawnedObjects[networkId].gameObject;
|
||||
if (netManager != null && netManager.isServer)
|
||||
{
|
||||
releasedNetworkObjectIds.Push(networkId);
|
||||
if (spawnedObjects[networkId] != null)
|
||||
{
|
||||
using (BitWriter writer = new BitWriter())
|
||||
{
|
||||
writer.WriteUInt(networkId);
|
||||
|
||||
InternalMessageHandler.Send("MLAPI_DESTROY_OBJECT", "MLAPI_INTERNAL", writer.Finalize(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (destroyGameObject && go != null)
|
||||
MonoBehaviour.Destroy(go);
|
||||
spawnedObjects.Remove(networkId);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.IO;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Cryptography
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper class for encryption purposes
|
||||
/// </summary>
|
||||
public static class CryptographyHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Decrypts a message with AES with a given key and a salt that is encoded as the first 16 bytes of the buffer
|
||||
/// </summary>
|
||||
/// <param name="encryptedBuffer">The buffer with the salt</param>
|
||||
/// <param name="key">The key to use</param>
|
||||
/// <returns>The decrypted byte array</returns>
|
||||
public static byte[] Decrypt(byte[] encryptedBuffer, byte[] key)
|
||||
{
|
||||
byte[] iv = new byte[16];
|
||||
Array.Copy(encryptedBuffer, 0, iv, 0, 16);
|
||||
|
||||
using (MemoryStream stream = new MemoryStream())
|
||||
{
|
||||
using (RijndaelManaged aes = new RijndaelManaged())
|
||||
{
|
||||
aes.IV = iv;
|
||||
aes.Key = key;
|
||||
using (CryptoStream cs = new CryptoStream(stream, aes.CreateDecryptor(), CryptoStreamMode.Write))
|
||||
{
|
||||
cs.Write(encryptedBuffer, 16, encryptedBuffer.Length - 16);
|
||||
}
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encrypts a message with AES with a given key and a random salt that gets encoded as the first 16 bytes of the encrypted buffer
|
||||
/// </summary>
|
||||
/// <param name="clearBuffer">The buffer to be encrypted</param>
|
||||
/// <param name="key">The key to use</param>
|
||||
/// <returns>The encrypted byte array with encoded salt</returns>
|
||||
public static byte[] Encrypt(byte[] clearBuffer, byte[] key)
|
||||
{
|
||||
using (MemoryStream stream = new MemoryStream())
|
||||
{
|
||||
using (RijndaelManaged aes = new RijndaelManaged())
|
||||
{
|
||||
aes.Key = key;
|
||||
aes.GenerateIV();
|
||||
using (CryptoStream cs = new CryptoStream(stream, aes.CreateEncryptor(), CryptoStreamMode.Write))
|
||||
{
|
||||
cs.Write(clearBuffer, 0, clearBuffer.Length);
|
||||
}
|
||||
byte[] encrypted = stream.ToArray();
|
||||
byte[] final = new byte[encrypted.Length + 16];
|
||||
Array.Copy(aes.IV, final, 16);
|
||||
Array.Copy(encrypted, 0, final, 16, encrypted.Length);
|
||||
return final;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
104
MLAPI/NetworkingManagerComponents/Cryptography/DiffieHellman.cs
Normal file
104
MLAPI/NetworkingManagerComponents/Cryptography/DiffieHellman.cs
Normal file
@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using IntXLib;
|
||||
using System.Text;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Cryptography
|
||||
{
|
||||
internal class EllipticDiffieHellman
|
||||
{
|
||||
protected static readonly RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
|
||||
public static readonly IntX DEFAULT_PRIME = (new IntX(1) << 255) - 19;
|
||||
public static readonly IntX DEFAULT_ORDER = (new IntX(1) << 252) + IntX.Parse("27742317777372353535851937790883648493");
|
||||
public static readonly EllipticCurve DEFAULT_CURVE = new EllipticCurve(486662, 1, DEFAULT_PRIME, EllipticCurve.CurveType.Montgomery);
|
||||
public static readonly CurvePoint DEFAULT_GENERATOR = new CurvePoint(9, IntX.Parse("14781619447589544791020593568409986887264606134616475288964881837755586237401"));
|
||||
|
||||
protected readonly EllipticCurve curve;
|
||||
public readonly IntX priv;
|
||||
protected readonly CurvePoint generator, pub;
|
||||
|
||||
|
||||
public EllipticDiffieHellman(EllipticCurve curve, CurvePoint generator, IntX order, byte[] priv = null)
|
||||
{
|
||||
this.curve = curve;
|
||||
this.generator = generator;
|
||||
|
||||
// Generate private key
|
||||
if (priv == null)
|
||||
{
|
||||
byte[] max = order.ToArray();
|
||||
do
|
||||
{
|
||||
byte[] p1 = new byte[5 /*rand.Next(max.Length) + 1*/];
|
||||
|
||||
rand.GetBytes(p1);
|
||||
|
||||
if (p1.Length == max.Length) p1[p1.Length - 1] %= max[max.Length - 1];
|
||||
else p1[p1.Length - 1] &= 127;
|
||||
|
||||
this.priv = DHHelper.FromArray(p1);
|
||||
} while (this.priv<2);
|
||||
}
|
||||
else this.priv = DHHelper.FromArray(priv);
|
||||
|
||||
// Generate public key
|
||||
pub = curve.Multiply(generator, this.priv);
|
||||
}
|
||||
|
||||
public byte[] GetPublicKey()
|
||||
{
|
||||
byte[] p1 = pub.X.ToArray();
|
||||
byte[] p2 = pub.Y.ToArray();
|
||||
|
||||
byte[] ser = new byte[4 + p1.Length + p2.Length];
|
||||
ser[0] = (byte)(p1.Length & 255);
|
||||
ser[1] = (byte)((p1.Length >> 8) & 255);
|
||||
ser[2] = (byte)((p1.Length >> 16) & 255);
|
||||
ser[3] = (byte)((p1.Length >> 24) & 255);
|
||||
Array.Copy(p1, 0, ser, 4, p1.Length);
|
||||
Array.Copy(p2, 0, ser, 4 + p1.Length, p2.Length);
|
||||
|
||||
return ser;
|
||||
}
|
||||
|
||||
public byte[] GetPrivateKey() => priv.ToArray();
|
||||
|
||||
public byte[] GetSharedSecret(byte[] pK)
|
||||
{
|
||||
byte[] p1 = new byte[pK[0] | (pK[1]<<8) | (pK[2]<<16) | (pK[3]<<24)]; // Reconstruct x-axis size
|
||||
byte[] p2 = new byte[pK.Length - p1.Length - 4];
|
||||
Array.Copy(pK, 4, p1, 0, p1.Length);
|
||||
Array.Copy(pK, 4 + p1.Length, p2, 0, p2.Length);
|
||||
|
||||
CurvePoint remotePublic = new CurvePoint(DHHelper.FromArray(p1), DHHelper.FromArray(p2));
|
||||
|
||||
byte[] secret = curve.Multiply(remotePublic, priv).X.ToArray(); // Use the x-coordinate as the shared secret
|
||||
|
||||
// PBKDF2-HMAC-SHA1 (Common shared secret generation method)
|
||||
return new Rfc2898DeriveBytes(secret, Encoding.UTF8.GetBytes("P1sN0R4inb0wPl5P1sPls"), 1000).GetBytes(32);
|
||||
}
|
||||
}
|
||||
|
||||
internal static class DHHelper
|
||||
{
|
||||
internal static byte[] ToArray(this IntX v)
|
||||
{
|
||||
v.GetInternalState(out uint[] digits, out bool negative);
|
||||
byte[] b = DigitConverter.ToBytes(digits);
|
||||
byte[] b1 = new byte[b.Length + 1];
|
||||
Array.Copy(b, b1, b.Length);
|
||||
b1[b.Length] = (byte)(negative ? 1 : 0);
|
||||
return b1;
|
||||
}
|
||||
internal static IntX FromArray(byte[] b)
|
||||
{
|
||||
if (b.Length == 0) return new IntX();
|
||||
byte[] b1 = new byte[b.Length - 1];
|
||||
Array.Copy(b, b1, b1.Length);
|
||||
uint[] u = DigitConverter.FromBytes(b1);
|
||||
return new IntX(u, b[b.Length - 1]==1);
|
||||
}
|
||||
internal static bool BitAt(this uint[] data, long index) => (data[index / 32] & (1 << (int)(index % 32))) != 0;
|
||||
internal static IntX Abs(this IntX i) => i < 0 ? -i : i;
|
||||
}
|
||||
}
|
189
MLAPI/NetworkingManagerComponents/Cryptography/EllipticCurve.cs
Normal file
189
MLAPI/NetworkingManagerComponents/Cryptography/EllipticCurve.cs
Normal file
@ -0,0 +1,189 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using IntXLib;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Cryptography
|
||||
{
|
||||
internal class CurvePoint
|
||||
{
|
||||
public static readonly CurvePoint POINT_AT_INFINITY = new CurvePoint();
|
||||
public IntX X { get; private set; }
|
||||
public IntX Y { get; private set; }
|
||||
private bool pai = false;
|
||||
public CurvePoint(IntX x, IntX y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
private CurvePoint() { pai = true; } // Accessing corrdinates causes undocumented behaviour
|
||||
public override string ToString()
|
||||
{
|
||||
return pai ? "(POINT_AT_INFINITY)" : "(" + X + ", " + Y + ")";
|
||||
}
|
||||
}
|
||||
|
||||
internal class EllipticCurve
|
||||
{
|
||||
public enum CurveType { Weierstrass, Montgomery }
|
||||
|
||||
protected readonly IntX a, b, modulo;
|
||||
protected readonly CurveType type;
|
||||
|
||||
public EllipticCurve(IntX a, IntX b, IntX modulo, CurveType type = CurveType.Weierstrass)
|
||||
{
|
||||
if (
|
||||
(type==CurveType.Weierstrass && (4 * a * a * a) + (27 * b * b) == 0) || // Unfavourable Weierstrass curves
|
||||
(type==CurveType.Montgomery && b * (a * a - 4)==0) // Unfavourable Montgomery curves
|
||||
) throw new Exception("Unfavourable curve");
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
this.modulo = modulo;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public CurvePoint Add(CurvePoint p1, CurvePoint p2)
|
||||
{
|
||||
#if SAFE_MATH
|
||||
CheckOnCurve(p1);
|
||||
CheckOnCurve(p2);
|
||||
#endif
|
||||
|
||||
// Special cases
|
||||
if (p1 == CurvePoint.POINT_AT_INFINITY && p2 == CurvePoint.POINT_AT_INFINITY) return CurvePoint.POINT_AT_INFINITY;
|
||||
else if (p1 == CurvePoint.POINT_AT_INFINITY) return p2;
|
||||
else if (p2 == CurvePoint.POINT_AT_INFINITY) return p1;
|
||||
else if (p1.X == p2.X && p1.Y == Inverse(p2).Y) return CurvePoint.POINT_AT_INFINITY;
|
||||
|
||||
IntX x3 = 0, y3 = 0;
|
||||
if (type == CurveType.Weierstrass)
|
||||
{
|
||||
IntX slope = p1.X == p2.X && p1.Y == p2.Y ? Mod((3 * p1.X * p1.X + a) * MulInverse(2 * p1.Y)) : Mod(Mod(p2.Y - p1.Y) * MulInverse(p2.X - p1.X));
|
||||
x3 = Mod((slope * slope) - p1.X - p2.X);
|
||||
y3 = Mod(-((slope * x3) + p1.Y - (slope * p1.X)));
|
||||
}
|
||||
else if (type == CurveType.Montgomery)
|
||||
{
|
||||
if ((p1.X == p2.X && p1.Y == p2.Y))
|
||||
{
|
||||
IntX q = 3 * p1.X;
|
||||
IntX w = q * p1.X;
|
||||
|
||||
IntX e = 2 * a;
|
||||
IntX r = e * p1.X;
|
||||
|
||||
IntX t = 2 * b;
|
||||
IntX y = t * p1.Y;
|
||||
|
||||
IntX u = MulInverse(y);
|
||||
|
||||
IntX o = w + e + 1;
|
||||
IntX p = o * u;
|
||||
}
|
||||
IntX co = p1.X == p2.X && p1.Y == p2.Y ? Mod((3 * p1.X * p1.X + 2 * a * p1.X + 1) * MulInverse(2 * b * p1.Y)) : Mod(Mod(p2.Y - p1.Y) * MulInverse(p2.X - p1.X)); // Compute a commonly used coefficient
|
||||
x3 = Mod(b * co * co - a - p1.X - p2.X);
|
||||
y3 = Mod(((2 * p1.X + p2.X + a) * co) - (b * co * co * co) - p1.Y);
|
||||
}
|
||||
|
||||
return new CurvePoint(x3, y3);
|
||||
}
|
||||
|
||||
public CurvePoint Multiply(CurvePoint p, IntX scalar)
|
||||
{
|
||||
if (scalar <= 0) throw new Exception("Cannot multiply by a scalar which is <= 0");
|
||||
if (p == CurvePoint.POINT_AT_INFINITY) return CurvePoint.POINT_AT_INFINITY;
|
||||
|
||||
CurvePoint p1 = new CurvePoint(p.X, p.Y);
|
||||
scalar.GetInternalState(out uint[] u, out bool b);
|
||||
long high_bit = -1;
|
||||
for (int i = u.Length - 1; i>=0; --i)
|
||||
if (u[i] != 0)
|
||||
{
|
||||
for(int j = 31; j>=0; --j)
|
||||
if ((u[i] & (1<<j))!=0)
|
||||
{
|
||||
high_bit = j + i * 32;
|
||||
goto Next;
|
||||
}
|
||||
}
|
||||
Next:
|
||||
|
||||
// Double-and-add method
|
||||
while(high_bit >= 0)
|
||||
{
|
||||
p1 = Add(p1, p1); // Double
|
||||
if ((u.BitAt(high_bit)))
|
||||
p1 = Add(p1, p); // Add
|
||||
--high_bit;
|
||||
}
|
||||
|
||||
return p1;
|
||||
}
|
||||
|
||||
protected IntX MulInverse(IntX eq) => MulInverse(eq, modulo);
|
||||
public static IntX MulInverse(IntX eq, IntX modulo)
|
||||
{
|
||||
eq = Mod(eq, modulo);
|
||||
Stack<IntX> collect = new Stack<IntX>();
|
||||
IntX v = modulo; // Copy modulo
|
||||
IntX m;
|
||||
while((m = v % eq) != 0)
|
||||
{
|
||||
collect.Push(-v/eq/*-(m.l_div)*/);
|
||||
v = eq;
|
||||
eq = m;
|
||||
}
|
||||
if (collect.Count == 0) return 1;
|
||||
v = 1;
|
||||
m = collect.Pop();
|
||||
while (collect.Count > 0)
|
||||
{
|
||||
eq = m;
|
||||
m = v + (m * collect.Pop());
|
||||
v = eq;
|
||||
}
|
||||
return Mod(m, modulo);
|
||||
}
|
||||
|
||||
public CurvePoint Inverse(CurvePoint p) => Inverse(p, modulo);
|
||||
protected static CurvePoint Inverse(CurvePoint p, IntX modulo) => new CurvePoint(p.X, Mod(-p.Y, modulo));
|
||||
|
||||
public bool IsOnCurve(CurvePoint p)
|
||||
{
|
||||
try { CheckOnCurve(p); }
|
||||
catch { return false; }
|
||||
return true;
|
||||
}
|
||||
protected void CheckOnCurve(CurvePoint p)
|
||||
{
|
||||
if (
|
||||
p!=CurvePoint.POINT_AT_INFINITY && // The point at infinity is asserted to be on the curve
|
||||
(type == CurveType.Weierstrass && Mod(p.Y * p.Y) != Mod((p.X * p.X * p.X) + (p.X * a) + b)) || // Weierstrass formula
|
||||
(type == CurveType.Montgomery && Mod(b * p.Y * p.Y) != Mod((p.X * p.X * p.X) + (p.X * p.X * a) + p.X)) // Montgomery formula
|
||||
) throw new Exception("Point is not on curve");
|
||||
}
|
||||
|
||||
protected IntX Mod(IntX b) => Mod(b, modulo);
|
||||
|
||||
private static IntX Mod(IntX x, IntX m)
|
||||
{
|
||||
IntX r = x.Abs() > m ? x % m : x;
|
||||
return r < 0 ? r + m : r;
|
||||
}
|
||||
|
||||
protected static IntX ModPow(IntX x, IntX power, IntX prime)
|
||||
{
|
||||
IntX result = 1;
|
||||
bool setBit = false;
|
||||
while(power > 0)
|
||||
{
|
||||
x %= prime;
|
||||
setBit = (power & 1) == 1;
|
||||
power >>= 1;
|
||||
if (setBit) result *= x;
|
||||
x *= x;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
123
MLAPI/NetworkingManagerComponents/Cryptography/MessageDigest.cs
Normal file
123
MLAPI/NetworkingManagerComponents/Cryptography/MessageDigest.cs
Normal file
@ -0,0 +1,123 @@
|
||||
using MLAPI.NetworkingManagerComponents.Binary;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents.Cryptography
|
||||
{
|
||||
public static class MessageDigest
|
||||
{
|
||||
public struct SHA1Result
|
||||
{
|
||||
public uint i0, i1, i2, i3, i4;
|
||||
public byte Get(int idx) => (byte)((idx < 4 ? i0 : idx < 8 ? i1 : idx < 12 ? i2 : idx < 16 ? i3 : i4) >> (8 * (idx % 4)));
|
||||
public byte[] ToArray()
|
||||
{
|
||||
byte[] b = new byte[20];
|
||||
for (int i = 0; i < 20; ++i) b[i] = Get(i);
|
||||
return b;
|
||||
}
|
||||
private ulong Collect(int bytes)
|
||||
{
|
||||
ulong u = 0;
|
||||
for (int i = 0; i < bytes; ++i) u |= (ulong)Get(i) << (8*i);
|
||||
return u;
|
||||
}
|
||||
public byte CastByte() => Get(0);
|
||||
public ushort CastUShort() => (ushort)Collect(2);
|
||||
public uint CastUInt() => (uint)Collect(4);
|
||||
public ulong CastULong() => (ulong)Collect(8);
|
||||
}
|
||||
public static SHA1Result SHA1_Opt(byte[] message)
|
||||
{
|
||||
SHA1Result result = new SHA1Result
|
||||
{
|
||||
// Initialize buffers
|
||||
i0 = 0x67452301,
|
||||
i1 = 0xEFCDAB89,
|
||||
i2 = 0x98BADCFE,
|
||||
i3 = 0x10325476,
|
||||
i4 = 0xC3D2E1F0
|
||||
};
|
||||
|
||||
// Pad message
|
||||
long len = message.Length * 8;
|
||||
int
|
||||
ml = message.Length + 1,
|
||||
max = ml + ((960 - (ml * 8 % 512)) % 512) / 8 + 8;
|
||||
|
||||
// Replaces the allocation of a lot of bytes
|
||||
byte GetMsg(int idx)
|
||||
{
|
||||
if (idx < message.Length)
|
||||
return message[idx];
|
||||
else if (idx == message.Length)
|
||||
return 0x80;
|
||||
else if (max - idx <= 8)
|
||||
return (byte)((len >> ((max - 1 - idx) * 8)) & 255);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int chunks = max / 64;
|
||||
|
||||
// Replaces the recurring allocation of 80 uints
|
||||
uint ComputeIndex(int block, int idx)
|
||||
{
|
||||
if (idx < 16)
|
||||
return (uint)((GetMsg(block * 64 + idx * 4) << 24) | (GetMsg(block * 64 + idx * 4 + 1) << 16) | (GetMsg(block * 64 + idx * 4 + 2) << 8) | (GetMsg(block * 64 + idx * 4 + 3) << 0));
|
||||
else
|
||||
return Rot(ComputeIndex(block, idx - 3) ^ ComputeIndex(block, idx - 8) ^ ComputeIndex(block, idx - 14) ^ ComputeIndex(block, idx - 16), 1);
|
||||
}
|
||||
|
||||
// Perform hashing for each 512-bit block
|
||||
for (int i = 0; i < chunks; ++i)
|
||||
{
|
||||
|
||||
// Initialize chunk-hash
|
||||
uint
|
||||
a = result.i0,
|
||||
b = result.i1,
|
||||
c = result.i2,
|
||||
d = result.i3,
|
||||
e = result.i4;
|
||||
|
||||
// Do hash rounds
|
||||
for (int t = 0; t < 80; ++t)
|
||||
{
|
||||
uint tmp = Rot(a, 5) + func(t, b, c, d) + e + K(t) + ComputeIndex(i, t);
|
||||
e = d;
|
||||
d = c;
|
||||
c = Rot(b, 30);
|
||||
b = a;
|
||||
a = tmp;
|
||||
}
|
||||
result.i0 += a;
|
||||
result.i1 += b;
|
||||
result.i2 += c;
|
||||
result.i3 += d;
|
||||
result.i4 += e;
|
||||
}
|
||||
result.i0 = BinaryHelpers.SwapEndian(result.i0);
|
||||
result.i1 = BinaryHelpers.SwapEndian(result.i1);
|
||||
result.i2 = BinaryHelpers.SwapEndian(result.i2);
|
||||
result.i3 = BinaryHelpers.SwapEndian(result.i3);
|
||||
result.i4 = BinaryHelpers.SwapEndian(result.i4);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static uint func(int t, uint b, uint c, uint d) =>
|
||||
t < 20 ? (b & c) | ((~b) & d) :
|
||||
t < 40 ? b ^ c ^ d :
|
||||
t < 60 ? (b & c) | (b & d) | (c & d) :
|
||||
/*t<80*/ b ^ c ^ d;
|
||||
|
||||
private static uint K(int t) =>
|
||||
t < 20 ? 0x5A827999 :
|
||||
t < 40 ? 0x6ED9EBA1 :
|
||||
t < 60 ? 0x8F1BBCDC :
|
||||
/*t<80*/ 0xCA62C1D6;
|
||||
|
||||
private static uint Rot(uint val, int by) => (val << by) | (val >> (32 - by));
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
using MLAPI.MonoBehaviours.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents
|
||||
{
|
||||
public static class LagCompensationManager
|
||||
{
|
||||
public static List<TrackedObject> SimulationObjects = new List<TrackedObject>();
|
||||
|
||||
public static void Simulate(float secondsAgo, Action action)
|
||||
{
|
||||
if(!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Lag compensation simulations are only to be ran on the server.");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < SimulationObjects.Count; i++)
|
||||
{
|
||||
SimulationObjects[i].ReverseTransform(secondsAgo);
|
||||
}
|
||||
|
||||
action.Invoke();
|
||||
|
||||
for (int i = 0; i < SimulationObjects.Count; i++)
|
||||
{
|
||||
SimulationObjects[i].ResetStateTransform();
|
||||
}
|
||||
}
|
||||
|
||||
private static byte error = 0;
|
||||
public static void Simulate(int clientId, Action action)
|
||||
{
|
||||
if (!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Lag compensation simulations are only to be ran on the server.");
|
||||
return;
|
||||
}
|
||||
float milisecondsDelay = NetworkTransport.GetCurrentRTT(NetworkingManager.singleton.hostId, clientId, out error) / 2f;
|
||||
Simulate(milisecondsDelay * 1000f, action);
|
||||
}
|
||||
|
||||
internal static void AddFrames()
|
||||
{
|
||||
for (int i = 0; i < SimulationObjects.Count; i++)
|
||||
{
|
||||
SimulationObjects[i].AddFrame();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
using MLAPI.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents
|
||||
{
|
||||
public static class NetworkPoolManager
|
||||
{
|
||||
internal static Dictionary<ushort, NetworkPool> Pools;
|
||||
private static ushort PoolIndex = 0;
|
||||
internal static Dictionary<string, ushort> PoolNamesToIndexes;
|
||||
|
||||
//Server only
|
||||
public static void CreatePool(string poolName, int spawnablePrefabIndex, uint size = 16)
|
||||
{
|
||||
if(!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Pools can only be created on the server");
|
||||
return;
|
||||
}
|
||||
NetworkPool pool = new NetworkPool(spawnablePrefabIndex, size, PoolIndex);
|
||||
PoolNamesToIndexes.Add(poolName, PoolIndex);
|
||||
PoolIndex++;
|
||||
}
|
||||
|
||||
public static void DestroyPool(string poolName)
|
||||
{
|
||||
if (!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Pools can only be destroyed on the server");
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < Pools[PoolNamesToIndexes[poolName]].objects.Length; i++)
|
||||
{
|
||||
MonoBehaviour.Destroy(Pools[PoolNamesToIndexes[poolName]].objects[i]);
|
||||
}
|
||||
Pools.Remove(PoolNamesToIndexes[poolName]);
|
||||
}
|
||||
|
||||
public static GameObject SpawnPoolObject(string poolName, Vector3 position, Quaternion rotation)
|
||||
{
|
||||
if (!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Object spawning can only occur on server");
|
||||
return null;
|
||||
}
|
||||
GameObject go = Pools[PoolNamesToIndexes[poolName]].SpawnObject(position, rotation);
|
||||
using (MemoryStream stream = new MemoryStream(28))
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(go.GetComponent<NetworkedObject>().NetworkId);
|
||||
writer.Write(position.x);
|
||||
writer.Write(position.y);
|
||||
writer.Write(position.z);
|
||||
writer.Write(rotation.eulerAngles.x);
|
||||
writer.Write(rotation.eulerAngles.y);
|
||||
writer.Write(rotation.eulerAngles.z);
|
||||
}
|
||||
NetworkingManager.singleton.Send("MLAPI_SPAWN_POOL_OBJECT", "MLAPI_INTERNAL", stream.GetBuffer());
|
||||
}
|
||||
return go;
|
||||
}
|
||||
|
||||
public static void DestroyPoolObject(NetworkedObject netObject)
|
||||
{
|
||||
if (!NetworkingManager.singleton.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Objects can only be destroyed on the server");
|
||||
return;
|
||||
}
|
||||
netObject.gameObject.SetActive(false);
|
||||
using (MemoryStream stream = new MemoryStream(4))
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(netObject.NetworkId);
|
||||
}
|
||||
NetworkingManager.singleton.Send("MLAPI_DESTROY_POOL_OBJECT", "MLAPI_INTERNAL", stream.GetBuffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,202 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MLAPI.NetworkingManagerComponents
|
||||
{
|
||||
internal static class SpawnManager
|
||||
{
|
||||
internal static Dictionary<uint, NetworkedObject> spawnedObjects;
|
||||
internal static Stack<uint> releasedNetworkObjectIds;
|
||||
private static uint networkObjectIdCounter;
|
||||
internal static uint GetNetworkObjectId()
|
||||
{
|
||||
if (releasedNetworkObjectIds.Count > 0)
|
||||
{
|
||||
return releasedNetworkObjectIds.Pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
networkObjectIdCounter++;
|
||||
return networkObjectIdCounter;
|
||||
}
|
||||
}
|
||||
|
||||
private static NetworkingManager netManager
|
||||
{
|
||||
get
|
||||
{
|
||||
return NetworkingManager.singleton;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void RemoveOwnership(uint netId)
|
||||
{
|
||||
NetworkedObject netObject = SpawnManager.spawnedObjects[netId];
|
||||
NetworkingManager.singleton.connectedClients[netObject.OwnerClientId].OwnedObjects.RemoveAll(x => x.NetworkId == netId);
|
||||
netObject.OwnerClientId = -2;
|
||||
using (MemoryStream stream = new MemoryStream(8))
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(netId);
|
||||
writer.Write(-2);
|
||||
}
|
||||
netManager.Send("MLAPI_CHANGE_OWNER", "MLAPI_INTERNAL", stream.GetBuffer());
|
||||
}
|
||||
}
|
||||
|
||||
internal static void ChangeOwnership(uint netId, int clientId)
|
||||
{
|
||||
NetworkedObject netObject = SpawnManager.spawnedObjects[netId];
|
||||
NetworkingManager.singleton.connectedClients[netObject.OwnerClientId].OwnedObjects.RemoveAll(x => x.NetworkId == netId);
|
||||
NetworkingManager.singleton.connectedClients[clientId].OwnedObjects.Add(netObject);
|
||||
netObject.OwnerClientId = clientId;
|
||||
using (MemoryStream stream = new MemoryStream(8))
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(netId);
|
||||
writer.Write(clientId);
|
||||
}
|
||||
netManager.Send("MLAPI_CHANGE_OWNER", "MLAPI_INTERNAL", stream.GetBuffer());
|
||||
}
|
||||
}
|
||||
|
||||
internal static GameObject SpawnObject(int spawnablePrefabIndex, uint networkId, int ownerId)
|
||||
{
|
||||
GameObject go = MonoBehaviour.Instantiate(netManager.SpawnablePrefabs[spawnablePrefabIndex]);
|
||||
NetworkedObject netObject = go.GetComponent<NetworkedObject>();
|
||||
if (netObject == null)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Please add a NetworkedObject component to the root of all spawnable objects");
|
||||
netObject = go.AddComponent<NetworkedObject>();
|
||||
}
|
||||
netObject.SpawnablePrefabIndex = spawnablePrefabIndex;
|
||||
if (netManager.isServer)
|
||||
{
|
||||
netObject.NetworkId = GetNetworkObjectId();
|
||||
}
|
||||
else
|
||||
{
|
||||
netObject.NetworkId = networkId;
|
||||
}
|
||||
netObject.OwnerClientId = ownerId;
|
||||
|
||||
spawnedObjects.Add(netObject.NetworkId, netObject);
|
||||
netObject.InvokeBehaviourNetworkSpawn();
|
||||
return go;
|
||||
}
|
||||
|
||||
internal static GameObject SpawnPlayerObject(int clientId, uint networkId)
|
||||
{
|
||||
GameObject go = MonoBehaviour.Instantiate(netManager.DefaultPlayerPrefab);
|
||||
NetworkedObject netObject = go.GetComponent<NetworkedObject>();
|
||||
if (netObject == null)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Please add a NetworkedObject component to the root of the player prefab");
|
||||
netObject = go.AddComponent<NetworkedObject>();
|
||||
}
|
||||
netObject.OwnerClientId = clientId;
|
||||
if (NetworkingManager.singleton.isServer)
|
||||
{
|
||||
netObject.NetworkId = GetNetworkObjectId();
|
||||
}
|
||||
else
|
||||
{
|
||||
netObject.NetworkId = networkId;
|
||||
}
|
||||
netObject.isPlayerObject = true;
|
||||
netManager.connectedClients[clientId].PlayerObject = go;
|
||||
spawnedObjects.Add(netObject.NetworkId, netObject);
|
||||
netObject.InvokeBehaviourNetworkSpawn();
|
||||
return go;
|
||||
}
|
||||
|
||||
internal static void OnDestroyObject(uint networkId, bool destroyGameObject)
|
||||
{
|
||||
if (!spawnedObjects.ContainsKey(networkId) || (netManager != null && !netManager.NetworkConfig.HandleObjectSpawning))
|
||||
return;
|
||||
if (spawnedObjects[networkId].OwnerClientId > -2 && !spawnedObjects[networkId].isPlayerObject)
|
||||
{
|
||||
//Someone owns it.
|
||||
NetworkingManager.singleton.connectedClients[spawnedObjects[networkId].OwnerClientId].OwnedObjects.RemoveAll(x => x.NetworkId == networkId);
|
||||
}
|
||||
GameObject go = spawnedObjects[networkId].gameObject;
|
||||
if (netManager != null && netManager.isServer)
|
||||
{
|
||||
releasedNetworkObjectIds.Push(networkId);
|
||||
if (spawnedObjects[networkId] != null && !spawnedObjects[networkId].ServerOnly)
|
||||
{
|
||||
using (MemoryStream stream = new MemoryStream(4))
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(networkId);
|
||||
}
|
||||
//If we are host, send to everyone except ourselves. Otherwise, send to all
|
||||
if (netManager != null && netManager.isHost)
|
||||
netManager.Send("MLAPI_DESTROY_OBJECT", "MLAPI_INTERNAL", stream.GetBuffer(), -1);
|
||||
else
|
||||
netManager.Send("MLAPI_DESTROY_OBJECT", "MLAPI_INTERNAL", stream.GetBuffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (destroyGameObject && go != null)
|
||||
MonoBehaviour.Destroy(go);
|
||||
spawnedObjects.Remove(networkId);
|
||||
}
|
||||
|
||||
internal static void OnSpawnObject(NetworkedObject netObject, int? clientOwnerId = null)
|
||||
{
|
||||
if (netObject.isSpawned)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Object already spawned");
|
||||
return;
|
||||
}
|
||||
else if (!netManager.isServer)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Only server can spawn objects");
|
||||
return;
|
||||
}
|
||||
else if (netObject.SpawnablePrefabIndex == -1)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Invalid prefab index");
|
||||
return;
|
||||
}
|
||||
else if (netObject.ServerOnly)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: Server only objects does not have to be spawned");
|
||||
return;
|
||||
}
|
||||
else if (netManager.NetworkConfig.HandleObjectSpawning)
|
||||
{
|
||||
Debug.LogWarning("MLAPI: NetworkingConfiguration is set to not handle object spawning");
|
||||
return;
|
||||
}
|
||||
uint netId = GetNetworkObjectId();
|
||||
spawnedObjects.Add(netId, netObject);
|
||||
netObject.isSpawned = true;
|
||||
if (clientOwnerId != null)
|
||||
{
|
||||
netObject.OwnerClientId = clientOwnerId.Value;
|
||||
NetworkingManager.singleton.connectedClients[clientOwnerId.Value].OwnedObjects.Add(netObject);
|
||||
}
|
||||
using (MemoryStream stream = new MemoryStream(13))
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(false);
|
||||
writer.Write(netObject.NetworkId);
|
||||
writer.Write(netObject.OwnerClientId);
|
||||
writer.Write(netObject.SpawnablePrefabIndex);
|
||||
}
|
||||
//If we are host, send to everyone except ourselves. Otherwise, send to all
|
||||
if (netManager.isHost)
|
||||
netManager.Send("MLAPI_ADD_OBJECT", "MLAPI_INTERNAL", stream.GetBuffer(), -1);
|
||||
else
|
||||
netManager.Send("MLAPI_ADD_OBJECT", "MLAPI_INTERNAL", stream.GetBuffer());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +1,15 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MLAPI")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyDescription("Game networking stack")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MLAPI")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyCopyright("Copyright © Albin Corén 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
4
MLAPI/packages.config
Normal file
4
MLAPI/packages.config
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="IntX" version="1.0.1.0" targetFramework="net35" />
|
||||
</packages>
|
219
Protocol.md
Normal file
219
Protocol.md
Normal file
@ -0,0 +1,219 @@
|
||||
# MLAPI Protocol
|
||||
#### NOTE
|
||||
_This protocol specification is TEMPORARY, it's due to change and is just here to give you an aproximate idea of how the protocol works_
|
||||
|
||||
The MLAPI protocol is layered. The layers can be seen below.
|
||||
|
||||
The first layer is the UDP IP layer. Ontop of the UDP layer, the Unity Network Transport layer is built. And just after that, the MLAPI's protocol starts to appear. The MLAPI has two protocol stages. The first stage is the generic MLAPI message protocol. This is the protocol all messages use that is sent by the user or the MLAPI library.
|
||||
|
||||
The structure can be seen below, note that all messages use little endian format.
|
||||
|
||||
## MLAPI Generic Message Format
|
||||
The first two bytes define what message type the message is. This message type is represented as a unsigned int16. The first 32 values are reserved for MLAPI messages. As of version 0.1.7, 10 messages are used. The rest of the message types are reserved for use by the user. That means the user can define ((2^16)-32)=65504 different messageTypes.
|
||||
|
||||
The next byte defines if the message is "targeted", see the targeted section on the wiki for more information. The byte is treated as a bool.
|
||||
|
||||
**If** the message is targeted (the previous byte was 1)
|
||||
|
||||
The next 4 bytes define the target networkId, a unsigned int32.
|
||||
|
||||
The next 2 bytes define the networkBehaviour orderId from the root networkObject root. That is, the first networkBehaviour under the networkObject we target (defined by previous 4 bytes) would be a 0, the second one would be a 1 and so on.
|
||||
|
||||
**Endif**
|
||||
|
||||
The next byte represents wheter or nor the message is a passthrough message, see the passthrough section on the wiki for more information. If the byte is 1, it's true, if it's 0 it's false.
|
||||
|
||||
**If** the message is a passthrough message (the previous byte was 1)
|
||||
|
||||
The next 4 bytes is a unsigned int32 specifying the clientId this message targted at.
|
||||
|
||||
**Endif**
|
||||
|
||||
The next two bytes is a unsigned int16 representing the size of the message payload (next field). If the channel this message is sent on is an encrypted channel, this will be the size of the encrypted payload.
|
||||
|
||||
The last field is the message payload. It has the size specified in the previous field. This is where the next layer sits. This is the messageData. If it's a user messageType, this is the data you send with your message. Otherwise, see the next section for the MLAPI internal message formats
|
||||
|
||||
|
||||
## MLAPI Internal Messages
|
||||
|
||||
### MLAPI_CONNECTION_REQUEST (MessageType 0)
|
||||
This message type is sent Client to Server. It's purpose is to ask the Server to join by providing information that help the server decide. This is the first message of the MLAPI Handshake
|
||||
|
||||
The first 32 bytes is a SHA256 hash of certain fields in the NetworkConfig.
|
||||
|
||||
**If** encryption is turned on
|
||||
|
||||
The next two bytes represents a unsigned int16 specifying the size of the public diffie hellman key.
|
||||
|
||||
The next bytes has the size specified above and contains the diffie hellman public key of the client.
|
||||
|
||||
**Endif**
|
||||
|
||||
**If** conectionApproval is turned on
|
||||
|
||||
The next two bytes represents a unsigned int16 specifying the size of the connectionData.
|
||||
|
||||
The next bytes has the size specified above and contains the connectionData.
|
||||
|
||||
**Endif**
|
||||
|
||||
### MLAPI_CONNECTION_APPROVED (MessageType 1)
|
||||
This message is sent Server to Client, it's purpose is to notify Client's that their request has been approved and they are now fully joined. This is the last handshake message. (The request being MessageType 0)
|
||||
|
||||
The first two bytes represents a unsigned int32 containing the clientId the server has assigned to the recepient.
|
||||
|
||||
**If** scene management is enabled
|
||||
|
||||
The next 4 bytes represents a unsigned int32 containing the sceneIndex the server is currently using.
|
||||
|
||||
**Endif**
|
||||
|
||||
**If** encryption is enabled
|
||||
|
||||
The next two bytes represents a unsigned int16 specifying the size of the next field.
|
||||
|
||||
The next bytes have the size of the previous field and represents the diffie hellman public key.
|
||||
|
||||
**If** sign keyexchange is enabled
|
||||
|
||||
The next two bytes represents a unsigned int16 specifying the size of the next field.
|
||||
|
||||
The next bytes have the size of the previous field and contains a RSA signature of a SHA512 hash of the diffie hellman public key.
|
||||
|
||||
**Endif**
|
||||
|
||||
**Endif**
|
||||
|
||||
The next 4 bytes represents a single precision floating point value containing the current networkTime.
|
||||
|
||||
The next 4 bytes represents a signed int32 and contains a network timestamp generated by the NetworkTransport.
|
||||
|
||||
The next 4 bytes represents a signed int32 and contains the number of connected clients.
|
||||
|
||||
The next (4 * previousField) bytes is a sequence of unsigned int32 containing the clientId of a client.
|
||||
|
||||
**If** handle object spawning is turned on
|
||||
|
||||
The next 4 bytes represents a signed int32 containing the amount of networkedObjects is spawned.
|
||||
|
||||
The next (39 * previousField) represents information about each networkedObject. That is, each NetworkedObject has 39 bytes sent about it. A NetworkedField structure looks like this:
|
||||
|
||||
First byte specifies if the object is a playerObject. If the byte is 1, it's true, if it's 0, it's false
|
||||
|
||||
The next 4 bytes is a unsigned int32 containing the networkId of the object
|
||||
|
||||
The next 4 bytes is a unsigned int32 containing the ownerId of the object
|
||||
|
||||
The next 4 bytes is a signed int32 containing the networkedPrefabId to create the object from
|
||||
|
||||
The next byte is a boolean specifying if the object is active in the hierarchy
|
||||
|
||||
The next byte is a boolean specifying if the object is a sceneObject
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the x position of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the y position of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the z position of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the x rotation of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the y rotation of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the z rotation of the object
|
||||
|
||||
**Endif**
|
||||
|
||||
### MLAPI_ADD_OBJECT (MessageType 2)
|
||||
Sent server to client
|
||||
|
||||
**If** handle object spawning
|
||||
|
||||
The first byte is a boolean, represents if it's a player object or not
|
||||
|
||||
The next 4 bytes is a unsigned int32 representing the networkId
|
||||
|
||||
The next 4 bytes is a unsigned int32 representing the ownerId
|
||||
|
||||
The next 4 bytes is signed int32 represents the prefabId
|
||||
|
||||
The next byte is a bool representing if it's a sceneObject
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the x position of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the y position of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the z position of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the x rotation of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the y rotation of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the z rotation of the object
|
||||
|
||||
**Else**
|
||||
|
||||
The first 4 bytes represents a unsigned int32 containing the ownerId
|
||||
|
||||
**Endif**
|
||||
|
||||
### MLAPI_CLIENT_DISCONNECT (MessageType 3)
|
||||
Sent server to client
|
||||
|
||||
The first 4 bytes is a unsigned int32 containing the clientId
|
||||
|
||||
### MLAPI_DESTROY_OBJECT (MessageType 4)
|
||||
Server to client
|
||||
|
||||
The first 4 bytes is a unsigned int32 containing the netId
|
||||
|
||||
### MLAPI_SWITCH_SCENE (MessageType 5)
|
||||
Server to client
|
||||
|
||||
The first 4 bytes is a unsigned int32 containing the sceneId
|
||||
|
||||
|
||||
### MLAPI_SPAWN_POOL_OBJECT (MessageType 6)
|
||||
Server to client
|
||||
|
||||
The first 4 bytes is a unsigned int32 containing the netId
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the x position of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the y position of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the z position of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the x rotation of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the y rotation of the object
|
||||
|
||||
The next 4 bytes is a single precision floating point value containing the z rotation of the object
|
||||
|
||||
### MLAPI_DESTROY_POOL_OBJECT (MessageType 7)
|
||||
Server to client
|
||||
|
||||
The first 4 bytes is a unsigned int32 containing the netId
|
||||
|
||||
### MLAPI_CHANGE_OWNER (MessageType 8)
|
||||
Server to client
|
||||
|
||||
The first 4 bytes is a unsigned int32 containing the netId
|
||||
|
||||
The first 4 bytes is a unsigned int32 containing the ownerClientId
|
||||
|
||||
### MLAPI_SYNC_VAR_UPDATE (MessageType 9)
|
||||
Server to client
|
||||
|
||||
The first byte represents the amount of dirty fields
|
||||
|
||||
The next 4 bytes is a unsigned int32 containing the netId
|
||||
|
||||
The next 2 bytes is a unsigned int16 containing the order of the netBehaviour
|
||||
|
||||
//HERE IS THE SYNCVAR DATA. NOTHING TO OPTIMIZE
|
||||
|
||||
### MLAPI_ADD_OBJECTS (MessageType 10)
|
||||
Server to client
|
||||
|
||||
Same as ADD_OBJECT, but contains two bytes (unsigned int16 specifying the amount of objects, then repeated ADD_OBJECT patterns)
|
30
README.md
30
README.md
@ -1,11 +1,17 @@
|
||||

|
||||

|
||||
|
||||
MLAPI (Mid level API) is a framework that hopefully simplifies building networked games in Unity. It is built on the LLAPI and is similar to the HLAPI in many ways. It does not however integrate into the compiler and it's meant to offer much greater flexibility than the HLAPI while keeping some of it's simplicity. It offers greater performance over the HLAPI.
|
||||
### Documentation
|
||||
To get started, check the [Wiki](https://github.com/TwoTenPvP/MLAPI/wiki).
|
||||
This is also where most documentation lies.
|
||||
|
||||
There is also a autogenerated Sandcastle [API reference](https://twotenpvp.github.io/MLAPI/docs/index.html).
|
||||
|
||||
### Requirements
|
||||
* Unity 2017 or newer
|
||||
* .NET 4.6 or .NET 3.5 with .NET 2.0 non subset [Issue](https://github.com/TwoTenPvP/MLAPI/issues/43)
|
||||
|
||||
## Features
|
||||
## Feature highlights
|
||||
* Host support (Client hosts the server)
|
||||
* Object and player spawning \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/Object-Spawning)\]
|
||||
* Connection approval \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/Connection-Approval)\]
|
||||
@ -14,6 +20,7 @@ MLAPI (Mid level API) is a framework that hopefully simplifies building networke
|
||||
* ProtocolVersion to allow making different versions not talk to each other.
|
||||
* NetworkedBehaviours does not have to be on the root, it's simply just a class that implements the send methods etc.
|
||||
* Custom tickrate
|
||||
* Synced network time
|
||||
* Supports separate Unity projects crosstalking
|
||||
* Passthrough messages \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/Passthrough-messages)\]
|
||||
* Scene Management \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/Scene-Management)\]
|
||||
@ -21,24 +28,23 @@ MLAPI (Mid level API) is a framework that hopefully simplifies building networke
|
||||
* NetworkTransform replacement \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/NetworkedTransform)\]
|
||||
* Targeted messages \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/Targeted-Messages)\]
|
||||
* Port of NetworkedAnimator \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/NetworkedAnimator)\]
|
||||
* Networked NavMeshAgent \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/NetworkedNavMeshAgent)\]
|
||||
* Networked Object Pooling \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/Networked-Object-Pooling)\]
|
||||
* Synced Vars \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/SyncedVars)\]
|
||||
|
||||
|
||||
## Planned features
|
||||
* Area of interest
|
||||
* Encrypted messages / full encryption for all messages. Diffie Hellman key exchange with the option to sign the transaction using RSA.
|
||||
* Serializer (both for the library to speed up and to allow structs to be sent easily)
|
||||
* Message compression
|
||||
* Targeted Synced Vars \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/SyncedVars#target)\]
|
||||
* Encryption \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/Message-Encryption)\]
|
||||
* Super efficient BitWriter & BitReader \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/BitWriter-&-BitReader)\]
|
||||
* Command & Rpc system like HLAPI to allow for quick transfer from HLAPI to MLAPI \[[Wiki page](https://github.com/TwoTenPvP/MLAPI/wiki/Attribute-Message-System)\]
|
||||
|
||||
## Example
|
||||
[Example project](https://github.com/TwoTenPvP/MLAPI-Examples)
|
||||
|
||||
The example project has a much lower priority compared to the library itself. If something doesn't exist in the example nor the wiki. Please open an issue on GitHub.
|
||||
|
||||
## Special thanks
|
||||
Special thanks to [Gabriel Tofvesson](https://github.com/GabrielTofvesson) for writing the BitWriter, BitReader & ECDH implementation
|
||||
|
||||
|
||||
|
||||
## Issues and missing features
|
||||
If there are any issues, bugs or features that are missing. Please open an issue on GitHub!
|
||||
## Testing
|
||||
The project is not extensivley tested. I am however very active on answering and fixing issues. If you are using the library and you find something doesn't work or throws an exception. Open an issue or submit a PR.
|
||||
If there are any issues, bugs or features that are missing. Please open an issue on the GitHub [issues page](https://github.com/TwoTenPvP/MLAPI/issues)
|
||||
|
1
_config.yml
Normal file
1
_config.yml
Normal file
@ -0,0 +1 @@
|
||||
theme: jekyll-theme-slate
|
233
docs/SearchHelp.aspx
Normal file
233
docs/SearchHelp.aspx
Normal file
@ -0,0 +1,233 @@
|
||||
<%@ Page Language="C#" EnableViewState="False" %>
|
||||
|
||||
<script runat="server">
|
||||
//===============================================================================================================
|
||||
// System : Sandcastle Help File Builder
|
||||
// File : SearchHelp.aspx
|
||||
// Author : Eric Woodruff (Eric@EWoodruff.us)
|
||||
// Updated : 05/15/2014
|
||||
// Note : Copyright 2007-2015, Eric Woodruff, All rights reserved
|
||||
// Compiler: Microsoft C#
|
||||
//
|
||||
// This file contains the code used to search for keywords within the help topics using the full-text index
|
||||
// files created by the help file builder.
|
||||
//
|
||||
// This code is published under the Microsoft Public License (Ms-PL). A copy of the license should be
|
||||
// distributed with the code. It can also be found at the project website: https://GitHub.com/EWSoftware/SHFB. This
|
||||
// notice, the author's name, and all copyright notices must remain intact in all applications, documentation,
|
||||
// and source files.
|
||||
//
|
||||
// Date Who Comments
|
||||
// ==============================================================================================================
|
||||
// 06/24/2007 EFW Created the code
|
||||
// 02/17/2012 EFW Switched to JSON serialization to support websites that use something other than ASP.NET
|
||||
// such as PHP.
|
||||
// 05/15/2014 EFW Updated for use with the lightweight website presentation styles
|
||||
//===============================================================================================================
|
||||
|
||||
/// <summary>
|
||||
/// This class is used to track the results and their rankings
|
||||
/// </summary>
|
||||
private class Ranking
|
||||
{
|
||||
public string Filename, PageTitle;
|
||||
public int Rank;
|
||||
|
||||
public Ranking(string file, string title, int rank)
|
||||
{
|
||||
Filename = file;
|
||||
PageTitle = title;
|
||||
Rank = rank;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Render the search results
|
||||
/// </summary>
|
||||
/// <param name="writer">The writer to which the results are written</param>
|
||||
protected override void Render(HtmlTextWriter writer)
|
||||
{
|
||||
JavaScriptSerializer jss = new JavaScriptSerializer();
|
||||
string searchText, ftiFile;
|
||||
char letter;
|
||||
bool sortByTitle = false;
|
||||
|
||||
jss.MaxJsonLength = Int32.MaxValue;
|
||||
|
||||
// The keywords for which to search should be passed in the query string
|
||||
searchText = this.Request.QueryString["Keywords"];
|
||||
|
||||
if(String.IsNullOrEmpty(searchText))
|
||||
{
|
||||
writer.Write("<strong>Nothing found</strong>");
|
||||
return;
|
||||
}
|
||||
|
||||
// An optional SortByTitle option can also be specified
|
||||
if(this.Request.QueryString["SortByTitle"] != null)
|
||||
sortByTitle = Convert.ToBoolean(this.Request.QueryString["SortByTitle"]);
|
||||
|
||||
List<string> keywords = this.ParseKeywords(searchText);
|
||||
List<char> letters = new List<char>();
|
||||
List<string> fileList;
|
||||
Dictionary<string, List<long>> ftiWords, wordDictionary = new Dictionary<string,List<long>>();
|
||||
|
||||
// Load the file index
|
||||
using(StreamReader sr = new StreamReader(Server.MapPath("fti/FTI_Files.json")))
|
||||
{
|
||||
fileList = jss.Deserialize<List<string>>(sr.ReadToEnd());
|
||||
}
|
||||
|
||||
// Load the required word index files
|
||||
foreach(string word in keywords)
|
||||
{
|
||||
letter = word[0];
|
||||
|
||||
if(!letters.Contains(letter))
|
||||
{
|
||||
letters.Add(letter);
|
||||
ftiFile = Server.MapPath(String.Format(CultureInfo.InvariantCulture, "fti/FTI_{0}.json", (int)letter));
|
||||
|
||||
if(File.Exists(ftiFile))
|
||||
{
|
||||
using(StreamReader sr = new StreamReader(ftiFile))
|
||||
{
|
||||
ftiWords = jss.Deserialize<Dictionary<string, List<long>>>(sr.ReadToEnd());
|
||||
}
|
||||
|
||||
foreach(string ftiWord in ftiWords.Keys)
|
||||
wordDictionary.Add(ftiWord, ftiWords[ftiWord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Perform the search and return the results as a block of HTML
|
||||
writer.Write(this.Search(keywords, fileList, wordDictionary, sortByTitle));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Split the search text up into keywords
|
||||
/// </summary>
|
||||
/// <param name="keywords">The keywords to parse</param>
|
||||
/// <returns>A list containing the words for which to search</returns>
|
||||
private List<string> ParseKeywords(string keywords)
|
||||
{
|
||||
List<string> keywordList = new List<string>();
|
||||
string checkWord;
|
||||
string[] words = Regex.Split(keywords, @"\W+");
|
||||
|
||||
foreach(string word in words)
|
||||
{
|
||||
checkWord = word.ToLower(CultureInfo.InvariantCulture);
|
||||
|
||||
if(checkWord.Length > 2 && !Char.IsDigit(checkWord[0]) && !keywordList.Contains(checkWord))
|
||||
keywordList.Add(checkWord);
|
||||
}
|
||||
|
||||
return keywordList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Search for the specified keywords and return the results as a block of HTML
|
||||
/// </summary>
|
||||
/// <param name="keywords">The keywords for which to search</param>
|
||||
/// <param name="fileInfo">The file list</param>
|
||||
/// <param name="wordDictionary">The dictionary used to find the words</param>
|
||||
/// <param name="sortByTitle">True to sort by title, false to sort by ranking</param>
|
||||
/// <returns>A block of HTML representing the search results</returns>
|
||||
private string Search(List<string> keywords, List<string> fileInfo,
|
||||
Dictionary<string, List<long>> wordDictionary, bool sortByTitle)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(10240);
|
||||
Dictionary<string, List<long>> matches = new Dictionary<string, List<long>>();
|
||||
List<long> occurrences;
|
||||
List<int> matchingFileIndices = new List<int>(), occurrenceIndices = new List<int>();
|
||||
List<Ranking> rankings = new List<Ranking>();
|
||||
|
||||
string filename, title;
|
||||
string[] fileIndex;
|
||||
bool isFirst = true;
|
||||
int idx, wordCount, matchCount;
|
||||
|
||||
foreach(string word in keywords)
|
||||
{
|
||||
if(!wordDictionary.TryGetValue(word, out occurrences))
|
||||
return "<strong>Nothing found</strong>";
|
||||
|
||||
matches.Add(word, occurrences);
|
||||
occurrenceIndices.Clear();
|
||||
|
||||
// Get a list of the file indices for this match
|
||||
foreach(long entry in occurrences)
|
||||
occurrenceIndices.Add((int)(entry >> 16));
|
||||
|
||||
if(isFirst)
|
||||
{
|
||||
isFirst = false;
|
||||
matchingFileIndices.AddRange(occurrenceIndices);
|
||||
}
|
||||
else
|
||||
{
|
||||
// After the first match, remove files that do not appear for
|
||||
// all found keywords.
|
||||
for(idx = 0; idx < matchingFileIndices.Count; idx++)
|
||||
if(!occurrenceIndices.Contains(matchingFileIndices[idx]))
|
||||
{
|
||||
matchingFileIndices.RemoveAt(idx);
|
||||
idx--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(matchingFileIndices.Count == 0)
|
||||
return "<strong>Nothing found</strong>";
|
||||
|
||||
// Rank the files based on the number of times the words occurs
|
||||
foreach(int index in matchingFileIndices)
|
||||
{
|
||||
// Split out the title, filename, and word count
|
||||
fileIndex = fileInfo[index].Split('\x0');
|
||||
|
||||
title = fileIndex[0];
|
||||
filename = fileIndex[1];
|
||||
wordCount = Convert.ToInt32(fileIndex[2]);
|
||||
matchCount = 0;
|
||||
|
||||
foreach(string word in keywords)
|
||||
{
|
||||
occurrences = matches[word];
|
||||
|
||||
foreach(long entry in occurrences)
|
||||
if((int)(entry >> 16) == index)
|
||||
matchCount += (int)(entry & 0xFFFF);
|
||||
}
|
||||
|
||||
rankings.Add(new Ranking(filename, title, matchCount * 1000 / wordCount));
|
||||
|
||||
if(rankings.Count > 99)
|
||||
break;
|
||||
}
|
||||
|
||||
// Sort by rank in descending order or by page title in ascending order
|
||||
rankings.Sort(delegate (Ranking x, Ranking y)
|
||||
{
|
||||
if(!sortByTitle)
|
||||
return y.Rank - x.Rank;
|
||||
|
||||
return x.PageTitle.CompareTo(y.PageTitle);
|
||||
});
|
||||
|
||||
// Format the file list and return the results
|
||||
sb.Append("<ol>");
|
||||
|
||||
foreach(Ranking r in rankings)
|
||||
sb.AppendFormat("<li><a href=\"{0}\" target=\"_blank\">{1}</a></li>", r.Filename, r.PageTitle);
|
||||
|
||||
sb.Append("</ol>");
|
||||
|
||||
if(rankings.Count < matchingFileIndices.Count)
|
||||
sb.AppendFormat("<p>Omitted {0} more results</p>", matchingFileIndices.Count - rankings.Count);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
</script>
|
173
docs/SearchHelp.inc.php
Normal file
173
docs/SearchHelp.inc.php
Normal file
@ -0,0 +1,173 @@
|
||||
<?
|
||||
// Contributed to the Sandcastle Help File Builder project by Thomas Levesque
|
||||
|
||||
class Ranking
|
||||
{
|
||||
public $filename;
|
||||
public $pageTitle;
|
||||
public $rank;
|
||||
|
||||
function __construct($file, $title, $rank)
|
||||
{
|
||||
$this->filename = $file;
|
||||
$this->pageTitle = $title;
|
||||
$this->rank = $rank;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Split the search text up into keywords
|
||||
/// </summary>
|
||||
/// <param name="keywords">The keywords to parse</param>
|
||||
/// <returns>A list containing the words for which to search</returns>
|
||||
function ParseKeywords($keywords)
|
||||
{
|
||||
$keywordList = array();
|
||||
$words = preg_split("/[^\w]+/", $keywords);
|
||||
|
||||
foreach($words as $word)
|
||||
{
|
||||
$checkWord = strtolower($word);
|
||||
$first = substr($checkWord, 0, 1);
|
||||
if(strlen($checkWord) > 2 && !ctype_digit($first) && !in_array($checkWord, $keywordList))
|
||||
{
|
||||
array_push($keywordList, $checkWord);
|
||||
}
|
||||
}
|
||||
|
||||
return $keywordList;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Search for the specified keywords and return the results as a block of
|
||||
/// HTML.
|
||||
/// </summary>
|
||||
/// <param name="keywords">The keywords for which to search</param>
|
||||
/// <param name="fileInfo">The file list</param>
|
||||
/// <param name="wordDictionary">The dictionary used to find the words</param>
|
||||
/// <param name="sortByTitle">True to sort by title, false to sort by
|
||||
/// ranking</param>
|
||||
/// <returns>A block of HTML representing the search results.</returns>
|
||||
function Search($keywords, $fileInfo, $wordDictionary, $sortByTitle)
|
||||
{
|
||||
$sb = "<ol>";
|
||||
$matches = array();
|
||||
$matchingFileIndices = array();
|
||||
$rankings = array();
|
||||
|
||||
$isFirst = true;
|
||||
|
||||
foreach($keywords as $word)
|
||||
{
|
||||
if (!array_key_exists($word, $wordDictionary))
|
||||
{
|
||||
return "<strong>Nothing found</strong>";
|
||||
}
|
||||
$occurrences = $wordDictionary[$word];
|
||||
|
||||
$matches[$word] = $occurrences;
|
||||
$occurrenceIndices = array();
|
||||
|
||||
// Get a list of the file indices for this match
|
||||
foreach($occurrences as $entry)
|
||||
array_push($occurrenceIndices, ($entry >> 16));
|
||||
|
||||
if($isFirst)
|
||||
{
|
||||
$isFirst = false;
|
||||
foreach($occurrenceIndices as $i)
|
||||
{
|
||||
array_push($matchingFileIndices, $i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// After the first match, remove files that do not appear for
|
||||
// all found keywords.
|
||||
for($idx = 0; $idx < count($matchingFileIndices); $idx++)
|
||||
{
|
||||
if (!in_array($matchingFileIndices[$idx], $occurrenceIndices))
|
||||
{
|
||||
array_splice($matchingFileIndices, $idx, 1);
|
||||
$idx--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(count($matchingFileIndices) == 0)
|
||||
{
|
||||
return "<strong>Nothing found</strong>";
|
||||
}
|
||||
|
||||
// Rank the files based on the number of times the words occurs
|
||||
foreach($matchingFileIndices as $index)
|
||||
{
|
||||
// Split out the title, filename, and word count
|
||||
$fileIndex = explode("\x00", $fileInfo[$index]);
|
||||
|
||||
$title = $fileIndex[0];
|
||||
$filename = $fileIndex[1];
|
||||
$wordCount = intval($fileIndex[2]);
|
||||
$matchCount = 0;
|
||||
|
||||
foreach($keywords as $words)
|
||||
{
|
||||
$occurrences = $matches[$word];
|
||||
|
||||
foreach($occurrences as $entry)
|
||||
{
|
||||
if(($entry >> 16) == $index)
|
||||
$matchCount += $entry & 0xFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
$r = new Ranking($filename, $title, $matchCount * 1000 / $wordCount);
|
||||
array_push($rankings, $r);
|
||||
|
||||
if(count($rankings) > 99)
|
||||
break;
|
||||
}
|
||||
|
||||
// Sort by rank in descending order or by page title in ascending order
|
||||
if($sortByTitle)
|
||||
{
|
||||
usort($rankings, "cmprankbytitle");
|
||||
}
|
||||
else
|
||||
{
|
||||
usort($rankings, "cmprank");
|
||||
}
|
||||
|
||||
// Format the file list and return the results
|
||||
foreach($rankings as $r)
|
||||
{
|
||||
$f = $r->filename;
|
||||
$t = $r->pageTitle;
|
||||
$sb .= "<li><a href=\"$f\" target=\"_blank\">$t</a></li>";
|
||||
}
|
||||
|
||||
$sb .= "</ol";
|
||||
|
||||
if(count($rankings) < count($matchingFileIndices))
|
||||
{
|
||||
$c = count(matchingFileIndices) - count(rankings);
|
||||
$sb .= "<p>Omitted $c more results</p>";
|
||||
}
|
||||
|
||||
return $sb;
|
||||
}
|
||||
|
||||
function cmprank($x, $y)
|
||||
{
|
||||
return $y->rank - $x->rank;
|
||||
}
|
||||
|
||||
function cmprankbytitle($x, $y)
|
||||
{
|
||||
return strcmp($x->pageTitle, $y->pageTitle);
|
||||
}
|
||||
|
||||
?>
|
58
docs/SearchHelp.php
Normal file
58
docs/SearchHelp.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?
|
||||
// Contributed to the Sandcastle Help File Builder project by Thomas Levesque
|
||||
|
||||
include("SearchHelp.inc.php");
|
||||
|
||||
$sortByTitle = false;
|
||||
|
||||
// The keywords for which to search should be passed in the query string
|
||||
$searchText = $_GET["Keywords"];
|
||||
|
||||
if(empty($searchText))
|
||||
{
|
||||
?>
|
||||
<strong>Nothing found</strong>
|
||||
<?
|
||||
return;
|
||||
}
|
||||
|
||||
// An optional SortByTitle option can also be specified
|
||||
if($_GET["SortByTitle"] == "true")
|
||||
$sortByTitle = true;
|
||||
|
||||
$keywords = ParseKeywords($searchText);
|
||||
$letters = array();
|
||||
$wordDictionary = array();
|
||||
|
||||
// Load the file index
|
||||
$json = file_get_contents("fti/FTI_Files.json");
|
||||
$fileList = json_decode($json);
|
||||
|
||||
// Load the required word index files
|
||||
foreach($keywords as $word)
|
||||
{
|
||||
$letter = substr($word, 0, 1);
|
||||
|
||||
if(!in_array($letter, $letters))
|
||||
{
|
||||
array_push($letters, $letter);
|
||||
$ascii = ord($letter);
|
||||
$ftiFile = "fti/FTI_$ascii.json";
|
||||
|
||||
if(file_exists($ftiFile))
|
||||
{
|
||||
$json = file_get_contents($ftiFile);
|
||||
$ftiWords = json_decode($json, true);
|
||||
|
||||
foreach($ftiWords as $ftiWord => $val)
|
||||
{
|
||||
$wordDictionary[$ftiWord] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Perform the search and return the results as a block of HTML
|
||||
$results = Search($keywords, $fileList, $wordDictionary, $sortByTitle);
|
||||
echo $results;
|
||||
?>
|
34
docs/Web.Config
Normal file
34
docs/Web.Config
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
|
||||
<system.web>
|
||||
<customErrors mode="On" defaultRedirect="~/html/GeneralError.htm">
|
||||
<error statusCode="404" redirect="~/html/PageNotFound.htm" />
|
||||
</customErrors>
|
||||
<compilation debug="false">
|
||||
<assemblies>
|
||||
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
<pages>
|
||||
<namespaces>
|
||||
<add namespace="System"/>
|
||||
<add namespace="System.Collections.Generic"/>
|
||||
<add namespace="System.Globalization"/>
|
||||
<add namespace="System.IO"/>
|
||||
<add namespace="System.Text"/>
|
||||
<add namespace="System.Text.RegularExpressions"/>
|
||||
<add namespace="System.Web"/>
|
||||
<add namespace="System.Web.Script.Serialization"/>
|
||||
<add namespace="System.Web.UI"/>
|
||||
<add namespace="System.Xml"/>
|
||||
<add namespace="System.Xml.Serialization" />
|
||||
<add namespace="System.Xml.XPath"/>
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web>
|
||||
<appSettings>
|
||||
<!-- Increase this value if you get an "Operation is not valid due to the current state of the object" error
|
||||
when using the search page. -->
|
||||
<add key="aspnet:MaxJsonDeserializerMembers" value="100000" />
|
||||
</appSettings>
|
||||
</configuration>
|
685
docs/WebKI.xml
Normal file
685
docs/WebKI.xml
Normal file
@ -0,0 +1,685 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<HelpKI>
|
||||
<HelpKINode Title="AesKey field" Url="html/F_MLAPI_Data_NetworkedClient_AesKey.htm" />
|
||||
<HelpKINode Title="AllowPassthroughMessages field" Url="html/F_MLAPI_Data_NetworkConfig_AllowPassthroughMessages.htm" />
|
||||
<HelpKINode Title="animator property" Url="html/P_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_animator.htm" />
|
||||
<HelpKINode Title="AssumeSyncedSends field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_AssumeSyncedSends.htm" />
|
||||
<HelpKINode Title="AvgTimeBetweenPointsMs property" Url="html/P_MLAPI_MonoBehaviours_Core_TrackedObject_AvgTimeBetweenPointsMs.htm" />
|
||||
<HelpKINode Title="BinaryHelpers class">
|
||||
<HelpKINode Title="BinaryHelpers Class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BinaryHelpers.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Binary_BinaryHelpers.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="BinaryHelpers.SwapEndian method" Url="html/Overload_MLAPI_NetworkingManagerComponents_Binary_BinaryHelpers_SwapEndian.htm" />
|
||||
<HelpKINode Title="BinaryIgnore class">
|
||||
<HelpKINode Title="BinaryIgnore Class" Url="html/T_MLAPI_Attributes_BinaryIgnore.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Attributes_BinaryIgnore__ctor.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Attributes_BinaryIgnore.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_Attributes_BinaryIgnore.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="BinaryIgnore.BinaryIgnore constructor" Url="html/M_MLAPI_Attributes_BinaryIgnore__ctor.htm" />
|
||||
<HelpKINode Title="BinarySerializer class">
|
||||
<HelpKINode Title="BinarySerializer Class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="BinarySerializer.ClearCache method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_ClearCache.htm" />
|
||||
<HelpKINode Title="BinarySerializer.Deserialize(Of T) method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_Deserialize__1.htm" />
|
||||
<HelpKINode Title="BinarySerializer.Deserialize<T> method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_Deserialize__1.htm" />
|
||||
<HelpKINode Title="BinarySerializer.Serialize(Of T) method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_Serialize__1.htm" />
|
||||
<HelpKINode Title="BinarySerializer.Serialize<T> method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_Serialize__1.htm" />
|
||||
<HelpKINode Title="BitReader class">
|
||||
<HelpKINode Title="BitReader Class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BitReader.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader__ctor.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Binary_BitReader.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="BitReader.BitReader constructor" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader__ctor.htm" />
|
||||
<HelpKINode Title="BitReader.ReadBits method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadBits.htm" />
|
||||
<HelpKINode Title="BitReader.ReadBool method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadBool.htm" />
|
||||
<HelpKINode Title="BitReader.ReadByte method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadByte.htm" />
|
||||
<HelpKINode Title="BitReader.ReadByteArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadByteArray.htm" />
|
||||
<HelpKINode Title="BitReader.ReadDouble method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadDouble.htm" />
|
||||
<HelpKINode Title="BitReader.ReadDoubleArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadDoubleArray.htm" />
|
||||
<HelpKINode Title="BitReader.ReadFloat method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadFloat.htm" />
|
||||
<HelpKINode Title="BitReader.ReadFloatArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadFloatArray.htm" />
|
||||
<HelpKINode Title="BitReader.ReadInt method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadInt.htm" />
|
||||
<HelpKINode Title="BitReader.ReadIntArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadIntArray.htm" />
|
||||
<HelpKINode Title="BitReader.ReadLong method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadLong.htm" />
|
||||
<HelpKINode Title="BitReader.ReadLongArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadLongArray.htm" />
|
||||
<HelpKINode Title="BitReader.ReadSByte method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadSByte.htm" />
|
||||
<HelpKINode Title="BitReader.ReadSByteArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadSByteArray.htm" />
|
||||
<HelpKINode Title="BitReader.ReadShort method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadShort.htm" />
|
||||
<HelpKINode Title="BitReader.ReadShortArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadShortArray.htm" />
|
||||
<HelpKINode Title="BitReader.ReadString method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadString.htm" />
|
||||
<HelpKINode Title="BitReader.ReadUInt method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUInt.htm" />
|
||||
<HelpKINode Title="BitReader.ReadUIntArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUIntArray.htm" />
|
||||
<HelpKINode Title="BitReader.ReadULong method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadULong.htm" />
|
||||
<HelpKINode Title="BitReader.ReadULongArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadULongArray.htm" />
|
||||
<HelpKINode Title="BitReader.ReadUShort method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUShort.htm" />
|
||||
<HelpKINode Title="BitReader.ReadUShortArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUShortArray.htm" />
|
||||
<HelpKINode Title="BitReader.SkipPadded method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_SkipPadded.htm" />
|
||||
<HelpKINode Title="BitWriter class">
|
||||
<HelpKINode Title="BitWriter Class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BitWriter.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter__ctor.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Binary_BitWriter.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="BitWriter.BitWriter constructor" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter__ctor.htm" />
|
||||
<HelpKINode Title="BitWriter.Dispose method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_Dispose.htm" />
|
||||
<HelpKINode Title="BitWriter.Finalize method" Url="html/Overload_MLAPI_NetworkingManagerComponents_Binary_BitWriter_Finalize.htm" />
|
||||
<HelpKINode Title="BitWriter.GetFinalizeSize method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_GetFinalizeSize.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteAlignBits method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteAlignBits.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteBits method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteBits.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteBool method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteBool.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteByte method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteByte.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteByteArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteByteArray.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteDouble method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteDouble.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteDoubleArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteDoubleArray.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteFloat method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteFloat.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteFloatArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteFloatArray.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteInt method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteInt.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteIntArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteIntArray.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteLong method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteLong.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteLongArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteLongArray.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteSByte method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteSByte.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteSByteArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteSByteArray.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteShort method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteShort.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteShortArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteShortArray.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteString method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteString.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteUInt method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUInt.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteUIntArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUIntArray.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteULong method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteULong.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteULongArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteULongArray.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteUShort method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUShort.htm" />
|
||||
<HelpKINode Title="BitWriter.WriteUShortArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUShortArray.htm" />
|
||||
<HelpKINode Title="ChangeOwnership method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_ChangeOwnership.htm" />
|
||||
<HelpKINode Title="Channel class">
|
||||
<HelpKINode Title="Channel Class" Url="html/T_MLAPI_Data_Channel.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Data_Channel__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_Data_Channel.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Data_Channel.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="Channel.Channel constructor" Url="html/M_MLAPI_Data_Channel__ctor.htm" />
|
||||
<HelpKINode Title="Channel.Encrypted field" Url="html/F_MLAPI_Data_Channel_Encrypted.htm" />
|
||||
<HelpKINode Title="Channel.Name field" Url="html/F_MLAPI_Data_Channel_Name.htm" />
|
||||
<HelpKINode Title="Channel.Type field" Url="html/F_MLAPI_Data_Channel_Type.htm" />
|
||||
<HelpKINode Title="Channels field" Url="html/F_MLAPI_Data_NetworkConfig_Channels.htm" />
|
||||
<HelpKINode Title="ClearCache method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_ClearCache.htm" />
|
||||
<HelpKINode Title="ClientConnectionBufferTimeout field" Url="html/F_MLAPI_Data_NetworkConfig_ClientConnectionBufferTimeout.htm" />
|
||||
<HelpKINode Title="ClientId field" Url="html/F_MLAPI_Data_NetworkedClient_ClientId.htm" />
|
||||
<HelpKINode Title="ClientRpc class">
|
||||
<HelpKINode Title="ClientRpc Class" Url="html/T_MLAPI_Attributes_ClientRpc.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Attributes_ClientRpc__ctor.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Attributes_ClientRpc.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_Attributes_ClientRpc.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="ClientRpc.ClientRpc constructor" Url="html/M_MLAPI_Attributes_ClientRpc__ctor.htm" />
|
||||
<HelpKINode Title="Command class">
|
||||
<HelpKINode Title="Command Class" Url="html/T_MLAPI_Attributes_Command.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Attributes_Command__ctor.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Attributes_Command.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_Attributes_Command.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="Command.Command constructor" Url="html/M_MLAPI_Attributes_Command__ctor.htm" />
|
||||
<HelpKINode Title="CompareConfig method" Url="html/M_MLAPI_Data_NetworkConfig_CompareConfig.htm" />
|
||||
<HelpKINode Title="ConnectAddress field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectAddress.htm" />
|
||||
<HelpKINode Title="ConnectedClients property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_ConnectedClients.htm" />
|
||||
<HelpKINode Title="ConnectionApproval field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectionApproval.htm" />
|
||||
<HelpKINode Title="ConnectionApprovalCallback field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_ConnectionApprovalCallback.htm" />
|
||||
<HelpKINode Title="ConnectionData field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectionData.htm" />
|
||||
<HelpKINode Title="ConnectionId field" Url="html/F_MLAPI_Data_NetId_ConnectionId.htm" />
|
||||
<HelpKINode Title="ConnectPort field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectPort.htm" />
|
||||
<HelpKINode Title="CorrectionDelay field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_CorrectionDelay.htm" />
|
||||
<HelpKINode Title="CreatePool method" Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_CreatePool.htm" />
|
||||
<HelpKINode Title="CryptographyHelper class">
|
||||
<HelpKINode Title="CryptographyHelper Class" Url="html/T_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="CryptographyHelper.Decrypt method" Url="html/M_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper_Decrypt.htm" />
|
||||
<HelpKINode Title="CryptographyHelper.Encrypt method" Url="html/M_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper_Encrypt.htm" />
|
||||
<HelpKINode Title="Decrypt method" Url="html/M_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper_Decrypt.htm" />
|
||||
<HelpKINode Title="DeregisterMessageHandler method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_DeregisterMessageHandler.htm" />
|
||||
<HelpKINode Title="Deserialize(Of T) method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_Deserialize__1.htm" />
|
||||
<HelpKINode Title="Deserialize<T> method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_Deserialize__1.htm" />
|
||||
<HelpKINode Title="DestroyPool method" Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_DestroyPool.htm" />
|
||||
<HelpKINode Title="DestroyPoolObject method" Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_DestroyPoolObject.htm" />
|
||||
<HelpKINode Title="Dispose method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_Dispose.htm" />
|
||||
<HelpKINode Title="DontDestroy field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_DontDestroy.htm" />
|
||||
<HelpKINode Title="DriftCorrectionPercentage field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_DriftCorrectionPercentage.htm" />
|
||||
<HelpKINode Title="EnableEncryption field" Url="html/F_MLAPI_Data_NetworkConfig_EnableEncryption.htm" />
|
||||
<HelpKINode Title="EnableProximity field">
|
||||
<HelpKINode Title="NetworkedAnimator.EnableProximity Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_EnableProximity.htm" />
|
||||
<HelpKINode Title="NetworkedNavMeshAgent.EnableProximity Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_EnableProximity.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.EnableProximity Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_EnableProximity.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="EnableSceneSwitching field" Url="html/F_MLAPI_Data_NetworkConfig_EnableSceneSwitching.htm" />
|
||||
<HelpKINode Title="EnableTimeResync field" Url="html/F_MLAPI_Data_NetworkConfig_EnableTimeResync.htm" />
|
||||
<HelpKINode Title="Encrypt method" Url="html/M_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper_Encrypt.htm" />
|
||||
<HelpKINode Title="Encrypted field" Url="html/F_MLAPI_Data_Channel_Encrypted.htm" />
|
||||
<HelpKINode Title="Equality operator" Url="html/M_MLAPI_Data_NetId_op_Equality.htm" />
|
||||
<HelpKINode Title="Equals method" Url="html/M_MLAPI_Data_NetId_Equals.htm" />
|
||||
<HelpKINode Title="EventTickrate field" Url="html/F_MLAPI_Data_NetworkConfig_EventTickrate.htm" />
|
||||
<HelpKINode Title="Finalize method" Url="html/Overload_MLAPI_NetworkingManagerComponents_Binary_BitWriter_Finalize.htm" />
|
||||
<HelpKINode Title="GetChunkedMessage method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_GetChunkedMessage.htm" />
|
||||
<HelpKINode Title="GetClientId method" Url="html/M_MLAPI_Data_NetId_GetClientId.htm" />
|
||||
<HelpKINode Title="GetConfig method" Url="html/M_MLAPI_Data_NetworkConfig_GetConfig.htm" />
|
||||
<HelpKINode Title="GetFinalizeSize method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_GetFinalizeSize.htm" />
|
||||
<HelpKINode Title="GetHashCode method" Url="html/M_MLAPI_Data_NetId_GetHashCode.htm" />
|
||||
<HelpKINode Title="GetMessageOrdered method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_GetMessageOrdered.htm" />
|
||||
<HelpKINode Title="GetMessageUnordered method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_GetMessageUnordered.htm" />
|
||||
<HelpKINode Title="GetNetworkedObject method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_GetNetworkedObject.htm" />
|
||||
<HelpKINode Title="GetParameterAutoSend method" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_GetParameterAutoSend.htm" />
|
||||
<HelpKINode Title="HandleObjectSpawning field" Url="html/F_MLAPI_Data_NetworkConfig_HandleObjectSpawning.htm" />
|
||||
<HelpKINode Title="HasDuplicates method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_HasDuplicates.htm" />
|
||||
<HelpKINode Title="HasMissingParts method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_HasMissingParts.htm" />
|
||||
<HelpKINode Title="hookMethodName field" Url="html/F_MLAPI_Attributes_SyncedVar_hookMethodName.htm" />
|
||||
<HelpKINode Title="HostId field" Url="html/F_MLAPI_Data_NetId_HostId.htm" />
|
||||
<HelpKINode Title="Inequality operator" Url="html/M_MLAPI_Data_NetId_op_Inequality.htm" />
|
||||
<HelpKINode Title="InterpolatePosition field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_InterpolatePosition.htm" />
|
||||
<HelpKINode Title="InterpolateServer field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_InterpolateServer.htm" />
|
||||
<HelpKINode Title="InvokeClientRpc method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_InvokeClientRpc.htm" />
|
||||
<HelpKINode Title="InvokeCommand method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_InvokeCommand.htm" />
|
||||
<HelpKINode Title="InvokeTargetRpc method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_InvokeTargetRpc.htm" />
|
||||
<HelpKINode Title="isClient property">
|
||||
<HelpKINode Title="NetworkedBehaviour.isClient Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isClient.htm" />
|
||||
<HelpKINode Title="NetworkingManager.isClient Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_isClient.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="IsClientConnected property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_IsClientConnected.htm" />
|
||||
<HelpKINode Title="IsHost method" Url="html/M_MLAPI_Data_NetId_IsHost.htm" />
|
||||
<HelpKINode Title="isHost property">
|
||||
<HelpKINode Title="NetworkedBehaviour.isHost Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isHost.htm" />
|
||||
<HelpKINode Title="NetworkingManager.isHost Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_isHost.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="IsInvalid method" Url="html/M_MLAPI_Data_NetId_IsInvalid.htm" />
|
||||
<HelpKINode Title="isLocalPlayer property">
|
||||
<HelpKINode Title="NetworkedBehaviour.isLocalPlayer Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isLocalPlayer.htm" />
|
||||
<HelpKINode Title="NetworkedObject.isLocalPlayer Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isLocalPlayer.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="IsOrdered method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_IsOrdered.htm" />
|
||||
<HelpKINode Title="isOwner property">
|
||||
<HelpKINode Title="NetworkedBehaviour.isOwner Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isOwner.htm" />
|
||||
<HelpKINode Title="NetworkedObject.isOwner Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isOwner.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="isPlayerObject property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isPlayerObject.htm" />
|
||||
<HelpKINode Title="isPooledObject property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isPooledObject.htm" />
|
||||
<HelpKINode Title="isServer property">
|
||||
<HelpKINode Title="NetworkedBehaviour.isServer Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isServer.htm" />
|
||||
<HelpKINode Title="NetworkingManager.isServer Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_isServer.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="isSpawned property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isSpawned.htm" />
|
||||
<HelpKINode Title="LagCompensationManager class">
|
||||
<HelpKINode Title="LagCompensationManager Class" Url="html/T_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="LagCompensationManager.Simulate method" Url="html/Overload_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager_Simulate.htm" />
|
||||
<HelpKINode Title="LagCompensationManager.SimulationObjects property" Url="html/P_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager_SimulationObjects.htm" />
|
||||
<HelpKINode Title="MaxConnections field" Url="html/F_MLAPI_Data_NetworkConfig_MaxConnections.htm" />
|
||||
<HelpKINode Title="MaxReceiveEventsPerTickRate field" Url="html/F_MLAPI_Data_NetworkConfig_MaxReceiveEventsPerTickRate.htm" />
|
||||
<HelpKINode Title="MessageBufferSize field" Url="html/F_MLAPI_Data_NetworkConfig_MessageBufferSize.htm" />
|
||||
<HelpKINode Title="MessageChunker class">
|
||||
<HelpKINode Title="MessageChunker Class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_MessageChunker.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Binary_MessageChunker.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="MessageChunker.GetChunkedMessage method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_GetChunkedMessage.htm" />
|
||||
<HelpKINode Title="MessageChunker.GetMessageOrdered method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_GetMessageOrdered.htm" />
|
||||
<HelpKINode Title="MessageChunker.GetMessageUnordered method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_GetMessageUnordered.htm" />
|
||||
<HelpKINode Title="MessageChunker.HasDuplicates method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_HasDuplicates.htm" />
|
||||
<HelpKINode Title="MessageChunker.HasMissingParts method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_HasMissingParts.htm" />
|
||||
<HelpKINode Title="MessageChunker.IsOrdered method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_IsOrdered.htm" />
|
||||
<HelpKINode Title="MessageType class">
|
||||
<HelpKINode Title="MessageType Class" Url="html/T_MLAPI_Data_MessageType.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Data_MessageType__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_Data_MessageType.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Data_MessageType.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="MessageType.MessageType constructor" Url="html/M_MLAPI_Data_MessageType__ctor.htm" />
|
||||
<HelpKINode Title="MessageType.Name field" Url="html/F_MLAPI_Data_MessageType_Name.htm" />
|
||||
<HelpKINode Title="MessageType.Passthrough field" Url="html/F_MLAPI_Data_MessageType_Passthrough.htm" />
|
||||
<HelpKINode Title="MessageTypes field" Url="html/F_MLAPI_Data_NetworkConfig_MessageTypes.htm" />
|
||||
<HelpKINode Title="Meta field" Url="html/F_MLAPI_Data_NetId_Meta.htm" />
|
||||
<HelpKINode Title="MinDegrees field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_MinDegrees.htm" />
|
||||
<HelpKINode Title="MinMeters field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_MinMeters.htm" />
|
||||
<HelpKINode Title="MLAPI.Attributes namespace" Url="html/N_MLAPI_Attributes.htm" />
|
||||
<HelpKINode Title="MLAPI.Attributes.BinaryIgnore class" Url="html/T_MLAPI_Attributes_BinaryIgnore.htm" />
|
||||
<HelpKINode Title="MLAPI.Attributes.ClientRpc class" Url="html/T_MLAPI_Attributes_ClientRpc.htm" />
|
||||
<HelpKINode Title="MLAPI.Attributes.Command class" Url="html/T_MLAPI_Attributes_Command.htm" />
|
||||
<HelpKINode Title="MLAPI.Attributes.SyncedVar class" Url="html/T_MLAPI_Attributes_SyncedVar.htm" />
|
||||
<HelpKINode Title="MLAPI.Attributes.TargetRpc class" Url="html/T_MLAPI_Attributes_TargetRpc.htm" />
|
||||
<HelpKINode Title="MLAPI.Data namespace" Url="html/N_MLAPI_Data.htm" />
|
||||
<HelpKINode Title="MLAPI.Data.Channel class" Url="html/T_MLAPI_Data_Channel.htm" />
|
||||
<HelpKINode Title="MLAPI.Data.MessageType class" Url="html/T_MLAPI_Data_MessageType.htm" />
|
||||
<HelpKINode Title="MLAPI.Data.NetId structure" Url="html/T_MLAPI_Data_NetId.htm" />
|
||||
<HelpKINode Title="MLAPI.Data.NetworkConfig class" Url="html/T_MLAPI_Data_NetworkConfig.htm" />
|
||||
<HelpKINode Title="MLAPI.Data.NetworkedClient class" Url="html/T_MLAPI_Data_NetworkedClient.htm" />
|
||||
<HelpKINode Title="MLAPI.Data.NetworkedPrefab class" Url="html/T_MLAPI_Data_NetworkedPrefab.htm" />
|
||||
<HelpKINode Title="MLAPI.Data.TransportHost class" Url="html/T_MLAPI_Data_TransportHost.htm" />
|
||||
<HelpKINode Title="MLAPI.MonoBehaviours.Core namespace" Url="html/N_MLAPI_MonoBehaviours_Core.htm" />
|
||||
<HelpKINode Title="MLAPI.MonoBehaviours.Core.NetworkedBehaviour class" Url="html/T_MLAPI_MonoBehaviours_Core_NetworkedBehaviour.htm" />
|
||||
<HelpKINode Title="MLAPI.MonoBehaviours.Core.NetworkedObject class" Url="html/T_MLAPI_MonoBehaviours_Core_NetworkedObject.htm" />
|
||||
<HelpKINode Title="MLAPI.MonoBehaviours.Core.NetworkingManager class" Url="html/T_MLAPI_MonoBehaviours_Core_NetworkingManager.htm" />
|
||||
<HelpKINode Title="MLAPI.MonoBehaviours.Core.TrackedObject class" Url="html/T_MLAPI_MonoBehaviours_Core_TrackedObject.htm" />
|
||||
<HelpKINode Title="MLAPI.MonoBehaviours.Prototyping namespace" Url="html/N_MLAPI_MonoBehaviours_Prototyping.htm" />
|
||||
<HelpKINode Title="MLAPI.MonoBehaviours.Prototyping.NetworkedAnimator class" Url="html/T_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator.htm" />
|
||||
<HelpKINode Title="MLAPI.MonoBehaviours.Prototyping.NetworkedNavMeshAgent class" Url="html/T_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent.htm" />
|
||||
<HelpKINode Title="MLAPI.MonoBehaviours.Prototyping.NetworkedTransform class" Url="html/T_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Binary namespace" Url="html/N_MLAPI_NetworkingManagerComponents_Binary.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Binary.BinaryHelpers class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BinaryHelpers.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Binary.BinarySerializer class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Binary.BitReader class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BitReader.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Binary.BitWriter class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BitWriter.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Binary.MessageChunker class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_MessageChunker.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Core namespace" Url="html/N_MLAPI_NetworkingManagerComponents_Core.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Core.LagCompensationManager class" Url="html/T_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Core.NetworkPoolManager class" Url="html/T_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Core.NetworkSceneManager class" Url="html/T_MLAPI_NetworkingManagerComponents_Core_NetworkSceneManager.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Cryptography namespace" Url="html/N_MLAPI_NetworkingManagerComponents_Cryptography.htm" />
|
||||
<HelpKINode Title="MLAPI.NetworkingManagerComponents.Cryptography.CryptographyHelper class" Url="html/T_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper.htm" />
|
||||
<HelpKINode Title="MyClientId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_MyClientId.htm" />
|
||||
<HelpKINode Title="Name field">
|
||||
<HelpKINode Title="Channel.Name Field" Url="html/F_MLAPI_Data_Channel_Name.htm" />
|
||||
<HelpKINode Title="MessageType.Name Field" Url="html/F_MLAPI_Data_MessageType_Name.htm" />
|
||||
<HelpKINode Title="TransportHost.Name Field" Url="html/F_MLAPI_Data_TransportHost_Name.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetId structure">
|
||||
<HelpKINode Title="NetId Structure" Url="html/T_MLAPI_Data_NetId.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/Overload_MLAPI_Data_NetId__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_Data_NetId.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Data_NetId.htm" />
|
||||
<HelpKINode Title="operators" Url="html/Operators_T_MLAPI_Data_NetId.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_Data_NetId.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetId.ConnectionId field" Url="html/F_MLAPI_Data_NetId_ConnectionId.htm" />
|
||||
<HelpKINode Title="NetId.Equality operator" Url="html/M_MLAPI_Data_NetId_op_Equality.htm" />
|
||||
<HelpKINode Title="NetId.Equals method" Url="html/M_MLAPI_Data_NetId_Equals.htm" />
|
||||
<HelpKINode Title="NetId.GetClientId method" Url="html/M_MLAPI_Data_NetId_GetClientId.htm" />
|
||||
<HelpKINode Title="NetId.GetHashCode method" Url="html/M_MLAPI_Data_NetId_GetHashCode.htm" />
|
||||
<HelpKINode Title="NetId.HostId field" Url="html/F_MLAPI_Data_NetId_HostId.htm" />
|
||||
<HelpKINode Title="NetId.Inequality operator" Url="html/M_MLAPI_Data_NetId_op_Inequality.htm" />
|
||||
<HelpKINode Title="NetId.IsHost method" Url="html/M_MLAPI_Data_NetId_IsHost.htm" />
|
||||
<HelpKINode Title="NetId.IsInvalid method" Url="html/M_MLAPI_Data_NetId_IsInvalid.htm" />
|
||||
<HelpKINode Title="NetId.Meta field" Url="html/F_MLAPI_Data_NetId_Meta.htm" />
|
||||
<HelpKINode Title="NetId.NetId constructor" Url="html/Overload_MLAPI_Data_NetId__ctor.htm" />
|
||||
<HelpKINode Title="NetId.ServerNetId property" Url="html/P_MLAPI_Data_NetId_ServerNetId.htm" />
|
||||
<HelpKINode Title="NetworkConfig class">
|
||||
<HelpKINode Title="NetworkConfig Class" Url="html/T_MLAPI_Data_NetworkConfig.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Data_NetworkConfig__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_Data_NetworkConfig.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Data_NetworkConfig.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkConfig field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_NetworkConfig.htm" />
|
||||
<HelpKINode Title="NetworkConfig.AllowPassthroughMessages field" Url="html/F_MLAPI_Data_NetworkConfig_AllowPassthroughMessages.htm" />
|
||||
<HelpKINode Title="NetworkConfig.Channels field" Url="html/F_MLAPI_Data_NetworkConfig_Channels.htm" />
|
||||
<HelpKINode Title="NetworkConfig.ClientConnectionBufferTimeout field" Url="html/F_MLAPI_Data_NetworkConfig_ClientConnectionBufferTimeout.htm" />
|
||||
<HelpKINode Title="NetworkConfig.CompareConfig method" Url="html/M_MLAPI_Data_NetworkConfig_CompareConfig.htm" />
|
||||
<HelpKINode Title="NetworkConfig.ConnectAddress field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectAddress.htm" />
|
||||
<HelpKINode Title="NetworkConfig.ConnectionApproval field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectionApproval.htm" />
|
||||
<HelpKINode Title="NetworkConfig.ConnectionData field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectionData.htm" />
|
||||
<HelpKINode Title="NetworkConfig.ConnectPort field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectPort.htm" />
|
||||
<HelpKINode Title="NetworkConfig.EnableEncryption field" Url="html/F_MLAPI_Data_NetworkConfig_EnableEncryption.htm" />
|
||||
<HelpKINode Title="NetworkConfig.EnableSceneSwitching field" Url="html/F_MLAPI_Data_NetworkConfig_EnableSceneSwitching.htm" />
|
||||
<HelpKINode Title="NetworkConfig.EnableTimeResync field" Url="html/F_MLAPI_Data_NetworkConfig_EnableTimeResync.htm" />
|
||||
<HelpKINode Title="NetworkConfig.EventTickrate field" Url="html/F_MLAPI_Data_NetworkConfig_EventTickrate.htm" />
|
||||
<HelpKINode Title="NetworkConfig.GetConfig method" Url="html/M_MLAPI_Data_NetworkConfig_GetConfig.htm" />
|
||||
<HelpKINode Title="NetworkConfig.HandleObjectSpawning field" Url="html/F_MLAPI_Data_NetworkConfig_HandleObjectSpawning.htm" />
|
||||
<HelpKINode Title="NetworkConfig.MaxConnections field" Url="html/F_MLAPI_Data_NetworkConfig_MaxConnections.htm" />
|
||||
<HelpKINode Title="NetworkConfig.MaxReceiveEventsPerTickRate field" Url="html/F_MLAPI_Data_NetworkConfig_MaxReceiveEventsPerTickRate.htm" />
|
||||
<HelpKINode Title="NetworkConfig.MessageBufferSize field" Url="html/F_MLAPI_Data_NetworkConfig_MessageBufferSize.htm" />
|
||||
<HelpKINode Title="NetworkConfig.MessageTypes field" Url="html/F_MLAPI_Data_NetworkConfig_MessageTypes.htm" />
|
||||
<HelpKINode Title="NetworkConfig.NetworkConfig constructor" Url="html/M_MLAPI_Data_NetworkConfig__ctor.htm" />
|
||||
<HelpKINode Title="NetworkConfig.NetworkedPrefabs field" Url="html/F_MLAPI_Data_NetworkConfig_NetworkedPrefabs.htm" />
|
||||
<HelpKINode Title="NetworkConfig.ProtocolVersion field" Url="html/F_MLAPI_Data_NetworkConfig_ProtocolVersion.htm" />
|
||||
<HelpKINode Title="NetworkConfig.ReceiveTickrate field" Url="html/F_MLAPI_Data_NetworkConfig_ReceiveTickrate.htm" />
|
||||
<HelpKINode Title="NetworkConfig.RegisteredScenes field" Url="html/F_MLAPI_Data_NetworkConfig_RegisteredScenes.htm" />
|
||||
<HelpKINode Title="NetworkConfig.RSAPrivateKey field" Url="html/F_MLAPI_Data_NetworkConfig_RSAPrivateKey.htm" />
|
||||
<HelpKINode Title="NetworkConfig.RSAPublicKey field" Url="html/F_MLAPI_Data_NetworkConfig_RSAPublicKey.htm" />
|
||||
<HelpKINode Title="NetworkConfig.SecondsHistory field" Url="html/F_MLAPI_Data_NetworkConfig_SecondsHistory.htm" />
|
||||
<HelpKINode Title="NetworkConfig.SendTickrate field" Url="html/F_MLAPI_Data_NetworkConfig_SendTickrate.htm" />
|
||||
<HelpKINode Title="NetworkConfig.ServerTransports field" Url="html/F_MLAPI_Data_NetworkConfig_ServerTransports.htm" />
|
||||
<HelpKINode Title="NetworkConfig.SignKeyExchange field" Url="html/F_MLAPI_Data_NetworkConfig_SignKeyExchange.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator class">
|
||||
<HelpKINode Title="NetworkedAnimator Class" Url="html/T_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkedAnimator.animator property" Url="html/P_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_animator.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.EnableProximity field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_EnableProximity.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.GetParameterAutoSend method" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_GetParameterAutoSend.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.NetworkedAnimator constructor" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator__ctor.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.NetworkStart method" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_NetworkStart.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.param0 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param0.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.param1 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param1.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.param2 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param2.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.param3 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param3.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.param4 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param4.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.param5 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param5.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.ProximityRange field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_ProximityRange.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.ResetParameterOptions method" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_ResetParameterOptions.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.SetParameterAutoSend method" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_SetParameterAutoSend.htm" />
|
||||
<HelpKINode Title="NetworkedAnimator.SetTrigger method" Url="html/Overload_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_SetTrigger.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour class">
|
||||
<HelpKINode Title="NetworkedBehaviour Class" Url="html/T_MLAPI_MonoBehaviours_Core_NetworkedBehaviour.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Core_NetworkedBehaviour.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Core_NetworkedBehaviour.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Core_NetworkedBehaviour.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkedBehaviour.DeregisterMessageHandler method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_DeregisterMessageHandler.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.GetNetworkedObject method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_GetNetworkedObject.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.InvokeClientRpc method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_InvokeClientRpc.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.InvokeCommand method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_InvokeCommand.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.InvokeTargetRpc method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_InvokeTargetRpc.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.isClient property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isClient.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.isHost property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isHost.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.isLocalPlayer property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isLocalPlayer.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.isOwner property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isOwner.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.isServer property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isServer.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.NetworkedBehaviour constructor" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour__ctor.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.networkedObject property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_networkedObject.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.networkId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_networkId.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.NetworkStart method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_NetworkStart.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.OnGainedOwnership method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_OnGainedOwnership.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.OnLostOwnership method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_OnLostOwnership.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.ownerClientId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_ownerClientId.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.RegisterMessageHandler method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_RegisterMessageHandler.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SendToClient method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClient.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SendToClients method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClients.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SendToClientsTarget method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientsTarget.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SendToClientTarget method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientTarget.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SendToLocalClient method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToLocalClient.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SendToLocalClientTarget method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToLocalClientTarget.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SendToNonLocalClients method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToNonLocalClients.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SendToNonLocalClientsTarget method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToNonLocalClientsTarget.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SendToServer method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToServer.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SendToServerTarget method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToServerTarget.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.SyncVarSyncDelay field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SyncVarSyncDelay.htm" />
|
||||
<HelpKINode Title="NetworkedClient class">
|
||||
<HelpKINode Title="NetworkedClient Class" Url="html/T_MLAPI_Data_NetworkedClient.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Data_NetworkedClient__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_Data_NetworkedClient.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Data_NetworkedClient.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkedClient.AesKey field" Url="html/F_MLAPI_Data_NetworkedClient_AesKey.htm" />
|
||||
<HelpKINode Title="NetworkedClient.ClientId field" Url="html/F_MLAPI_Data_NetworkedClient_ClientId.htm" />
|
||||
<HelpKINode Title="NetworkedClient.NetworkedClient constructor" Url="html/M_MLAPI_Data_NetworkedClient__ctor.htm" />
|
||||
<HelpKINode Title="NetworkedClient.OwnedObjects field" Url="html/F_MLAPI_Data_NetworkedClient_OwnedObjects.htm" />
|
||||
<HelpKINode Title="NetworkedClient.PlayerObject field" Url="html/F_MLAPI_Data_NetworkedClient_PlayerObject.htm" />
|
||||
<HelpKINode Title="NetworkedNavMeshAgent class">
|
||||
<HelpKINode Title="NetworkedNavMeshAgent Class" Url="html/T_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkedNavMeshAgent.CorrectionDelay field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_CorrectionDelay.htm" />
|
||||
<HelpKINode Title="NetworkedNavMeshAgent.DriftCorrectionPercentage field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_DriftCorrectionPercentage.htm" />
|
||||
<HelpKINode Title="NetworkedNavMeshAgent.EnableProximity field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_EnableProximity.htm" />
|
||||
<HelpKINode Title="NetworkedNavMeshAgent.NetworkedNavMeshAgent constructor" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent__ctor.htm" />
|
||||
<HelpKINode Title="NetworkedNavMeshAgent.NetworkStart method" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_NetworkStart.htm" />
|
||||
<HelpKINode Title="NetworkedNavMeshAgent.ProximityRange field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_ProximityRange.htm" />
|
||||
<HelpKINode Title="NetworkedNavMeshAgent.WarpOnDestinationChange field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_WarpOnDestinationChange.htm" />
|
||||
<HelpKINode Title="NetworkedObject class">
|
||||
<HelpKINode Title="NetworkedObject Class" Url="html/T_MLAPI_MonoBehaviours_Core_NetworkedObject.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Core_NetworkedObject.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Core_NetworkedObject.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Core_NetworkedObject.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="networkedObject property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_networkedObject.htm" />
|
||||
<HelpKINode Title="NetworkedObject.ChangeOwnership method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_ChangeOwnership.htm" />
|
||||
<HelpKINode Title="NetworkedObject.isLocalPlayer property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isLocalPlayer.htm" />
|
||||
<HelpKINode Title="NetworkedObject.isOwner property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isOwner.htm" />
|
||||
<HelpKINode Title="NetworkedObject.isPlayerObject property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isPlayerObject.htm" />
|
||||
<HelpKINode Title="NetworkedObject.isPooledObject property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isPooledObject.htm" />
|
||||
<HelpKINode Title="NetworkedObject.isSpawned property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isSpawned.htm" />
|
||||
<HelpKINode Title="NetworkedObject.NetworkedObject constructor" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject__ctor.htm" />
|
||||
<HelpKINode Title="NetworkedObject.NetworkedPrefabName field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkedObject_NetworkedPrefabName.htm" />
|
||||
<HelpKINode Title="NetworkedObject.NetworkId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_NetworkId.htm" />
|
||||
<HelpKINode Title="NetworkedObject.OwnerClientId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_OwnerClientId.htm" />
|
||||
<HelpKINode Title="NetworkedObject.PoolId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_PoolId.htm" />
|
||||
<HelpKINode Title="NetworkedObject.RemoveOwnership method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_RemoveOwnership.htm" />
|
||||
<HelpKINode Title="NetworkedObject.Spawn method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_Spawn.htm" />
|
||||
<HelpKINode Title="NetworkedObject.SpawnWithOwnership method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_SpawnWithOwnership.htm" />
|
||||
<HelpKINode Title="NetworkedPrefab class">
|
||||
<HelpKINode Title="NetworkedPrefab Class" Url="html/T_MLAPI_Data_NetworkedPrefab.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Data_NetworkedPrefab__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_Data_NetworkedPrefab.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Data_NetworkedPrefab.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkedPrefab.NetworkedPrefab constructor" Url="html/M_MLAPI_Data_NetworkedPrefab__ctor.htm" />
|
||||
<HelpKINode Title="NetworkedPrefab.playerPrefab field" Url="html/F_MLAPI_Data_NetworkedPrefab_playerPrefab.htm" />
|
||||
<HelpKINode Title="NetworkedPrefab.prefab field" Url="html/F_MLAPI_Data_NetworkedPrefab_prefab.htm" />
|
||||
<HelpKINode Title="NetworkedPrefabName field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkedObject_NetworkedPrefabName.htm" />
|
||||
<HelpKINode Title="NetworkedPrefabs field" Url="html/F_MLAPI_Data_NetworkConfig_NetworkedPrefabs.htm" />
|
||||
<HelpKINode Title="NetworkedTransform class">
|
||||
<HelpKINode Title="NetworkedTransform Class" Url="html/T_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkedTransform.AssumeSyncedSends field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_AssumeSyncedSends.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.EnableProximity field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_EnableProximity.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.InterpolatePosition field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_InterpolatePosition.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.InterpolateServer field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_InterpolateServer.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.MinDegrees field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_MinDegrees.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.MinMeters field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_MinMeters.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.NetworkedTransform constructor" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform__ctor.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.NetworkStart method" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_NetworkStart.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.ProximityRange field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_ProximityRange.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.SendsPerSecond field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_SendsPerSecond.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.SnapDistance field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_SnapDistance.htm" />
|
||||
<HelpKINode Title="NetworkId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_NetworkId.htm" />
|
||||
<HelpKINode Title="networkId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_networkId.htm" />
|
||||
<HelpKINode Title="NetworkingManager class">
|
||||
<HelpKINode Title="NetworkingManager Class" Url="html/T_MLAPI_MonoBehaviours_Core_NetworkingManager.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Core_NetworkingManager.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Core_NetworkingManager.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Core_NetworkingManager.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkingManager.ConnectedClients property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_ConnectedClients.htm" />
|
||||
<HelpKINode Title="NetworkingManager.ConnectionApprovalCallback field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_ConnectionApprovalCallback.htm" />
|
||||
<HelpKINode Title="NetworkingManager.DontDestroy field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_DontDestroy.htm" />
|
||||
<HelpKINode Title="NetworkingManager.isClient property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_isClient.htm" />
|
||||
<HelpKINode Title="NetworkingManager.IsClientConnected property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_IsClientConnected.htm" />
|
||||
<HelpKINode Title="NetworkingManager.isHost property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_isHost.htm" />
|
||||
<HelpKINode Title="NetworkingManager.isServer property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_isServer.htm" />
|
||||
<HelpKINode Title="NetworkingManager.MyClientId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_MyClientId.htm" />
|
||||
<HelpKINode Title="NetworkingManager.NetworkConfig field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_NetworkConfig.htm" />
|
||||
<HelpKINode Title="NetworkingManager.NetworkingManager constructor" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager__ctor.htm" />
|
||||
<HelpKINode Title="NetworkingManager.NetworkTime property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_NetworkTime.htm" />
|
||||
<HelpKINode Title="NetworkingManager.OnClientConnectedCallback field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_OnClientConnectedCallback.htm" />
|
||||
<HelpKINode Title="NetworkingManager.OnClientDisconnectCallback field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_OnClientDisconnectCallback.htm" />
|
||||
<HelpKINode Title="NetworkingManager.OnServerStarted field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_OnServerStarted.htm" />
|
||||
<HelpKINode Title="NetworkingManager.RegenerateRSAKeys field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_RegenerateRSAKeys.htm" />
|
||||
<HelpKINode Title="NetworkingManager.RunInBackground field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_RunInBackground.htm" />
|
||||
<HelpKINode Title="NetworkingManager.singleton property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_singleton.htm" />
|
||||
<HelpKINode Title="NetworkingManager.StartClient method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartClient.htm" />
|
||||
<HelpKINode Title="NetworkingManager.StartClientWebsocket method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartClientWebsocket.htm" />
|
||||
<HelpKINode Title="NetworkingManager.StartHost method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartHost.htm" />
|
||||
<HelpKINode Title="NetworkingManager.StartServer method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartServer.htm" />
|
||||
<HelpKINode Title="NetworkingManager.StopClient method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StopClient.htm" />
|
||||
<HelpKINode Title="NetworkingManager.StopHost method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StopHost.htm" />
|
||||
<HelpKINode Title="NetworkingManager.StopServer method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StopServer.htm" />
|
||||
<HelpKINode Title="NetworkPoolManager class">
|
||||
<HelpKINode Title="NetworkPoolManager Class" Url="html/T_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkPoolManager.CreatePool method" Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_CreatePool.htm" />
|
||||
<HelpKINode Title="NetworkPoolManager.DestroyPool method" Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_DestroyPool.htm" />
|
||||
<HelpKINode Title="NetworkPoolManager.DestroyPoolObject method" Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_DestroyPoolObject.htm" />
|
||||
<HelpKINode Title="NetworkPoolManager.SpawnPoolObject method" Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_SpawnPoolObject.htm" />
|
||||
<HelpKINode Title="NetworkSceneManager class">
|
||||
<HelpKINode Title="NetworkSceneManager Class" Url="html/T_MLAPI_NetworkingManagerComponents_Core_NetworkSceneManager.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Core_NetworkSceneManager.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkSceneManager.SwitchScene method" Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkSceneManager_SwitchScene.htm" />
|
||||
<HelpKINode Title="NetworkStart method">
|
||||
<HelpKINode Title="NetworkedAnimator.NetworkStart Method " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_NetworkStart.htm" />
|
||||
<HelpKINode Title="NetworkedBehaviour.NetworkStart Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_NetworkStart.htm" />
|
||||
<HelpKINode Title="NetworkedNavMeshAgent.NetworkStart Method " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_NetworkStart.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.NetworkStart Method " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_NetworkStart.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="NetworkTime property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_NetworkTime.htm" />
|
||||
<HelpKINode Title="OnClientConnectedCallback field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_OnClientConnectedCallback.htm" />
|
||||
<HelpKINode Title="OnClientDisconnectCallback field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_OnClientDisconnectCallback.htm" />
|
||||
<HelpKINode Title="OnGainedOwnership method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_OnGainedOwnership.htm" />
|
||||
<HelpKINode Title="OnLostOwnership method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_OnLostOwnership.htm" />
|
||||
<HelpKINode Title="OnServerStarted field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_OnServerStarted.htm" />
|
||||
<HelpKINode Title="OwnedObjects field" Url="html/F_MLAPI_Data_NetworkedClient_OwnedObjects.htm" />
|
||||
<HelpKINode Title="OwnerClientId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_OwnerClientId.htm" />
|
||||
<HelpKINode Title="ownerClientId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_ownerClientId.htm" />
|
||||
<HelpKINode Title="param0 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param0.htm" />
|
||||
<HelpKINode Title="param1 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param1.htm" />
|
||||
<HelpKINode Title="param2 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param2.htm" />
|
||||
<HelpKINode Title="param3 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param3.htm" />
|
||||
<HelpKINode Title="param4 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param4.htm" />
|
||||
<HelpKINode Title="param5 field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param5.htm" />
|
||||
<HelpKINode Title="Passthrough field" Url="html/F_MLAPI_Data_MessageType_Passthrough.htm" />
|
||||
<HelpKINode Title="PlayerObject field" Url="html/F_MLAPI_Data_NetworkedClient_PlayerObject.htm" />
|
||||
<HelpKINode Title="playerPrefab field" Url="html/F_MLAPI_Data_NetworkedPrefab_playerPrefab.htm" />
|
||||
<HelpKINode Title="PoolId property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_PoolId.htm" />
|
||||
<HelpKINode Title="Port field" Url="html/F_MLAPI_Data_TransportHost_Port.htm" />
|
||||
<HelpKINode Title="prefab field" Url="html/F_MLAPI_Data_NetworkedPrefab_prefab.htm" />
|
||||
<HelpKINode Title="ProtocolVersion field" Url="html/F_MLAPI_Data_NetworkConfig_ProtocolVersion.htm" />
|
||||
<HelpKINode Title="ProximityRange field">
|
||||
<HelpKINode Title="NetworkedAnimator.ProximityRange Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_ProximityRange.htm" />
|
||||
<HelpKINode Title="NetworkedNavMeshAgent.ProximityRange Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_ProximityRange.htm" />
|
||||
<HelpKINode Title="NetworkedTransform.ProximityRange Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_ProximityRange.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="ReadBits method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadBits.htm" />
|
||||
<HelpKINode Title="ReadBool method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadBool.htm" />
|
||||
<HelpKINode Title="ReadByte method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadByte.htm" />
|
||||
<HelpKINode Title="ReadByteArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadByteArray.htm" />
|
||||
<HelpKINode Title="ReadDouble method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadDouble.htm" />
|
||||
<HelpKINode Title="ReadDoubleArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadDoubleArray.htm" />
|
||||
<HelpKINode Title="ReadFloat method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadFloat.htm" />
|
||||
<HelpKINode Title="ReadFloatArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadFloatArray.htm" />
|
||||
<HelpKINode Title="ReadInt method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadInt.htm" />
|
||||
<HelpKINode Title="ReadIntArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadIntArray.htm" />
|
||||
<HelpKINode Title="ReadLong method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadLong.htm" />
|
||||
<HelpKINode Title="ReadLongArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadLongArray.htm" />
|
||||
<HelpKINode Title="ReadSByte method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadSByte.htm" />
|
||||
<HelpKINode Title="ReadSByteArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadSByteArray.htm" />
|
||||
<HelpKINode Title="ReadShort method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadShort.htm" />
|
||||
<HelpKINode Title="ReadShortArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadShortArray.htm" />
|
||||
<HelpKINode Title="ReadString method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadString.htm" />
|
||||
<HelpKINode Title="ReadUInt method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUInt.htm" />
|
||||
<HelpKINode Title="ReadUIntArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUIntArray.htm" />
|
||||
<HelpKINode Title="ReadULong method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadULong.htm" />
|
||||
<HelpKINode Title="ReadULongArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadULongArray.htm" />
|
||||
<HelpKINode Title="ReadUShort method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUShort.htm" />
|
||||
<HelpKINode Title="ReadUShortArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUShortArray.htm" />
|
||||
<HelpKINode Title="ReceiveTickrate field" Url="html/F_MLAPI_Data_NetworkConfig_ReceiveTickrate.htm" />
|
||||
<HelpKINode Title="RegenerateRSAKeys field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_RegenerateRSAKeys.htm" />
|
||||
<HelpKINode Title="RegisteredScenes field" Url="html/F_MLAPI_Data_NetworkConfig_RegisteredScenes.htm" />
|
||||
<HelpKINode Title="RegisterMessageHandler method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_RegisterMessageHandler.htm" />
|
||||
<HelpKINode Title="RemoveOwnership method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_RemoveOwnership.htm" />
|
||||
<HelpKINode Title="ResetParameterOptions method" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_ResetParameterOptions.htm" />
|
||||
<HelpKINode Title="RSAPrivateKey field" Url="html/F_MLAPI_Data_NetworkConfig_RSAPrivateKey.htm" />
|
||||
<HelpKINode Title="RSAPublicKey field" Url="html/F_MLAPI_Data_NetworkConfig_RSAPublicKey.htm" />
|
||||
<HelpKINode Title="RunInBackground field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_RunInBackground.htm" />
|
||||
<HelpKINode Title="SecondsHistory field" Url="html/F_MLAPI_Data_NetworkConfig_SecondsHistory.htm" />
|
||||
<HelpKINode Title="SendsPerSecond field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_SendsPerSecond.htm" />
|
||||
<HelpKINode Title="SendTickrate field" Url="html/F_MLAPI_Data_NetworkConfig_SendTickrate.htm" />
|
||||
<HelpKINode Title="SendToClient method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClient.htm" />
|
||||
<HelpKINode Title="SendToClients method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClients.htm" />
|
||||
<HelpKINode Title="SendToClientsTarget method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientsTarget.htm" />
|
||||
<HelpKINode Title="SendToClientTarget method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientTarget.htm" />
|
||||
<HelpKINode Title="SendToLocalClient method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToLocalClient.htm" />
|
||||
<HelpKINode Title="SendToLocalClientTarget method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToLocalClientTarget.htm" />
|
||||
<HelpKINode Title="SendToNonLocalClients method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToNonLocalClients.htm" />
|
||||
<HelpKINode Title="SendToNonLocalClientsTarget method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToNonLocalClientsTarget.htm" />
|
||||
<HelpKINode Title="SendToServer method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToServer.htm" />
|
||||
<HelpKINode Title="SendToServerTarget method" Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToServerTarget.htm" />
|
||||
<HelpKINode Title="Serialize(Of T) method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_Serialize__1.htm" />
|
||||
<HelpKINode Title="Serialize<T> method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_Serialize__1.htm" />
|
||||
<HelpKINode Title="ServerNetId property" Url="html/P_MLAPI_Data_NetId_ServerNetId.htm" />
|
||||
<HelpKINode Title="ServerTransports field" Url="html/F_MLAPI_Data_NetworkConfig_ServerTransports.htm" />
|
||||
<HelpKINode Title="SetParameterAutoSend method" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_SetParameterAutoSend.htm" />
|
||||
<HelpKINode Title="SetTrigger method" Url="html/Overload_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_SetTrigger.htm" />
|
||||
<HelpKINode Title="SignKeyExchange field" Url="html/F_MLAPI_Data_NetworkConfig_SignKeyExchange.htm" />
|
||||
<HelpKINode Title="Simulate method" Url="html/Overload_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager_Simulate.htm" />
|
||||
<HelpKINode Title="SimulationObjects property" Url="html/P_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager_SimulationObjects.htm" />
|
||||
<HelpKINode Title="singleton property" Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_singleton.htm" />
|
||||
<HelpKINode Title="SkipPadded method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_SkipPadded.htm" />
|
||||
<HelpKINode Title="SnapDistance field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_SnapDistance.htm" />
|
||||
<HelpKINode Title="Spawn method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_Spawn.htm" />
|
||||
<HelpKINode Title="SpawnPoolObject method" Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_SpawnPoolObject.htm" />
|
||||
<HelpKINode Title="SpawnWithOwnership method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_SpawnWithOwnership.htm" />
|
||||
<HelpKINode Title="StartClient method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartClient.htm" />
|
||||
<HelpKINode Title="StartClientWebsocket method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartClientWebsocket.htm" />
|
||||
<HelpKINode Title="StartHost method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartHost.htm" />
|
||||
<HelpKINode Title="StartServer method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartServer.htm" />
|
||||
<HelpKINode Title="StopClient method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StopClient.htm" />
|
||||
<HelpKINode Title="StopHost method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StopHost.htm" />
|
||||
<HelpKINode Title="StopServer method" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StopServer.htm" />
|
||||
<HelpKINode Title="SwapEndian method" Url="html/Overload_MLAPI_NetworkingManagerComponents_Binary_BinaryHelpers_SwapEndian.htm" />
|
||||
<HelpKINode Title="SwitchScene method" Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkSceneManager_SwitchScene.htm" />
|
||||
<HelpKINode Title="SyncedVar class">
|
||||
<HelpKINode Title="SyncedVar Class" Url="html/T_MLAPI_Attributes_SyncedVar.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Attributes_SyncedVar__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_Attributes_SyncedVar.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Attributes_SyncedVar.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_Attributes_SyncedVar.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="SyncedVar.hookMethodName field" Url="html/F_MLAPI_Attributes_SyncedVar_hookMethodName.htm" />
|
||||
<HelpKINode Title="SyncedVar.SyncedVar constructor" Url="html/M_MLAPI_Attributes_SyncedVar__ctor.htm" />
|
||||
<HelpKINode Title="SyncedVar.target field" Url="html/F_MLAPI_Attributes_SyncedVar_target.htm" />
|
||||
<HelpKINode Title="SyncVarSyncDelay field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SyncVarSyncDelay.htm" />
|
||||
<HelpKINode Title="target field" Url="html/F_MLAPI_Attributes_SyncedVar_target.htm" />
|
||||
<HelpKINode Title="TargetRpc class">
|
||||
<HelpKINode Title="TargetRpc Class" Url="html/T_MLAPI_Attributes_TargetRpc.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Attributes_TargetRpc__ctor.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Attributes_TargetRpc.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_Attributes_TargetRpc.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="TargetRpc.TargetRpc constructor" Url="html/M_MLAPI_Attributes_TargetRpc__ctor.htm" />
|
||||
<HelpKINode Title="TotalPoints property" Url="html/P_MLAPI_MonoBehaviours_Core_TrackedObject_TotalPoints.htm" />
|
||||
<HelpKINode Title="TrackedObject class">
|
||||
<HelpKINode Title="TrackedObject Class" Url="html/T_MLAPI_MonoBehaviours_Core_TrackedObject.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_MonoBehaviours_Core_TrackedObject__ctor.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Core_TrackedObject.htm" />
|
||||
<HelpKINode Title="properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Core_TrackedObject.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="TrackedObject.AvgTimeBetweenPointsMs property" Url="html/P_MLAPI_MonoBehaviours_Core_TrackedObject_AvgTimeBetweenPointsMs.htm" />
|
||||
<HelpKINode Title="TrackedObject.TotalPoints property" Url="html/P_MLAPI_MonoBehaviours_Core_TrackedObject_TotalPoints.htm" />
|
||||
<HelpKINode Title="TrackedObject.TrackedObject constructor" Url="html/M_MLAPI_MonoBehaviours_Core_TrackedObject__ctor.htm" />
|
||||
<HelpKINode Title="TransportHost class">
|
||||
<HelpKINode Title="TransportHost Class" Url="html/T_MLAPI_Data_TransportHost.htm" />
|
||||
<HelpKINode Title="constructor" Url="html/M_MLAPI_Data_TransportHost__ctor.htm" />
|
||||
<HelpKINode Title="fields" Url="html/Fields_T_MLAPI_Data_TransportHost.htm" />
|
||||
<HelpKINode Title="methods" Url="html/Methods_T_MLAPI_Data_TransportHost.htm" />
|
||||
</HelpKINode>
|
||||
<HelpKINode Title="TransportHost.Name field" Url="html/F_MLAPI_Data_TransportHost_Name.htm" />
|
||||
<HelpKINode Title="TransportHost.Port field" Url="html/F_MLAPI_Data_TransportHost_Port.htm" />
|
||||
<HelpKINode Title="TransportHost.TransportHost constructor" Url="html/M_MLAPI_Data_TransportHost__ctor.htm" />
|
||||
<HelpKINode Title="TransportHost.Websockets field" Url="html/F_MLAPI_Data_TransportHost_Websockets.htm" />
|
||||
<HelpKINode Title="Type field" Url="html/F_MLAPI_Data_Channel_Type.htm" />
|
||||
<HelpKINode Title="WarpOnDestinationChange field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_WarpOnDestinationChange.htm" />
|
||||
<HelpKINode Title="Websockets field" Url="html/F_MLAPI_Data_TransportHost_Websockets.htm" />
|
||||
<HelpKINode Title="WriteAlignBits method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteAlignBits.htm" />
|
||||
<HelpKINode Title="WriteBits method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteBits.htm" />
|
||||
<HelpKINode Title="WriteBool method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteBool.htm" />
|
||||
<HelpKINode Title="WriteByte method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteByte.htm" />
|
||||
<HelpKINode Title="WriteByteArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteByteArray.htm" />
|
||||
<HelpKINode Title="WriteDouble method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteDouble.htm" />
|
||||
<HelpKINode Title="WriteDoubleArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteDoubleArray.htm" />
|
||||
<HelpKINode Title="WriteFloat method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteFloat.htm" />
|
||||
<HelpKINode Title="WriteFloatArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteFloatArray.htm" />
|
||||
<HelpKINode Title="WriteInt method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteInt.htm" />
|
||||
<HelpKINode Title="WriteIntArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteIntArray.htm" />
|
||||
<HelpKINode Title="WriteLong method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteLong.htm" />
|
||||
<HelpKINode Title="WriteLongArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteLongArray.htm" />
|
||||
<HelpKINode Title="WriteSByte method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteSByte.htm" />
|
||||
<HelpKINode Title="WriteSByteArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteSByteArray.htm" />
|
||||
<HelpKINode Title="WriteShort method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteShort.htm" />
|
||||
<HelpKINode Title="WriteShortArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteShortArray.htm" />
|
||||
<HelpKINode Title="WriteString method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteString.htm" />
|
||||
<HelpKINode Title="WriteUInt method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUInt.htm" />
|
||||
<HelpKINode Title="WriteUIntArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUIntArray.htm" />
|
||||
<HelpKINode Title="WriteULong method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteULong.htm" />
|
||||
<HelpKINode Title="WriteULongArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteULongArray.htm" />
|
||||
<HelpKINode Title="WriteUShort method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUShort.htm" />
|
||||
<HelpKINode Title="WriteUShortArray method" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUShortArray.htm" />
|
||||
</HelpKI>
|
465
docs/WebTOC.xml
Normal file
465
docs/WebTOC.xml
Normal file
@ -0,0 +1,465 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<HelpTOC>
|
||||
|
||||
<HelpTOCNode Id="0161c0c0-46c3-4819-8b9d-7a30af9c27d5" Title="MLAPI.Attributes" Url="html/N_MLAPI_Attributes.htm">
|
||||
<HelpTOCNode Id="10581d5e-88f9-4495-8ec9-72386cc2f33f" Title="BinaryIgnore Class" Url="html/T_MLAPI_Attributes_BinaryIgnore.htm">
|
||||
<HelpTOCNode Title="BinaryIgnore Constructor " Url="html/M_MLAPI_Attributes_BinaryIgnore__ctor.htm" />
|
||||
<HelpTOCNode Title="BinaryIgnore Properties" Url="html/Properties_T_MLAPI_Attributes_BinaryIgnore.htm" />
|
||||
<HelpTOCNode Title="BinaryIgnore Methods" Url="html/Methods_T_MLAPI_Attributes_BinaryIgnore.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="362876d1-3be5-445f-bf46-037ad7411fcf" Title="ClientRpc Class" Url="html/T_MLAPI_Attributes_ClientRpc.htm">
|
||||
<HelpTOCNode Title="ClientRpc Constructor " Url="html/M_MLAPI_Attributes_ClientRpc__ctor.htm" />
|
||||
<HelpTOCNode Title="ClientRpc Properties" Url="html/Properties_T_MLAPI_Attributes_ClientRpc.htm" />
|
||||
<HelpTOCNode Title="ClientRpc Methods" Url="html/Methods_T_MLAPI_Attributes_ClientRpc.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="fb4cdb9f-e3f0-4d07-b4f4-699c14f48b22" Title="Command Class" Url="html/T_MLAPI_Attributes_Command.htm">
|
||||
<HelpTOCNode Title="Command Constructor " Url="html/M_MLAPI_Attributes_Command__ctor.htm" />
|
||||
<HelpTOCNode Title="Command Properties" Url="html/Properties_T_MLAPI_Attributes_Command.htm" />
|
||||
<HelpTOCNode Title="Command Methods" Url="html/Methods_T_MLAPI_Attributes_Command.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="a9ad7120-12b1-4193-8bf3-8aac24651aa4" Title="SyncedVar Class" Url="html/T_MLAPI_Attributes_SyncedVar.htm">
|
||||
<HelpTOCNode Title="SyncedVar Constructor " Url="html/M_MLAPI_Attributes_SyncedVar__ctor.htm" />
|
||||
<HelpTOCNode Title="SyncedVar Properties" Url="html/Properties_T_MLAPI_Attributes_SyncedVar.htm" />
|
||||
<HelpTOCNode Title="SyncedVar Methods" Url="html/Methods_T_MLAPI_Attributes_SyncedVar.htm" />
|
||||
<HelpTOCNode Id="58ef3cb5-9bcd-409c-a6c9-82a07bea7034" Title="SyncedVar Fields" Url="html/Fields_T_MLAPI_Attributes_SyncedVar.htm">
|
||||
<HelpTOCNode Title="hookMethodName Field" Url="html/F_MLAPI_Attributes_SyncedVar_hookMethodName.htm" />
|
||||
<HelpTOCNode Title="target Field" Url="html/F_MLAPI_Attributes_SyncedVar_target.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="d0b66898-c8cd-4d44-9f18-1a9382a82779" Title="TargetRpc Class" Url="html/T_MLAPI_Attributes_TargetRpc.htm">
|
||||
<HelpTOCNode Title="TargetRpc Constructor " Url="html/M_MLAPI_Attributes_TargetRpc__ctor.htm" />
|
||||
<HelpTOCNode Title="TargetRpc Properties" Url="html/Properties_T_MLAPI_Attributes_TargetRpc.htm" />
|
||||
<HelpTOCNode Title="TargetRpc Methods" Url="html/Methods_T_MLAPI_Attributes_TargetRpc.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="e63d4c1c-5f5c-462d-b54b-e517ffd2bda1" Title="MLAPI.Data" Url="html/N_MLAPI_Data.htm">
|
||||
<HelpTOCNode Id="0c676ff1-4a8b-4feb-916e-a5be3d64a202" Title="Channel Class" Url="html/T_MLAPI_Data_Channel.htm">
|
||||
<HelpTOCNode Title="Channel Constructor " Url="html/M_MLAPI_Data_Channel__ctor.htm" />
|
||||
<HelpTOCNode Title="Channel Methods" Url="html/Methods_T_MLAPI_Data_Channel.htm" />
|
||||
<HelpTOCNode Id="6bc7bec7-e47b-4e67-88e0-f764bb9aa61e" Title="Channel Fields" Url="html/Fields_T_MLAPI_Data_Channel.htm">
|
||||
<HelpTOCNode Title="Encrypted Field" Url="html/F_MLAPI_Data_Channel_Encrypted.htm" />
|
||||
<HelpTOCNode Title="Name Field" Url="html/F_MLAPI_Data_Channel_Name.htm" />
|
||||
<HelpTOCNode Title="Type Field" Url="html/F_MLAPI_Data_Channel_Type.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="87ef9f6c-f08f-493f-a940-1d78bb05757a" Title="MessageType Class" Url="html/T_MLAPI_Data_MessageType.htm">
|
||||
<HelpTOCNode Title="MessageType Constructor " Url="html/M_MLAPI_Data_MessageType__ctor.htm" />
|
||||
<HelpTOCNode Title="MessageType Methods" Url="html/Methods_T_MLAPI_Data_MessageType.htm" />
|
||||
<HelpTOCNode Id="e0a979ec-a3c6-4908-97db-8b4c58340c0c" Title="MessageType Fields" Url="html/Fields_T_MLAPI_Data_MessageType.htm">
|
||||
<HelpTOCNode Title="Name Field" Url="html/F_MLAPI_Data_MessageType_Name.htm" />
|
||||
<HelpTOCNode Title="Passthrough Field" Url="html/F_MLAPI_Data_MessageType_Passthrough.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="151e085c-a440-4335-96f7-93dd8ddfb1a2" Title="NetId Structure" Url="html/T_MLAPI_Data_NetId.htm">
|
||||
<HelpTOCNode Id="8e021207-0e6b-48e1-829e-753fbce76208" Title="NetId Constructor " Url="html/Overload_MLAPI_Data_NetId__ctor.htm">
|
||||
<HelpTOCNode Title="NetId Constructor (UInt32)" Url="html/M_MLAPI_Data_NetId__ctor_1.htm" />
|
||||
<HelpTOCNode Title="NetId Constructor (Byte, UInt16, Boolean, Boolean)" Url="html/M_MLAPI_Data_NetId__ctor.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="f79698ce-0b9b-4e33-a40d-494887d53be9" Title="NetId Properties" Url="html/Properties_T_MLAPI_Data_NetId.htm">
|
||||
<HelpTOCNode Title="ServerNetId Property " Url="html/P_MLAPI_Data_NetId_ServerNetId.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="7219b61b-7923-492e-bf04-ddb743c7c84f" Title="NetId Methods" Url="html/Methods_T_MLAPI_Data_NetId.htm">
|
||||
<HelpTOCNode Title="Equals Method " Url="html/M_MLAPI_Data_NetId_Equals.htm" />
|
||||
<HelpTOCNode Title="GetClientId Method " Url="html/M_MLAPI_Data_NetId_GetClientId.htm" />
|
||||
<HelpTOCNode Title="GetHashCode Method " Url="html/M_MLAPI_Data_NetId_GetHashCode.htm" />
|
||||
<HelpTOCNode Title="IsHost Method " Url="html/M_MLAPI_Data_NetId_IsHost.htm" />
|
||||
<HelpTOCNode Title="IsInvalid Method " Url="html/M_MLAPI_Data_NetId_IsInvalid.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="ef58468d-e021-4c5e-9ff2-ba059f86a2f4" Title="NetId Operators" Url="html/Operators_T_MLAPI_Data_NetId.htm">
|
||||
<HelpTOCNode Title="Equality Operator " Url="html/M_MLAPI_Data_NetId_op_Equality.htm" />
|
||||
<HelpTOCNode Title="Inequality Operator " Url="html/M_MLAPI_Data_NetId_op_Inequality.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="66157c1e-5253-466d-a34d-9386d2ffe13d" Title="NetId Fields" Url="html/Fields_T_MLAPI_Data_NetId.htm">
|
||||
<HelpTOCNode Title="ConnectionId Field" Url="html/F_MLAPI_Data_NetId_ConnectionId.htm" />
|
||||
<HelpTOCNode Title="HostId Field" Url="html/F_MLAPI_Data_NetId_HostId.htm" />
|
||||
<HelpTOCNode Title="Meta Field" Url="html/F_MLAPI_Data_NetId_Meta.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="74dc2563-2661-4d72-87ae-b7b2bbd4154b" Title="NetworkConfig Class" Url="html/T_MLAPI_Data_NetworkConfig.htm">
|
||||
<HelpTOCNode Title="NetworkConfig Constructor " Url="html/M_MLAPI_Data_NetworkConfig__ctor.htm" />
|
||||
<HelpTOCNode Id="9ea30dfb-4279-4e57-a408-79ff4833000c" Title="NetworkConfig Methods" Url="html/Methods_T_MLAPI_Data_NetworkConfig.htm">
|
||||
<HelpTOCNode Title="CompareConfig Method " Url="html/M_MLAPI_Data_NetworkConfig_CompareConfig.htm" />
|
||||
<HelpTOCNode Title="GetConfig Method " Url="html/M_MLAPI_Data_NetworkConfig_GetConfig.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="3292384e-7fd1-46d7-af47-c36af240943c" Title="NetworkConfig Fields" Url="html/Fields_T_MLAPI_Data_NetworkConfig.htm">
|
||||
<HelpTOCNode Title="AllowPassthroughMessages Field" Url="html/F_MLAPI_Data_NetworkConfig_AllowPassthroughMessages.htm" />
|
||||
<HelpTOCNode Title="Channels Field" Url="html/F_MLAPI_Data_NetworkConfig_Channels.htm" />
|
||||
<HelpTOCNode Title="ClientConnectionBufferTimeout Field" Url="html/F_MLAPI_Data_NetworkConfig_ClientConnectionBufferTimeout.htm" />
|
||||
<HelpTOCNode Title="ConnectAddress Field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectAddress.htm" />
|
||||
<HelpTOCNode Title="ConnectionApproval Field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectionApproval.htm" />
|
||||
<HelpTOCNode Title="ConnectionData Field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectionData.htm" />
|
||||
<HelpTOCNode Title="ConnectPort Field" Url="html/F_MLAPI_Data_NetworkConfig_ConnectPort.htm" />
|
||||
<HelpTOCNode Title="EnableEncryption Field" Url="html/F_MLAPI_Data_NetworkConfig_EnableEncryption.htm" />
|
||||
<HelpTOCNode Title="EnableSceneSwitching Field" Url="html/F_MLAPI_Data_NetworkConfig_EnableSceneSwitching.htm" />
|
||||
<HelpTOCNode Title="EnableTimeResync Field" Url="html/F_MLAPI_Data_NetworkConfig_EnableTimeResync.htm" />
|
||||
<HelpTOCNode Title="EventTickrate Field" Url="html/F_MLAPI_Data_NetworkConfig_EventTickrate.htm" />
|
||||
<HelpTOCNode Title="HandleObjectSpawning Field" Url="html/F_MLAPI_Data_NetworkConfig_HandleObjectSpawning.htm" />
|
||||
<HelpTOCNode Title="MaxConnections Field" Url="html/F_MLAPI_Data_NetworkConfig_MaxConnections.htm" />
|
||||
<HelpTOCNode Title="MaxReceiveEventsPerTickRate Field" Url="html/F_MLAPI_Data_NetworkConfig_MaxReceiveEventsPerTickRate.htm" />
|
||||
<HelpTOCNode Title="MessageBufferSize Field" Url="html/F_MLAPI_Data_NetworkConfig_MessageBufferSize.htm" />
|
||||
<HelpTOCNode Title="MessageTypes Field" Url="html/F_MLAPI_Data_NetworkConfig_MessageTypes.htm" />
|
||||
<HelpTOCNode Title="NetworkedPrefabs Field" Url="html/F_MLAPI_Data_NetworkConfig_NetworkedPrefabs.htm" />
|
||||
<HelpTOCNode Title="ProtocolVersion Field" Url="html/F_MLAPI_Data_NetworkConfig_ProtocolVersion.htm" />
|
||||
<HelpTOCNode Title="ReceiveTickrate Field" Url="html/F_MLAPI_Data_NetworkConfig_ReceiveTickrate.htm" />
|
||||
<HelpTOCNode Title="RegisteredScenes Field" Url="html/F_MLAPI_Data_NetworkConfig_RegisteredScenes.htm" />
|
||||
<HelpTOCNode Title="RSAPrivateKey Field" Url="html/F_MLAPI_Data_NetworkConfig_RSAPrivateKey.htm" />
|
||||
<HelpTOCNode Title="RSAPublicKey Field" Url="html/F_MLAPI_Data_NetworkConfig_RSAPublicKey.htm" />
|
||||
<HelpTOCNode Title="SecondsHistory Field" Url="html/F_MLAPI_Data_NetworkConfig_SecondsHistory.htm" />
|
||||
<HelpTOCNode Title="SendTickrate Field" Url="html/F_MLAPI_Data_NetworkConfig_SendTickrate.htm" />
|
||||
<HelpTOCNode Title="ServerTransports Field" Url="html/F_MLAPI_Data_NetworkConfig_ServerTransports.htm" />
|
||||
<HelpTOCNode Title="SignKeyExchange Field" Url="html/F_MLAPI_Data_NetworkConfig_SignKeyExchange.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="f72761d2-701a-473c-8655-d48e95a49004" Title="NetworkedClient Class" Url="html/T_MLAPI_Data_NetworkedClient.htm">
|
||||
<HelpTOCNode Title="NetworkedClient Constructor " Url="html/M_MLAPI_Data_NetworkedClient__ctor.htm" />
|
||||
<HelpTOCNode Title="NetworkedClient Methods" Url="html/Methods_T_MLAPI_Data_NetworkedClient.htm" />
|
||||
<HelpTOCNode Id="46a9ca1d-a55a-4060-b54f-1a555251c014" Title="NetworkedClient Fields" Url="html/Fields_T_MLAPI_Data_NetworkedClient.htm">
|
||||
<HelpTOCNode Title="AesKey Field" Url="html/F_MLAPI_Data_NetworkedClient_AesKey.htm" />
|
||||
<HelpTOCNode Title="ClientId Field" Url="html/F_MLAPI_Data_NetworkedClient_ClientId.htm" />
|
||||
<HelpTOCNode Title="OwnedObjects Field" Url="html/F_MLAPI_Data_NetworkedClient_OwnedObjects.htm" />
|
||||
<HelpTOCNode Title="PlayerObject Field" Url="html/F_MLAPI_Data_NetworkedClient_PlayerObject.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="40dfa748-6eb6-4ceb-ac4c-556ffe4e5dd6" Title="NetworkedPrefab Class" Url="html/T_MLAPI_Data_NetworkedPrefab.htm">
|
||||
<HelpTOCNode Title="NetworkedPrefab Constructor " Url="html/M_MLAPI_Data_NetworkedPrefab__ctor.htm" />
|
||||
<HelpTOCNode Title="NetworkedPrefab Methods" Url="html/Methods_T_MLAPI_Data_NetworkedPrefab.htm" />
|
||||
<HelpTOCNode Id="a3e6b48a-5477-4732-bafb-d916f66cff04" Title="NetworkedPrefab Fields" Url="html/Fields_T_MLAPI_Data_NetworkedPrefab.htm">
|
||||
<HelpTOCNode Title="playerPrefab Field" Url="html/F_MLAPI_Data_NetworkedPrefab_playerPrefab.htm" />
|
||||
<HelpTOCNode Title="prefab Field" Url="html/F_MLAPI_Data_NetworkedPrefab_prefab.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="bb42c23a-5480-47cd-b714-07679ad7894b" Title="TransportHost Class" Url="html/T_MLAPI_Data_TransportHost.htm">
|
||||
<HelpTOCNode Title="TransportHost Constructor " Url="html/M_MLAPI_Data_TransportHost__ctor.htm" />
|
||||
<HelpTOCNode Title="TransportHost Methods" Url="html/Methods_T_MLAPI_Data_TransportHost.htm" />
|
||||
<HelpTOCNode Id="0c8aa163-7b7e-48d1-9425-70c83a81f13b" Title="TransportHost Fields" Url="html/Fields_T_MLAPI_Data_TransportHost.htm">
|
||||
<HelpTOCNode Title="Name Field" Url="html/F_MLAPI_Data_TransportHost_Name.htm" />
|
||||
<HelpTOCNode Title="Port Field" Url="html/F_MLAPI_Data_TransportHost_Port.htm" />
|
||||
<HelpTOCNode Title="Websockets Field" Url="html/F_MLAPI_Data_TransportHost_Websockets.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="2b78a972-4df2-4dfa-912e-c250ded047ab" Title="MLAPI.MonoBehaviours.Core" Url="html/N_MLAPI_MonoBehaviours_Core.htm">
|
||||
<HelpTOCNode Id="a7378dfd-d06a-437d-9a68-c834c90ec934" Title="NetworkedBehaviour Class" Url="html/T_MLAPI_MonoBehaviours_Core_NetworkedBehaviour.htm">
|
||||
<HelpTOCNode Title="NetworkedBehaviour Constructor " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour__ctor.htm" />
|
||||
<HelpTOCNode Id="fec3295c-94e5-44f6-973a-5529ec7c96c2" Title="NetworkedBehaviour Properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Core_NetworkedBehaviour.htm">
|
||||
<HelpTOCNode Title="isClient Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isClient.htm" />
|
||||
<HelpTOCNode Title="isHost Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isHost.htm" />
|
||||
<HelpTOCNode Title="isLocalPlayer Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isLocalPlayer.htm" />
|
||||
<HelpTOCNode Title="isOwner Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isOwner.htm" />
|
||||
<HelpTOCNode Title="isServer Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_isServer.htm" />
|
||||
<HelpTOCNode Title="networkedObject Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_networkedObject.htm" />
|
||||
<HelpTOCNode Title="networkId Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_networkId.htm" />
|
||||
<HelpTOCNode Title="ownerClientId Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_ownerClientId.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="fc2206d6-a21a-4e90-b34c-d9302252c4e5" Title="NetworkedBehaviour Methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Core_NetworkedBehaviour.htm">
|
||||
<HelpTOCNode Title="DeregisterMessageHandler Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_DeregisterMessageHandler.htm" />
|
||||
<HelpTOCNode Title="GetNetworkedObject Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_GetNetworkedObject.htm" />
|
||||
<HelpTOCNode Title="InvokeClientRpc Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_InvokeClientRpc.htm" />
|
||||
<HelpTOCNode Title="InvokeCommand Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_InvokeCommand.htm" />
|
||||
<HelpTOCNode Title="InvokeTargetRpc Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_InvokeTargetRpc.htm" />
|
||||
<HelpTOCNode Title="NetworkStart Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_NetworkStart.htm" />
|
||||
<HelpTOCNode Title="OnGainedOwnership Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_OnGainedOwnership.htm" />
|
||||
<HelpTOCNode Title="OnLostOwnership Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_OnLostOwnership.htm" />
|
||||
<HelpTOCNode Title="RegisterMessageHandler Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_RegisterMessageHandler.htm" />
|
||||
<HelpTOCNode Id="75420319-ea50-4d92-9480-00f81fc95132" Title="SendToClient Method " Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClient.htm">
|
||||
<HelpTOCNode Title="SendToClient(T) Method (Int32, String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClient__1.htm" />
|
||||
<HelpTOCNode Title="SendToClient Method (UInt32, String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClient.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="1a760020-66e7-4ffe-9350-401d26ccb05e" Title="SendToClients Method " Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClients.htm">
|
||||
<HelpTOCNode Title="SendToClients Method (String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClients_1.htm" />
|
||||
<HelpTOCNode Title="SendToClients(T) Method (String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClients__1_2.htm" />
|
||||
<HelpTOCNode Title="SendToClients(T) Method (List(Int32), String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClients__1.htm" />
|
||||
<HelpTOCNode Title="SendToClients Method (List(UInt32), String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClients.htm" />
|
||||
<HelpTOCNode Title="SendToClients(T) Method (Int32[], String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClients__1_1.htm" />
|
||||
<HelpTOCNode Title="SendToClients Method (UInt32[], String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClients_2.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="7954a49a-f2ce-4ab1-9286-564a22825290" Title="SendToClientsTarget Method " Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientsTarget.htm">
|
||||
<HelpTOCNode Title="SendToClientsTarget Method (String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientsTarget_1.htm" />
|
||||
<HelpTOCNode Title="SendToClientsTarget(T) Method (String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientsTarget__1_2.htm" />
|
||||
<HelpTOCNode Title="SendToClientsTarget Method (List(UInt32), String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientsTarget.htm" />
|
||||
<HelpTOCNode Title="SendToClientsTarget(T) Method (List(UInt32), String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientsTarget__1.htm" />
|
||||
<HelpTOCNode Title="SendToClientsTarget(T) Method (Int32[], String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientsTarget__1_1.htm" />
|
||||
<HelpTOCNode Title="SendToClientsTarget Method (UInt32[], String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientsTarget_2.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="f02d3c1a-622f-41d9-8ff9-df63e36f3503" Title="SendToClientTarget Method " Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientTarget.htm">
|
||||
<HelpTOCNode Title="SendToClientTarget(T) Method (Int32, String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientTarget__1.htm" />
|
||||
<HelpTOCNode Title="SendToClientTarget Method (UInt32, String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToClientTarget.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="d5649bd9-a344-4e6b-a1bb-c9ee2e080fde" Title="SendToLocalClient Method " Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToLocalClient.htm">
|
||||
<HelpTOCNode Title="SendToLocalClient Method (String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToLocalClient.htm" />
|
||||
<HelpTOCNode Title="SendToLocalClient(T) Method (String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToLocalClient__1.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="6284da67-5a20-403a-937e-b6404aaa3259" Title="SendToLocalClientTarget Method " Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToLocalClientTarget.htm">
|
||||
<HelpTOCNode Title="SendToLocalClientTarget Method (String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToLocalClientTarget.htm" />
|
||||
<HelpTOCNode Title="SendToLocalClientTarget(T) Method (String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToLocalClientTarget__1.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="d57cf1be-d549-488b-9690-3052ea9da814" Title="SendToNonLocalClients Method " Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToNonLocalClients.htm">
|
||||
<HelpTOCNode Title="SendToNonLocalClients Method (String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToNonLocalClients.htm" />
|
||||
<HelpTOCNode Title="SendToNonLocalClients(T) Method (String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToNonLocalClients__1.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="2cdf6dbb-1912-40e1-80f3-daa985c0d5dd" Title="SendToNonLocalClientsTarget Method " Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToNonLocalClientsTarget.htm">
|
||||
<HelpTOCNode Title="SendToNonLocalClientsTarget Method (String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToNonLocalClientsTarget.htm" />
|
||||
<HelpTOCNode Title="SendToNonLocalClientsTarget(T) Method (String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToNonLocalClientsTarget__1.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="c0ebeea4-d36d-4456-a929-6217eac1ab5a" Title="SendToServer Method " Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToServer.htm">
|
||||
<HelpTOCNode Title="SendToServer Method (String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToServer.htm" />
|
||||
<HelpTOCNode Title="SendToServer(T) Method (String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToServer__1.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="6e0bf34a-57ea-4d13-a48b-bcb8d4a26ae4" Title="SendToServerTarget Method " Url="html/Overload_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToServerTarget.htm">
|
||||
<HelpTOCNode Title="SendToServerTarget Method (String, String, Byte[])" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToServerTarget.htm" />
|
||||
<HelpTOCNode Title="SendToServerTarget(T) Method (String, String, T)" Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SendToServerTarget__1.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="001c1eb0-91b4-4cc9-99ff-5c814b47f852" Title="NetworkedBehaviour Fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Core_NetworkedBehaviour.htm">
|
||||
<HelpTOCNode Title="SyncVarSyncDelay Field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkedBehaviour_SyncVarSyncDelay.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="73ede72c-67cd-4e3a-a92b-f024864716d0" Title="NetworkedObject Class" Url="html/T_MLAPI_MonoBehaviours_Core_NetworkedObject.htm">
|
||||
<HelpTOCNode Title="NetworkedObject Constructor " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject__ctor.htm" />
|
||||
<HelpTOCNode Id="0997cab9-ae18-4db6-9a83-1427f3166dbc" Title="NetworkedObject Properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Core_NetworkedObject.htm">
|
||||
<HelpTOCNode Title="isLocalPlayer Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isLocalPlayer.htm" />
|
||||
<HelpTOCNode Title="isOwner Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isOwner.htm" />
|
||||
<HelpTOCNode Title="isPlayerObject Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isPlayerObject.htm" />
|
||||
<HelpTOCNode Title="isPooledObject Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isPooledObject.htm" />
|
||||
<HelpTOCNode Title="isSpawned Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_isSpawned.htm" />
|
||||
<HelpTOCNode Title="NetworkId Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_NetworkId.htm" />
|
||||
<HelpTOCNode Title="OwnerClientId Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_OwnerClientId.htm" />
|
||||
<HelpTOCNode Title="PoolId Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkedObject_PoolId.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="9fb4134f-e0a8-409f-90dd-1d2ba32482c5" Title="NetworkedObject Methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Core_NetworkedObject.htm">
|
||||
<HelpTOCNode Title="ChangeOwnership Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_ChangeOwnership.htm" />
|
||||
<HelpTOCNode Title="RemoveOwnership Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_RemoveOwnership.htm" />
|
||||
<HelpTOCNode Title="Spawn Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_Spawn.htm" />
|
||||
<HelpTOCNode Title="SpawnWithOwnership Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkedObject_SpawnWithOwnership.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="d964f1f0-0a3b-45f1-86fd-b6a3aac155c7" Title="NetworkedObject Fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Core_NetworkedObject.htm">
|
||||
<HelpTOCNode Title="NetworkedPrefabName Field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkedObject_NetworkedPrefabName.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="8fe2f9db-3fa9-4c96-aaad-923c33a0b219" Title="NetworkingManager Class" Url="html/T_MLAPI_MonoBehaviours_Core_NetworkingManager.htm">
|
||||
<HelpTOCNode Title="NetworkingManager Constructor " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager__ctor.htm" />
|
||||
<HelpTOCNode Id="3a114f27-0ddd-49d3-9289-8e38cbf5cc70" Title="NetworkingManager Properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Core_NetworkingManager.htm">
|
||||
<HelpTOCNode Title="ConnectedClients Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_ConnectedClients.htm" />
|
||||
<HelpTOCNode Title="isClient Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_isClient.htm" />
|
||||
<HelpTOCNode Title="IsClientConnected Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_IsClientConnected.htm" />
|
||||
<HelpTOCNode Title="isHost Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_isHost.htm" />
|
||||
<HelpTOCNode Title="isServer Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_isServer.htm" />
|
||||
<HelpTOCNode Title="MyClientId Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_MyClientId.htm" />
|
||||
<HelpTOCNode Title="NetworkTime Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_NetworkTime.htm" />
|
||||
<HelpTOCNode Title="singleton Property " Url="html/P_MLAPI_MonoBehaviours_Core_NetworkingManager_singleton.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="75b0a333-495d-4325-919d-d1cae33d24a2" Title="NetworkingManager Methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Core_NetworkingManager.htm">
|
||||
<HelpTOCNode Title="StartClient Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartClient.htm" />
|
||||
<HelpTOCNode Title="StartClientWebsocket Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartClientWebsocket.htm" />
|
||||
<HelpTOCNode Title="StartHost Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartHost.htm" />
|
||||
<HelpTOCNode Title="StartServer Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StartServer.htm" />
|
||||
<HelpTOCNode Title="StopClient Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StopClient.htm" />
|
||||
<HelpTOCNode Title="StopHost Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StopHost.htm" />
|
||||
<HelpTOCNode Title="StopServer Method " Url="html/M_MLAPI_MonoBehaviours_Core_NetworkingManager_StopServer.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="f7bf3a6e-6b45-47a2-9806-4a0aa7efb179" Title="NetworkingManager Fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Core_NetworkingManager.htm">
|
||||
<HelpTOCNode Title="ConnectionApprovalCallback Field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_ConnectionApprovalCallback.htm" />
|
||||
<HelpTOCNode Title="DontDestroy Field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_DontDestroy.htm" />
|
||||
<HelpTOCNode Title="NetworkConfig Field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_NetworkConfig.htm" />
|
||||
<HelpTOCNode Title="OnClientConnectedCallback Field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_OnClientConnectedCallback.htm" />
|
||||
<HelpTOCNode Title="OnClientDisconnectCallback Field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_OnClientDisconnectCallback.htm" />
|
||||
<HelpTOCNode Title="OnServerStarted Field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_OnServerStarted.htm" />
|
||||
<HelpTOCNode Title="RegenerateRSAKeys Field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_RegenerateRSAKeys.htm" />
|
||||
<HelpTOCNode Title="RunInBackground Field" Url="html/F_MLAPI_MonoBehaviours_Core_NetworkingManager_RunInBackground.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="ce37a000-186b-4c0d-8fdb-a78cf450c85b" Title="TrackedObject Class" Url="html/T_MLAPI_MonoBehaviours_Core_TrackedObject.htm">
|
||||
<HelpTOCNode Title="TrackedObject Constructor " Url="html/M_MLAPI_MonoBehaviours_Core_TrackedObject__ctor.htm" />
|
||||
<HelpTOCNode Id="5f99e0ad-788d-4b2e-ab2a-a46ddf9d408f" Title="TrackedObject Properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Core_TrackedObject.htm">
|
||||
<HelpTOCNode Title="AvgTimeBetweenPointsMs Property " Url="html/P_MLAPI_MonoBehaviours_Core_TrackedObject_AvgTimeBetweenPointsMs.htm" />
|
||||
<HelpTOCNode Title="TotalPoints Property " Url="html/P_MLAPI_MonoBehaviours_Core_TrackedObject_TotalPoints.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Title="TrackedObject Methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Core_TrackedObject.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="46992f5e-f570-40f4-ba78-3b2fe5e318ff" Title="MLAPI.MonoBehaviours.Prototyping" Url="html/N_MLAPI_MonoBehaviours_Prototyping.htm">
|
||||
<HelpTOCNode Id="608f7234-28e5-41d1-890c-bed7f270c84f" Title="NetworkedAnimator Class" Url="html/T_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator.htm">
|
||||
<HelpTOCNode Title="NetworkedAnimator Constructor " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator__ctor.htm" />
|
||||
<HelpTOCNode Id="dd0f3f94-6dbb-4420-8f1b-76cc15a19890" Title="NetworkedAnimator Properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator.htm">
|
||||
<HelpTOCNode Title="animator Property " Url="html/P_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_animator.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="3823ad08-4fdd-40c2-8e31-6e57bbc78955" Title="NetworkedAnimator Methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator.htm">
|
||||
<HelpTOCNode Title="GetParameterAutoSend Method " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_GetParameterAutoSend.htm" />
|
||||
<HelpTOCNode Title="NetworkStart Method " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_NetworkStart.htm" />
|
||||
<HelpTOCNode Title="ResetParameterOptions Method " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_ResetParameterOptions.htm" />
|
||||
<HelpTOCNode Title="SetParameterAutoSend Method " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_SetParameterAutoSend.htm" />
|
||||
<HelpTOCNode Id="eb90a014-3cdd-47c4-ab18-e8fac9ee1690" Title="SetTrigger Method " Url="html/Overload_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_SetTrigger.htm">
|
||||
<HelpTOCNode Title="SetTrigger Method (Int32)" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_SetTrigger.htm" />
|
||||
<HelpTOCNode Title="SetTrigger Method (String)" Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_SetTrigger_1.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="cb332f52-cfac-423d-9bc5-168ce5aa815a" Title="NetworkedAnimator Fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator.htm">
|
||||
<HelpTOCNode Title="EnableProximity Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_EnableProximity.htm" />
|
||||
<HelpTOCNode Title="param0 Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param0.htm" />
|
||||
<HelpTOCNode Title="param1 Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param1.htm" />
|
||||
<HelpTOCNode Title="param2 Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param2.htm" />
|
||||
<HelpTOCNode Title="param3 Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param3.htm" />
|
||||
<HelpTOCNode Title="param4 Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param4.htm" />
|
||||
<HelpTOCNode Title="param5 Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_param5.htm" />
|
||||
<HelpTOCNode Title="ProximityRange Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedAnimator_ProximityRange.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="4565e34b-5397-4e2a-8c43-13514c26f2da" Title="NetworkedNavMeshAgent Class" Url="html/T_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent.htm">
|
||||
<HelpTOCNode Title="NetworkedNavMeshAgent Constructor " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent__ctor.htm" />
|
||||
<HelpTOCNode Title="NetworkedNavMeshAgent Properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent.htm" />
|
||||
<HelpTOCNode Id="4e0c30e8-2253-4cf4-b0a9-3301de5b72a2" Title="NetworkedNavMeshAgent Methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent.htm">
|
||||
<HelpTOCNode Title="NetworkStart Method " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_NetworkStart.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="5ea3a976-2fd7-43a2-9c04-df365272408f" Title="NetworkedNavMeshAgent Fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent.htm">
|
||||
<HelpTOCNode Title="CorrectionDelay Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_CorrectionDelay.htm" />
|
||||
<HelpTOCNode Title="DriftCorrectionPercentage Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_DriftCorrectionPercentage.htm" />
|
||||
<HelpTOCNode Title="EnableProximity Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_EnableProximity.htm" />
|
||||
<HelpTOCNode Title="ProximityRange Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_ProximityRange.htm" />
|
||||
<HelpTOCNode Title="WarpOnDestinationChange Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedNavMeshAgent_WarpOnDestinationChange.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="9e9d266b-237e-40bb-88bd-8c7a874a7ecf" Title="NetworkedTransform Class" Url="html/T_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform.htm">
|
||||
<HelpTOCNode Title="NetworkedTransform Constructor " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform__ctor.htm" />
|
||||
<HelpTOCNode Title="NetworkedTransform Properties" Url="html/Properties_T_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform.htm" />
|
||||
<HelpTOCNode Id="433f25c1-8c0b-41e6-8383-82824025262a" Title="NetworkedTransform Methods" Url="html/Methods_T_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform.htm">
|
||||
<HelpTOCNode Title="NetworkStart Method " Url="html/M_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_NetworkStart.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="326c641f-8d2f-4342-a125-b6ddc6b5133b" Title="NetworkedTransform Fields" Url="html/Fields_T_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform.htm">
|
||||
<HelpTOCNode Title="AssumeSyncedSends Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_AssumeSyncedSends.htm" />
|
||||
<HelpTOCNode Title="EnableProximity Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_EnableProximity.htm" />
|
||||
<HelpTOCNode Title="InterpolatePosition Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_InterpolatePosition.htm" />
|
||||
<HelpTOCNode Title="InterpolateServer Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_InterpolateServer.htm" />
|
||||
<HelpTOCNode Title="MinDegrees Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_MinDegrees.htm" />
|
||||
<HelpTOCNode Title="MinMeters Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_MinMeters.htm" />
|
||||
<HelpTOCNode Title="ProximityRange Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_ProximityRange.htm" />
|
||||
<HelpTOCNode Title="SendsPerSecond Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_SendsPerSecond.htm" />
|
||||
<HelpTOCNode Title="SnapDistance Field" Url="html/F_MLAPI_MonoBehaviours_Prototyping_NetworkedTransform_SnapDistance.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="45906398-d599-44f8-a564-00f14f453f42" Title="MLAPI.NetworkingManagerComponents.Binary" Url="html/N_MLAPI_NetworkingManagerComponents_Binary.htm">
|
||||
<HelpTOCNode Id="d2697f96-631d-4d11-915a-e67e9cac62e9" Title="BinaryHelpers Class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BinaryHelpers.htm">
|
||||
<HelpTOCNode Id="e37e74cd-d689-4652-bafc-1f7abd795c57" Title="BinaryHelpers Methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Binary_BinaryHelpers.htm">
|
||||
<HelpTOCNode Id="55dddd48-9049-4788-873c-4e529464e533" Title="SwapEndian Method " Url="html/Overload_MLAPI_NetworkingManagerComponents_Binary_BinaryHelpers_SwapEndian.htm">
|
||||
<HelpTOCNode Title="SwapEndian Method (UInt32)" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinaryHelpers_SwapEndian.htm" />
|
||||
<HelpTOCNode Title="SwapEndian Method (UInt64)" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinaryHelpers_SwapEndian_1.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="039e6ae9-2f10-4683-ba54-c3d5138ea63c" Title="BinarySerializer Class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer.htm">
|
||||
<HelpTOCNode Id="990f33f2-70db-4fea-b6cf-6b0ffe3148ae" Title="BinarySerializer Methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer.htm">
|
||||
<HelpTOCNode Title="ClearCache Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_ClearCache.htm" />
|
||||
<HelpTOCNode Title="Deserialize(T) Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_Deserialize__1.htm" />
|
||||
<HelpTOCNode Title="Serialize(T) Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BinarySerializer_Serialize__1.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="2f50c96c-1f99-4875-a1c5-ff7d0ace510a" Title="BitReader Class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BitReader.htm">
|
||||
<HelpTOCNode Title="BitReader Constructor " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader__ctor.htm" />
|
||||
<HelpTOCNode Id="cb8a380d-4dcc-4a68-b078-feb5c23117c6" Title="BitReader Methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Binary_BitReader.htm">
|
||||
<HelpTOCNode Title="ReadBits Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadBits.htm" />
|
||||
<HelpTOCNode Title="ReadBool Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadBool.htm" />
|
||||
<HelpTOCNode Title="ReadByte Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadByte.htm" />
|
||||
<HelpTOCNode Title="ReadByteArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadByteArray.htm" />
|
||||
<HelpTOCNode Title="ReadDouble Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadDouble.htm" />
|
||||
<HelpTOCNode Title="ReadDoubleArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadDoubleArray.htm" />
|
||||
<HelpTOCNode Title="ReadFloat Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadFloat.htm" />
|
||||
<HelpTOCNode Title="ReadFloatArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadFloatArray.htm" />
|
||||
<HelpTOCNode Title="ReadInt Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadInt.htm" />
|
||||
<HelpTOCNode Title="ReadIntArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadIntArray.htm" />
|
||||
<HelpTOCNode Title="ReadLong Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadLong.htm" />
|
||||
<HelpTOCNode Title="ReadLongArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadLongArray.htm" />
|
||||
<HelpTOCNode Title="ReadSByte Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadSByte.htm" />
|
||||
<HelpTOCNode Title="ReadSByteArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadSByteArray.htm" />
|
||||
<HelpTOCNode Title="ReadShort Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadShort.htm" />
|
||||
<HelpTOCNode Title="ReadShortArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadShortArray.htm" />
|
||||
<HelpTOCNode Title="ReadString Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadString.htm" />
|
||||
<HelpTOCNode Title="ReadUInt Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUInt.htm" />
|
||||
<HelpTOCNode Title="ReadUIntArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUIntArray.htm" />
|
||||
<HelpTOCNode Title="ReadULong Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadULong.htm" />
|
||||
<HelpTOCNode Title="ReadULongArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadULongArray.htm" />
|
||||
<HelpTOCNode Title="ReadUShort Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUShort.htm" />
|
||||
<HelpTOCNode Title="ReadUShortArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_ReadUShortArray.htm" />
|
||||
<HelpTOCNode Title="SkipPadded Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitReader_SkipPadded.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="0566c26b-eb90-417c-b554-e8261f93f387" Title="BitWriter Class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_BitWriter.htm">
|
||||
<HelpTOCNode Title="BitWriter Constructor " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter__ctor.htm" />
|
||||
<HelpTOCNode Id="5b1f546c-17e8-417b-895e-393d4f825860" Title="BitWriter Methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Binary_BitWriter.htm">
|
||||
<HelpTOCNode Title="Dispose Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_Dispose.htm" />
|
||||
<HelpTOCNode Id="25ae43e5-0e9d-406a-8760-4141e3e23092" Title="Finalize Method " Url="html/Overload_MLAPI_NetworkingManagerComponents_Binary_BitWriter_Finalize.htm">
|
||||
<HelpTOCNode Title="Finalize Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_Finalize.htm" />
|
||||
<HelpTOCNode Title="Finalize Method (Byte[])" Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_Finalize_1.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Title="GetFinalizeSize Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_GetFinalizeSize.htm" />
|
||||
<HelpTOCNode Title="WriteAlignBits Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteAlignBits.htm" />
|
||||
<HelpTOCNode Title="WriteBits Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteBits.htm" />
|
||||
<HelpTOCNode Title="WriteBool Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteBool.htm" />
|
||||
<HelpTOCNode Title="WriteByte Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteByte.htm" />
|
||||
<HelpTOCNode Title="WriteByteArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteByteArray.htm" />
|
||||
<HelpTOCNode Title="WriteDouble Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteDouble.htm" />
|
||||
<HelpTOCNode Title="WriteDoubleArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteDoubleArray.htm" />
|
||||
<HelpTOCNode Title="WriteFloat Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteFloat.htm" />
|
||||
<HelpTOCNode Title="WriteFloatArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteFloatArray.htm" />
|
||||
<HelpTOCNode Title="WriteInt Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteInt.htm" />
|
||||
<HelpTOCNode Title="WriteIntArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteIntArray.htm" />
|
||||
<HelpTOCNode Title="WriteLong Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteLong.htm" />
|
||||
<HelpTOCNode Title="WriteLongArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteLongArray.htm" />
|
||||
<HelpTOCNode Title="WriteSByte Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteSByte.htm" />
|
||||
<HelpTOCNode Title="WriteSByteArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteSByteArray.htm" />
|
||||
<HelpTOCNode Title="WriteShort Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteShort.htm" />
|
||||
<HelpTOCNode Title="WriteShortArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteShortArray.htm" />
|
||||
<HelpTOCNode Title="WriteString Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteString.htm" />
|
||||
<HelpTOCNode Title="WriteUInt Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUInt.htm" />
|
||||
<HelpTOCNode Title="WriteUIntArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUIntArray.htm" />
|
||||
<HelpTOCNode Title="WriteULong Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteULong.htm" />
|
||||
<HelpTOCNode Title="WriteULongArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteULongArray.htm" />
|
||||
<HelpTOCNode Title="WriteUShort Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUShort.htm" />
|
||||
<HelpTOCNode Title="WriteUShortArray Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_BitWriter_WriteUShortArray.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="15deab02-9c2e-4521-849a-96457b913f9a" Title="MessageChunker Class" Url="html/T_MLAPI_NetworkingManagerComponents_Binary_MessageChunker.htm">
|
||||
<HelpTOCNode Id="05a7ad68-a7e4-46f1-8374-d7fc33f9e741" Title="MessageChunker Methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Binary_MessageChunker.htm">
|
||||
<HelpTOCNode Title="GetChunkedMessage Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_GetChunkedMessage.htm" />
|
||||
<HelpTOCNode Title="GetMessageOrdered Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_GetMessageOrdered.htm" />
|
||||
<HelpTOCNode Title="GetMessageUnordered Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_GetMessageUnordered.htm" />
|
||||
<HelpTOCNode Title="HasDuplicates Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_HasDuplicates.htm" />
|
||||
<HelpTOCNode Title="HasMissingParts Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_HasMissingParts.htm" />
|
||||
<HelpTOCNode Title="IsOrdered Method " Url="html/M_MLAPI_NetworkingManagerComponents_Binary_MessageChunker_IsOrdered.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="49a9bcd4-7110-4aaf-8f6c-d722ff810434" Title="MLAPI.NetworkingManagerComponents.Core" Url="html/N_MLAPI_NetworkingManagerComponents_Core.htm">
|
||||
<HelpTOCNode Id="9dc011d0-59cf-455c-90b8-f13342d8d657" Title="LagCompensationManager Class" Url="html/T_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager.htm">
|
||||
<HelpTOCNode Id="d85f118a-1eed-45c0-95a7-d02bfd3b19ba" Title="LagCompensationManager Properties" Url="html/Properties_T_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager.htm">
|
||||
<HelpTOCNode Title="SimulationObjects Property " Url="html/P_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager_SimulationObjects.htm" />
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="faab6a75-3bea-4718-b6a3-795962bd5764" Title="LagCompensationManager Methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager.htm">
|
||||
<HelpTOCNode Id="045d4910-f505-4653-9ffa-b7e13c559091" Title="Simulate Method " Url="html/Overload_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager_Simulate.htm">
|
||||
<HelpTOCNode Title="Simulate Method (Single, Action)" Url="html/M_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager_Simulate.htm" />
|
||||
<HelpTOCNode Title="Simulate Method (UInt32, Action)" Url="html/M_MLAPI_NetworkingManagerComponents_Core_LagCompensationManager_Simulate_1.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="3d56ee61-c383-43fe-b03b-bb53c6965137" Title="NetworkPoolManager Class" Url="html/T_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager.htm">
|
||||
<HelpTOCNode Id="25dda867-685d-49b1-9913-912381bcb9f2" Title="NetworkPoolManager Methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager.htm">
|
||||
<HelpTOCNode Title="CreatePool Method " Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_CreatePool.htm" />
|
||||
<HelpTOCNode Title="DestroyPool Method " Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_DestroyPool.htm" />
|
||||
<HelpTOCNode Title="DestroyPoolObject Method " Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_DestroyPoolObject.htm" />
|
||||
<HelpTOCNode Title="SpawnPoolObject Method " Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkPoolManager_SpawnPoolObject.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="8a99b52c-9fcf-402a-a878-25cde910f2ce" Title="NetworkSceneManager Class" Url="html/T_MLAPI_NetworkingManagerComponents_Core_NetworkSceneManager.htm">
|
||||
<HelpTOCNode Id="69a13892-bd40-409a-97f7-b360afe01a07" Title="NetworkSceneManager Methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Core_NetworkSceneManager.htm">
|
||||
<HelpTOCNode Title="SwitchScene Method " Url="html/M_MLAPI_NetworkingManagerComponents_Core_NetworkSceneManager_SwitchScene.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
<HelpTOCNode Id="9b2c257a-d866-4660-a03b-8a83fe4eae51" Title="MLAPI.NetworkingManagerComponents.Cryptography" Url="html/N_MLAPI_NetworkingManagerComponents_Cryptography.htm">
|
||||
<HelpTOCNode Id="e985be53-c814-49d3-a546-73147883fe92" Title="CryptographyHelper Class" Url="html/T_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper.htm">
|
||||
<HelpTOCNode Id="77035f4a-9681-4dd4-bf62-2731266f105c" Title="CryptographyHelper Methods" Url="html/Methods_T_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper.htm">
|
||||
<HelpTOCNode Title="Decrypt Method " Url="html/M_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper_Decrypt.htm" />
|
||||
<HelpTOCNode Title="Encrypt Method " Url="html/M_MLAPI_NetworkingManagerComponents_Cryptography_CryptographyHelper_Encrypt.htm" />
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
</HelpTOCNode>
|
||||
</HelpTOC>
|
1
docs/fti/FTI_100.json
Normal file
1
docs/fti/FTI_100.json
Normal file
File diff suppressed because one or more lines are too long
1
docs/fti/FTI_101.json
Normal file
1
docs/fti/FTI_101.json
Normal file
File diff suppressed because one or more lines are too long
1
docs/fti/FTI_102.json
Normal file
1
docs/fti/FTI_102.json
Normal file
@ -0,0 +1 @@
|
||||
{"false":[7208961,7733249,8060929,8454145,8650753,15007745,15400961,15597569,15728641,16384001,16515073,16580609,17498113,17629185,19070977],"following":[131073,196609,262145,327681,393217,458753,524289,589825,655361,720897,786433,851969,1310721,2490369,5701633,5767169,5963777,6029313,6094849,6422529,6553601,6619137,6684673,6750209,6815745,6881281,7012353,7077889,7143425,7274497,7405569,7536641,7602177,11337729,12124161,13107201,14286849,15532033,17563649,17825793,17956865,18022401,18415617,18743297,18808833,18874369,19202049,19267585,19333121,19398657,19595265,19726337,20054017,20512769,20774913,20971521,21299201,21692417,21757953,22478849,22544385,22675457,22872065,22937601,23003137,23265281,23461889,23527425,23592961,23658497,23789569,23855105,23920641,23986177,24051713,24117249,24182785,24248321,24313857,24444929,24510465,24576001],"frame":[786433,2097153,21692417],"function":[6029313,9109505,20774913],"flooding":[786433,2621441,21692417],"follow":[1],"fields":[131074,196610,262146,327682,393218,458754,524290,589826,655362,720898,786434,851970,1310722,2490370,20512769,20774913,20971521,21692417,22544385,22937601,23265281,23789569,23920641,23986177,24051713,24182785,24248321,24313857],"field":[917506,983042,1048578,1114114,1179650,1245186,1376258,1441794,1507330,1572866,1638402,1703938,1769474,1835010,1900546,1966082,2031618,2097154,2162690,2228226,2293762,2359298,2424834,2555906,2621442,2686978,2752514,2818050,2883586,2949122,3014658,3080194,3145730,3211266,3276802,3342338,3407874,3473410,3538946,3604482,3670018,3735554,3801090,3866626,3932162,3997698,4063234,4128770,4194306,4259842,4325378,4390914,4456450,4521986,4587522,4653058,4718594,4784130,4849666,4915202,4980738,5046274,5111810,5177346,5242882,5308418,5373954,5439490,5570562,5636098,5832706,5898242,6160386,6225922,6291458,6356994,6946818],"first":[7077890,8060929,8454145,19791873,20840449,23003138],"finalize":[5701633,5767169,5963777,6094849,6422529,6553601,6619137,6815745,7012353,7143425,7274498,7405569,7536641,11337729,12124161,14286849,15138819,15532033,15663108,17956865,18284547,20512769,20971521,21692417,22544385,22937601,23265281,23461889,23527425,23592961,23658497,23789569,23855105,23920641,24051713,24117249,24182785,24248321,24313857,24510465,24576002],"float":[3080193,3735553,4784129,4915201,5439489,5636097,5832705,5898241,6160385,6291457,6946817,13238273,13631489,17039361,17629185,19005441,22347777,23068673]}
|
1
docs/fti/FTI_103.json
Normal file
1
docs/fti/FTI_103.json
Normal file
@ -0,0 +1 @@
|
||||
{"getcomponent":[11337731,12124163,13107203,14286851,15532035,17956867,23592963,23920643,23986179,24051715,24117251,24182787,24248323,24313859],"getmessageunordered":[7602177,16056323,21299201],"getmessageordered":[7602177,20381699,21299201],"getcomponentsinparent":[11337733,12124165,13107205,14286853,15532037,17956869,23592965,23920645,23986181,24051717,24117253,24182789,24248325,24313861],"getcomponentinchildren":[11337732,12124164,13107204,14286852,15532036,17956868,23592964,23920644,23986180,24051716,24117252,24182788,24248324,24313860],"gethashcode":[5701633,5767169,5963777,6029314,6094849,6422529,6553601,6619137,6815745,7012353,7143425,7274497,7405569,7536641,9109506,11337729,12124161,13107201,14286849,15532033,17956865,20512769,20774914,20971521,21692417,22544385,22937601,23265281,23461889,23527425,23592961,23658497,23789569,23855105,23920641,23986177,24051713,24117249,24182785,24248321,24313857,24510465,24576001],"general":[5505025],"getfinalizesize":[7274497,15990786,24576001],"generic":[9502721,9764865,10551297,11075585,16056322,16252929,17104897,18481153,20381698],"getcomponentinparent":[11337730,12124162,13107202,14286850,15532034,17956866,23592962,23920642,23986178,24051714,24117250,24182786,24248322,24313858],"getinstanceid":[11337729,12124161,13107201,14286849,15532033,17956865,23592961,23920641,23986177,24051713,24117249,24182785,24248321,24313857],"gains":[10289153,11337729,12124161,17956865,23592961,23920641,24182785,24248321,24313857],"getclientid":[6029313,8912898,20774913],"gameobject":[196609,3670019,3801090,11272193,13107201,18022401,18087938,18415617,18743297,18874369,19267585,19398657,19726337,21495809,22937601,23920641,23986179,24051713,24117249,24182785,24248321,24313857],"getparameterautosend":[11337729,11993092,24182785],"getcomponentsinchildren":[11337734,12124166,13107206,14286854,15532038,17956870,23592966,23920646,23986182,24051718,24117254,24182790,24248326,24313862],"guitext":[18022401,18415617,18743297,18874369,19267585,19398657,19726337,23920641,23986177,24051713,24117249,24182785,24248321,24313857],"given":[6488066,6750209,6881281,7077890,7274497,7929857,8323073,9175041,9437185,11337734,11665409,12124166,13107201,13893633,14417921,15663105,16318465,16646146,17891330,17956870,18087937,18284545,18546690,18677761,19005441,19791873,20840449,21757954,22478849,22872065,23003138,23592966,23920646,23986177,24182790,24248326,24313862,24576001],"getconfig":[5963777,8847364,21692417],"guielement":[18022401,18415617,18743297,18874369,19267585,19398657,19726337,23920641,23986177,24051713,24117249,24182785,24248321,24313857],"games":[786433,3342337,21692417],"guitexture":[18022401,18415617,18743297,18874369,19267585,19398657,19726337,23920641,23986177,24051713,24117249,24182785,24248321,24313857],"gettype":[5701633,5767169,5963777,6029313,6094849,6422529,6553601,6619137,6815745,7012353,7143425,7274497,7405569,7536641,11337729,12124161,13107201,14286849,15532033,17956865,20512769,20774913,20971521,21692417,22544385,22937601,23265281,23461889,23527425,23592961,23658497,23789569,23855105,23920641,23986177,24051713,24117249,24182785,24248321,24313857,24510465,24576001],"getnetworkedobject":[8323076,11337729,12124161,17956865,23592961,23920641,24182785,24248321,24313857],"getchunkedmessage":[7602177,19136514,21299201],"gets":[589826,3604481,5242881,5963777,6029313,7077889,7274497,8323073,8847361,8912897,9371649,9764865,10092545,10158081,10289153,10551297,10682369,11337737,12124170,13893633,14417921,15990785,17891330,17956873,18022408,18415624,18743301,18874370,19267593,19398664,19464193,19529729,19726344,19857409,19922945,19988481,20119556,20185089,20250625,20578305,20643841,20709377,20774913,20840449,20905985,21102593,21233665,21430273,21561345,21626881,21692417,22085633,22151169,22609921,22740993,23003137,23068673,23134209,23199745,23330817,23592969,23920658,23986184,24051719,24117250,24182802,24248337,24313873,24576001],"getcomponents":[11337732,12124164,13107204,14286852,15532036,17956868,23592964,23920644,23986180,24051716,24117252,24182788,24248324,24313860]}
|
1
docs/fti/FTI_104.json
Normal file
1
docs/fti/FTI_104.json
Normal file
@ -0,0 +1 @@
|
||||
{"hingejoint":[18022401,18415617,18743297,18874369,19267585,19398657,19726337,23920641,23986177,24051713,24117249,24182785,24248321,24313857],"header":[19136513],"history":[786433,3080193,21692417],"handleobjectspawning":[786433,2555906,21692417],"hosts":[786433,3276801,21364737,21692418],"handlerid":[8716289],"hierarchy":[20512769,20971521,21299201,21692417,21757953,22478849,22544385,22872065,22937601,23003137,23265281,23461889,23527425,23658497,23789569,23855105,23920641,23986177,24051713,24117249,24182785,24248321,24313857,24379393,24444929,24510465,24576001],"hostid":[393218,1572867,7798786,20774914],"hookmethodname":[655361,1048578,23789569],"hideflags":[18022401,18415617,18743297,18874369,19267585,19398657,19726337,23920641,23986177,24051713,24117249,24182785,24248321,24313857],"hellman":[786433,3014657,21692417],"handshake":[786433,1900545,21692417],"handler":[7929857,8716289,11337730,12124162,17956866,23592962,23920642,24182786,24248322,24313858],"hasmissingparts":[7602177,17104898,21299201],"hasduplicates":[7602177,16252930,21299201],"handle":[786433,2555905,21692417],"hashing":[9109505],"hte":[393217,1441793,20774913],"hash":[5963779,6029313,8519685,8847361,9109507,11141123,20774913,21692419],"handlers":[9043969,9240577,9371649,9764865,9961473,10092545,10158081,10223617,10354689,10551297,10878977,11337743,12124175,12255233,12386305,12845057,12910593,13500417,13893633,14417921,17891330,17956879,18939906,20119558,20316162,21823490,23592975,23920655,24182799,24248335,24313871],"helper":[21299201,22020098,22413313,23003137,24444929],"host":[1310722,3866625,3932161,7208961,7798786,10944513,11730945,14286850,18022401,18743297,19267585,19398657,19726337,20905985,21233665,21364737,23265283,23920641,24051715,24182785,24248321,24313857]}
|
1
docs/fti/FTI_105.json
Normal file
1
docs/fti/FTI_105.json
Normal file
File diff suppressed because one or more lines are too long
1
docs/fti/FTI_107.json
Normal file
1
docs/fti/FTI_107.json
Normal file
@ -0,0 +1 @@
|
||||
{"keys":[589825,5111809,24051713],"key":[131073,786437,2752514,3014657,3211266,3407873,7077890,19791876,20840452,21692421,22544385,23003138],"known":[13041667,13631491,13697027,14352387,14548995,14942211,15007747,15073283,15335427,15400963,15597571,15728643,15925251,16384003,16515075,16580611,16973827,17498115,17629187,19070979]}
|
1
docs/fti/FTI_108.json
Normal file
1
docs/fti/FTI_108.json
Normal file
@ -0,0 +1 @@
|
||||
{"large":[7602177,19136514,21299201],"local":[8323073,10289153,11337730,12124162,17956866,18022401,18415617,18743297,19267585,19398657,19464193,19726337,21954561,22085633,23592962,23920643,23986177,24051713,24182787,24248323,24313859],"logic":[786433,2359297,21692417],"loose":[10682369,11337729,12124161,17956865,23592961,23920641,24182785,24248321,24313857],"library":[786433,2555905,21495809,21692417,24051713],"list":[786434,1769474,2424835,2686978,3276802,3342339,3538946,7602183,9502723,9764867,10551299,11075587,11337737,12124169,13107205,14286853,15532037,16056326,16187393,16252933,16646145,17104901,17432577,17891329,17956873,18219011,18284545,18350081,18481156,18546689,18939905,19136515,19660801,20119555,20316161,20381702,21037057,21299207,21692418,21823489,22216705,23396354,23592969,23920649,23986181,24051717,24117253,24182793,24248329,24313865],"longer":[18612225],"long":[14024705,14352385,14680065,15007745,15663105,15990785],"listen":[1310722,3473409,3866625,23265282],"locate":[18612225],"looking":[18612225],"link":[1],"lerp":[851969,4784129,24248321],"lag":[786433,3080193,21495809,21692417,21757953,22282241,24117249],"light":[18022401,18415617,18743297,18874369,19267585,19398657,19726337,23920641,23986177,24051713,24117249,24182785,24248321,24313857],"load":[5505025],"lagcompensationmanager":[6488066,16318466,18546690,19005442,20054019,21757956,22282241,23396354]}
|
1
docs/fti/FTI_109.json
Normal file
1
docs/fti/FTI_109.json
Normal file
File diff suppressed because one or more lines are too long
1
docs/fti/FTI_110.json
Normal file
1
docs/fti/FTI_110.json
Normal file
File diff suppressed because one or more lines are too long
1
docs/fti/FTI_111.json
Normal file
1
docs/fti/FTI_111.json
Normal file
@ -0,0 +1 @@
|
||||
{"ownerclientid":[18022401,18415617,19267585,19398657,19726337,20185090,22151170,23920641,23986177,24182785,24248321,24313857],"obj":[8650754],"ongainedownership":[10289154,11337729,12124161,17956865,23592961,23920641,24182785,24248321,24313857],"outside":[589825,5111809,24051713],"optional":[8847361,11730946,13041665,13631489,13697025,14352385,14548993,14942209,15007745,15073281,15335425,15400961,15597569,15728641,15925249,16056322,16384001,16515073,16580609,16842753,16973825,17498113,17629185,19070977,20381698],"ownedobjects":[131073,3538946,22544385],"onserverstarted":[589825,4653058,24051713],"objects":[6750209,16842753,17235969,20054017,21757953,22478849,23396353],"onlostownership":[10682370,11337729,12124161,17956865,23592961,23920641,24182785,24248321,24313857],"ownership":[10289153,10682369,11010049,11337730,12124162,13107201,17956866,23592962,23920642,23986177,24182786,24248322,24313858],"onclientdisconnectcallback":[589825,4456450,24051713],"operators":[20774913,22675458],"overrides":[6029314,11337729,17956865,20774914,23592961,24182785,24248321,24313857],"owns":[10354689,10878977,11337730,12124162,17956866,18022403,18939906,19267587,19398659,19529729,19726339,19922945,20185089,23592962,23920645,24182789,24248325,24313861],"override":[8650753,9109505,12255233,12386305,12845057,21495809,23920641],"object":[786433,2555905,5701636,5767174,5963782,6029316,6094854,6422532,6553604,6619142,6750211,6815750,7012358,7143428,7274500,7405572,7536646,8323073,8650757,9109505,9568261,9699329,9830405,9961473,10027013,10223617,10289153,10354689,10682369,10813441,10878977,11010049,11337751,11468801,11665410,12124183,13107215,14286862,15532046,16842753,17235969,17956887,18022405,18087939,18415627,18743298,18874370,18939906,19267589,19398661,19464193,19660802,19726341,19857410,20316162,20512776,20578305,20643842,20774916,20971527,21102593,21299201,21364738,21495809,21561346,21626881,21692425,21757953,22085633,22478852,22544391,22740993,22872065,22937607,23003137,23265287,23461893,23527429,23592983,23658501,23789573,23855109,23920670,23986204,24051730,24117267,24182814,24248350,24313886,24379393,24444929,24510471,24576005],"operator":[8060930,8454146],"order":[7602179,16056321,18481154,20381697,21299203],"original":[6684673,7602178,13369345,16056321,20381697,21299202,24444929],"obsolete":[11337729,12124161,13107201,14286849,15532033,17956865,18022417,18415633,18743313,18874385,19267601,19398673,19726353,23592961,23920658,23986194,24051730,24117266,24182802,24248338,24313874],"owned":[131073,3538945,18022401,18415617,19267585,19398657,19464193,19726337,22085633,22544385,23920641,23986177,24182785,24248321,24313857],"owner":[655361,917505,9699329,9961473,10223617,10813442,11337732,11468801,11665409,12124164,13107202,17956868,18415617,19660802,20316162,22151169,23592964,23789569,23920644,23986179,24182788,24248324,24313860],"overload":[7798785,8126465,9043969,9175041,9240577,9306113,9371649,9437185,9502721,9633793,9699329,9764865,9895937,9961473,10092545,10223617,10354689,10420225,10485761,10551297,10878977,11075585,11141121,11468801,11534337,12058625,12451841,12713985,12910593,13303809,13500417,13565953,13893633,14417921,15138817,15663105,16187393,16318465,16646145,17432577,17891329,18219009,18284545,18350081,18546689,18939905,19005441,19660801,20119553,20316161,21037057,21823489,22216705],"onclientconnectedcallback":[589825,4063234,24051713],"occur":[786433,2097153,21692417],"occurred":[5505025]}
|
1
docs/fti/FTI_112.json
Normal file
1
docs/fti/FTI_112.json
Normal file
File diff suppressed because one or more lines are too long
1
docs/fti/FTI_113.json
Normal file
1
docs/fti/FTI_113.json
Normal file
@ -0,0 +1 @@
|
||||
{"qostype":[1179650],"queue":[786433,2883585,21692417],"quaternion":[4521986,11730948,18087939],"qos":[262145,1179649,20512769]}
|
1
docs/fti/FTI_114.json
Normal file
1
docs/fti/FTI_114.json
Normal file
File diff suppressed because one or more lines are too long
1
docs/fti/FTI_115.json
Normal file
1
docs/fti/FTI_115.json
Normal file
File diff suppressed because one or more lines are too long
1
docs/fti/FTI_116.json
Normal file
1
docs/fti/FTI_116.json
Normal file
File diff suppressed because one or more lines are too long
1
docs/fti/FTI_117.json
Normal file
1
docs/fti/FTI_117.json
Normal file
@ -0,0 +1 @@
|
||||
{"uint64":[12451846,14745601,15073281,16121859,16515076,17432577,23724033,24379393],"useguilayout":[18022401,18415617,18743297,18874369,19267585,19398657,19726337,23920641,23986177,24051713,24117249,24182785,24248321,24313857],"url":[18612225],"unique":[18415617,21626881,23986177],"uint":[3145729,4063233,4456449,4521986,8126465,8323073,8716289,8912897,9175041,9371649,9502721,9764865,10485761,10551297,10813441,11665409,13565954,13893633,14090241,14548993,15728641,16252929,16318465,16842753,17104897,17301505,19922945,20185089,21626881,21954561,22151169,23134209],"ulong":[12451842,14745601,15073281,16121857,16515073],"unityengine":[11730948,18087938],"ump":[11337732,12124164,13107204,14286852,15532036,17956868,23592964,23920644,23986180,24051716,24117252,24182788,24248324,24313860],"uint32":[3145729,4063233,4456449,4521986,6488065,8126466,8323075,8716289,8912897,9175042,9371650,9502722,9764866,10485762,10551298,10813441,11337735,11665409,12124167,13565958,13893634,14090241,14548993,15728644,16187393,16252929,16318466,16646145,16842753,17104897,17301507,17432577,17891329,17956871,18219010,18546689,19922945,20119555,20185089,20774913,21626881,21757953,21954561,22151169,23134209,23592967,23724033,23920647,24182791,24248327,24313863,24379393],"updated":[655361,1048577,23789569],"unity":[589825,5111809,24051713],"user":[9043970,9175042,9240578,9306114,9371650,9437186,9502722,9633794,9699330,9764866,9895938,9961474,10092546,10223618,10354690,10420226,10485762,10551298,10878978,11075586,11468802,12058626,12713986,12910594,13303810,13500418,13893634,14417922],"using":[10747905,14286849,24051713],"udp":[1310721,3473409,23265281],"uses":[786434,2359297,3276801,21692418],"used":[131073,589825,786435,1769473,2162689,3342337,3407873,5111809,8716289,14811137,19267585,21364737,21495810,21692420,22544385,23330817,23986177,24051713,24117249,24182785,24576001],"uint16":[1245185,4325377,7798786,15204353,16187393,16908291,16973825,17498116,20774913,22740993],"ushort":[1245185,4325377,7798785,15204353,16908289,16973825,17498113,22740993]}
|
1
docs/fti/FTI_118.json
Normal file
1
docs/fti/FTI_118.json
Normal file
File diff suppressed because one or more lines are too long
1
docs/fti/FTI_119.json
Normal file
1
docs/fti/FTI_119.json
Normal file
@ -0,0 +1 @@
|
||||
{"writefloatarray":[7274497,17629189,24576001],"writeshort":[7274497,15794180,24576001],"writeintarray":[7274497,19070981,24576001],"writeuintarray":[7274497,15728645,24576001],"writedouble":[7274497,15859716,24576001],"writesbyte":[7274497,15269892,24576001],"writeuint":[7274497,17301508,24576001],"writelongarray":[7274497,15007749,24576001],"warp":[851969,6225921,24248321],"writeint":[7274497,18153476,24576001],"writebyte":[7274497,14155780,24576001],"web":[18612225],"writeulong":[7274497,16121860,24576001],"writealignbits":[7274497,16449539,24576001],"writebits":[7274497,16777221,24576001],"wait":[786433,1900545,21692417],"writedoublearray":[7274497,16580613,24576001],"websockets":[1310722,3473411,10747905,14286849,23265282,24051713],"writestring":[7274497,16711684,24576001],"writesbytearray":[7274497,15597573,24576001],"writefloat":[7274497,17039364,24576001],"writelong":[7274497,14680068,24576001],"writeulongarray":[7274497,16515077,24576001],"writeushortarray":[7274497,17498117,24576001],"writeshortarray":[7274497,16384005,24576001],"writebool":[7274497,17170436,24576001],"writeushort":[7274497,16908292,24576001],"write":[21495809,23920641],"written":[15138817,15663105],"writes":[7274497,15663105,18284545,24576001],"writebytearray":[7274497,15400965,24576001],"warpondestinationchange":[851969,6225922,24248321],"wheter":[196609,262145,786438,1376257,1638401,1703937,1835009,2031617,2490369,2555905,2818049,3014657,4194305,6029313,7208961,18743298,19988481,20512769,20774913,20971521,21430273,21692422,22937601,24051714]}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user