Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
WorldShutdownLifecycle.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
7
8namespace Skyfire
9{
11{
12 namespace
13 {
14 int GetShutdownStepIndex(WorldShutdownStep step)
15 {
16 switch (step)
17 {
19 return 0;
21 return 1;
23 return 2;
25 return 3;
27 return 4;
29 return 5;
31 return 6;
33 return 7;
35 return 8;
37 return 9;
39 return 10;
40 default:
41 return -1;
42 }
43 }
44 }
45
47 {
48 switch (step)
49 {
51 return "start";
53 return "script shutdown";
55 return "kick players";
57 return "update sessions";
59 return "delete battlegrounds";
61 return "stop network";
63 return "unload maps";
65 return "unload object accessor";
67 return "unload scripts";
69 return "outdoor pvp cleanup";
71 return "complete";
72 default:
73 return "unknown";
74 }
75 }
76
78 {
79 int const currentIndex = GetShutdownStepIndex(current);
80 int const nextIndex = GetShutdownStepIndex(next);
81 return currentIndex >= 0 && nextIndex == currentIndex + 1;
82 }
83
85 {
86 int const firstIndex = GetShutdownStepIndex(first);
87 int const secondIndex = GetShutdownStepIndex(second);
88 return firstIndex >= 0 && secondIndex >= 0 && firstIndex < secondIndex;
89 }
90}
91}
char const * GetShutdownStepName(WorldShutdownStep step)
bool IsExpectedShutdownTransition(WorldShutdownStep current, WorldShutdownStep next)
bool IsShutdownStepBefore(WorldShutdownStep first, WorldShutdownStep second)