-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
136 lines (121 loc) · 6.14 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
package palworldapi
import "net/http"
type PalworldAPI struct {
Host string // Defaults to localhost:8212
Username string // Defaults to "admin"
AdminPassword string
client http.Client
}
// GET
type ServerInfo struct {
Version string `json:"version"`
ServerName string `json:"servername"`
Description string `json:"description"`
}
type Player struct {
Name string `json:"name"`
AccountName string `json:"accountName"`
PlayerID string `json:"playerId"`
UserID string `json:"userId"`
IP string `json:"ip"`
Ping float64 `json:"ping"`
LocationX float64 `json:"location_x"`
LocationY float64 `json:"location_y"`
Level int `json:"level"`
}
type PlayerList struct {
Players []*Player `json:"players"`
}
type ServerSettings struct {
Difficulty string `json:"Difficulty"`
DayTimeSpeedRate int `json:"DayTimeSpeedRate"`
NightTimeSpeedRate int `json:"NightTimeSpeedRate"`
ExpRate int `json:"ExpRate"`
PalCaptureRate int `json:"PalCaptureRate"`
PalSpawnNumRate int `json:"PalSpawnNumRate"`
PalDamageRateAttack int `json:"PalDamageRateAttack"`
PalDamageRateDefense int `json:"PalDamageRateDefense"`
PlayerDamageRateAttack int `json:"PlayerDamageRateAttack"`
PlayerDamageRateDefense int `json:"PlayerDamageRateDefense"`
PlayerStomachDecreaceRate int `json:"PlayerStomachDecreaceRate"`
PlayerStaminaDecreaceRate int `json:"PlayerStaminaDecreaceRate"`
PlayerAutoHPRegeneRate int `json:"PlayerAutoHPRegeneRate"`
PlayerAutoHpRegeneRateInSleep int `json:"PlayerAutoHpRegeneRateInSleep"`
PalStomachDecreaceRate int `json:"PalStomachDecreaceRate"`
PalStaminaDecreaceRate int `json:"PalStaminaDecreaceRate"`
PalAutoHPRegeneRate int `json:"PalAutoHPRegeneRate"`
PalAutoHpRegeneRateInSleep int `json:"PalAutoHpRegeneRateInSleep"`
BuildObjectDamageRate int `json:"BuildObjectDamageRate"`
BuildObjectDeteriorationDamageRate int `json:"BuildObjectDeteriorationDamageRate"`
CollectionDropRate int `json:"CollectionDropRate"`
CollectionObjectHpRate int `json:"CollectionObjectHpRate"`
CollectionObjectRespawnSpeedRate int `json:"CollectionObjectRespawnSpeedRate"`
EnemyDropItemRate int `json:"EnemyDropItemRate"`
DeathPenalty string `json:"DeathPenalty"`
EnablePlayerToPlayerDamage bool `json:"bEnablePlayerToPlayerDamage"`
EnableFriendlyFire bool `json:"bEnableFriendlyFire"`
EnableInvaderEnemy bool `json:"bEnableInvaderEnemy"`
ActiveUNKO bool `json:"bActiveUNKO"`
EnableAimAssistPad bool `json:"bEnableAimAssistPad"`
EnableAimAssistKeyboard bool `json:"bEnableAimAssistKeyboard"`
DropItemMaxNum int `json:"DropItemMaxNum"`
DropItemMaxNum_UNKO int `json:"DropItemMaxNum_UNKO"`
BaseCampMaxNum int `json:"BaseCampMaxNum"`
BaseCampWorkerMaxNum int `json:"BaseCampWorkerMaxNum"`
DropItemAliveMaxHours int `json:"DropItemAliveMaxHours"`
AutoResetGuildNoOnlinePlayers bool `json:"bAutoResetGuildNoOnlinePlayers"`
AutoResetGuildTimeNoOnlinePlayers int `json:"AutoResetGuildTimeNoOnlinePlayers"`
GuildPlayerMaxNum int `json:"GuildPlayerMaxNum"`
PalEggDefaultHatchingTime int `json:"PalEggDefaultHatchingTime"`
WorkSpeedRate int `json:"WorkSpeedRate"`
IsMultiplay bool `json:"bIsMultiplay"`
IsPvP bool `json:"bIsPvP"`
CanPickupOtherGuildDeathPenaltyDrop bool `json:"bCanPickupOtherGuildDeathPenaltyDrop"`
EnableNonLoginPenalty bool `json:"bEnableNonLoginPenalty"`
EnableFastTravel bool `json:"bEnableFastTravel"`
IsStartLocationSelectByMap bool `json:"bIsStartLocationSelectByMap"`
ExistPlayerAfterLogout bool `json:"bExistPlayerAfterLogout"`
EnableDefenseOtherGuildPlayer bool `json:"bEnableDefenseOtherGuildPlayer"`
CoopPlayerMaxNum int `json:"CoopPlayerMaxNum"`
ServerPlayerMaxNum int `json:"ServerPlayerMaxNum"`
ServerName string `json:"ServerName"`
ServerDescription string `json:"ServerDescription"`
PublicPort int `json:"PublicPort"`
PublicIP string `json:"PublicIP"`
RCONEnabled bool `json:"RCONEnabled"`
RCONPort int `json:"RCONPort"`
Region string `json:"Region"`
UseAuth bool `json:"bUseAuth"`
BanListURL string `json:"BanListURL"`
RESTAPIEnabled bool `json:"RESTAPIEnabled"`
RESTAPIPort int `json:"RESTAPIPort"`
BShowPlayerList bool `json:"bShowPlayerList"`
AllowConnectPlatform string `json:"AllowConnectPlatform"`
IsUseBackupSaveData bool `json:"bIsUseBackupSaveData"`
LogFormatType string `json:"LogFormatType"`
}
type ServerMetrics struct {
FPS int `json:"serverfps"`
CurrentPlayerNum int `json:"currentplayernum"`
MaxPlayerNum int `json:"maxplayernum"`
Uptime int `json:"uptime"`
}
// POST
type Announce struct {
Message string `json:"message"`
}
type KickPlayer struct {
UserID string `json:"userid"`
Message string `json:"message"`
}
type BanPlayer struct {
UserID string `json:"userid"`
Message string `json:"message"`
}
type UnbanPlayer struct {
UserID string `json:"userid"`
}
type ServerShutdown struct {
WaitTime int `json:"waittime"` // Use custom datatype which converts time.Duration to the WaitTime
Message string `json:"string"`
}