Exemplo n.º 1
0
    private void OnData(int cnnId, int channelId, int recHostId, NetMsg msg)
    {
        Debug.Log("Received a message of type " + msg.OP);
        switch (msg.OP)
        {
        case NetOP.None:
            break;

        case NetOP.CreateAccount:
            break;

        case NetOP.company:
            CompanyInfo company = (CompanyInfo)msg;
            company.setData();
            break;

        case NetOP.block:
            BlockInfo blockInfo = (BlockInfo)msg;
            blockInfo.SetData();
            break;

        case NetOP.contract:
            Debug.Log("接收到合同");

            ContractInfo contract     = (ContractInfo)msg;
            Contract     tempContract = contract.contract;
            if (tempContract._targetId != City.currentCompany.id)
            {
                return;
            }
            curContract = contract.contract;

            break;
        }
    }