返回介绍

Network.InitializeSecurity 初始化安全层

发布于 2019-12-18 15:38:07 字数 1659 浏览 886 评论 0 收藏 0

JavaScript => public static function InitializeSecurity(): void;
C# => public static void InitializeSecurity();

Description 描述

Initializes security layer.

初始化安全层。

You need to call this function on the server before calling Network.InitializeServer. Don't call this function on the client.

你需要在Network.InitializeServer调用之后在服务器上调用这个函数。不要在客户端调用该函数。

Once your online game reaches a certain popularity people will try to cheat. You will need to account for this both at the game layer and at the network layer. Unity handles the network layer by providing secure connections if you wish to use them. * Uses AES encryption. Prevents unauthorized reads and blocks replay attacks * Adds CRCs so that data tampering can be detected. * Uses randomized, encrypted SYNCookies to prevent unauthorized logins. * Uses RSA encryption to protect the AES key. Most games will want to use secure connections. However, they add up to 15 bytes per packet and take time to compute so you may wish to limit usage to deployed games only.

JavaScript:

function Start () {
		Network.InitializeSecurity();
		Network.InitializeServer(32, 25000);
	}

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
    void Start() {
        Network.InitializeSecurity();
        Network.InitializeServer(32, 25000);
    }
}

network

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文