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 sgmongo · Oct 04, 2013 at 03:01 PM · errornetwork

Network errors and update failures

I'm receiving two error codes and my scene is very simple. Just trying to connect to a host. Very simple stuff. Here is my code for both the Server and Client.

Server:

 #pragma strict
 
 
 var accounttools : GameObject;
 var loginhost : GameObject;
 
 //Hidden Variable List
 @System.NonSerialized
 var LSC_Timer : float = 0;
 @System.NonSerialized
 var IC_Timer : float = 0;
 @System.NonSerialized
 var InternetStatus : String = "Testing";
 @System.NonSerialized
 private var hostdata : HostData[];
 @System.NonSerialized
 var StartupLoginServer : boolean = false;
 
 
 //Visible Variable List
 var gameName : String = "Rogue_Republic_Test";
 
 
 
 // Script Specific Functions
 
 function InternetCheck()
 {
     // 74.125.224.72 is Google, When we have our own server check against
     // its IP to determine internet viability.
     var testPing : Ping = new Ping("74.125.224.72");
     while(!testPing.isDone)
     {
         if (IC_Timer > 2)
         {
             IC_Timer = 0;
             InternetStatus = "Internet Unavailable";
             Debug.Log(InternetStatus);
             return;
         }
         IC_Timer += Time.deltaTime;
         yield;
 
     }
     InternetStatus = "Internet Available";
     Debug.Log(InternetStatus);
 }
 
 function OnMasterServerEvent (mse:MasterServerEvent) {
     if ( mse == MasterServerEvent.RegistrationSucceeded ) {
         Debug.Log("Login Server Online");
         accounttools.active = true;
         loginhost.active = true;
     }
     if ( mse == MasterServerEvent.RegistrationFailedGameName ||
          mse == MasterServerEvent.RegistrationFailedGameType ||
          mse == MasterServerEvent.RegistrationFailedNoServer )
     {
         Debug.Log("Login Server Failure.");
     }
 }
 
 // Core Functions
 function Start () 
 {
     InternetCheck();
 }
 
 function Update () 
 {
     //If internet is available start the login server.
     if (InternetStatus == "Internet Available")
     {
         Debug.Log("Starting Login Server");
         Network.InitializeServer (32, 24001, !Network.HavePublicAddress());
         MasterServer.RegisterHost( gameName, "RR_Test_Login_Server", "Server Data Placeholder");
         InternetStatus = "Login Server is being Resolved";
     }
 }


And this is for the Client:

 var playertestobj : Transform;
 var playerinstantiated : boolean = false;
 //Hidden Variable List
 //@System.NonSerialized
 var LSC_Timer : float = 0;
 //@System.NonSerialized
 var IC_Timer : float = 0;
 //@System.NonSerialized
 var InternetStatus : String = "Testing";
 //@System.NonSerialized
 var Refreshing : boolean = false;
 @System.NonSerialized
 private var hostdata : HostData[];
 @System.NonSerialized
 var ConnectToLogin : boolean = false;
 
 
 
 //Visible Variable List
 var gameName : String = "Rogue_Republic_Test";
 
 
 
 // Script Specific Functions
 
 function InternetCheck()
 {
     // 74.125.224.72 is Google, When we have our own server check against
     // its IP to determine internet viability.
     var testPing : Ping = new Ping("74.125.224.72");
     while(!testPing.isDone)
     {
         if (IC_Timer > 2)
         {
             IC_Timer = 0;
             InternetStatus = "Internet Unavailable";
             Debug.Log(InternetStatus);
             return;
         }
         IC_Timer += Time.deltaTime;
         yield;
 
     }
     InternetStatus = "Internet Available";
     Refreshing = true;
     Debug.Log(InternetStatus);
 }
 
 function refreshHostList() {
     MasterServer.ClearHostList();
     MasterServer.RequestHostList("Rogue_Republic_Test");
 }
 
 @RPC
 function login () {
     
 }
 
 // Core Functions
 
 
 function Start () 
 {
     InternetCheck();
     refreshHostList();
 }
 
 
 
 function Update () 
 {
     //If internet is available grab serverlist, connect to the login server.
     if (InternetStatus == "Internet Available")
     {
         
         if (Refreshing)
         {
             if (MasterServer.PollHostList().Length > 0) 
             {
                 Refreshing = false;
                 hostdata = MasterServer.PollHostList();
                 ConnectToLogin = true;
             }
             LSC_Timer += Time.deltaTime;
             if (LSC_Timer > 10)
             {
                 InternetStatus = "Unavailable";
                 Refreshing = false;
                 Debug.Log("Login Server Not Available.");
             }
         }
         if (ConnectToLogin == true)
         {
         //Host list recieved. Begin connecting to Login Server.
             var temp = hostdata.Length;
             for ( var i : int = 0; i < temp; i++) 
             {
                 Debug.Log(hostdata[i].gameName);
                 if (hostdata[i].gameName == "RR_Test_Login_Server")
                 {
                     Network.Connect(hostdata[i]);
                     Debug.Log("Connecting to Login Server");
                     ConnectToLogin = false;
                 }
             }
         }
     }
     
     //Now if connection is valid, activate login gui and functions.
     if (Network.isClient)
     {
         
         if (!playerinstantiated)
         {
             Debug.Log("Connected to Login Server");
             //Network.Instantiate(playertestobj, gameObject.transform.position, gameObject.transform.rotation, 0);
             playerinstantiated = true;
         }
     }
     
     
     
 }


Now I've been recieving the following two error codes on the client side only:

View ID AllocatedID: 0 not found during lookup. Strange behaviour may occur & Received state update for view id' AllocatedID: 0' but the NetworkView doesn't exist

After searching the internet I dug up some confusing stuff about Network.isMessageQueueRunning and Network.SetReceivingEnabled and Network.SetSendingEnabled. It seems the solution might be there, but my randomly pluging it in has not helped.

The server is registering, and showing up on the masterserver so that's no problem.

I have noted that non of the objects with network view from the server or client appear in the Hierarchy of the other. Which leads me to believe its some sort of a connection problem.

My Debug line inside the "if network.isclient" never executes... which leads me to believe I'm not ever actually connected. However both show a connection in the editor's stats.

So I'm connected, but i'm not a client, with the client, or something.

Also note: everything in both the server and client has a networkview attached to the object.

I'm really confused as to why this is refusing to work. Any ideas?

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 gl_jessy · Oct 04, 2013 at 04:51 PM

Check you network connection first.

Comment
Add comment · Show 1 · 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 sgmongo · Oct 04, 2013 at 05:33 PM 0
Share

Well, as the master server is reporting the game, and I'm sufficiently connected to the internet to talk to you, I'd say my network connection is A O$$anonymous$$. I did double-check the ports being open, and somfar so good. Any other ideas?

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

16 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

Related Questions

Server & client on same wifi, error 1 Answer

What is error "Skipping profile frame. Reciever can not keep up with the amount of data sent" 4 Answers

How to put Networkview.isMine in mouselook 0 Answers

Network.Connect returns NoError but no connection? 0 Answers

A phone network question!About GSM 、wifi and WWW! 0 Answers


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