• 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 Dr.Yes · Jun 06, 2013 at 01:22 AM · errorsendcannot

Can not send RPC function since no connection was started?

Hello people, I keep getting the error: Can't send RPC function since no connection was started. Can't send RPC function since no connection was started. UnityEngine.NetworkView:RPC(String, RPCMode, Object[]) Loader:LoadLevel(String) (at Assets/Scripts/Main/Loader.cs:63) LoaderGui:Host(String) (at Assets/Scripts/Main/LoaderGui.cs:94) LoaderGui:ServerList(Int32) (at Assets/Scripts/Main/LoaderGui.cs:38) UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, GUISkin, Int32, Single, Single, GUIStyle)

I get these errors when I try to start a server after downloading Counter Strike Port Source Code ( http://forum.unity3d.com/threads/103919-cs-port/page6 )

Here is the script:

 using System.Linq;
 using doru;
 using UnityEngine;
 using System.Collections;
 using gui = UnityEngine.GUILayout;
 using System.Collections.Generic;
 
 public class Loader : Bs
 {
     public int errorcount;
     public int exceptionCount;
     int lastLevelPrefix;
     public GUIText info;
     static string LastError = "";
     int fps;
     Timer timer = new Timer();
     public string[] maps;
     internal bool DebugLevelMode;
     string NickNameEditor = "Editor" + new System.Random().Next(99);
     internal string playerName { get { return isEditor ? NickNameEditor : PlayerPrefs.GetString("PlayerName", "Guest" + Random.Range(0, 99)); } set { PlayerPrefs.SetString("PlayerName", value); } }
 
     public override void Awake()
     {
         if (Object.FindObjectsOfType(typeof(Loader)).Length > 1)
         {
             Debug.Log("Destroyed Loader Dub");
             DestroyImmediate(this.gameObject);
             return;
         }
         Debug.Log("Loader Awake");
         if (Application.loadedLevel != 0)
         {
             Debug.Log("DebugLevelMode");
             DebugLevelMode = true;
             return;
         }
         Application.RegisterLogCallback(onLog);
         networkView.group = 1;
         DontDestroyOnLoad(transform.root);
         base.Awake();
     }
     
 
     public void Update()
     {
         fps = (int)timer.GetFps();
         info.text = "FPS:" + fps + " Warnings:" + errorcount + " Errors:" + exceptionCount + " " + LastError;
         timer.Update();
     }
 
     public void onLog(string c, string stackTrace, LogType type)
     {
         if (type == LogType.Error) errorcount++;
         if (type == LogType.Exception) exceptionCount++;
         if (type == LogType.Exception)
             LastError = c + stackTrace;
     }
 
     public void LoadLevel(string level)
     {
         Network.RemoveRPCsInGroup(0);
         Network.RemoveRPCsInGroup(1);
         networkView.RPC("RPCLoadLevel", RPCMode.AllBuffered, level, lastLevelPrefix + 1);
     }
    
     [RPC]
     public IEnumerator RPCLoadLevel(string level, int levelPrefix)
     {
         Debug.Log("LoadLevel: " + level);
         lastLevelPrefix = levelPrefix;
         Network.SetSendingEnabled(0, false);
         Network.isMessageQueueRunning = false;
         Network.SetLevelPrefix(levelPrefix);
         Application.LoadLevel(level);
         yield return null;
     }
     public void OnDisconnectedFromServer(NetworkDisconnection info)
     {
         Debug.Log("Disconnected "+name);
         _LoaderGui.enabled = true;
         Application.LoadLevel(0);
         
     }
     void OnConnected()
     {
         Debug.Log("Connected "+name);
     }
     public void OnServerInitialized() { OnConnected(); }
     public void OnConnectedToServer() { OnConnected(); }
 
 
 
 }
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 Kacheek · Jun 06, 2013 at 06:02 AM

well did you connect to a server or not? please specify where and when you get this error that would help! :)

Comment
Add comment · 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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

15 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

Related Questions

Multiple Cars not working 1 Answer

BCE0005: Unknown identifier: 'spriteRenderer'. 2 Answers

BCE0044: expecting EOF, found '}'. 1 Answer

No appropriate version of 'UnityEngine.AudioSource.Play' for the argument list '(System.Type)' was found. 1 Answer

MonoDevelop Error 2 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