viewing paste Unknown #5732 | Diff

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
Index: src/map/atcommand.c
===================================================================
--- src/map/atcommand.c (revision 17295)
+++ src/map/atcommand.c (working copy)
@@ -1482,8 +1482,10 @@
 
    map[sd->bl.m].flag.pvp = 0;
 
-   if (!battle_config.pk_mode)
+   if (!battle_config.pk_mode){
        clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
+       clif_maptypeproperty2(&sd->bl,ALL_SAMEMAP);
+   }
    map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC);
    map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
    clif_displaymessage(fd, msg_txt(sd,31)); // PvP: Off.
@@ -1521,6 +1523,7 @@
    if (!battle_config.pk_mode)
    {// display pvp circle and rank
        clif_map_property_mapall(sd->bl.m, MAPPROPERTY_FREEPVPZONE);
+       clif_maptypeproperty2(&sd->bl,ALL_SAMEMAP);
        map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC);
    }
 
@@ -1543,6 +1546,7 @@
 
    map[sd->bl.m].flag.gvg = 0;
    clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING);
+   clif_maptypeproperty2(&sd->bl,ALL_SAMEMAP);
    map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0);
    clif_displaymessage(fd, msg_txt(sd,33)); // GvG: Off.
 
@@ -1563,6 +1567,7 @@
 
    map[sd->bl.m].flag.gvg = 1;
    clif_map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE);
+   clif_maptypeproperty2(&sd->bl,ALL_SAMEMAP);
    clif_displaymessage(fd, msg_txt(sd,34)); // GvG: On.
 
    return 0;
@@ -8894,10 +8899,12 @@
        return channel_pcunbind(sd);
    } else if ( strcmpi(key,"ban") == 0 ) {
        return channel_pcban(sd,sub1,map_nick2sd(sub2),0);
-   } else if ( strcmpi(key,"unban") == 0 ) {
+   }  else if ( strcmpi(key,"unban") == 0 ) {
        return channel_pcban(sd,sub1,map_nick2sd(sub2),1);
    } else if ( strcmpi(key,"unbanall") == 0 ) {
        return channel_pcban(sd,sub1,NULL,2);
+   } else if ( strcmpi(key,"banlist") == 0 ) {
+       return channel_pcban(sd,sub1,NULL,3);
    } else if ( strcmpi(key,"setopt") == 0 ) {
        return channel_pcsetopt(sd,sub1,sub2,sub3);
    } else {
Index: src/map/channel.c
===================================================================
--- src/map/channel.c   (revision 17295)
+++ src/map/channel.c   (working copy)
@@ -20,6 +20,11 @@
 static DBMap* channel_db; // channels
 DBMap* channel_get_db(void){ return channel_db; }
 
+struct chan_banentry {
+    int char_id;
+    char char_name[NAME_LENGTH];
+} chan_banentry;
+
 /*
  * Create *channel
  * - will then add it in channel_db if type not map or ally
@@ -37,7 +42,7 @@
 
    CREATE( channel, struct Channel, 1 ); //will exit on fail allocation
    channel->users = idb_alloc(DB_OPT_BASE);
-   channel->banned = idb_alloc(DB_OPT_BASE);
+   channel->banned = idb_alloc(DB_OPT_BASE|DB_OPT_RELEASE_DATA);
    channel->opt = CHAN_OPT_BASE;
    channel->type = chantype;
    channel->color = color;
@@ -846,11 +851,16 @@
 
    //let properly alter the list now
    switch(flag){
-   case 0:
-       idb_put(channel->banned, tsd->status.char_id, tsd);
+   case 0: {
+       struct chan_banentry *cbe;
+       CREATE(cbe, struct chan_banentry, 1);
+       cbe->char_id = tsd->status.char_id;
+       strcpy(cbe->char_name,tsd->status.name);
+       idb_put(channel->banned, tsd->status.char_id, cbe);
        channel_clean(channel,tsd,0);
        sprintf(output, msg_txt(sd,1437),tsd->status.name,chname); // Player '%s' has now been banned from '%s' channel
        break;
+   }
    case 1:
        idb_remove(channel->banned, tsd->status.char_id);
        sprintf(output, msg_txt(sd,1441),tsd->status.name,chname); // Player '%s' has now been unbanned from the '%s' channel
@@ -861,16 +871,16 @@
        break;
    case 3: {
        DBIterator *iter = db_iterator(channel->banned);
-       struct map_session_data *pl_sd;
+       struct chan_banentry *cbe;
        sprintf(output, msg_txt(sd,1443), channel->name);// -- '%s' ban list
        clif_displaymessage(sd->fd, output);
-       for( pl_sd = dbi_first(iter); dbi_exists(iter); pl_sd = dbi_next(iter) ) { //for all users
-           sprintf(output, msg_txt(sd,1444),pl_sd->status.char_id,pl_sd->status.name); //  %d: %s
+       for( cbe = dbi_first(iter); dbi_exists(iter); cbe = dbi_next(iter) ) { //for all users
+           sprintf(output, "%d %s",cbe->char_id,cbe->char_name); //  %d: %s
            clif_displaymessage(sd->fd, output);
        }
        dbi_destroy(iter);
        }
-       break;
+       return 0;
    }
    clif_displaymessage(sd->fd, output);
 
Index: src/map/clif.c
===================================================================
--- src/map/clif.c  (revision 17295)
+++ src/map/clif.c  (working copy)
@@ -729,7 +729,7 @@
    uint32 header=0x84b;
 #else
    uint8 buf[17];
-   uint32 header=0x09b;
+   uint32 header=0x09e;
 #endif
    int view, offset=0;
 
@@ -9159,9 +9159,7 @@
            sd->pvp_lost = 0;
        }
        clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
-   } else
-   // set flag, if it's a duel [LuzZza]
-   if(sd->duel_group)
+   } else if(sd->duel_group) // set flag, if it's a duel [LuzZza]
        clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
 
    if (map[sd->bl.m].flag.gvg_dungeon)
Viewed 1259 times, submitted by lighta.