예제 #1
0
    public void OnSetUpID(NetworkMessage netMsg)
    {
        SetIDMessage msg = netMsg.ReadMessage <SetIDMessage>();

        if (clientID < 0)
        {
            clientID = msg.id;
        }
    }
예제 #2
0
    void OnServerConnect(NetworkMessage netMsg)
    {
        Debug.Log(string.Format("Client has connected to server with connection id: {0}", netMsg.conn.connectionId));
        NetworkServer.SetClientReady(netMsg.conn);
        SetIDMessage msg = new SetIDMessage();

        msg.id = netMsg.conn.connectionId;
        clients.Add(msg.id);
        NetworkServer.SendToClient(netMsg.conn.connectionId, (short)MyMsgType.ClientSetupID, msg);
    }