Esempio n. 1
0
    public void HeroChangeRequest(NetworkMessage netMsg)
    {
        Callipso.GameSession _currentSession = sessions.Find(x => x.agents.Find(e => e.user != null && e.user.connectionId == netMsg.conn.connectionId)); // currently in session
        if (_currentSession == null || _currentSession.isStarted)
        {                                                                                                                                                 // Not in a session or session is not started
            netMsg.conn.Disconnect();
            return;
        }

        MObjects.HeroChangeRequest mObject = netMsg.ReadMessage <MObjects.HeroChangeRequest>();
        _currentSession.HeroChange(netMsg.conn.connectionId, mObject.val);
    }