Connection problem?

Very strange and I don’t know why. Please help.

I ran own master server and facilitator.

And if I ran 2 instances, and make room from first A instance, and join A’s room from B instance.

I have synchronize boolean code using @RPC.

Problem is,

After make room and connected at the first time, boolean synchronize does not work.

But if I disconnected by click some button like “go to main menu” (Not the method of close instances itself and run it again, just disconnect from in instance itself), and try again from making room process,

then boolean synchronization work after 2nd try. Why?

booleans are not supported through RPC : http://unity3d.com/support/documentation/Components/net-RPCDetails.html

send a byte that is 0 or 1 instead of bools.

hi there. thx to you two.

@appels, But, you replied this code at my past thread.

var a:boolean = true;
 
if (GUILayout.Button ("sync A")) {
    a = !a;
    networkView.RPC ("SyncA", RPCMode.All, a);
}
 
@RPC
function SyncA (receivedA:boolean) {
    a = receivedA;
}

What is this then? And when I tested this, it worked. If RPC really don’t support boolean, why this work?

yep thats a mistake i made, that does happen lol.
you need to translate them to int’s :

var myBool:int = 0; // 0 = false and 1 = true
 
if (GUILayout.Button ("sync A")) {
    if (myBool=0)
        myBool=1;
    else
        myBool=0;
    networkView.RPC ("SyncA", RPCMode.All, myBool);
}
 
@RPC
function SyncA (receivedA:int) {
    myBool = receivedA;
}

I found my problem was because of other part of my code.
Hard to find cuz standalone build has no debug console like in editor.
Always human wrong, machine never lie.

You can check the logs in a standalone player.