Hercules Renewal: Phase Two
Hello~! - What?!
[*]"So whats this phase two about?"
Goal: user-friendliness
void clif_authok(struct map_session_data *sd)
{
#if PACKETVER < 20080102
const int cmd = 0x73;
#else
const int cmd = 0x2eb;
#endif
int fd = sd->fd;
WFIFOHEAD(fd,packet_len(cmd));
WFIFOW(fd, 0) = cmd;
WFIFOL(fd, 2) = gettick();
WFIFOPOS(fd, 6, sd->bl.x, sd->bl.y, sd->ud.dir);
WFIFOB(fd, 9) = 5; // ignored
WFIFOB(fd,10) = 5; // ignored
#if PACKETVER >= 20080102
WFIFOW(fd,11) = sd->user_font;
#endif
WFIFOSET(fd,packet_len(cmd));
}
After
void clif_authok(struct map_session_data *sd)
{
struct packet_authok pack;
pack.PacketType = authokType;
pack.startTime = gettick();
pack.PosDir[0] = sd->bl.x;
pack.PosDir[1] = sd->bl.y;
pack.PosDir[2] = sd->ud.dir;
pack.xSize = 5; //not used
pack.ySize = 5; //not used
#if PACKETVER >= 20080102
pack.font = sd->user_font;
#endif
clif->send(pack,sd->fd,blabla,SELF);
}
Special Thanks
Hello~! - What?!
- "but phase one isn't complete yet!"its alright, we have been able to manage parallel projects and goals, we surely can take care of this one too and effort required on this one is pretty much less than on phase one
[*]"So whats this phase two about?"
- one of my favorite things: user friendliness
Goal: user-friendliness
- This aims at rewriting all of our server-client packet building, making it much more user friendly to modify and add new ones.
- We'll be starting with map server <- -> client (clif.c) and then will move to char server <- -> client and later login server <- -> client
void clif_authok(struct map_session_data *sd)
{
#if PACKETVER < 20080102
const int cmd = 0x73;
#else
const int cmd = 0x2eb;
#endif
int fd = sd->fd;
WFIFOHEAD(fd,packet_len(cmd));
WFIFOW(fd, 0) = cmd;
WFIFOL(fd, 2) = gettick();
WFIFOPOS(fd, 6, sd->bl.x, sd->bl.y, sd->ud.dir);
WFIFOB(fd, 9) = 5; // ignored
WFIFOB(fd,10) = 5; // ignored
#if PACKETVER >= 20080102
WFIFOW(fd,11) = sd->user_font;
#endif
WFIFOSET(fd,packet_len(cmd));
}
After
void clif_authok(struct map_session_data *sd)
{
struct packet_authok pack;
pack.PacketType = authokType;
pack.startTime = gettick();
pack.PosDir[0] = sd->bl.x;
pack.PosDir[1] = sd->bl.y;
pack.PosDir[2] = sd->ud.dir;
pack.xSize = 5; //not used
pack.ySize = 5; //not used
#if PACKETVER >= 20080102
pack.font = sd->user_font;
#endif
clif->send(pack,sd->fd,blabla,SELF);
}
Special Thanks
- To Yommy for bringing this up!
Last edited by a moderator: