diff --git a/README.md b/README.md index a8987179..4ee7086a 100644 --- a/README.md +++ b/README.md @@ -109,8 +109,8 @@ You can get SynicSugar from OpenUPM or [SynicSugar/Release](https://github.com/s  These packages can be imported from **Window/PackageManager/MyRegistries**. Importing SynicSugar will automatically import the other required librarys. If uses synicsugar.unitypackage, import other three packages.
If you are using another version in your project, that one will probably work. However, SynicSugar has been developed using the following: * Epic Online Services Plugin for Unity: 3.0.3 - * UniTask: 2.3.3 - * MemoryPack: 1.9.14 + * UniTask: 2.5.5 + * MemoryPack: 1.10.0 3. Import the rest (Skip if downloading as unitypackage.)
diff --git a/Resources/GenaratedSampleNetworkplayer.cs b/Resources/GenaratedSampleNetworkplayer.cs new file mode 100644 index 00000000..1b8ee197 --- /dev/null +++ b/Resources/GenaratedSampleNetworkplayer.cs @@ -0,0 +1,71 @@ + +namespace YOURNAMESPACE { + public partial class GenaratedSampleNetworkplayer : INetworkOwner, IGetPlayer { + //For Basis + UserId _ownerUserID; + public UserId OwnerUserID { + get { return _ownerUserID; } + set { + _ownerUserID = UserId.GetUserId(value); + ConnectHub.Instance.RegisterInstance(_ownerUserID, this); + } + } + public void SetOwnerID(UserId value){ + OwnerUserID = value; + } + /// + /// Is this the instance's local? Invalid in Awake. + /// + public bool isLocal { get { return p2pInfo.Instance.IsLoaclUser(_ownerUserID); } } + + /// + /// Is this the id's instance? Invalid in Awake. + /// + public bool ThisOwnerIs(UserId id){ + return id == _ownerUserID; + } + //---For Sync var--- + //These have not been changed since the beginning. + //So performance is not good + + //For private SyncVar + // internal void SetLocalYOURSYNCVAR(YOURSYNCVARARG value) { + // YOURSYNCVAR = value; + // } + bool isWaitingYOURSYNCVARInterval; + void StartSynicYOURSYNCVAR() { + if(isWaitingYOURSYNCVARInterval){ + return; + } + isWaitingYOURSYNCVARInterval = true; + SyniYOURSYNCVAR().Forget(); + } + + async UniTask SyniYOURSYNCVAR(){ + var preValue = YOURSYNCVAR; + + EOSp2p.SendPacketToAll((byte)ConnectHub.CHANNELLIST.YOURSYNCVAR, MemoryPack.MemoryPackSerializer.Serialize(YOURSYNCVAR)).Forget(); + await UniTask.Delay(IntervalTime.OnConfig); + + if(p2pConnectorForOtherAssembly.Instance.p2pToken.IsCancellationRequested){ + return; + } + if(preValue == YOURSYNCVAR){ + isWaitingYOURSYNCVARInterval = false; + return; + } + SynicYOURSYNCVAR().Forget(); + } + + //---For RPC--- + //This could be changed to a method of creating and inserting this process-self in IL in future. + //Compromise because it was complicated. + //This function is inserted at the top of the process with the RPC attribute + void SynicSugarRpc_YOURRPC(YOURPRCARG value) { + if(isLocal){ + EOSp2p.SendLargePacketsToAll((byte)ConnectHub.CHANNELLIST.YOURRPC, MemoryPack.MemoryPackSerializer.Serialize(value)).Forget(); + } + } + } +} + diff --git a/docs/content/AboutSynicSugar/QandA.md b/docs/content/AboutSynicSugar/QandA.md new file mode 100644 index 00000000..e21a2a51 --- /dev/null +++ b/docs/content/AboutSynicSugar/QandA.md @@ -0,0 +1,83 @@ ++++ +title = "Q&A" +weight = 3 ++++ +# Q&A +
+Is there a CCU (Concurrent User) limit? +Probably not. As long as you're not using it in extreme use, it should be fine.
+ +[Service Usage Limitations](https://dev.epicgames.com/docs/epic-online-services/eos-get-started/working-with-the-eos-sdk/conventions-and-limitations#service-usage-limitations) + +
+ +
+Where can I find the DevTool for DebugLogin? +It's included in the SDK, which can be downloaded from the "Download and configure EOS SDK" section after creating a product page in the Developer portal.
+Register test accounts in the Organization section of the Devportal, then launch the Devtool. You need to log in with each account and keep the Tool open in the background during testing.
+The DeviceID is the same for both the Editor and built versions, so use DebugDeviceID + DevLogin or similar for debugging.

+
+ +
+What does SourceGenerator do? +It adds classes based on attributes at compile time. The example is such this. + +[GenaratedSampleNetworkplayer](https://github.com/skeyll/SynicSugar/blob/main/Resources/GenaratedSampleNetworkplayer.cs). + +
+ +
+About Transport of P2P. +EOS uses DTLS (Datagram Transport Layer Security), which is an encrypted version of UDP packets. In addition to this, the EOS SDK has an internal mechanism to resend packets based on factors such as order and reliability. When reliability is enabled, packets are generally guaranteed to be delivered successfully.

+
+ +
+Large Packets in SynicSugar +While the EOS SDK can only send packets up to 1170 bytes, SynicSugar divides packets into 1166-byte segments and attaches its own unique header before transmission. On the receiving end, these segments are stored in Dictionary, organized by CH (Channel). Once all segments of a packet have been received, they are combined into a single byte array and executed as an RPC. The system can send up to 256 packets. If this limit is exceeded, an error is thrown.

+
+ +
+About Mobile Store Reviews +Mobile store reviews (for both Android and iOS) can be passed even using UDP alone. In the notes section of your review application, please mention that UDP is used and that online features may not function in the review environment. If you're concerned, it might be a good idea to add a tutorial using an SynicSugar Offline Mode.

+
+ +
+What entitlement dose need for macOS notarization? +When using VC (Voice Chat) and network features, add the following permissions and notarize the app: + +```YOURGAME.entitlements + + + + + com.apple.security.cs.disable-library-validation + + com.apple.security.cs.disable-executable-page-protection + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.device.audio-input + + com.apple.security.device.microphone + + com.apple.security.network.client + + com.apple.security.network.server + + + +``` + +Even if the app passes notarization with these permissions, there will be a one-time confirmation prompt when the app launches, asking for permission to access the DeviceID key from the Keychain. +
+ + + + + + + diff --git a/docs/content/AboutSynicSugar/Symbols.md b/docs/content/AboutSynicSugar/Symbols.md index 0a307280..7140dda8 100644 --- a/docs/content/AboutSynicSugar/Symbols.md +++ b/docs/content/AboutSynicSugar/Symbols.md @@ -1,6 +1,6 @@ +++ title = "Symbols" -weight = 3 +weight = 4 +++ ## Symbols diff --git a/docs/content/AboutSynicSugar/_index.md b/docs/content/AboutSynicSugar/_index.md index a93ab787..bde2348b 100644 --- a/docs/content/AboutSynicSugar/_index.md +++ b/docs/content/AboutSynicSugar/_index.md @@ -1,5 +1,5 @@ +++ -title = "About SynicSugar" +title = "AboutSynicSugar" weight = 0 sort_by = "weight" insert_anchor_links = "right" diff --git a/docs/content/_index.md b/docs/content/_index.md index 279474b7..ea761f04 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -17,7 +17,7 @@ There is no charge for use and no CCU limits or server management thanks to Epic Almost SynicSugar APIs are zero-allocation in Runtime, so the process is sonic. SynicSugar will be optimized for small-party game not covered by [Mirror](https://github.com/MirrorNetworking/Mirror). Can get it from [Github](https://github.com/skeyll/SynicSugar). -```csharp +```cs using SynicSugar.P2P; using UnityEngine; [NetworkPlayer(true)]