viewing paste Unknown #5806 | C (LoadRunner)

Posted on the
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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432
/// Use for ?
/// 0905 <packet len>.W (ZC_STORE_ITEMLIST_EQUIP)
/// 0976 <packet len>.W <store name>.24B (ZC_STORE_ITEMLIST_EQUIP_V2)
/// 0996 <packet len>.W <store name>.24B (ZC_STORE_ITEMLIST_EQUIP_V5)
void clif_storeitemlistequip (struct map_session_data* sd){
    // start use of this packet : 20111122
    int header,fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
#if PACKETVER < 20120221
    header=0x905;
#elif PACKETVER < 20120925
    header=0x976;
#else
    header=0x996;
#endif
 
    WFIFOHEAD(fd,packet_len(header));
    WFIFOW(fd,0)=header;
    WFIFOW(fd,2)=packet_len(header);
#if PACKETVER >= 20120221
    safestrncpy((char*)WFIFOP(fd,4), sd->status.name, NAME_LENGHT); //[0x18](24) StoreName
#endif
    WFIFOSET(fd,packet_len(header));
 
}
 
/// Use for ?
/// 0904 <packet len>.W (ZC_STORE_ITEMLIST_NORMAL)
/// 0975 <packet len>.W <store name>.24B (ZC_STORE_ITEMLIST_NORMAL_V2)
/// 0995 <packet len>.W <store name>.24B (ZC_STORE_ITEMLIST_NORMAL_V5)
void clif_storeitemlistnormal (struct map_session_data* sd){
    // start use of this packet : 20111122
    int header,fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
#if PACKETVER < 20120221
    header=0x904;
#elif PACKETVER < 20120925
    header=0x975;
#else
    header=0x995;
#endif
 
    WFIFOHEAD(fd,packet_len(header));
    WFIFOW(fd,0)=header;
    WFIFOW(fd,2)=packet_len(header);
#if PACKETVER >= 20120221
    safestrncpy((char*)WFIFOP(fd,4), sd->status.name, NAME_LENGHT); //[0x18](24) StoreName
#endif
    WFIFOSET(fd,packet_len(header));
 
}
 
/// Use for ?
/// 0903 <packet len>.W (ZC_CART_ITEMLIST_EQUIP)
/// 0994 <packet len>.W (ZC_CART_ITEMLIST_EQUIP_V5)
void clif_cartitemlistequip (struct map_session_data* sd){
    // start use of this packet : 20111122
    int header,fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
#if PACKETVER < 20120925
    header=0x903;
#else
    header=0x996;
#endif
 
    WFIFOHEAD(fd,packet_len(header));
    WFIFOW(fd,0)=header;
    WFIFOW(fd,2)=packet_len(header);
    WFIFOSET(fd,packet_len(header));
 
}
 
/// Use for ?
/// 0902 <packet len>.W (ZC_CART_ITEMLIST_NORMAL)
/// 0993 <packet len>.W (ZC_CART_ITEMLIST_NORMAL_V5)
void clif_cartitemlistnormal (struct map_session_data* sd){
    // start use of this packet : 20111122
    int header,fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
#if PACKETVER < 20120925
    header=0x902;
#else
    header=0x993;
#endif
 
    WFIFOHEAD(fd,packet_len(header));
    WFIFOW(fd,0)=header;
    WFIFOW(fd,2)=packet_len(header);
    WFIFOSET(fd,packet_len(header));
 
}
 
/// Use for ?
/// 0901 <packet len>.W (ZC_INVENTORY_ITEMLIST_EQUIP)
/// 0992 <packet len>.W (ZC_INVENTORY_ITEMLIST_EQUIP_V5)
void clif_inventoryitemlistequip (struct map_session_data* sd){
    // start use of this packet : 20111122
    int header,fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
#if PACKETVER < 20120925
    header=0x901;
#else
    header=0x992;
#endif
 
    WFIFOHEAD(fd,packet_len(header));
    WFIFOW(fd,0)=header;
    WFIFOW(fd,2)=packet_len(header);
    WFIFOSET(fd,packet_len(header));
 
}
 
/// Use for ?
/// 0900 <packet len>.W (ZC_INVENTORY_ITEMLIST_NORMAL)
/// 0991 <packet len>.W (ZC_INVENTORY_ITEMLIST_NORMAL_V5)
void clif_inventoryitemlistnormal (struct map_session_data* sd){
    // start use of this packet : 20111122
    int header,fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
#if PACKETVER < 20120925
    header=0x900;
#else
    header=0x991;
#endif
 
    WFIFOHEAD(fd,packet_len(header));
    WFIFOW(fd,0)=header;
    WFIFOW(fd,2)=packet_len(header);
    WFIFOSET(fd,packet_len(header));
 
}
 
