2020-08-18 20:42:30 +00:00
|
|
|
/*
|
2020-08-20 16:36:29 +00:00
|
|
|
CNStructs.hpp - defines some basic structs & useful methods for packets used by FusionFall based on the version defined
|
2020-08-18 20:42:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CNS_HPP
|
|
|
|
#define _CNS_HPP
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
2020-08-20 15:43:37 +00:00
|
|
|
// Can't use this in MSVC.
|
|
|
|
#ifndef _MSC_VER
|
2020-08-20 16:36:29 +00:00
|
|
|
#include <sys/time.h>
|
2020-08-20 15:43:37 +00:00
|
|
|
#else
|
2020-08-20 16:36:29 +00:00
|
|
|
#include <time.h>
|
2020-08-20 15:43:37 +00:00
|
|
|
#endif
|
2020-08-18 20:42:30 +00:00
|
|
|
#include <cstring>
|
|
|
|
#include <string>
|
|
|
|
#include <locale>
|
|
|
|
#include <codecvt>
|
|
|
|
|
|
|
|
// TODO: rewrite U16toU8 & U8toU16 to not use codecvt
|
|
|
|
|
|
|
|
std::string U16toU8(char16_t* src);
|
2020-08-20 16:37:47 +00:00
|
|
|
int U8toU16(std::string src, char16_t* des); // returns number of char16_t that was written at des
|
2020-08-18 20:42:30 +00:00
|
|
|
uint64_t getTime();
|
|
|
|
|
|
|
|
//#define CNPROTO_VERSION_0728
|
2020-08-19 20:00:39 +00:00
|
|
|
#define CNPROTO_VERSION_0104
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2020-08-20 16:36:29 +00:00
|
|
|
#if defined(CNPROTO_VERSION_0104)
|
2020-08-19 20:07:11 +00:00
|
|
|
#include "structs/0104.hpp"
|
2020-08-20 16:36:29 +00:00
|
|
|
#elif defined(CNPROTO_VERSION_0728)
|
|
|
|
#include "structs/0728.hpp"
|
2020-08-19 20:00:39 +00:00
|
|
|
#endif
|
|
|
|
|
2020-08-19 17:43:24 +00:00
|
|
|
#endif
|