DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnInputUserDataProcess()

bool OnInputUserDataProcess ( int userDataType,
ParamsReadContext ctx )
protected

См. определение в файле EmoteManager.c строка 517

518 {
519 if (userDataType == INPUT_UDT_GESTURE)
520 {
521 int forced = EmoteLauncher.FORCE_NONE;
522 int gestureID = -1;
523 int cancelID = 0;
524 int random = -1;
525 bool guaranteed = false;
526
527 if (!ctx.Read(gestureID))
528 {
529 cancelID = CALLBACK_CMD_INSTACANCEL; //fallback solution in case of severe data corruption
530 }
531 else
532 {
533 ctx.Read(forced);
534 ctx.Read(guaranteed);
535 if (ctx.Read(random))
536 m_RPSOutcome = random;
537 //server-side check, sends CALLBACK_CMD_INSTACANCEL as a fail
538 bool canPlay = CanPlayEmote(gestureID);
539 if (!canPlay && (forced == EmoteLauncher.FORCE_NONE || !m_Player.GetCommand_Move())) //HOTFIX for swim and such
540 {
541 gestureID = CALLBACK_CMD_INVALID;
542 cancelID = CALLBACK_CMD_INSTACANCEL;
543 }
544 }
545
547 pCtx.Write(gestureID);
548 pCtx.Write(cancelID);
549 pCtx.Write(forced);
550 pCtx.Write(guaranteed);
552 SetPending(true);
553
554 return true;
555 }
556 return false;
557 }
const int INPUT_UDT_GESTURE
int m_RPSOutcome
Определения EmoteManager.c:146
const int CALLBACK_CMD_INVALID
Определения EmoteManager.c:148
bool CanPlayEmote(int id)
Определения EmoteManager.c:1026
void SetPending(bool state)
Определения EmoteManager.c:280
const int CALLBACK_CMD_INSTACANCEL
Определения EmoteManager.c:151
DayZPlayer m_Player
Определения Hand_Events.c:42
static const int SJ_GESTURE_REQUEST
Определения DayZPlayerSyncJunctures.c:22
static const int FORCE_NONE
Определения EmoteManager.c:61
Определения EmoteManager.c:60
Определения gameplay.c:152
proto bool Write(void value_out)
proto bool Read(void value_in)

Перекрестные ссылки CALLBACK_CMD_INSTACANCEL, CALLBACK_CMD_INVALID, CanPlayEmote(), EmoteLauncher::FORCE_NONE, INPUT_UDT_GESTURE, m_Player, m_RPSOutcome, Serializer::Read(), SetPending(), DayZPlayerSyncJunctures::SJ_GESTURE_REQUEST и Serializer::Write().

Используется в ManBase::OnInputUserDataProcess() и DayZPlayer::OnInputUserDataReceived().