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

◆ OnInputUserDataProcess()

bool OnInputUserDataProcess ( int userDataType,
ParamsReadContext ctx )
protected

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

550 {
551 if (userDataType == INPUT_UDT_GESTURE)
552 {
553 int forced = EmoteLauncher.FORCE_NONE;
554 int gestureID = -1;
555 int cancelID = 0;
556 int random = -1;
557 bool guaranteed = false;
558
559 if (!ctx.Read(gestureID))
560 {
561 cancelID = CALLBACK_CMD_INSTACANCEL; //fallback solution in case of severe data corruption
562 }
563 else
564 {
565 ctx.Read(forced);
566 ctx.Read(guaranteed);
567 if (ctx.Read(random))
568 m_RPSOutcome = random;
569 //server-side check, sends CALLBACK_CMD_INSTACANCEL as a fail
570 bool canPlay = CanPlayEmote(gestureID);
571 if (!canPlay && (forced == EmoteLauncher.FORCE_NONE || !m_Player.GetCommand_Move())) //HOTFIX for swim and such
572 {
573 gestureID = CALLBACK_CMD_INVALID;
574 cancelID = CALLBACK_CMD_INSTACANCEL;
575 }
576 }
577
579 pCtx.Write(gestureID);
580 pCtx.Write(cancelID);
581 pCtx.Write(forced);
582 pCtx.Write(guaranteed);
584 SetPending(true);
585
586 return true;
587 }
588 return false;
589 }
const int INPUT_UDT_GESTURE
map m_Player
int m_RPSOutcome
Определения EmoteManager.c:153
const int CALLBACK_CMD_INVALID
Определения EmoteManager.c:155
bool CanPlayEmote(int id)
Определения EmoteManager.c:1059
void SetPending(bool state)
Определения EmoteManager.c:293
const int CALLBACK_CMD_INSTACANCEL
Определения EmoteManager.c:158
static const int SJ_GESTURE_REQUEST
Определения DayZPlayerSyncJunctures.c:22
static const int FORCE_NONE
Определения EmoteManager.c:66
Определения EmoteManager.c:65
Определения 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_RPSOutcome, Serializer::Read(), SetPending(), DayZPlayerSyncJunctures::SJ_GESTURE_REQUEST и Serializer::Write().

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