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

◆ OnEvent() [1/2]

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

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

1434 {
1435 string address;
1436 int port;
1437 int high, low;
1438
1439 switch (eventTypeId)
1440 {
1441 case StartupEventTypeID:
1442 {
1443 #ifndef SERVER
1444 // Just call it, to create the global instance if it doesn't exist yet
1445 ParticleManager.GetInstance();
1446 #endif
1447 break;
1448 }
1450 {
1451 #ifndef SERVER
1453 #endif
1454 m_FirstConnect = true;
1455 ClientData.ResetClientData();
1456 break;
1457 }
1459 {
1460 LoadingHide();
1462 SetConnecting(false);
1463 SetGameState(DayZGameState.MAIN_MENU);
1464 m_FirstConnect = true;
1465 #ifdef PLATFORM_CONSOLE
1466 if (GetUserManager().GetSelectedUser())
1467 {
1468 OnlineServices.LeaveGameplaySession();
1469 OnlineServices.ClearCurrentServerInfo();
1470 if (GetGameState() == DayZGameState.IN_GAME)
1471 {
1472 SetLoadState(DayZLoadState.MAIN_MENU_START);
1473 }
1474 }
1475 m_Notifications.ClearVoiceNotifications();
1476 #endif
1477
1478 // analytics - disconnected player
1479 StatsEventDisconnectedData discData = new StatsEventDisconnectedData();
1480 discData.m_CharacterId = g_Game.GetDatabaseID();
1481 discData.m_Reason = "quit";
1482 Analytics.PlayerDisconnected(discData);
1483 break;
1484 }
1486 {
1488 LoadingHide(true);
1489 SetConnecting(false);
1490 ProgressAsync.DestroyAllPendingProgresses();
1491
1492 if (GetGameState() == DayZGameState.CONNECTING)
1493 {
1494 SetGameState(DayZGameState.MAIN_MENU);
1495 }
1496
1497 break;
1498 }
1500 {
1501 LoadingHide(true);
1502 ProgressAsync.DestroyAllPendingProgresses();
1503
1504 SetGameState(DayZGameState.IN_GAME);
1505
1506 // analytics - spawned
1507 StatsEventSpawnedData spawnData = new StatsEventSpawnedData();
1508 spawnData.m_CharacterId = g_Game.GetDatabaseID();
1509 spawnData.m_Lifetime = 0;
1510 spawnData.m_Position = vector.Zero;
1511 if (GetPlayer())
1512 {
1513 spawnData.m_Position = GetPlayer().GetPosition();
1514 }
1515 spawnData.m_DaytimeHour = 0;
1516 spawnData.m_Population = 0;
1517 Analytics.PlayerSpawned(spawnData);
1518
1519 #ifdef PLATFORM_CONSOLE
1520 m_Notifications.ClearVoiceNotifications();
1521 OnlineServices.SetMultiplayState(true);
1522 #endif
1523 if (m_FirstConnect)
1524 {
1525 m_FirstConnect = false;
1526 if (GetHostAddress(address, port))
1527 {
1528 AddVisitedServer(address, port);
1529 }
1530
1531 #ifdef PLATFORM_CONSOLE
1532 #ifndef PLATFORM_WINDOWS // if app is not on Windows with -XBOX parameter
1533 if (null != GetUserManager().GetSelectedUser())
1534 {
1535 OnlineServices.EnterGameplaySession();
1536 OnlineServices.LoadVoicePrivilege();
1537 }
1538 #endif
1539 #endif
1540 }
1541
1543
1544 break;
1545 }
1547 {
1548 MPConnectionLostEventParams conLost_params;
1549 if (Class.CastTo(conLost_params, params))
1550 {
1551 int duration = conLost_params.param1;
1552 OnMPConnectionLostEvent(duration);
1553 }
1554 break;
1555 }
1557 {
1558 LoadingShow();
1559 break;
1560 }
1562 {
1564 break;
1565 }
1567 {
1568 ChatMessageEventParams chat_params;
1569 if (Class.CastTo(chat_params, params))
1570 {
1571
1572 }
1573 break;
1574 }
1576 {
1577 ProgressEventParams prog_params;
1578 if (Class.CastTo(prog_params, params))
1579 LoadProgressUpdate(prog_params.param1, prog_params.param2, prog_params.param3);
1580 break;
1581 }
1583 {
1584 LoginTimeEventParams loginTimeParams;
1585 if (Class.CastTo(loginTimeParams, params))
1586 {
1587 OnLoginTimeEvent(loginTimeParams.param1);
1588 }
1589 break;
1590 }
1591 case RespawnEventTypeID:
1592 {
1593 RespawnEventParams respawnParams;
1594 if (Class.CastTo(respawnParams, params))
1595 {
1596 OnRespawnEvent(respawnParams.param1);
1597 }
1598 break;
1599 }
1600 case PreloadEventTypeID:
1601 {
1602 PreloadEventParams preloadParams;
1603 if (Class.CastTo(preloadParams, params))
1604 {
1605 OnPreloadEvent(preloadParams.param1);
1606 }
1607 break;
1608 }
1609 case LogoutEventTypeID:
1610 {
1611 LogoutEventParams logoutParams;
1612 if (Class.CastTo(logoutParams, params))
1613 {
1614 GetCallQueue(CALL_CATEGORY_GUI).Call(GetMission().StartLogoutMenu, logoutParams.param1);
1615 }
1616 break;
1617 }
1619 {
1620 OnlineServices.Init();
1621 break;
1622 }
1624 {
1625 LoginStatusEventParams loginStatusParams;
1626 Class.CastTo(loginStatusParams, params);
1627
1628 string msg1 = loginStatusParams.param1;
1629 string msg2 = loginStatusParams.param2;
1630 string finalMsg;
1631
1632 // write either to login time screen or loading screen
1634 {
1635 finalMsg = msg1;
1636 // login time screen supports two lines
1637 if (msg2.Length() > 0)
1638 finalMsg += "\n" + msg2;
1639
1640 m_LoginTimeScreen.SetStatus(finalMsg);
1641 }
1642 else if (m_loading)
1643 {
1644 // loading only one line, but it's a long one
1645 finalMsg = msg1 + " " + msg2;
1646 m_loading.SetStatus(finalMsg);
1647 }
1648 break;
1649 }
1651 {
1652 g_Game.SetGameState(DayZGameState.CONNECTING);
1653 SetConnecting(true);
1654 break;
1655 }
1657 {
1658 g_Game.SetGameState(DayZGameState.MAIN_MENU);
1659 SetConnecting(false);
1661 {
1662 m_ConnectFromJoin = false;
1663 AbortMission();
1664 }
1665 break;
1666 }
1668 {
1669 DLCOwnerShipFailedParams dlcParams;
1670 if (Class.CastTo(dlcParams, params))
1671 {
1672 Print("### DLC Ownership failed !!! Map: " + dlcParams.param1);
1673 }
1674 break;
1675 }
1677 {
1678 ConnectivityStatsUpdatedEventParams connectivityStatsParams;
1679 if (Class.CastTo(connectivityStatsParams, params))
1680 {
1681 PlayerIdentity playerIdentity = connectivityStatsParams.param1;
1682
1683 int pingAvg = playerIdentity.GetPingAvg();
1684 if (pingAvg < GetWorld().GetPingWarningThreshold())
1685 {
1686 SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.OFF);
1687 }
1688 else if (pingAvg < GetWorld().GetPingCriticalThreshold())
1689 {
1690 SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.LEVEL1);
1691 }
1692 else
1693 {
1694 SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.LEVEL2);
1695 }
1696 }
1697 break;
1698 }
1700 {
1701 ServerFpsStatsUpdatedEventParams serverFpsStatsParams;
1702 if (Class.CastTo(serverFpsStatsParams, params))
1703 {
1704 #ifdef DIAG_DEVELOPER
1705 m_ServerFpsStatsParams = serverFpsStatsParams;
1706 #endif
1707 float fps = serverFpsStatsParams.param1;
1708 if (fps > GetWorld().GetServerFpsWarningThreshold())
1709 {
1710 SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.OFF);
1711 }
1712 else if (fps > GetWorld().GetServerFpsCriticalThreshold())
1713 {
1714 SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.LEVEL1);
1715 }
1716 else
1717 {
1718 SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.LEVEL2);
1719 }
1720 }
1721 break;
1722 }
1723 }
1724
1725 VONManager.GetInstance().OnEvent(eventTypeId, params);
1726
1727 Mission mission = GetMission();
1728 if (mission)
1729 {
1730 mission.OnEvent(eventTypeId, params);
1731 }
1732
1733 ErrorModuleHandler emh = ErrorModuleHandler.GetInstance();
1734 if (emh)
1735 emh.OnEvent(eventTypeId, params);
1736 }
DayZGame g_Game
Определения DayZGame.c:3868
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:3325
void SetConnectivityStatState(EConnectivityStatType type, EConnectivityStatLevel level)
Определения DayZGame.c:1738
void CancelLoginQueue()
Определения DayZGame.c:1391
void AddVisitedServer(string ip, int port)
Определения DayZGame.c:2599
DayZGameState GetGameState()
Определения DayZGame.c:1320
void LoadingShow()
Определения DayZGame.c:3348
proto native World GetWorld()
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto bool GetHostAddress(out string address, out int port)
Gets the server address. (from client)
void LoadingHide(bool force=false)
Определения DayZGame.c:3356
proto native BiosUserManager GetUserManager()
void OnLoginTimeEvent(int loginTime)
Определения DayZGame.c:1860
bool m_ConnectFromJoin
Определения DayZGame.c:945
void OnMPConnectionLostEvent(int duration)
Определения DayZGame.c:1977
void OnRespawnEvent(int time)
Определения DayZGame.c:1915
void OnPreloadEvent(vector pos)
Определения DayZGame.c:1943
bool m_FirstConnect
Определения DayZGame.c:908
void SetLoadState(DayZLoadState state)
Определения DayZGame.c:1325
void ClearConnectivityStates()
Определения DayZGame.c:1425
proto native DayZPlayer GetPlayer()
void CancelLoginTimeCountdown()
Определения DayZGame.c:1407
ref NotificationUI m_Notifications
Определения DayZGame.c:907
ref LoginTimeBase m_LoginTimeScreen
Определения DayZGame.c:912
proto native void AbortMission()
Returns to main menu, leave world empty for using last mission world.
proto native Mission GetMission()
void UpdateInputDeviceDisconnectWarning()
Определения DayZGame.c:2194
void SetGameState(DayZGameState state)
Определения DayZGame.c:1315
void LoadProgressUpdate(int progressState, float progress, string title)
Определения DayZGame.c:1998
ref LoadingScreen m_loading
Определения DayZGame.c:911
void OnEvent(EventType eventTypeId, Param params)
is called by DayZGame to pass Events.
Определения ErrorModuleHandler.c:255
void OnEvent(EventType eventTypeId, Param params)
Определения gameplay.c:714
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:110
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
Определения tools.c:9
const int CALL_CATEGORY_SYSTEM
Определения 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.