diff --git a/TestVelGameServer/Assets/RPCTest.cs b/TestVelGameServer/Assets/RPCTest.cs
new file mode 100644
index 0000000..d462359
--- /dev/null
+++ b/TestVelGameServer/Assets/RPCTest.cs
@@ -0,0 +1,32 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using UnityEngine;
+using VelNet;
+
+public class RPCTest : NetworkComponent
+{
+ // Start is called before the first frame update
+ void Start()
+ {
+ }
+
+ // Update is called once per frame
+ private void Update()
+ {
+ if (Input.GetKeyDown(KeyCode.R))
+ {
+ SendRPC(nameof(TestRPC), true);
+ }
+ }
+
+ private void TestRPC()
+ {
+ Debug.LogError("RPC RECEIVED!");
+ }
+
+ public override void ReceiveBytes(byte[] message)
+ {
+ Debug.LogError("WOW. BYTES");
+ }
+}
\ No newline at end of file
diff --git a/TestVelGameServer/Assets/RPCTest.cs.meta b/TestVelGameServer/Assets/RPCTest.cs.meta
new file mode 100644
index 0000000..6f48220
--- /dev/null
+++ b/TestVelGameServer/Assets/RPCTest.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2bcc94802a5742d4299e48c898e52dfa
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/PlayerPrefab.prefab b/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/PlayerPrefab.prefab
index 94ec1b1..02d1047 100644
--- a/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/PlayerPrefab.prefab
+++ b/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/PlayerPrefab.prefab
@@ -28,6 +28,7 @@ Transform:
m_LocalRotation: {x: -0.70710635, y: -0, z: -0, w: 0.7071073}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 8, y: 0.1, z: 8}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3076416102083120807}
m_RootOrder: 0
@@ -51,6 +52,7 @@ MeshRenderer:
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
+ m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
@@ -114,6 +116,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6602982999811082154}
m_Father: {fileID: 0}
@@ -138,6 +141,7 @@ MeshRenderer:
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
+ m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
diff --git a/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/test.unity b/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/test.unity
index a9d0e78..da36a24 100644
--- a/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/test.unity
+++ b/TestVelGameServer/Assets/Samples/VelNet/1.0.4/Example/test.unity
@@ -193,6 +193,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 626742070}
m_RootOrder: 0
@@ -296,6 +297,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 138032023}
- {fileID: 1557879931}
@@ -416,6 +418,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 117638565}
m_RootOrder: 0
@@ -453,6 +456,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 711524767}
m_RootOrder: 0
@@ -595,6 +599,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1894247853}
- {fileID: 117638565}
@@ -664,6 +669,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 948755938}
m_RootOrder: 0
@@ -777,6 +783,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
@@ -809,6 +816,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1992361063}
m_RootOrder: 0
@@ -889,6 +897,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1081889596}
m_Father: {fileID: 244561620}
@@ -1021,6 +1030,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1047954372}
m_RootOrder: 1
@@ -1138,7 +1148,10 @@ MonoBehaviour:
m_HideMobileInput: 0
m_CharacterValidation: 0
m_CharacterLimit: 0
- m_OnEndEdit:
+ m_OnSubmit:
+ m_PersistentCalls:
+ m_Calls: []
+ m_OnDidEndEdit:
m_PersistentCalls:
m_Calls: []
m_OnValueChanged:
@@ -1162,6 +1175,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2034439}
- {fileID: 1560686264}
@@ -1300,6 +1314,7 @@ Transform:
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
@@ -1333,6 +1348,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 162005664}
- {fileID: 1484033256}
@@ -1395,7 +1411,10 @@ MonoBehaviour:
m_HideMobileInput: 0
m_CharacterValidation: 0
m_CharacterLimit: 0
- m_OnEndEdit:
+ m_OnSubmit:
+ m_PersistentCalls:
+ m_Calls: []
+ m_OnDidEndEdit:
m_PersistentCalls:
m_Calls: []
m_OnValueChanged:
@@ -1517,6 +1536,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1047954372}
m_RootOrder: 2
@@ -1555,6 +1575,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1401860307}
m_Father: {fileID: 244561620}
@@ -1753,6 +1774,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -20}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
@@ -1786,6 +1808,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1055818112}
m_Father: {fileID: 927188573}
@@ -1876,6 +1899,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 912887456}
- {fileID: 1154194182}
@@ -1986,6 +2010,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 359309141}
- {fileID: 1840952814}
@@ -2084,7 +2109,10 @@ MonoBehaviour:
m_HideMobileInput: 0
m_CharacterValidation: 0
m_CharacterLimit: 0
- m_OnEndEdit:
+ m_OnSubmit:
+ m_PersistentCalls:
+ m_Calls: []
+ m_OnDidEndEdit:
m_PersistentCalls:
m_Calls: []
m_OnValueChanged:
@@ -2164,6 +2192,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 244561620}
m_RootOrder: 10
@@ -2242,6 +2271,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2144436500}
- {fileID: 615558652}
@@ -2328,6 +2358,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1047954372}
m_Father: {fileID: 912887456}
@@ -2366,6 +2397,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 545137760}
m_RootOrder: 0
@@ -2471,6 +2503,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
@@ -2487,7 +2520,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 233344de094f11341bdb834d564708dc, type: 3}
m_Name:
m_EditorClassIdentifier:
- host: velnet-lts.ugavel.com
+ host: vn.ugavel.com
port: 5000
udpConnected: 0
userid: -1
@@ -2526,6 +2559,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1679565284}
m_Father: {fileID: 927188573}
@@ -2652,6 +2686,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1295274441}
m_Father: {fileID: 244561620}
@@ -2784,6 +2819,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1278634767}
m_RootOrder: 0
@@ -2863,6 +2899,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 864104176}
m_RootOrder: 0
@@ -2942,6 +2979,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1997780490}
m_RootOrder: 0
@@ -3037,6 +3075,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 818.5, y: 223, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
@@ -3143,6 +3182,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 711524767}
m_RootOrder: 1
@@ -3222,6 +3262,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 244561620}
m_RootOrder: 11
@@ -3301,6 +3342,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 117638565}
m_RootOrder: 1
@@ -3376,6 +3418,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 626742070}
m_RootOrder: 1
@@ -3453,6 +3496,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2033163677}
m_Father: {fileID: 1154194182}
@@ -3492,6 +3536,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2118429759}
m_Father: {fileID: 244561620}
@@ -3624,6 +3669,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 948755938}
m_RootOrder: 1
@@ -3703,6 +3749,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 244561620}
m_RootOrder: 0
@@ -3783,6 +3830,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 498776800}
m_Father: {fileID: 948755938}
@@ -3916,6 +3964,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1428857710}
m_Father: {fileID: 244561620}
@@ -4020,6 +4069,71 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1997780489}
m_CullTransparentMesh: 1
+--- !u!1 &2021764943
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 2021764946}
+ - component: {fileID: 2021764945}
+ - component: {fileID: 2021764944}
+ m_Layer: 0
+ m_Name: TestRPC Object
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &2021764944
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2021764943}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 5515094c5c544b6b8ed7fd51a86548d4, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ ownershipLocked: 0
+ networkId:
+ sceneNetworkId: 102
+ prefabName:
+ isSceneObject: 1
+ syncedComponents:
+ - {fileID: 2021764945}
+--- !u!114 &2021764945
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2021764943}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 2bcc94802a5742d4299e48c898e52dfa, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ networkObject: {fileID: 2021764944}
+--- !u!4 &2021764946
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 2021764943}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 2.9278836, y: 2.2367568, z: 0.06653424}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 7
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2033163676
GameObject:
m_ObjectHideFlags: 0
@@ -4048,6 +4162,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1679565284}
m_RootOrder: 0
@@ -4123,6 +4238,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1760805525}
m_RootOrder: 0
@@ -4202,6 +4318,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
+ m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1047954372}
m_RootOrder: 0
@@ -4264,6 +4381,10 @@ PrefabInstance:
propertyPath: sceneNetworkId
value: 100
objectReference: {fileID: 0}
+ - target: {fileID: 8565720275311462452, guid: 6e4a023f70e01405e8b249a4488fe319, type: 3}
+ propertyPath: m_Enabled
+ value: 1
+ objectReference: {fileID: 0}
- target: {fileID: 8565720275311462453, guid: 6e4a023f70e01405e8b249a4488fe319, type: 3}
propertyPath: m_Name
value: TestNetworkedGameObject
diff --git a/TestVelGameServer/Assets/test.cs b/TestVelGameServer/Assets/test.cs
new file mode 100644
index 0000000..2033b33
--- /dev/null
+++ b/TestVelGameServer/Assets/test.cs
@@ -0,0 +1,34 @@
+using UnityEngine;
+using VelNet;
+
+public class test : MonoBehaviour
+{
+ // Start is called before the first frame update
+ private void Start()
+ {
+ VelNetManager.OnJoinedRoom += roomName =>
+ {
+ Debug.Log("VelNet room joined!!!!!: " + roomName);
+ //VelNetManager.GetRoomData(roomName);
+ byte[] testpacekt = new[] { (byte)244 };
+ VelNetManager.SendCustomMessage(testpacekt, true, true, false);
+ };
+
+ VelNetManager.CustomMessageReceived += (senderId, dataWithCategory) =>
+ {
+ //customPacketReceived(senderId, dataWithCategory);
+ if (dataWithCategory[0] == (byte)244)
+ {
+ Debug.Log("received test packet");
+ return;
+ }
+
+ ;
+ };
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+ }
+}
\ No newline at end of file
diff --git a/TestVelGameServer/Assets/test.cs.meta b/TestVelGameServer/Assets/test.cs.meta
new file mode 100644
index 0000000..354019c
--- /dev/null
+++ b/TestVelGameServer/Assets/test.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5ea1fe0eb58e4184bbb2edcc99c51119
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/TestVelGameServer/Assets/test2.unity b/TestVelGameServer/Assets/test2.unity
new file mode 100644
index 0000000..9392990
--- /dev/null
+++ b/TestVelGameServer/Assets/test2.unity
@@ -0,0 +1,191 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!29 &1
+OcclusionCullingSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_OcclusionBakeSettings:
+ smallestOccluder: 5
+ smallestHole: 0.25
+ backfaceThreshold: 100
+ m_SceneGUID: 00000000000000000000000000000000
+ m_OcclusionCullingData: {fileID: 0}
+--- !u!104 &2
+RenderSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 9
+ m_Fog: 0
+ m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+ m_FogMode: 3
+ m_FogDensity: 0.01
+ m_LinearFogStart: 0
+ m_LinearFogEnd: 300
+ m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
+ m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
+ m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
+ m_AmbientIntensity: 1
+ m_AmbientMode: 0
+ m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
+ m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
+ m_HaloStrength: 0.5
+ m_FlareStrength: 1
+ m_FlareFadeSpeed: 3
+ m_HaloTexture: {fileID: 0}
+ m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
+ m_DefaultReflectionMode: 0
+ m_DefaultReflectionResolution: 128
+ m_ReflectionBounces: 1
+ m_ReflectionIntensity: 1
+ m_CustomReflection: {fileID: 0}
+ m_Sun: {fileID: 0}
+ m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
+ m_UseRadianceAmbientProbe: 0
+--- !u!157 &3
+LightmapSettings:
+ m_ObjectHideFlags: 0
+ serializedVersion: 12
+ m_GIWorkflowMode: 1
+ m_GISettings:
+ serializedVersion: 2
+ m_BounceScale: 1
+ m_IndirectOutputScale: 1
+ m_AlbedoBoost: 1
+ m_EnvironmentLightingMode: 0
+ m_EnableBakedLightmaps: 1
+ m_EnableRealtimeLightmaps: 0
+ m_LightmapEditorSettings:
+ serializedVersion: 12
+ m_Resolution: 2
+ m_BakeResolution: 40
+ m_AtlasSize: 1024
+ m_AO: 0
+ m_AOMaxDistance: 1
+ m_CompAOExponent: 1
+ m_CompAOExponentDirect: 0
+ m_ExtractAmbientOcclusion: 0
+ m_Padding: 2
+ m_LightmapParameters: {fileID: 0}
+ m_LightmapsBakeMode: 1
+ m_TextureCompression: 1
+ m_FinalGather: 0
+ m_FinalGatherFiltering: 1
+ m_FinalGatherRayCount: 256
+ m_ReflectionCompression: 2
+ m_MixedBakeMode: 2
+ m_BakeBackend: 1
+ m_PVRSampling: 1
+ m_PVRDirectSampleCount: 32
+ m_PVRSampleCount: 512
+ m_PVRBounces: 2
+ m_PVREnvironmentSampleCount: 256
+ m_PVREnvironmentReferencePointCount: 2048
+ m_PVRFilteringMode: 1
+ m_PVRDenoiserTypeDirect: 1
+ m_PVRDenoiserTypeIndirect: 1
+ m_PVRDenoiserTypeAO: 1
+ m_PVRFilterTypeDirect: 0
+ m_PVRFilterTypeIndirect: 0
+ m_PVRFilterTypeAO: 0
+ m_PVREnvironmentMIS: 1
+ m_PVRCulling: 1
+ m_PVRFilteringGaussRadiusDirect: 1
+ m_PVRFilteringGaussRadiusIndirect: 5
+ m_PVRFilteringGaussRadiusAO: 2
+ m_PVRFilteringAtrousPositionSigmaDirect: 0.5
+ m_PVRFilteringAtrousPositionSigmaIndirect: 2
+ m_PVRFilteringAtrousPositionSigmaAO: 1
+ m_ExportTrainingData: 0
+ m_TrainingDataDestination: TrainingData
+ m_LightProbeSampleCountMultiplier: 4
+ m_LightingDataAsset: {fileID: 0}
+ m_LightingSettings: {fileID: 0}
+--- !u!196 &4
+NavMeshSettings:
+ serializedVersion: 2
+ m_ObjectHideFlags: 0
+ m_BuildSettings:
+ serializedVersion: 2
+ agentTypeID: 0
+ agentRadius: 0.5
+ agentHeight: 2
+ agentSlope: 45
+ agentClimb: 0.4
+ ledgeDropHeight: 0
+ maxJumpAcrossDistance: 0
+ minRegionArea: 2
+ manualCellSize: 0
+ cellSize: 0.16666667
+ manualTileSize: 0
+ tileSize: 256
+ accuratePlacement: 0
+ maxJobWorkers: 0
+ preserveTilesOutsideBounds: 0
+ debug:
+ m_Flags: 0
+ m_NavMeshData: {fileID: 0}
+--- !u!1 &1148318672
+GameObject:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ serializedVersion: 6
+ m_Component:
+ - component: {fileID: 1148318674}
+ - component: {fileID: 1148318673}
+ - component: {fileID: 1148318675}
+ m_Layer: 0
+ m_Name: GameObject
+ m_TagString: Untagged
+ m_Icon: {fileID: 0}
+ m_NavMeshLayer: 0
+ m_StaticEditorFlags: 0
+ m_IsActive: 1
+--- !u!114 &1148318673
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1148318672}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 233344de094f11341bdb834d564708dc, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ host: velnet-lts.ugavel.com
+ port: 5000
+ udpConnected: 0
+ userid: -1
+ connected: 0
+ prefabs:
+ - {fileID: 9102273340480352682, guid: d4158ab9c4a204cdbba28d3273fc1fb3, type: 3}
+ - {fileID: 3951900052977689805, guid: 6e4a023f70e01405e8b249a4488fe319, type: 3}
+ sceneObjects: []
+ deletedSceneObjects: []
+--- !u!4 &1148318674
+Transform:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1148318672}
+ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+ m_LocalPosition: {x: 297.37976, y: 241.59624, z: -3.2564697}
+ m_LocalScale: {x: 1, y: 1, z: 1}
+ m_Children: []
+ m_Father: {fileID: 0}
+ m_RootOrder: 0
+ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &1148318675
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1148318672}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 5ea1fe0eb58e4184bbb2edcc99c51119, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
diff --git a/TestVelGameServer/Assets/test2.unity.meta b/TestVelGameServer/Assets/test2.unity.meta
new file mode 100644
index 0000000..aadeec9
--- /dev/null
+++ b/TestVelGameServer/Assets/test2.unity.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: dda4edde45d871c4c9cc53849f3b62c7
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/TestVelGameServer/Packages/VelNetUnity/Runtime/NetworkComponent.cs b/TestVelGameServer/Packages/VelNetUnity/Runtime/NetworkComponent.cs
index f1a9b31..70548e4 100644
--- a/TestVelGameServer/Packages/VelNetUnity/Runtime/NetworkComponent.cs
+++ b/TestVelGameServer/Packages/VelNetUnity/Runtime/NetworkComponent.cs
@@ -1,4 +1,8 @@
-using UnityEngine;
+using System;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using UnityEngine;
namespace VelNet
{
@@ -13,20 +17,95 @@ namespace VelNet
///
protected void SendBytes(byte[] message, bool reliable = true)
{
- networkObject.SendBytes(this, message, reliable);
+ networkObject.SendBytes(this, false, message, reliable);
}
-
+
///
/// call this in child classes to send a message to other people
///
protected void SendBytesToGroup(string group, byte[] message, bool reliable = true)
{
- networkObject.SendBytesToGroup(this, group, message, reliable);
+ networkObject.SendBytesToGroup(this, false, group, message, reliable);
}
///
/// This is called by when messages are received for this component
///
public abstract void ReceiveBytes(byte[] message);
+
+ public void ReceiveRPC(byte[] message)
+ {
+ using MemoryStream mem = new MemoryStream(message);
+ using BinaryReader reader = new BinaryReader(mem);
+ byte methodIndex = reader.ReadByte();
+ int length = reader.ReadInt32();
+ byte[] parameterData = reader.ReadBytes(length);
+
+ MethodInfo[] mInfos = GetType().GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic);
+ Array.Sort(mInfos, (m1, m2) => string.Compare(m1.Name, m2.Name, StringComparison.Ordinal));
+ try
+ {
+ mInfos[methodIndex].Invoke(this, length > 0 ? new object[] { parameterData } : Array.Empty