/// Clan chat notify (ZC_NOTIFY_CLAN_CHAT)
/// 098e <packet len>.W <char name>.24B
void clif_notifyclanchat(struct map_session_data* sd)
{
    int fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
    WFIFOHEAD(fd,packet_len(0x98e));
    
    WFIFOW(fd,0)=0x98e;
    WFIFOW(fd,2)=packet_len(0x98e);
    safestrncpy((char*)WFIFOP(fd,4), sd->status.name, NAME_LENGHT); //[0x18](24) StoreName
    
    WFIFOSET(fd,packet_len(0x98e));
}
 
/// Clan chat message (CZ_CLAN_CHAT)
/// 098d <packet len>.W
void clif_notifyclanchat()
{
//CZ ?
}
 
/// Clan info (CZ_CLANINFO)
/// 098a <packet len>.W <emblem num>.L <clan name>.24B <master name>.24B <manage map>.16B <num allyclan>.B <num hostileclan>.B
void clif_claninfo(struct map_session_data* sd)
{
    int fd;
    struct clan *c; // Struct must be create
 
    nullpo_retv(sd);
    fd = sd->fd;
    
    if( (c = sd->clan) == NULL )
        return;
    
    WFIFOHEAD(fd,packet_len(0x98a));
    
    WFIFOW(fd,0)=0x98a;
    WFIFOW(fd,2)=packet_len(0x98a);
    WFIFOL(fd,4)=c->emblem_id; // EmblemNum
    memcpy(WFIFOP(fd,8),c->name, NAME_LENGTH); // Clan name
    memcpy(WFIFOP(fd,32),c->master, NAME_LENGTH); // Master name
    // Manage map (???) (fd,56)
    // Num ally clan (Id of ally clan) (fd,72)
    // Num hostile clan (Id of hostile clan) (fd,72)
    
    WFIFOSET(fd,packet_len(0x98a));
}
 
/// Clan leave (ZC_ACK_CLAN_LEAVE)
/// 0989 ->  Call a fonction to leave the clan ?
void clif_clanleave(struct map_session_data* sd)
{
    int fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
    WFIFOHEAD(fd,packet_len(0x989));
    WFIFOW(fd,0)=0x989;
    WFIFOSET(fd,packet_len(0x989));
}
 
/// Clan connect info (ZC_NOTIFY_CLAN_CONNECTINFO)
/// 0988 <num connect>.W <num total>.W
void clif_clanconnectinfo(struct map_session_data* sd)
{
    int fd;
    struct clan *c; // TODO
    
    nullpo_retv(sd);
    fd = sd->fd;
    
    if( (c = sd->clan) == NULL )
        return;
    
    WFIFOHEAD(fd,packet_len(0x989));
    WFIFOW(fd,0)=0x988;
    WFIFOW(fd,2)=c->connect_member; //short NumConnect
    WFIFOW(fd,4)=c->max_member; //short NumTotal
    WFIFOSET(fd,packet_len(0x989));
}
 
/// Fatigue change (Total play time -> penality ?) (ZC_FATIGUE_CHN)
/// 0982 <char level>.B <total play time>.L
void clif_fatiguechn(struct map_session_data* sd)
{
    int fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
    WFIFOHEAD(fd,packet_len(0x982));
    WFIFOW(fd,0)=0x982;
    WFIFOB(fd,2)= //char Level
    WFIFOL(fd,3)= //long TotalPlayTime
    WFIFOSET(fd,packet_len(0x982));
}
 
/// Personal information request
/// 0x8cb <packet len>.W <exp>.W <death>.W <drop>.W (ZC_PERSONAL_INFOMATION)
/// 0x97b <packet len>.W <exp>.L <death>.L <drop>.L (ZC_PERSONAL_INFOMATION2)
void clif_personalinformation(struct map_session_data* sd)
{
    int fd,header;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
#if PACKETVER < 20130320 //date ??
    header = 0x8cb;
#else
    header=0x97b;
#endif
    
    WFIFOHEAD(fd,packet_len(header));
    WFIFOW(fd,0)=header;
    WFIFOW(fd,2)=packet_len(header);
#if PACKETVER < 20130320
    WFIFOW(fd,4)= //exp rate
    WFIFOW(fd,6)= //death exp lost
    WFIFOW(fd,8)= //drop rate
#else
    WFIFOL(fd,4)= //exp rate
    WFIFOL(fd,8)= //death exp lost
    WFIFOL(fd,12)= //drop rate
#endif  
    WFIFOSET(fd,packet_len(header));
}
 
/// Personal information change (Total play time -> penality ?)
/// 0981 <packet len>.W <exp>.W <death>.W <drop>.W <activity rate>.W (ZC_PERSONAL_INFOMATION_CHN)
void clif_personalinformationchn(struct map_session_data* sd)
{
    int fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
    WFIFOHEAD(fd,packet_len(0x981));
    WFIFOW(fd,0)=0x981;
    WFIFOW(fd,2)=packet_len(0x981);
    WFIFOW(fd,4)= //exp rate
    WFIFOW(fd,6)= //death exp lost
    WFIFOW(fd,8)= //drop rate
    WFIFOW(fd,10)= //activity rate
    WFIFOSET(fd,packet_len(0x981));
}
 
