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

◆ OnEvent() [1/2]

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

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

1480 {
1481 string address;
1482 int port;
1483 int high, low;
1484
1485 switch (eventTypeId)
1486 {
1487 case StartupEventTypeID:
1488 {
1489 #ifndef SERVER
1490 #ifndef NO_GUI
1491 // Just call it, to create the global instance if it doesn't exist yet
1492 ParticleManager.GetInstance();
1493 #endif
1494 #endif
1495 break;
1496 }
1498 {
1499 #ifndef SERVER
1501 #endif
1502 m_FirstConnect = true;
1503 ClientData.ResetClientData();
1504 break;
1505 }
1507 {
1508 LoadingHide();
1510 SetConnecting(false);
1511 SetGameState(DayZGameState.MAIN_MENU);
1512 m_FirstConnect = true;
1513 #ifdef PLATFORM_CONSOLE
1514 if (GetUserManager().GetSelectedUser())
1515 {
1516 OnlineServices.LeaveGameplaySession();
1517 OnlineServices.ClearCurrentServerInfo();
1518 if (GetGameState() == DayZGameState.IN_GAME)
1519 {
1520 SetLoadState(DayZLoadState.MAIN_MENU_START);
1521 }
1522 }
1523 m_Notifications.ClearVoiceNotifications();
1524 #endif
1525
1526 // analytics - disconnected player
1527 StatsEventDisconnectedData discData = new StatsEventDisconnectedData();
1528 discData.m_CharacterId = g_Game.GetDatabaseID();
1529 discData.m_Reason = "quit";
1530 Analytics.PlayerDisconnected(discData);
1531 break;
1532 }
1534 {
1536 LoadingHide(true);
1537 SetConnecting(false);
1538 ProgressAsync.DestroyAllPendingProgresses();
1539
1540 if (GetGameState() == DayZGameState.CONNECTING)
1541 {
1542 SetGameState(DayZGameState.MAIN_MENU);
1543 }
1544
1545 break;
1546 }
1548 {
1549 LoadingHide(true);
1550 ProgressAsync.DestroyAllPendingProgresses();
1551
1552 SetGameState(DayZGameState.IN_GAME);
1553 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(g_Game.GetMission().GetOnInputDeviceDisconnected().Invoke, 100, false, -1);
1554
1555 // analytics - spawned
1556 StatsEventSpawnedData spawnData = new StatsEventSpawnedData();
1557 spawnData.m_CharacterId = g_Game.GetDatabaseID();
1558 spawnData.m_Lifetime = 0;
1559 spawnData.m_Position = vector.Zero;
1560 if (GetPlayer())
1561 {
1562 spawnData.m_Position = GetPlayer().GetPosition();
1563 }
1564 spawnData.m_DaytimeHour = 0;
1565 spawnData.m_Population = 0;
1566 Analytics.PlayerSpawned(spawnData);
1567
1568 #ifdef PLATFORM_CONSOLE
1569 m_Notifications.ClearVoiceNotifications();
1570 OnlineServices.SetMultiplayState(true);
1571 #endif
1572 if (m_FirstConnect)
1573 {
1574 m_FirstConnect = false;
1575 if (GetHostAddress(address, port))
1576 {
1577 AddVisitedServer(address, port);
1578 }
1579
1580 #ifdef PLATFORM_CONSOLE
1581 #ifndef PLATFORM_WINDOWS // if app is not on Windows with -XBOX parameter
1582 if (null != GetUserManager().GetSelectedUser())
1583 {
1584 OnlineServices.EnterGameplaySession();
1585 OnlineServices.LoadVoicePrivilege();
1586 }
1587 #endif
1588 #endif
1589 }
1590
1592
1593 break;
1594 }
1596 {
1597 MPConnectionLostEventParams conLost_params;
1598 if (Class.CastTo(conLost_params, params))
1599 {
1600 int duration = conLost_params.param1;
1601 OnMPConnectionLostEvent(duration);
1602 }
1603 break;
1604 }
1606 {
1607 LoadingShow();
1608 break;
1609 }
1611 {
1613 break;
1614 }
1616 {
1617 ChatMessageEventParams chat_params;
1618 if (Class.CastTo(chat_params, params))
1619 {
1620
1621 }
1622 break;
1623 }
1625 {
1626 ProgressEventParams prog_params;
1627 if (Class.CastTo(prog_params, params))
1628 LoadProgressUpdate(prog_params.param1, prog_params.param2, prog_params.param3);
1629 break;
1630 }
1632 {
1633 LoginTimeEventParams loginTimeParams;
1634 if (Class.CastTo(loginTimeParams, params))
1635 {
1636 OnLoginTimeEvent(loginTimeParams.param1);
1637 }
1638 break;
1639 }
1640 case RespawnEventTypeID:
1641 {
1642 RespawnEventParams respawnParams;
1643 if (Class.CastTo(respawnParams, params))
1644 {
1645 OnRespawnEvent(respawnParams.param1);
1646 }
1647 break;
1648 }
1649 case PreloadEventTypeID:
1650 {
1651 PreloadEventParams preloadParams;
1652 if (Class.CastTo(preloadParams, params))
1653 {
1654 OnPreloadEvent(preloadParams.param1);
1655 }
1656 break;
1657 }
1658 case LogoutEventTypeID:
1659 {
1660 LogoutEventParams logoutParams;
1661 if (Class.CastTo(logoutParams, params))
1662 {
1663 GetCallQueue(CALL_CATEGORY_GUI).Call(GetMission().StartLogoutMenu, logoutParams.param1);
1664 }
1665 break;
1666 }
1668 {
1669 OnlineServices.Init();
1670 break;
1671 }
1673 {
1674 LoginStatusEventParams loginStatusParams;
1675 Class.CastTo(loginStatusParams, params);
1676
1677 string msg1 = loginStatusParams.param1;
1678 string msg2 = loginStatusParams.param2;
1679 string finalMsg;
1680
1681 // write either to login time screen or loading screen
1683 {
1684 finalMsg = msg1;
1685 // login time screen supports two lines
1686 if (msg2.Length() > 0)
1687 finalMsg += "\n" + msg2;
1688
1689 m_LoginTimeScreen.SetStatus(finalMsg);
1690 }
1691 else if (m_loading)
1692 {
1693 // loading only one line, but it's a long one
1694 finalMsg = msg1 + " " + msg2;
1695 m_loading.SetStatus(finalMsg);
1696 }
1697 break;
1698 }
1700 {
1701 g_Game.SetGameState(DayZGameState.CONNECTING);
1702 SetConnecting(true);
1703 break;
1704 }
1706 {
1707 g_Game.SetGameState(DayZGameState.MAIN_MENU);
1708 SetConnecting(false);
1710 {
1711 m_ConnectFromJoin = false;
1712 AbortMission();
1713 }
1714 break;
1715 }
1717 {
1718 DLCOwnerShipFailedParams dlcParams;
1719 if (Class.CastTo(dlcParams, params))
1720 {
1721 Print("### DLC Ownership failed !!! Map: " + dlcParams.param1);
1722 }
1723 break;
1724 }
1726 {
1727 ConnectivityStatsUpdatedEventParams connectivityStatsParams;
1728 if (Class.CastTo(connectivityStatsParams, params))
1729 {
1730 PlayerIdentity playerIdentity = connectivityStatsParams.param1;
1731
1732 int pingAvg = playerIdentity.GetPingAvg();
1733 if (pingAvg < GetWorld().GetPingWarningThreshold())
1734 {
1735 SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.OFF);
1736 }
1737 else if (pingAvg < GetWorld().GetPingCriticalThreshold())
1738 {
1739 SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.LEVEL1);
1740 }
1741 else
1742 {
1743 SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.LEVEL2);
1744 }
1745 }
1746 break;
1747 }
1749 {
1750 ServerFpsStatsUpdatedEventParams serverFpsStatsParams;
1751 if (Class.CastTo(serverFpsStatsParams, params))
1752 {
1753 #ifdef DIAG_DEVELOPER
1754 m_ServerFpsStatsParams = serverFpsStatsParams;
1755 #endif
1756 float fps = serverFpsStatsParams.param1;
1757 if (fps > GetWorld().GetServerFpsWarningThreshold())
1758 {
1759 SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.OFF);
1760 }
1761 else if (fps > GetWorld().GetServerFpsCriticalThreshold())
1762 {
1763 SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.LEVEL1);
1764 }
1765 else
1766 {
1767 SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.LEVEL2);
1768 }
1769 }
1770 break;
1771 }
1772 }
1773
1774 VONManager.GetInstance().OnEvent(eventTypeId, params);
1775
1776 Mission mission = GetMission();
1777 if (mission)
1778 {
1779 mission.OnEvent(eventTypeId, params);
1780 }
1781
1782 ErrorModuleHandler emh = ErrorModuleHandler.GetInstance();
1783 if (emh)
1784 emh.OnEvent(eventTypeId, params);
1785 }
DayZGame g_Game
Определения DayZGame.c:4074
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:3529
void SetConnectivityStatState(EConnectivityStatType type, EConnectivityStatLevel level)
Определения DayZGame.c:1787
void CancelLoginQueue()
Определения DayZGame.c:1437
void AddVisitedServer(string ip, int port)
Определения DayZGame.c:2665
DayZGameState GetGameState()
Определения DayZGame.c:1366
void LoadingShow()
Определения DayZGame.c:3552
proto native World GetWorld()
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1233
proto bool GetHostAddress(out string address, out int port)
Gets the server address. (from client)
void LoadingHide(bool force=false)
Определения DayZGame.c:3560
proto native BiosUserManager GetUserManager()
void OnLoginTimeEvent(int loginTime)
Определения DayZGame.c:1909
bool m_ConnectFromJoin
Определения DayZGame.c:964
void OnMPConnectionLostEvent(int duration)
Определения DayZGame.c:2028
void OnRespawnEvent(int time)
Определения DayZGame.c:1964
void OnPreloadEvent(vector pos)
Определения DayZGame.c:1994
bool m_FirstConnect
Определения DayZGame.c:927
void SetLoadState(DayZLoadState state)
Определения DayZGame.c:1371
void ClearConnectivityStates()
Определения DayZGame.c:1471
proto native DayZPlayer GetPlayer()
void CancelLoginTimeCountdown()
Определения DayZGame.c:1453
ref NotificationUI m_Notifications
Определения DayZGame.c:926
ref LoginTimeBase m_LoginTimeScreen
Определения DayZGame.c:931
proto native void AbortMission()
Returns to main menu, leave world empty for using last mission world.
proto native Mission GetMission()
void UpdateInputDeviceDisconnectWarning()
Определения DayZGame.c:2250
void SetGameState(DayZGameState state)
Определения DayZGame.c:1361
void LoadProgressUpdate(int progressState, float progress, string title)
Определения DayZGame.c:2049
ref LoadingScreen m_loading
Определения DayZGame.c:930
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.