67 namespace CharServerRecv
77 if (character ==
nullptr)
96 msg.readInt64(
"job exp");
101 msg.readInt32(
"job exp");
104 msg.readInt32(
"job level");
106 msg.readInt16(
"shoes?");
107 const int gloves =
msg.readInt16(
"gloves");
108 const int cape =
msg.readInt16(
"cape");
109 const int misc1 =
msg.readInt16(
"misc1");
111 msg.readInt32(
"option");
114 msg.readInt16(
"left points");
129 msg.readInt16(
"speed");
130 const uint16_t race =
msg.readInt16(
"class");
132 const int hairStyle =
msg.readInt16(
"hair style");
134 msg.readInt16(
"body");
135 const int option
A_UNUSED = (
msg.readInt16(
"weapon") | 1) ^ 1;
136 const int weapon = 0;
144 msg.readInt16(
"skill points");
145 const int bottomClothes =
msg.readInt16(
"head bottom");
146 const int shield =
msg.readInt16(
"shild");
147 const int hat =
msg.readInt16(
"head top");
148 const int topClothes =
msg.readInt16(
"head mid");
164 const uint16_t look =
msg.readInt16(
"clothes color");
166 tempPlayer->
setName(
msg.readString(24,
"name"));
168 character->
dummy = tempPlayer;
177 character->
slot =
msg.readInt16(
"character slot id");
179 msg.readInt16(
"rename");
182 msg.readString(16,
"map name");
183 msg.readInt32(
"delete date");
187 shoes =
msg.readInt32(
"robe");
209 msg.readInt32(
"slot change");
211 tempPlayer->
setRename(
msg.readInt32(
"rename (inverse)") != 0);
212 uint8_t gender = 99U;
221 msg.readInt16(
"packet len");
226 slots =
msg.readInt8(
"MAX_CHARS");
227 msg.readInt8(
"sd->char_slots");
228 msg.readInt8(
"MAX_CHARS");
233 msg.skip(20,
"unused 0");
239 const int count = (
msg.getLength() - 24 - offset)
240 / (106 + 4 + 2 + 16 + 4 + 4 + 4 + 4);
242 for (
int i = 0; i < count; ++i)
247 if (character->
dummy !=
nullptr)
249 logger->
log(
"CharServer: Player: %s (%d)",
260 msg.readInt16(
"len");
261 msg.readUInt8(
"char slots");
262 msg.readUInt8(
"left slots");
263 msg.readUInt8(
"left slots");
264 msg.readUInt8(
"char slots");
265 msg.readUInt8(
"char slots");
266 msg.skip(20,
"unused");
278 msg.readInt32(
"map ip address");
285 server.
port =
msg.readInt16(
"map ip port");
286 if (
msg.getVersion() >= 20170329)
288 for (
int f = 0; f < 32; f ++)
289 msg.readInt32(
"unused");
304 if (network !=
nullptr)
307 BLOCK_END(
"CharServerRecv::processCharMapInfo")
314 BLOCK_START(
"CharServerRecv::processChangeMapServer")
315 if (network ==
nullptr)
317 BLOCK_END(
"CharServerRecv::processChangeMapServer")
321 const int x =
msg.readInt16(
"x");
322 const int y =
msg.readInt16(
"y");
325 msg.readInt32(
"host");
332 server.
port =
msg.readInt16(
"port");
333 if (
msg.getVersion() >= 20170315)
335 for (
int f = 0; f < 32; f ++)
336 msg.readInt32(
"unknown");
346 BLOCK_END(
"CharServerRecv::processChangeMapServer")
355 msg.readInt16(
"state"))) ==
false)
365 const uint16_t state =
CAST_U16(
msg.readInt16(
"state"));
376 msg.readInt16(
"state");
377 msg.readInt32(
"seed");
383 msg.readInt16(
"state");
384 msg.readInt32(
"seed");
399 BLOCK_END(
"CharServerRecv::processCharCreate")
404 if (
msg.readInt16(
"flag") != 0)
407 outMsg.writeBeingId(
mRenameId,
"char id");
415 _(
"Character rename error."),
428 const int flag =
msg.readInt16(
"flag");
438 _(
"Character renamed."),
454 message =
_(
"Rename not allowed.");
458 message =
_(
"New name is not set.");
463 message =
_(
"Character rename error.");
467 message =
_(
"Character not found.");
487 msg.readInt16(
"len");
488 msg.readInt16(
"flag");
489 msg.readInt16(
"unused");
494 BLOCK_START(
"CharServerRecv::processCharDeleteFailed")
496 msg.readUInt8(
"error");
501 _(
"Failed to delete character."),
509 BLOCK_END(
"CharServerRecv::processCharDeleteFailed")
522 msg.readInt32(
"char id");
523 msg.readInt32(
"result");
526 msg.readInt32(
"time");
532 msg.readInt32(
"char id");
533 msg.readInt32(
"result");
539 msg.readInt32(
"char id");
540 msg.readInt32(
"result");
545 msg.readInt16(
"packet len");
551 const int count = (
msg.getLength() - 4)
552 / (106 + 4 + 2 + 16 + 4 + 4 + 4 + 4);
554 for (
int i = 0; i < count; ++i)
559 if (character->
dummy !=
nullptr)
561 logger->
log(
"CharServer: Player: %s (%d)",
572 const int count = (
msg.readInt16(
"len") - 4) / 24;
573 for (
int f = 0; f < count; f ++)
575 msg.readInt32(
"char id");
576 msg.readString(20,
"unbun time");
const BeingId BeingId_zero
const BeingTypeId BeingTypeId_zero
Net::CharServerHandler * charServerHandler
void setKarma(const int karma)
void setWeaponId(const int id)
static GenderT intToGender(const uint8_t sex) A_CONST
void setName(const std::string &name)
void setSubtype(const BeingTypeId subtype, const uint16_t look)
void setHairColor(const unsigned int slot, const ItemColor color)
const std::string & getName() const
void setSpriteId(const unsigned int slot, const int id)
virtual void setGender(const GenderT gender)
void unSetSprite(const unsigned int slot)
void setManner(const int manner)
void setSpriteColor(const unsigned int slot, const int id, const std::string &color)
void setName(const BeingId id, const std::string &newName)
void setState(const StateT state)
bool getBoolValue(const std::string &key) const
static Network * mInstance
static void setMap(const std::string &map)
void setTileCoords(const int x, const int y)
void setMap(Map *const map)
void setRename(const bool r)
void log(const char *const log_text,...)
static void unlockCharSelectDialog()
static void updateCharSelectDialog()
virtual void clear() const =0
static Net::Character * mSelectedCharacter
static CharSelectDialog * mCharSelectDialog
static Net::Characters mCharacters
static CharCreateDialog * mCharCreateDialog
virtual int getDefaultWalkSpeed() const =0
void setAccountId(const BeingId id)
void setPincodeLockFlag(const bool flag)
bool processPincodeStatus(const uint16_t state)
void setSeed(const uint32_t seed)
virtual void scheduleDelete()
void delete_all(Container &c)
#define fromInt(val, name)
LocalPlayer * localPlayer
#define UNIMPLEMENTEDPACKET
Net::LoginHandler * loginHandler
#define createOutPacket(name)
bool msg(InputEvent &event)
bool hat(InputEvent &event)
void processCharDelete2CancelAck(Net::MessageIn &msg)
void processCharCreate(Net::MessageIn &msg)
void processCharDelete2AcceptActual(Net::MessageIn &msg)
void processCharCharacters(Net::MessageIn &msg)
void processCharRename(Net::MessageIn &msg)
void processPincodeMakeStatus(Net::MessageIn &msg)
void processCharLogin(Net::MessageIn &msg)
void processCharBanCharList(Net::MessageIn &msg)
void processCharDelete2Ack(Net::MessageIn &msg)
void processPincodeStatus(Net::MessageIn &msg)
void processCharDeleteFailed(Net::MessageIn &msg)
void processPincodeEditStatus(Net::MessageIn &msg)
void processCharLogin2(Net::MessageIn &msg)
void processPincodeStatus2(Net::MessageIn &msg)
void processCharMapInfo(Net::MessageIn &msg)
void processChangeMapServer(Net::MessageIn &msg)
void processCharCaptchaNotSupported(Net::MessageIn &msg)
void readPlayerData(Net::MessageIn &msg, Net::Character *const character)
void processCharChangeSlot(Net::MessageIn &msg)
void processCharCheckRename(Net::MessageIn &msg)
const ItemInfo & get(const int id)
void setBackend(const PlayerInfoBackend &backend)
void setStatBase(const AttributesT id, const int value, const Notify notify)
void setCharId(const int charId)
Net::PlayerHandler * playerHandler
#define BLOCK_START(name)
PincodeManager pincodeManager
const bool ShowCenter_true
const char * ipToString(const uint32_t address)