/// Select cart (ZC_SELECTCART)
/// 097f <packet len>.W <identity>.W
void clif_zc_selectcart(struct map_session_data* sd)
{
    int fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
    WFIFOHEAD(fd,packet_len(0x97f));
    WFIFOW(fd,0)=0x97f;
    WFIFOW(fd,2)=packet_len(0x97f);
    WFIFOW(fd,4)= //identity
    WFIFOSET(fd,packet_len(0x97f));
}
 
/// Select cart (CZ_SELECTCART)
/// 0980 <identity>.L <type>.B
void clif_cz_selectcart()
{
// CZ?
}
 
/// Update ranking point (ZC_UPDATE_RANKING_POINT)
/// 097e <ranking type>.W <point>.L <total point>.L
void clif_updaterankingpoint(struct map_session_data* sd)
{
    int fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
    WFIFOHEAD(fd,packet_len(0x97f));
    WFIFOW(fd,0)=0x97f;
    WFIFOW(fd,2)= //Ranking type
    WFIFOL(fd,4)= //Point
    WFIFOL(fd,8)=sd->status.point //TotalPoint TODO
    WFIFOSET(fd,packet_len(0x97f));
}
 
/// Ask ranking ladder (PACKET_ZC_ACK_RANKING)
/// 097d <ranking type>.W { <char name>.18B }*10 { <point>.W }*10 <my point>.W
void clif_ackranking(short rankingtype, struct map_session_data* sd)
{
    int fd,i;
    const char* name;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
    WFIFOHEAD(fd,packet_len(0x97d));
    WFIFOW(fd,0)=0x97d;
    WFIFOW(fd,2)=rankingtype; //Ranking type
    
    //Packet size limits this list to 10 elements.
    for (i = 0; i < 10 && i < MAX_FAME_LIST; i++) { //Here this define can be use for rank (10)
        if (rank_list[i].id > 0) { // TODO rank_list
            if (strcmp(rank_list[i].name, "-") == 0 &&
                (name = map_charid2nick(rank_list[i].id)) != NULL)
            {
                strncpy((char *)(WFIFOP(fd, 4 + 24 * i)), name, NAME_LENGTH);
            } else
                strncpy((char *)(WFIFOP(fd, 4 + 24 * i)), rank_list[i].name, NAME_LENGTH);
        } else
            strncpy((char *)(WFIFOP(fd, 4 + 24 * i)), "None", 5);
        WFIFOL(fd, 244 + i * 4) = rank_list[i].fame;
    }
    for(;i < 10; i++) { //In case the MAX is less than 10.
        strncpy((char *)(WFIFOP(fd, 4 + 24 * i)), "Unavailable", 12);
        WFIFOL(fd, 244 + i * 4) = 0;
    }
 
    WFIFOL(fd,284)= // myPoint
    WFIFOSET(fd,packet_len(0x97d));
}
 
/// req ranking (CZ_REQ_RANKING)
/// 097c <ranking type>.W
void clif_reqranking(struct map_session_data *sd)
{
    // TODO receive short ranking type
    clif_ackranking(rankingtype,sd);
}
 
/// req world info (CZ_REQ_BEFORE_WORLD_INFO)
/// 0978 <ranking type>.W
void clif_reqworldinfo(struct map_session_data *sd)
{
    // TODO receive short AID
    clif_ackworldinfo(aid,sd);
}
 
/// Ack world info (ZC_ACK_BEFORE_WORLD_INFO)
/// 0979 <world name>.18B <char name>.18B
void clif_ackworldinfo(struct map_session_data* sd)
{
    int fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
    WFIFOHEAD(fd,packet_len(0x979));
    WFIFOW(fd,0)=0x979;
    //AID -> world name ?
    safestrncpy((char*)WFIFOP(fd,2), /* World name */, 24);
    safestrncpy((char*)WFIFOP(fd,26), sd->status.name, NAME_LENGHT);
    WFIFOSET(fd,packet_len(0x979));
}
 
/// req cancel merge item (CZ_CANCEL_MERGE_ITEM)
/// 0974
void clif_cancelmergeitem(struct map_session_data *sd)
{
    // Call function to cancel merge item
}
 
/// Ack world info (ZC_PARTY_RECRUIT_REFUSE_VOLUNTEER_TO_PM)
/// 0971 <pm aid>.L
void clif_partyrefusetopm(struct map_session_data* sd)
{
    int fd;
    
    nullpo_retv(sd);
    fd = sd->fd;
    
    WFIFOHEAD(fd,packet_len(0x971));
    WFIFOW(fd,0)=0x971;
    //PM AID ?? Long
    WFIFOSET(fd,packet_len(0x971));
}
Viewed 1131 times, submitted by Guest.