Can't run bolt_sample

Options
I followed the steps from this tutorial:http://doc.photonengine.com/en/bolt/current/advanced-tutorials/chapter-1
when I press "Debug Start" button, Unity catch a exception.Anyone know how to solve it? thanks

15-8-27 下07时57分30秒: socket created

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Registered token class TestToken as id 1
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:Log(Object)
Unity:BoltLog.IWriter.Debug(String)
BoltLog:Debug(String)
BoltLog:Debug(String, Object, Object)
Bolt.Factory:RegisterTokenClass(Type)
BoltNetwork:RegisterTokenClass()
TokenCallbacks:BoltStartBegin() (at Assets/bolt/sample/bolt_sample/scripts/Callbacks/TokenCallbacks.cs:7)
BoltInternal.GlobalEventListenerBase:BoltStartBeginInvoke()
BoltCore:BeginStart(ControlCommandStart)
Bolt.ControlCommandStart:Run()
Bolt.ControlBehaviour:Update()

(Filename: Assets/bolt/sample/bolt_sample/scripts/Callbacks/TokenCallbacks.cs Line: 7)

System.ArgumentException: An element with the same key already exists in the dictionary.
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
Unity:BoltLog.IWriter.Error(String)
BoltLog:Exception(Exception)
BoltInternal.GlobalEventListenerBase:BoltStartBeginInvoke()
BoltCore:BeginStart(ControlCommandStart)
Bolt.ControlCommandStart:Run()
Bolt.ControlBehaviour:Update()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

at System.Collections.Generic.Dictionary`2[System.Type,System.Byte].Add (System.Type key, Byte value) [0x0007e] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404
at Bolt.Factory.RegisterTokenClass (System.Type type) [0x00000] in :0
at BoltNetwork.RegisterTokenClass[TestToken] () [0x00000] in :0
at TokenCallbacks.BoltStartBegin () [0x00000] in /Users/skywalker/Documents/Unity3D/Bolt/Bolt/Assets/bolt/sample/bolt_sample/scripts/Callbacks/TokenCallbacks.cs:7
at BoltInternal.GlobalEventListenerBase.BoltStartBeginInvoke () [0x00000] in :0
UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
Unity:BoltLog.IWriter.Error(String)
BoltLog:Exception(Exception)
BoltInternal.GlobalEventListenerBase:BoltStartBeginInvoke()
BoltCore:BeginStart(ControlCommandStart)
Bolt.ControlCommandStart:Run()
Bolt.ControlBehaviour:Update()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

15-8-27 下07时57分30秒: Binding physical socket using platform 'DotNetPlatform'

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

15-8-27 下07时57分30秒: Socket bound to [EndPoint 127.0.0.1:54321 | 9151314447111869489]

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

15-8-27 下07时57分30秒: Physical socket bound to [EndPoint 127.0.0.1:54321 | 9151314447111869489]

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

15-8-27 下07时57分30秒: 192.168.0.116 202.96.209.5,223.5.5.5,192.168.0.1

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

15-8-27 下07时57分30秒: LAN endpoint resolved as [EndPoint 192.168.0.116:54321 | 13882346349585814577]

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

15-8-27 下07时57分30秒: physical socket started

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Comments

  • stanchion
    stanchion mod
    edited August 2015
    Options
    I think you need to do Assets -> Bolt -> Compile Assembly
    If that doesn't fix it, can you make a new project and import 0.4.3.4 Bolt Debug which includes the tutorial?
  • SkyWalker
    Options
    It works.I can run the demo,Thanks.
    But the error doesn't disappear,why?

    (Filename: Assets/bolt/sample/bolt_sample/scripts/Callbacks/TokenCallbacks.cs Line: 7)

    System.ArgumentException: An element with the same key already exists in the dictionary.
    UnityEngine.Debug:Internal_Log(Int32, String, Object)
    UnityEngine.Debug:LogError(Object)
    Unity:BoltLog.IWriter.Error(String)
    BoltLog:Exception(Exception)
    BoltInternal.GlobalEventListenerBase:BoltStartBeginInvoke()
    BoltCore:BeginStart(ControlCommandStart)
    Bolt.ControlCommandStart:Run()
    Bolt.ControlBehaviour:Update()
  • stanchion
    Options
    I believe you have a scene you're trying to play that isn't in your build settings. Add it to your build settings and compile Bolt
  • SkyWalker
    Options
    stanchion said:

    I believe you have a scene you're trying to play that isn't in your build settings. Add it to your build settings and compile Bolt

    I added level1/level2/mainmenu to my build settings and compiled bolt. The error still exists.
  • stanchion
    Options
    If line 7 of TokenCallbacks.cs is this
    BoltNetwork.RegisterTokenClass();

    then it means you're registering the token somewhere else as well