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 Karma1989 · Jul 20, 2013 at 01:10 PM · errorrpclogin

Can't send RPC function since no connection was started.login script

ok so got the http://u3d.as/content/saulius/login-system/47X

i got the server end working fine

client side seems it resgisters a username but when i client login or even register get

 Can't send RPC function since no connection was started.
 UnityEngine.NetworkView:RPC(String, RPCMode, Object[])
 LoginManager:Connect(String, String) (at Assets/LoginClient/Scripts/LoginManager.cs:40)
 Demo:OnGUI() (at Assets/LoginClient/Scenes/Demo.cs:23)
 
 the source to that file is
 using System.Collections;
 
 public class LoginManager : MonoBehaviour {
     private bool logged = false;
     private string login;
     //Setters and getters
     /// <summary>
     /// Call to chech if client is logged to the server.
     /// </summary>
     /// <value>
     /// <c>true</c> if logged; otherwise, <c>false</c>.
     /// </value>
     public bool Logged{
         get{return logged;}
     }
     public string Login{
         get{return login;}
     }
     
     // Use this for initialization
     void Start () {
     Network.Connect("127.0.0.1", 25001);    
     }
     
     // Update is called once per frame
     void Update () {
     
     }
     /// <summary>
     /// Send call to login into system with your specified info.
     /// </summary>
     /// <param name='login'>
     /// Login.
     /// </param>
     /// <param name='password'>
     /// Password.
     /// </param>
     public void Connect(string _login, string password){
         networkView.RPC("OnLogin",RPCMode.Server,_login,password);
         login = _login;
     }
     /// <summary>
     /// Send call to the server for registration with your info.
     /// </summary>
     /// <param name='login'>
     /// Login.
     /// </param>
     /// <param name='password'>
     /// Password.
     /// </param>
     public void Register(string login, string password){
         networkView.RPC("OnRegister",RPCMode.Server,login,password);
     }
     public void Disconnect(){
         networkView.RPC("OnDisconnect",RPCMode.Server,login);
         logged = false;
     }
     void OnDisconnectedFromServer (NetworkDisconnection info)
     {
         Debug.Log ("This CLIENT has disconnected from a server OR this SERVER was just shut down");
         //Set client as disconnected.
         logged = false;
     }
 
     //////////////////////////////////////////////////////////////////////////////////////
     //Server
     [RPC]
     void OnLogin(string login, string password){
     }
     [RPC]
     void OnRegister(string login, string password){
     }
     [RPC]
     void OnDisconnect(string login){
     }
     //Client
     [RPC]
     void OnRespond(int respondCode){
         Debug.Log("Respond code is: " + respondCode);
         //Implement your notification system instead the Debug.Log.
         
         if(respondCode == 0){
             logged = false;
             Debug.Log("Failed to login.");
         }else if(respondCode == 1){
             Debug.Log("Logged successfully.");
             logged = true;
         }else if(respondCode == 2){
             Debug.Log("Registered successfully.");
         }else if(respondCode == 3){
             Debug.Log("Failed to register.");
         }
         
     }
     
 }


any ideas guys?

Comment
Add comment · Show 3
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 Benproductions1 · Jul 21, 2013 at 11:58 PM 0
Share

Please format your code, it's unreadable

avatar image Karma1989 · Jul 22, 2013 at 03:53 AM 0
Share

i bought this off the unity3d store followed to steps to set it up yet it dont work and how can i format it better i supplyed the file it keeps throwing in the errors and the entire error code what about it cant u understand

avatar image Benproductions1 · Jul 22, 2013 at 04:27 AM 0
Share

You need to format your code! If you don't know how (or what that means) watch the tutorial video on the right :)

1 Reply

· Add your reply
  • Sort: 
avatar image
-1

Answer by Karma1989 · Jul 22, 2013 at 03:56 AM

i bought this off the unity3d store followed to steps to set it up yet it dont work and how can i format it better i supplyed the file it keeps throwing in the errors and the entire error code what about it cant u understand

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 Benproductions1 · Jul 22, 2013 at 04:28 AM 0
Share

Do NOT post comments as answers to questions!

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

Multiple Cars not working 1 Answer

How To Get Current Animation Name 3 Answers

Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers

NullReferenceException trouble 1 Answer

Assets/cubeAI.js(2,11): UCE0001: ';' expected. Insert a semicolon at the end. 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