clean up some debugging stuff and fix old comments
This commit is contained in:
@@ -425,8 +425,6 @@ struct Player {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define ERROR_COMBINE_ITEM_SPLIT 0x5FFFFFFE // this error code is used to tell calling functions that a combine item needs to be split
|
|
||||||
|
|
||||||
uint32_t compute_guild_card_checksum(const void* data, size_t size);
|
uint32_t compute_guild_card_checksum(const void* data, size_t size);
|
||||||
|
|
||||||
std::string filename_for_player_bb(const std::string& username, uint8_t player_index);
|
std::string filename_for_player_bb(const std::string& username, uint8_t player_index);
|
||||||
|
|||||||
@@ -212,14 +212,14 @@ void Server::receive_and_process_commands(shared_ptr<Client> c, struct buffereve
|
|||||||
// to call string functions on the buffer in command handlers
|
// to call string functions on the buffer in command handlers
|
||||||
string data = c->recv_buffer.substr(offset + header_size, size - header_size);
|
string data = c->recv_buffer.substr(offset + header_size, size - header_size);
|
||||||
data.append(4, '\0');
|
data.append(4, '\0');
|
||||||
// try {
|
try {
|
||||||
process_command(this->state, c, header->command(c->version),
|
process_command(this->state, c, header->command(c->version),
|
||||||
header->flag(c->version), size - header_size, data.data());
|
header->flag(c->version), size - header_size, data.data());
|
||||||
// } catch (const exception& e) {
|
} catch (const exception& e) {
|
||||||
// log(INFO, "[Server] error in client stream: %s", e.what());
|
log(INFO, "[Server] error in client stream: %s", e.what());
|
||||||
// c->should_disconnect = true;
|
c->should_disconnect = true;
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// BB pads commands to 8-byte boundaries, so if we see a shorter command,
|
// BB pads commands to 8-byte boundaries, so if we see a shorter command,
|
||||||
// skip over the padding
|
// skip over the padding
|
||||||
|
|||||||
@@ -64,11 +64,6 @@ static const vector<char16_t>& unicode_to_sjis_table() {
|
|||||||
return unicode_to_sjis_table_data;
|
return unicode_to_sjis_table_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// None of these functions truly convert between SJIS and Unicode. They will
|
|
||||||
// convert English properly (and some other languages as well), but Japanese
|
|
||||||
// text will screw up horribly
|
|
||||||
// TODO: fix this shit. this is definitely the worst part of this entire project
|
|
||||||
|
|
||||||
void encode_sjis(char* dest, const char16_t* source, size_t max) {
|
void encode_sjis(char* dest, const char16_t* source, size_t max) {
|
||||||
const auto& table = unicode_to_sjis_table();
|
const auto& table = unicode_to_sjis_table();
|
||||||
while (*source && (--max)) {
|
while (*source && (--max)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user