Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
GMNoteUtils.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
6
#include "
GMNoteUtils.h
"
7
8
#include <iomanip>
9
#include <sstream>
10
11
Skyfire::GMNoteValidation
Skyfire::ValidateGMNoteText
(std::string
const
& note)
12
{
13
if
(note.empty())
14
return
{
false
,
"Note text is required."
};
15
16
if
(note.size() >
GMNoteMaxLength
)
17
return
{
false
,
"GM notes are limited to 255 characters."
};
18
19
return
{
true
,
""
};
20
}
21
22
std::string
Skyfire::FormatGMNoteLocation
(
GMNoteLocation
const
& location)
23
{
24
std::ostringstream stream;
25
stream << std::fixed << std::setprecision(2)
26
<<
"map="
<< location.
MapId
27
<<
" zone="
<< location.
ZoneId
28
<<
" area="
<< location.
AreaId
29
<<
" x="
<< location.
X
30
<<
" y="
<< location.
Y
31
<<
" z="
<< location.
Z
32
<<
" o="
<< location.
Orientation
;
33
34
return
stream.str();
35
}
GMNoteUtils.h
Skyfire::FormatGMNoteLocation
std::string FormatGMNoteLocation(GMNoteLocation const &location)
Definition
GMNoteUtils.cpp:22
Skyfire::ValidateGMNoteText
GMNoteValidation ValidateGMNoteText(std::string const ¬e)
Definition
GMNoteUtils.cpp:11
Skyfire::GMNoteMaxLength
constexpr size_t GMNoteMaxLength
Definition
GMNoteUtils.h:32
Skyfire::GMNoteLocation
Definition
GMNoteUtils.h:22
Skyfire::GMNoteLocation::Orientation
float Orientation
Definition
GMNoteUtils.h:29
Skyfire::GMNoteLocation::AreaId
uint32 AreaId
Definition
GMNoteUtils.h:25
Skyfire::GMNoteLocation::X
float X
Definition
GMNoteUtils.h:26
Skyfire::GMNoteLocation::Z
float Z
Definition
GMNoteUtils.h:28
Skyfire::GMNoteLocation::MapId
uint32 MapId
Definition
GMNoteUtils.h:23
Skyfire::GMNoteLocation::Y
float Y
Definition
GMNoteUtils.h:27
Skyfire::GMNoteLocation::ZoneId
uint32 ZoneId
Definition
GMNoteUtils.h:24
Skyfire::GMNoteValidation
Definition
GMNoteUtils.h:16
src
server
shared
Utilities
GMNoteUtils.cpp
Generated on
for Project SkyFire Core by
1.17.0