summaryrefslogtreecommitdiff
path: root/src/plugins/sample.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-08-09 02:17:43 +0200
committerHaru <haru@dotalux.com>2015-08-15 00:51:41 +0200
commitf8edb93a6a26cd81eeaad0eac23e33da7740c8b4 (patch)
treee1d6ef1a867613be7d8d0384c93c9767867a91a3 /src/plugins/sample.c
parentb0210e25675b0b3e950a0ee13ae8652360d84386 (diff)
downloadhercules-f8edb93a6a26cd81eeaad0eac23e33da7740c8b4.tar.gz
hercules-f8edb93a6a26cd81eeaad0eac23e33da7740c8b4.tar.bz2
hercules-f8edb93a6a26cd81eeaad0eac23e33da7740c8b4.tar.xz
hercules-f8edb93a6a26cd81eeaad0eac23e33da7740c8b4.zip
Moved session array into the socket interface
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/plugins/sample.c')
-rw-r--r--src/plugins/sample.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/plugins/sample.c b/src/plugins/sample.c
index b034775b0..d11c082b4 100644
--- a/src/plugins/sample.c
+++ b/src/plugins/sample.c
@@ -44,15 +44,15 @@ struct sample_data_struct {
/* cmd 0xf3 - it is a client-server existent id, for clif_parse_GlobalMessage */
/* in this sample we do nothing and simply redirect */
void sample_packet0f3(int fd) {
- struct map_session_data *sd = session[fd]->session_data;
+ struct map_session_data *sd = sockt->session[fd]->session_data;
struct sample_data_struct *data;
if( !sd ) return;/* socket didn't fully log-in? this packet shouldn't do anything then! */
ShowInfo("sample_packet0f3: Hello World! received 0xf3 for '%s', redirecting!\n",sd->status.name);
- /* sample usage of appending data to a socket_data (session[]) entry */
- if( !(data = getFromSession(session[fd],0)) ) {
+ /* sample usage of appending data to a socket_data (sockt->session[]) entry */
+ if( !(data = getFromSession(sockt->session[fd],0)) ) {
CREATE(data,struct sample_data_struct,1);
data->lastMSGPosition.map = sd->status.last_point.map;
@@ -60,13 +60,13 @@ void sample_packet0f3(int fd) {
data->lastMSGPosition.y = sd->status.last_point.y;
data->someNumber = rand()%777;
- ShowInfo("Created Appended session[] data, %d %d %d %d\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
- addToSession(session[fd],data,0,true);
+ ShowInfo("Created Appended sockt->session[] data, %d %d %d %d\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
+ addToSession(sockt->session[fd],data,0,true);
} else {
- ShowInfo("Existent Appended session[] data, %d %d %d %d\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
+ ShowInfo("Existent Appended sockt->session[] data, %d %d %d %d\n",data->lastMSGPosition.map,data->lastMSGPosition.x,data->lastMSGPosition.y,data->someNumber);
if( rand()%4 == 2 ) {
- ShowInfo("Removing Appended session[] data\n");
- removeFromSession(session[fd],0);
+ ShowInfo("Removing Appended sockt->session[] data\n");
+ removeFromSession(sockt->session[fd],0);
}
}
@@ -133,9 +133,6 @@ HPExport void plugin_init (void) {
pc = GET_SYMBOL("pc");
strlib = GET_SYMBOL("strlib");
- /* session[] */
- session = GET_SYMBOL("session");
-
ShowInfo ("Server type is ");
switch (*server_type) {