Added WriteChar func to JsonWriterFile

This commit is contained in:
Jordan Cristiano 2015-07-12 20:51:25 -04:00
parent 236919cc4c
commit e959fb0334
3 changed files with 11 additions and 1 deletions

View File

@ -84,6 +84,15 @@ namespace base
writer.Bool(value); writer.Bool(value);
} }
void JsonWriterFile::WriteChar(const char* name, char value)
{
auto& writer = m_writer;
writer.String(name);
char temp[2] = { value, '\0' };
writer.String(temp);
}
void JsonWriterFile::WriteInt32(const char* name, std::int32_t value) void JsonWriterFile::WriteInt32(const char* name, std::int32_t value)
{ {
auto& writer = m_writer; auto& writer = m_writer;

View File

@ -28,6 +28,7 @@ namespace base
void WriteNull(const char* name); void WriteNull(const char* name);
void WriteBool(const char* name, bool value); void WriteBool(const char* name, bool value);
void WriteChar(const char* name, char value);
void WriteInt32(const char* name, std::int32_t value); void WriteInt32(const char* name, std::int32_t value);
void WriteInt32(const char* name, std::int32_t value, bool writeCondition); void WriteInt32(const char* name, std::int32_t value, bool writeCondition);
void WriteInt64(const char* name, std::int64_t value); void WriteInt64(const char* name, std::int64_t value);

View File

@ -92,7 +92,7 @@ namespace NetHandlers
jsonbuf.WriteUInt32("playerSlot", data->playerSlot); jsonbuf.WriteUInt32("playerSlot", data->playerSlot);
jsonbuf.WriteUInt32("maxClients", data->maxClients); jsonbuf.WriteUInt32("maxClients", data->maxClients);
jsonbuf.WriteFloat("tickInterval", data->tickInterval); jsonbuf.WriteFloat("tickInterval", data->tickInterval);
jsonbuf.WriteString("os", &data->os, 1); jsonbuf.WriteChar("os", data->os);
jsonbuf.WriteString("gameDir", data->gameDir); jsonbuf.WriteString("gameDir", data->gameDir);
jsonbuf.WriteString("mapName", data->mapName); jsonbuf.WriteString("mapName", data->mapName);
jsonbuf.WriteString("skyName", data->skyName); jsonbuf.WriteString("skyName", data->skyName);