/// <summary> /// Ejecuta una acción de una carta del lado servidor /// </summary> public CardActionResult ExecuteServer(Mesa mesa, Tablero tablero, DataStr data) { var e = new Events.EventHelper(tablero, mesa); var expression = "var result = new YerbaSoft.Web.Games.Clue.Common.DTO.Clue.Card.CardAction.CardActionResult(tablero, true);" + this.Server + "return result;"; var result = (CardActionResult)e.ExecuteAction(expression, data); tablero = result?.Tablero ?? tablero; return(result); }
static public AccErrorTypes TagAccPktGetErrType(ref RFID_PACKETMSG_18K6C_TAG_ACCESS_T TAPkt) { AccErrorTypes TAErr = AccErrorTypes.None; if ((TAPkt.cmn.flags & 0x01) != 0) { // CRC Error if ((TAPkt.cmn.flags & 0x08) != 0) { TAErr = AccErrorTypes.CRC; } // BackScatter Error else if ((TAPkt.cmn.flags & 0x02) != 0) { switch (TAPkt.error_code) { case 0x03: /* Memory Location error */ TAErr = AccErrorTypes.InvalidAddr; break; case 0x04: /* Memory location not writable/locked */ TAErr = AccErrorTypes.Unauthorized; break; case 0x00: /* catch-all */ case 0x0B: /* low power */ case 0x0F: /* unrecognized error code */ default: TAErr = AccErrorTypes.Others; break; } } // ACK Timeout else if ((TAPkt.cmn.flags & 0x04) != 0) { TAErr = AccErrorTypes.AckTimeout; } // Error code in tag_data field else { int DataSize = TagAccPktGetDataFieldSize(TAPkt.cmn.pkt_len, TAPkt.cmn.flags); String DataStr; DataStr = EPCTag.DataFieldToStr(TAPkt.tag_data, DataSize); Byte ErrCode = Byte.Parse(DataStr.Substring(0, 2), System.Globalization.NumberStyles.HexNumber); if (ErrCode >= 0x01 && ErrCode <= 0x18) { TAErr = (AccErrorTypes)((int)AccErrorTypes.VerifyError + (ErrCode - 0x01)); } else { throw new ApplicationException("Unexpected TagAccess error code:" + ErrCode); } } } return(TAErr); }