Exemplo n.º 1
0
    private void OnReq_AdvancePartner(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        ReqAdvancePartner      req = Serializer.Deserialize <ReqAdvancePartner>(ms);

        AckAdvancePartner ack = new AckAdvancePartner();

        ack.ID = req.ID;
        NetworkManager.Instance.Send(MessageID.MSG_ACK_ADVANVE_PARTNER, ack, 0, 0);
    }
Exemplo n.º 2
0
    private void OnAck_AdvancePartner(MessageRecv obj)
    {
        System.IO.MemoryStream ms  = new System.IO.MemoryStream(obj.Data);
        AckAdvancePartner      ack = Serializer.Deserialize <AckAdvancePartner>(ms);

        XPartner partner = DataDBSPartner.GetDataById(ack.ID);

        if (partner == null)
        {
            partner         = new XPartner();
            partner.Id      = ack.ID;
            partner.Advance = 1;
        }
        else
        {
            partner.Advance++;
        }
        DataDBSPartner.Update(ack.ID, partner);
        GTWorld.Instance.SyncMainPlayerData(ESyncDataType.TYPE_BASEATTR);
        GTEventCenter.FireEvent(GTEventID.TYPE_PARTNER_ADVANCE);
        GTEventCenter.FireEvent(GTEventID.TYPE_CHANGE_FIGHTVALUE);
    }