summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-15 22:08:30 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-15 22:08:30 +0000
commitefae7aa61b3b4d7fbb2782e8f00e27a6adc325c1 (patch)
treea56b8db8327b7fe6f71953469efd34952da10f0a /src/map/clif.c
parent0135f76b2a674a4824c33ac9d5e7ca65c945c7c4 (diff)
downloadhercules-efae7aa61b3b4d7fbb2782e8f00e27a6adc325c1.tar.gz
hercules-efae7aa61b3b4d7fbb2782e8f00e27a6adc325c1.tar.bz2
hercules-efae7aa61b3b4d7fbb2782e8f00e27a6adc325c1.tar.xz
hercules-efae7aa61b3b4d7fbb2782e8f00e27a6adc325c1.zip
- Merged and completed Latio's work on server-side hot-key saving (http://www.eathena.ws/board/index.php?s=&showtopic=159388&view=findpost&p=884453)
- Now hotkeys are stored server-side (table hotkey in SQL servers, file save/hotkeys.txt for TXT servers). You can disable this behaviour by commenting out the 'HOTKEY_SAVING' define in mmo.h - Fixed a few compilation warnings/errors. - Apply upgrade_svn11018.sql to create the hotkey table. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11019 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 30646a5b3..335d94ccf 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8083,6 +8083,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_updatestatus(sd,SP_NEXTJOBEXP);
clif_updatestatus(sd,SP_SKILLPOINT);
clif_initialstatus(sd);
+ clif_hotkeys_send(sd);
if (sd->sc.option&OPTION_FALCON)
clif_status_load(&sd->bl, SI_FALCON, 1);
@@ -8193,6 +8194,38 @@ void clif_parse_TickSend(int fd, struct map_session_data *sd)
return;
}
+void clif_hotkeys_send(struct map_session_data *sd) {
+#ifdef HOTKEY_SAVING
+ const int fd = sd->fd;
+ int i;
+ if (!fd) return;
+ WFIFOHEAD(fd, 2+HOTKEY_SAVING*7);
+ WFIFOW(fd, 0) = 0x02b9;
+ for(i = 0; i < HOTKEY_SAVING; i++) {
+ WFIFOB(fd, 2 + 0 + i * 7) = sd->status.hotkeys[i].type; // type: 0: item, 1: skill
+ WFIFOL(fd, 2 + 1 + i * 7) = sd->status.hotkeys[i].id; // item or skill ID
+ WFIFOW(fd, 2 + 5 + i * 7) = sd->status.hotkeys[i].lv; // skill level
+ }
+ WFIFOSET(fd, packet_len(0x02b9));
+#endif
+}
+
+void clif_parse_Hotkey(int fd, struct map_session_data *sd) {
+#ifdef HOTKEY_SAVING
+ unsigned short idx;
+ int cmd;
+
+ cmd = RFIFOW(fd, 0);
+ idx = RFIFOW(fd, packet_db[sd->packet_ver][cmd].pos[0]);
+ if (idx >= HOTKEY_SAVING) return;
+
+ sd->status.hotkeys[idx].type = RFIFOB(fd, packet_db[sd->packet_ver][cmd].pos[1]);
+ sd->status.hotkeys[idx].id = RFIFOL(fd, packet_db[sd->packet_ver][cmd].pos[2]);
+ sd->status.hotkeys[idx].lv = RFIFOW(fd, packet_db[sd->packet_ver][cmd].pos[3]);
+ return;
+#endif
+}
+
/*==========================================
*
*------------------------------------------*/
@@ -11705,7 +11738,7 @@ static int packetdb_readdb(void)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 0, 0, 0, 0,
//#0x02C0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -11843,13 +11876,13 @@ static int packetdb_readdb(void)
{clif_parse_FeelSaveOk,"feelsaveok"},
{clif_parse_AdoptRequest,"adopt"},
{clif_parse_debug,"debug"},
- //[blackhole89] //[orn]
{clif_parse_ChangeHomunculusName,"changehomunculusname"},
{clif_parse_HomMoveToMaster,"hommovetomaster"},
{clif_parse_HomMoveTo,"hommoveto"},
{clif_parse_HomAttack,"homattack"},
{clif_parse_HomMenu,"hommenu"},
{clif_parse_StoragePassword,"storagepassword"},
+ {clif_parse_Hotkey,"hotkey"},
{NULL,NULL}
};