Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
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
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}
std::string FormatGMNoteLocation(GMNoteLocation const &location)
GMNoteValidation ValidateGMNoteText(std::string const &note)
constexpr size_t GMNoteMaxLength
Definition GMNoteUtils.h:32