// Use this for initial void Start () { ws.OnOpen += (sender, e) => { Protocol.LoginReq req = new Protocol.LoginReq(); req.camp = m_myCamp; ws.Send(JsonMapper.ToJson(req)); }; ws.OnMessage += (sender, e) => { m_recvMsgs.Enqueue(e.Data); }; ws.OnError += (object sender, NetworkLib.WebSocketSharp.ErrorEventArgs e) => { }; ws.OnClose += (object sender, CloseEventArgs e) => { }; m_handlers.Add (Protocol.ID.LOGIN, OnLogin); m_handlers.Add (Protocol.ID.LOGOUT, OnLogout); m_handlers.Add (Protocol.ID.CREATURE_STATE, OnCreatureState); }
// Use this for initial void Start() { ws.OnOpen += (sender, e) => { Protocol.LoginReq req = new Protocol.LoginReq(); req.camp = m_myCamp; ws.Send(JsonMapper.ToJson(req)); }; ws.OnMessage += (sender, e) => { m_recvMsgs.Enqueue(e.Data); }; ws.OnError += (object sender, NetworkLib.WebSocketSharp.ErrorEventArgs e) => { }; ws.OnClose += (object sender, CloseEventArgs e) => { }; m_handlers.Add(Protocol.ID.LOGIN, OnLogin); m_handlers.Add(Protocol.ID.LOGOUT, OnLogout); m_handlers.Add(Protocol.ID.CREATURE_STATE, OnCreatureState); }