Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Drshk7 · Jan 06, 2014 at 02:48 AM · networkingmultiplayernetworksecurityinitialization

You may not be connected when initializing security layer.

Hello! I use my computer to test my builds. I make one build be the server and the editor to be the client. The build (server) disconnects and the editor disconnects with it. After that, I make a server with the editor and it says 'You may not be connected when initializing security layer.' It really bugs me. Is it because I'm using only one computer?

P.S.: I used the same IP and port for the two times I've created the server. I'm using Unity's built-in networking (Network.Connect(); and Network.InitializeSecurity(); and Network.InitializeServer();)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Jan 06, 2014 at 03:16 AM

Are you sure that you call "Network.InitializeSecurity" before you call "Network.InitializeServer" or "Network.Connect"? Also are you sure that you're disconnected? You can check Network-peerType if you're Disconnected.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Drshk7 · Jan 06, 2014 at 03:41 AM 0
Share

It says I'm not connected whenever I make a server so that isn't the problem... Yup I call it before... It happens when I (editor) connect to a server then the server EXITS out by clicking the X on the window. After that if I (editor) make a server, it does that.

avatar image Drshk7 · Jan 06, 2014 at 08:43 PM 0
Share

Any suggestions?

avatar image Drshk7 · Jan 07, 2014 at 04:24 AM 0
Share

I've tried debug logging. Before I create the server, I'm always disconnected. I also tried doing timers to wait after initializing security but that didn't work either. Yes, I call it before. Also, you don't put Network.InitializeSecurity before Network.Connect because you're not supposed to call it on the client.

avatar image AlucardJay · Jun 09, 2014 at 02:13 PM 0
Share

I can also confirm this is happening. Running Build and Editor :

  • Build creates a server

  • Editor joins the server

  • Build closes the server with Network.Disconnect(150);

  • Editor console reports The server has disconnected from the client. $$anonymous$$ost likely the server has shut down.

  • Editor debug from OnDisconnectedFromServer is from when info == NetworkDisconnection.Disconnected

  • Editor debug from return to main menu function is from when Network.peerType == NetworkPeerType.Disconnected

  • Editor creates a server

  • Editor reports You may not be connected when initializing security layer.

I tried adding Network.Disconnect(150); to OnDisconnectedFromServer but that just crashed the editor.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity networking tutorial? 6 Answers

Multiplayer desynchronize when grabbing an object by code. 0 Answers

Do i need to have 2 seperate apps communicating for server/client relationship? 2 Answers

How to implement a turn-based mobile game that allows the game to be closed until other player takes their turn? 1 Answer

network player only flip on LAN Host not in Lan Client 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges