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

◆ OnEvent() [1/2]

override void CGame::OnEvent ( EventType eventTypeId,
Param params )
inlineprivate

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

1445 {
1446 string address;
1447 int port;
1448 int high, low;
1449
1450 switch (eventTypeId)
1451 {
1452 case StartupEventTypeID:
1453 {
1454 #ifndef SERVER
1455 // Just call it, to create the global instance if it doesn't exist yet
1456 ParticleManager.GetInstance();
1457 #endif
1458 break;
1459 }
1461 {
1462 #ifndef SERVER
1464 #endif
1465 m_FirstConnect = true;
1466 ClientData.ResetClientData();
1467 break;
1468 }
1470 {
1471 LoadingHide();
1473 SetConnecting(false);
1474 SetGameState(DayZGameState.MAIN_MENU);
1475 m_FirstConnect = true;
1476 #ifdef PLATFORM_CONSOLE
1477 if (GetUserManager().GetSelectedUser())
1478 {
1479 OnlineServices.LeaveGameplaySession();
1480 OnlineServices.ClearCurrentServerInfo();
1481 if (GetGameState() == DayZGameState.IN_GAME)
1482 {
1483 SetLoadState(DayZLoadState.MAIN_MENU_START);
1484 }
1485 }
1486 m_Notifications.ClearVoiceNotifications();
1487 #endif
1488
1489 // analytics - disconnected player
1490 StatsEventDisconnectedData discData = new StatsEventDisconnectedData();
1491 discData.m_CharacterId = g_Game.GetDatabaseID();
1492 discData.m_Reason = "quit";
1493 Analytics.PlayerDisconnected(discData);
1494 break;
1495 }
1497 {
1499 LoadingHide(true);
1500 SetConnecting(false);
1501 ProgressAsync.DestroyAllPendingProgresses();
1502
1503 if (GetGameState() == DayZGameState.CONNECTING)
1504 {
1505 SetGameState(DayZGameState.MAIN_MENU);
1506 }
1507
1508 break;
1509 }
1511 {
1512 LoadingHide(true);
1513 ProgressAsync.DestroyAllPendingProgresses();
1514
1515 SetGameState(DayZGameState.IN_GAME);
1516 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(g_Game.GetMission().GetOnInputDeviceDisconnected().Invoke, 100, false, -1);
1517
1518 // analytics - spawned
1519 StatsEventSpawnedData spawnData = new StatsEventSpawnedData();
1520 spawnData.m_CharacterId = g_Game.GetDatabaseID();
1521 spawnData.m_Lifetime = 0;
1522 spawnData.m_Position = vector.Zero;
1523 if (GetPlayer())
1524 {
1525 spawnData.m_Position = GetPlayer().GetPosition();
1526 }
1527 spawnData.m_DaytimeHour = 0;
1528 spawnData.m_Population = 0;
1529 Analytics.PlayerSpawned(spawnData);
1530
1531 #ifdef PLATFORM_CONSOLE
1532 m_Notifications.ClearVoiceNotifications();
1533 OnlineServices.SetMultiplayState(true);
1534 #endif
1535 if (m_FirstConnect)
1536 {
1537 m_FirstConnect = false;
1538 if (GetHostAddress(address, port))
1539 {
1540 AddVisitedServer(address, port);
1541 }
1542
1543 #ifdef PLATFORM_CONSOLE
1544 #ifndef PLATFORM_WINDOWS // if app is not on Windows with -XBOX parameter
1545 if (null != GetUserManager().GetSelectedUser())
1546 {
1547 OnlineServices.EnterGameplaySession();
1548 OnlineServices.LoadVoicePrivilege();
1549 }
1550 #endif
1551 #endif
1552 }
1553
1555
1556 break;
1557 }
1559 {
1560 MPConnectionLostEventParams conLost_params;
1561 if (Class.CastTo(conLost_params, params))
1562 {
1563 int duration = conLost_params.param1;
1564 OnMPConnectionLostEvent(duration);
1565 }
1566 break;
1567 }
1569 {
1570 LoadingShow();
1571 break;
1572 }
1574 {
1576 break;
1577 }
1579 {
1580 ChatMessageEventParams chat_params;
1581 if (Class.CastTo(chat_params, params))
1582 {
1583
1584 }
1585 break;
1586 }
1588 {
1589 ProgressEventParams prog_params;
1590 if (Class.CastTo(prog_params, params))
1591 LoadProgressUpdate(prog_params.param1, prog_params.param2, prog_params.param3);
1592 break;
1593 }
1595 {
1596 LoginTimeEventParams loginTimeParams;
1597 if (Class.CastTo(loginTimeParams, params))
1598 {
1599 OnLoginTimeEvent(loginTimeParams.param1);
1600 }
1601 break;
1602 }
1603 case RespawnEventTypeID:
1604 {
1605 RespawnEventParams respawnParams;
1606 if (Class.CastTo(respawnParams, params))
1607 {
1608 OnRespawnEvent(respawnParams.param1);
1609 }
1610 break;
1611 }
1612 case PreloadEventTypeID:
1613 {
1614 PreloadEventParams preloadParams;
1615 if (Class.CastTo(preloadParams, params))
1616 {
1617 OnPreloadEvent(preloadParams.param1);
1618 }
1619 break;
1620 }
1621 case LogoutEventTypeID:
1622 {
1623 LogoutEventParams logoutParams;
1624 if (Class.CastTo(logoutParams, params))
1625 {
1626 GetCallQueue(CALL_CATEGORY_GUI).Call(GetMission().StartLogoutMenu, logoutParams.param1);
1627 }
1628 break;
1629 }
1631 {
1632 OnlineServices.Init();
1633 break;
1634 }
1636 {
1637 LoginStatusEventParams loginStatusParams;
1638 Class.CastTo(loginStatusParams, params);
1639
1640 string msg1 = loginStatusParams.param1;
1641 string msg2 = loginStatusParams.param2;
1642 string finalMsg;
1643
1644 // write either to login time screen or loading screen
1646 {
1647 finalMsg = msg1;
1648 // login time screen supports two lines
1649 if (msg2.Length() > 0)
1650 finalMsg += "\n" + msg2;
1651
1652 m_LoginTimeScreen.SetStatus(finalMsg);
1653 }
1654 else if (m_loading)
1655 {
1656 // loading only one line, but it's a long one
1657 finalMsg = msg1 + " " + msg2;
1658 m_loading.SetStatus(finalMsg);
1659 }
1660 break;
1661 }
1663 {
1664 g_Game.SetGameState(DayZGameState.CONNECTING);
1665 SetConnecting(true);
1666 break;
1667 }
1669 {
1670 g_Game.SetGameState(DayZGameState.MAIN_MENU);
1671 SetConnecting(false);
1673 {
1674 m_ConnectFromJoin = false;
1675 AbortMission();
1676 }
1677 break;
1678 }
1680 {
1681 DLCOwnerShipFailedParams dlcParams;
1682 if (Class.CastTo(dlcParams, params))
1683 {
1684 Print("### DLC Ownership failed !!! Map: " + dlcParams.param1);
1685 }
1686 break;
1687 }
1689 {
1690 ConnectivityStatsUpdatedEventParams connectivityStatsParams;
1691 if (Class.CastTo(connectivityStatsParams, params))
1692 {
1693 PlayerIdentity playerIdentity = connectivityStatsParams.param1;
1694
1695 int pingAvg = playerIdentity.GetPingAvg();
1696 if (pingAvg < GetWorld().GetPingWarningThreshold())
1697 {
1698 SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.OFF);
1699 }
1700 else if (pingAvg < GetWorld().GetPingCriticalThreshold())
1701 {
1702 SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.LEVEL1);
1703 }
1704 else
1705 {
1706 SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.LEVEL2);
1707 }
1708 }
1709 break;
1710 }
1712 {
1713 ServerFpsStatsUpdatedEventParams serverFpsStatsParams;
1714 if (Class.CastTo(serverFpsStatsParams, params))
1715 {
1716 #ifdef DIAG_DEVELOPER
1717 m_ServerFpsStatsParams = serverFpsStatsParams;
1718 #endif
1719 float fps = serverFpsStatsParams.param1;
1720 if (fps > GetWorld().GetServerFpsWarningThreshold())
1721 {
1722 SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.OFF);
1723 }
1724 else if (fps > GetWorld().GetServerFpsCriticalThreshold())
1725 {
1726 SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.LEVEL1);
1727 }
1728 else
1729 {
1730 SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.LEVEL2);
1731 }
1732 }
1733 break;
1734 }
1735 }
1736
1737 VONManager.GetInstance().OnEvent(eventTypeId, params);
1738
1739 Mission mission = GetMission();
1740 if (mission)
1741 {
1742 mission.OnEvent(eventTypeId, params);
1743 }
1744
1745 ErrorModuleHandler emh = ErrorModuleHandler.GetInstance();
1746 if (emh)
1747 emh.OnEvent(eventTypeId, params);
1748 }
DayZGame g_Game
Определения DayZGame.c:3942
Mission mission
Определения DisplayStatus.c:28
EConnectivityStatType
Определения EGameStateIcons.c:2
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения ParticleManager.c:88
void SetConnecting(bool value)
Returns true when connecting to server.
Определения DayZGame.c:3399
void SetConnectivityStatState(EConnectivityStatType type, EConnectivityStatLevel level)
Определения DayZGame.c:1750
void CancelLoginQueue()
Определения DayZGame.c:1402
void AddVisitedServer(string ip, int port)
Определения DayZGame.c:2621
DayZGameState GetGameState()
Определения DayZGame.c:1331
void LoadingShow()
Определения DayZGame.c:3422
proto native World GetWorld()
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1198
proto bool GetHostAddress(out string address, out int port)
Gets the server address. (from client)
void LoadingHide(bool force=false)
Определения DayZGame.c:3430
proto native BiosUserManager GetUserManager()
void OnLoginTimeEvent(int loginTime)
Определения DayZGame.c:1872
bool m_ConnectFromJoin
Определения DayZGame.c:947
void OnMPConnectionLostEvent(int duration)
Определения DayZGame.c:1989
void OnRespawnEvent(int time)
Определения DayZGame.c:1927
void OnPreloadEvent(vector pos)
Определения DayZGame.c:1955
bool m_FirstConnect
Определения DayZGame.c:910
void SetLoadState(DayZLoadState state)
Определения DayZGame.c:1336
void ClearConnectivityStates()
Определения DayZGame.c:1436
proto native DayZPlayer GetPlayer()
void CancelLoginTimeCountdown()
Определения DayZGame.c:1418
ref NotificationUI m_Notifications
Определения DayZGame.c:909
ref LoginTimeBase m_LoginTimeScreen
Определения DayZGame.c:914
proto native void AbortMission()
Returns to main menu, leave world empty for using last mission world.
proto native Mission GetMission()
void UpdateInputDeviceDisconnectWarning()
Определения DayZGame.c:2206
void SetGameState(DayZGameState state)
Определения DayZGame.c:1326
void LoadProgressUpdate(int progressState, float progress, string title)
Определения DayZGame.c:2010
ref LoadingScreen m_loading
Определения DayZGame.c:913
void OnEvent(EventType eventTypeId, Param params)
is called by DayZGame to pass Events.
Определения ErrorModuleHandler.c:255
void OnEvent(EventType eventTypeId, Param params)
Определения gameplay.c:713
proto int GetPingAvg()
ping range estimation
proto void Call(func fn, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
string m_CharacterId
character ID
Определения ScriptAnalytics.c:61
string m_Reason
reason of disconnect (quit, kick, ban, sign-out...)
Определения ScriptAnalytics.c:62
int m_Lifetime
lifetime of character in seconds
Определения ScriptAnalytics.c:69
int m_DaytimeHour
current time in hour (hour in 24h)
Определения ScriptAnalytics.c:72
int m_Population
population of current gameplay (server)
Определения ScriptAnalytics.c:71
vector m_Position
position of spawn
Определения ScriptAnalytics.c:70
string m_CharacterId
character ID
Определения ScriptAnalytics.c:68
static const vector Zero
Определения EnConvert.c:123
Param1< int > RespawnEventParams
RespawnTime.
Определения gameplay.c:431
Param1< int > MPConnectionLostEventParams
Duration.
Определения gameplay.c:457
Param1< int > LoginTimeEventParams
LoginTime.
Определения gameplay.c:429
const EventType MPSessionEndEventTypeID
no params
Определения gameplay.c:477
const EventType ConnectingStartEventTypeID
no params
Определения gameplay.c:567
const EventType LoginStatusEventTypeID
params: LoginStatusEventParams
Определения gameplay.c:539
Param1< vector > PreloadEventParams
Position.
Определения gameplay.c:433
Param4< float, float, int, int > ServerFpsStatsUpdatedEventParams
average server fps, highest frame time, skipped physics simulation steps server/client
Определения gameplay.c:439
const EventType WorldCleaupEventTypeID
no params
Определения gameplay.c:471
Param1< string > DLCOwnerShipFailedParams
world name
Определения gameplay.c:453
Param1< int > LogoutEventParams
logoutTime
Определения gameplay.c:443
const EventType SelectedUserChangedEventTypeID
no params
Определения gameplay.c:543
const EventType RespawnEventTypeID
params: RespawnEventParams
Определения gameplay.c:533
const EventType MPSessionFailEventTypeID
no params
Определения gameplay.c:479
const EventType StartupEventTypeID
no params
Определения gameplay.c:469
const EventType DialogQueuedEventTypeID
no params
Определения gameplay.c:495
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
Определения gameplay.c:407
Param2< string, string > LoginStatusEventParams
text message for line 1, text message for line 2
Определения gameplay.c:441
const EventType MPSessionStartEventTypeID
no params
Определения gameplay.c:475
const EventType PreloadEventTypeID
params: PreloadEventParams
Определения gameplay.c:535
const EventType LoginTimeEventTypeID
params: LoginTimeEventParams
Определения gameplay.c:531
Param1< PlayerIdentity > ConnectivityStatsUpdatedEventParams
PlayerIdentity.
Определения gameplay.c:437
const EventType ServerFpsStatsUpdatedEventTypeID
params: ServerFpsStatsUpdatedEventParams
Определения gameplay.c:527
const EventType ConnectivityStatsUpdatedEventTypeID
params: ConnectivityStatsUpdatedEventParams
Определения gameplay.c:525
const EventType MPConnectionLostEventTypeID
params: MPConnectionLostEventParams
Определения gameplay.c:483
const EventType LogoutEventTypeID
params: LogoutEventParams
Определения gameplay.c:537
const EventType MPSessionPlayerReadyEventTypeID
no params
Определения gameplay.c:481
const EventType DLCOwnerShipFailedEventTypeID
params: DLCOwnerShipFailedParams
Определения gameplay.c:563
Param3< int, float, string > ProgressEventParams
state, progress, title
Определения gameplay.c:404
const EventType ProgressEventTypeID
params: ProgressEventParams
Определения gameplay.c:489
const EventType ChatMessageEventTypeID
params: ChatMessageEventParams
Определения gameplay.c:499
const EventType ConnectingAbortEventTypeID
no params
Определения gameplay.c:569
proto void Print(void var)
Prints content of variable to console/log.
proto native int Length()
Returns length of string.
const int CALL_CATEGORY_GUI
Определения 3_Game/DayZ/tools/tools.c:9
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8

Перекрестные ссылки AbortMission(), AddVisitedServer(), ScriptCallQueue::Call(), CALL_CATEGORY_GUI, CALL_CATEGORY_SYSTEM, CancelLoginQueue(), CancelLoginTimeCountdown(), Class::CastTo(), ChatMessageEventTypeID, ClearConnectivityStates(), OnlineServices::ClearCurrentServerInfo(), ConnectingAbortEventTypeID, ConnectingStartEventTypeID, ConnectivityStatsUpdatedEventTypeID, ProgressAsync::DestroyAllPendingProgresses(), DialogQueuedEventTypeID, DLCOwnerShipFailedEventTypeID, OnlineServices::EnterGameplaySession(), g_Game, GetCallQueue(), GetGameState(), GetHostAddress(), ErrorModuleHandler::GetInstance(), VONManager::GetInstance(), GetMission(), PlayerIdentityBase::GetPingAvg(), GetPlayer(), GetUserManager(), GetWorld(), OnlineServices::Init(), OnlineServices::LeaveGameplaySession(), string::Length(), LoadingHide(), LoadingShow(), LoadProgressUpdate(), OnlineServices::LoadVoicePrivilege(), LoginStatusEventTypeID, LoginTimeEventTypeID, LogoutEventTypeID, StatsEventDisconnectedData::m_CharacterId, StatsEventSpawnedData::m_CharacterId, m_ConnectFromJoin, StatsEventSpawnedData::m_DaytimeHour, m_FirstConnect, StatsEventSpawnedData::m_Lifetime, m_loading, m_LoginTimeScreen, m_Notifications, StatsEventSpawnedData::m_Population, StatsEventSpawnedData::m_Position, StatsEventDisconnectedData::m_Reason, mission, MPConnectionLostEventTypeID, MPSessionEndEventTypeID, MPSessionFailEventTypeID, MPSessionPlayerReadyEventTypeID, MPSessionStartEventTypeID, ErrorModuleHandler::OnEvent(), VONManagerBase::OnEvent(), OnLoginTimeEvent(), OnMPConnectionLostEvent(), OnPreloadEvent(), OnRespawnEvent(), ParticleManager(), Analytics::PlayerDisconnected(), Analytics::PlayerSpawned(), PreloadEventTypeID, Print(), ProgressEventTypeID, ClientData::ResetClientData(), RespawnEventTypeID, SelectedUserChangedEventTypeID, ServerFpsStatsUpdatedEventTypeID, SetConnecting(), SetConnectivityStatState(), SetGameState(), SetLoadState(), OnlineServices::SetMultiplayState(), StartupEventTypeID, UpdateInputDeviceDisconnectWarning(), WorldCleaupEventTypeID и vector::Zero.