private void Start() { socket = GetComponent<NetSocket>(); zoneManager = GetComponent<NetZoneManager>(); zoneServer = GetComponent<NetZoneServer>(); aiManager = GetComponent<AiManager>(); ExampleItems.PopulateItemDatabase(); zoneServer.OnAssignment += AssignedToZone; socket.ProtocolAuthority = true; socket.AcceptConnections = true; socket.MaxConnections = 512; socket.Events.OnPeerApproval += PeerApproval; socket.Events.OnSocketStart += SocketStart; socket.Events.OnFailedToConnect += FailedToConnect; socket.StartSocket(ServerAddress + ":" + ServerPortRoot); socket.RegisterRpcListener(this); }
private void Start() { socket = GetComponent <NetSocket>(); zoneManager = GetComponent <NetZoneManager>(); zoneServer = GetComponent <NetZoneServer>(); aiManager = GetComponent <AiManager>(); ExampleItems.PopulateItemDatabase(); zoneServer.OnAssignment += AssignedToZone; socket.ProtocolAuthority = true; socket.AcceptConnections = true; socket.MaxConnections = 512; socket.Events.OnPeerApproval += PeerApproval; socket.Events.OnSocketStart += SocketStart; socket.Events.OnFailedToConnect += FailedToConnect; socket.StartSocket(ServerAddress + ":" + ServerPortRoot); socket.RegisterRpcListener(this); }