Esempio n. 1
0
CCaughtFishPacket::CCaughtFishPacket(CCharEntity * PChar, uint16 param0, uint16 messageID) 
{
	this->type = 0x27;
	this->size = 0x38;

	//DSP_DEBUG_BREAK_IF(PChar->name.size() > 15);

	WBUFL(data,(0x04)) = PChar->id;
	WBUFL(data,(0x08)) = PChar->targid;

	WBUFW(data,(0x0A)) = messageID + 0x8000;
	WBUFW(data,(0x10)) = param0;

	WBUFL(data,(0x14)) = 0x01;
	WBUFL(data,(0x1C)) = 0xF0;

	memcpy(data+(0x20), PChar->GetName(), PChar->name.size());
}
Esempio n. 2
0
CServerIPPacket::CServerIPPacket(CCharEntity* PChar, uint8 type)
{
	this->type = 0x0B;
	this->size = 0x0E;

	WBUFB(data,(0x04)-4) = type;
	WBUFL(data,(0x08)-4) = PChar->loc.zone->GetIP();
	WBUFW(data,(0x0C)-4) = PChar->loc.zone->GetPort();
}
Esempio n. 3
0
CChocoboDiggingPacket::CChocoboDiggingPacket(CCharEntity* PChar)
{
	this->type = 0x2F;
	this->size = 0x06;

	WBUFL(data,(0x04)-4) = PChar->id;
	WBUFW(data,(0x08)-4) = PChar->targid;
	WBUFB(data,(0x0A)-4) = 0x01;
}
Esempio n. 4
0
CMessageSystemPacket::CMessageSystemPacket(uint32 param0, uint32 param1, uint16 messageID)
{
	this->type = 0x53;
	this->size = 0x08;

	WBUFL(data,(0x04)) = param0;
	WBUFL(data,(0x08)) = param1;
	WBUFW(data,(0x0C)) = messageID;
}
Esempio n. 5
0
//Sends to map server the current max Account/Char id [Skotlex]
void mapif_send_maxid(int account_id, int char_id)
{
    unsigned char buf[12];

    WBUFW(buf,0) = 0x2b07;
    WBUFL(buf,2) = account_id;
    WBUFL(buf,6) = char_id;
    mapif_sendall(buf, 10);
}
Esempio n. 6
0
// パーティ解散通知
void mapif_party_broken(int party_id, int flag)
{
    unsigned char buf[7];
    WBUFW(buf, 0) = 0x3826;
    WBUFL(buf, 2) = party_id;
    WBUFB(buf, 6) = flag;
    mapif_sendall(buf, 7);
    PRINTF("int_party: broken %d\n", party_id);
}
Esempio n. 7
0
static void mapif_Auction_message(int char_id, unsigned char result)
{
	unsigned char buf[74];
	
	WBUFW(buf,0) = 0x3854;
	WBUFL(buf,2) = char_id;
	WBUFL(buf,6) = result;
	mapif_sendall(buf,7);
}
Esempio n. 8
0
// Wis sending result
int mapif_wis_end (struct WisData *wd, int flag)
{
	unsigned char buf[27];
	WBUFW (buf, 0) = 0x3802;
	memcpy (WBUFP (buf, 2), wd->src, 24);
	WBUFB (buf, 26) = flag;
	mapif_send (wd->fd, buf, 27);
	return 0;
}
Esempio n. 9
0
CWideScanPacket::CWideScanPacket(CCharEntity * PChar, CBaseEntity * PEntity) 
{
	this->type = 0xF4;
	this->size = 0x0E;

	WBUFW(data,(0x04)-4) = PEntity->targid;
  //WBUFB(data,(0x06)-4) = PEntity->GetMLevel();

	// 0 - черная точка (? Char ?) 
	// 1 - зеленая точка (NPC)
	// 2 - красная точка (Mob)
	WBUFB(data,(0x07)-4) = PEntity->objtype/2; 

	WBUFW(data,(0x08)-4) = (int16)(PEntity->loc.p.x - PChar->loc.p.x); // x - разница координат персонажа и объекта
	WBUFW(data,(0x0A)-4) = (int16)(PEntity->loc.p.z - PChar->loc.p.z); // z - разница координат персонажа и объекта

  //memcpy(data+(0x0C)-4, PEntity->GetName(), (PEntity->name.size() > 14 ? 14 : PEntity->name.size()));  
}
Esempio n. 10
0
/**
 * Parse received item broadcast and sends it to all connected map-serves
 * ZI 3009 <cmd>.W <len>.W <nameid>.W <source>.W <type>.B <name>.24B <srcname>.24B
 * IZ 3809 <cmd>.W <len>.W <nameid>.W <source>.W <type>.B <name>.24B <srcname>.24B
 * @param fd
 * @return
 **/
int mapif_parse_broadcast_item(int fd) {
	unsigned char buf[9 + NAME_LENGTH*2];

	memcpy(WBUFP(buf, 0), RFIFOP(fd, 0), RFIFOW(fd,2));
	WBUFW(buf, 0) = 0x3809;
	chmapif_sendallwos(fd, buf, RFIFOW(fd,2));

	return 0;
}
Esempio n. 11
0
// パーティ設定変更通知
static
void mapif_party_optionchanged(int fd, struct party *p, int account_id,
                               int flag)
{
    unsigned char buf[15];

    WBUFW(buf, 0) = 0x3823;
    WBUFL(buf, 2) = p->party_id;
    WBUFL(buf, 6) = account_id;
    WBUFW(buf, 10) = p->exp;
    WBUFW(buf, 12) = p->item;
    WBUFB(buf, 14) = flag;
    if (flag == 0)
        mapif_sendall(buf, 15);
    else
        mapif_send(fd, buf, 15);
    PRINTF("int_party: option changed %d %d %d %d %d\n", p->party_id,
            account_id, p->exp, p->item, flag);
}
Esempio n. 12
0
CRaiseTractorMenuPacket::CRaiseTractorMenuPacket(CCharEntity * PChar, REVIVAL_TYPE type) 
{
	this->type = 0xF9;
	this->size = 0x06;

	WBUFL(data,(0x04)-4) = PChar->id;
	WBUFW(data,(0x08)-4) = PChar->targid;

	WBUFB(data,(0x0A)-4) = type;
}
Esempio n. 13
0
CAHHistoryPacket::CAHHistoryPacket(uint16 ItemID)
{
    m_count  = 0;

    memset(m_PData, 0, sizeof(m_PData));

    WBUFB(m_PData,(0x0A)) = 0x80;
    WBUFB(m_PData,(0x0B)) = 0x85;                       // packe type
    WBUFW(m_PData,(0x10)) = ItemID;
}
Esempio n. 14
0
CSpoofMessagePacket::CSpoofMessagePacket(CCharEntity* PChar, int8* name, CHAT_MESSAGE_TYPE MessageType, int8* buff)
{
    int32 buffSize = (strlen(buff) > 108) ? 108 : strlen(buff);
    this->type = 0x17;
    this->size = dsp_min((32 + (buffSize + 1) + ((4 - ((buffSize + 1) % 4)) % 4)) / 2, 128);
    WBUFB(data, (0x04) - 4) = MessageType;
    WBUFW(data, (0x06) - 4) = PChar->getZone();
    memcpy(data + (0x08) - 4, name, size);
    memcpy(data + (0x18) - 4, buff, buffSize);
}
Esempio n. 15
0
CTradeItemPacket::CTradeItemPacket(CItem* PItem, uint8 slot)
{
	this->type = 0x25;
	this->size = 0x06;
	
    WBUFL(data,(0x04)-4) = PItem->getReserve();
	WBUFW(data,(0x08)-4) = PItem->getID();
	WBUFB(data,(0x0A)-4) = slot;
	WBUFB(data,(0x0B)-4) = PItem->getSlotID();
}
Esempio n. 16
0
CMessageSystemPacket::CMessageSystemPacket(uint32 param0, uint32 param1, uint16 messageID)
{
	PROFILE_FUNC();
	this->type = 0x53;
	this->size = 0x08;

	WBUFL(data,(0x04)-4) = param0;
	WBUFL(data,(0x08)-4) = param1;
	WBUFW(data,(0x0C)-4) = messageID;
}
Esempio n. 17
0
// パ?ティ解散通知
int mapif_party_broken(int party_id, int flag) {
	unsigned char buf[7];
	WBUFW(buf,0) = 0x3826;
	WBUFL(buf,2) = party_id;
	WBUFB(buf,6) = flag;
	mapif_sendall(buf, 7);
	ShowInfo("Party broken (%d)\n", party_id);

	return 0;
}
Esempio n. 18
0
CPetSyncPacket::CPetSyncPacket(CCharEntity* PChar)
{
	this->type = 0x67;
	this->size = 0x12;

    DSP_DEBUG_BREAK_IF(PChar->PPet == NULL);

	WBUFB(data,(0x04)-4) = 0x44; 	// назначение неизвестно
	WBUFB(data,(0x05)-4) = 0x08; 	// назначение неизвестно

	WBUFW(data,(0x06)-4) = PChar->targid;
	WBUFL(data,(0x08)-4) = PChar->id;

	WBUFW(data,(0x0C)-4) = PChar->PPet->targid;
	WBUFB(data,(0x0E)-4) = PChar->PPet->GetHPP();
	WBUFW(data,(0x10)-4) = PChar->PPet->health.tp << 1;

	// 0x14 - начинается имя питомца, но мы его записывать не будем, "мы экономить будем" © Матроскин
}
Esempio n. 19
0
//Dissolution party notification
int mapif_party_broken(int party_id, int flag)
{
	unsigned char buf[16];
	WBUFW(buf,0)=0x3826;
	WBUFL(buf,2)=party_id;
	WBUFB(buf,6)=flag;
	mapif->sendall(buf,7);
	//printf("int_party: broken %d\n",party_id);
	return 0;
}
Esempio n. 20
0
// Wisp/page transmission result to map-server
static
void mapif_wis_end(struct WisData *wd, int flag)
{
    uint8_t buf[27];

    WBUFW(buf, 0) = 0x3802;
    WBUF_STRING(buf, 2, wd->src.to__actual(), 24);
    WBUFB(buf, 26) = flag;     // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
    mapif_send(wd->fd, buf, 27);
}
Esempio n. 21
0
int mapif_guild_master_changed(struct guild *g, int aid, int cid)
{
	unsigned char buf[12];
	WBUFW(buf,0)=0x3843;
	WBUFL(buf,2)=g->guild_id;
	WBUFL(buf,6)=aid;
	WBUFL(buf,10)=cid;
	mapif_sendall(buf,14);
	return 0;
}
Esempio n. 22
0
//Withdrawal notification party
int mapif_party_withdraw(int party_id,int account_id, int char_id) {
	unsigned char buf[16];

	WBUFW(buf,0) = 0x3824;
	WBUFL(buf,2) = party_id;
	WBUFL(buf,6) = account_id;
	WBUFL(buf,10) = char_id;
	mapif->sendall(buf, 14);
	return 0;
}
Esempio n. 23
0
// Received wisp message from map-server for ALL gm (just copy the message and resends it to ALL map-servers)
int mapif_parse_WisToGM(int fd)
{
	unsigned char buf[2048]; // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B

	memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2));
	WBUFW(buf, 0) = 0x3803;
	mapif_sendall(buf, RFIFOW(fd,2));

	return 0;
}
Esempio n. 24
0
int mapif_send_gmaccounts()
{
	int i, len = 4;
	unsigned char buf[32000];

	// forward the gm accounts to the map server
	len = 4;
	WBUFW(buf,0) = 0x2b15;
				
	for(i = 0; i < GM_num; i++) {
		WBUFL(buf, len) = gm_account[i].account_id;
		WBUFB(buf, len+4) = (unsigned char)gm_account[i].level;
		len += 5;
	}
	WBUFW(buf, 2) = len;
	mapif_sendall(buf, len);

	return 0;
}
Esempio n. 25
0
CEventStringPacket::CEventStringPacket(
	CCharEntity* PChar,
	uint16 EventID, 
    string_t string0,
    string_t string1,
    string_t string2,
    string_t string3,
	uint32 param0,
	uint32 param1,
	uint32 param2,
	uint32 param3,
	uint32 param4,
	uint32 param5,
	uint32 param6,
	uint32 param7)
{
	PROFILE_FUNC();
	this->type = 0x33;
	this->size = 0x38;

	WBUFL(data,(0x04)-4) = PChar->id;
	WBUFW(data,(0x08)-4) = PChar->m_TargID;
    WBUFW(data,(0x0A)-4) = (PChar->getZone() != 0 ? PChar->getZone() : PChar->loc.prevzone);
	WBUFW(data,(0x0C)-4) = EventID;
	WBUFB(data,(0x0E)-4) = 8; // если патаметров меньше, чем 8, то после завершения события камера "прыгнет" за спину персонажу

    memcpy(data+(0x10)-4, string0.c_str(), string0.size());
    memcpy(data+(0x20)-4, string1.c_str(), string1.size());
    memcpy(data+(0x30)-4, string2.c_str(), string2.size());
    memcpy(data+(0x40)-4, string3.c_str(), string3.size());

	WBUFL(data,(0x50)-4) = param0;
	WBUFL(data,(0x54)-4) = param1;
	WBUFL(data,(0x58)-4) = param2;
	WBUFL(data,(0x5C)-4) = param3;
	WBUFL(data,(0x60)-4) = param4;
	WBUFL(data,(0x64)-4) = param5;
	WBUFL(data,(0x68)-4) = param6;
	WBUFL(data,(0x6C)-4) = param7;

	PChar->m_event.EventID = EventID;
}
Esempio n. 26
0
// Received wisp message from map-server for ALL gm (just copy the message and resends it to ALL map-servers)
static
void mapif_parse_WisToGM(int fd)
{
    size_t len = RFIFOW(fd, 2);
    uint8_t buf[len];
    // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B

    RFIFO_BUF_CLONE(fd, buf, len);
    WBUFW(buf, 0) = 0x3803;
    mapif_sendall(buf, len);
}
Esempio n. 27
0
// ギルド告知変更通知
int mapif_guild_notice(struct guild *g) {
	unsigned char buf[186];

	WBUFW(buf,0) = 0x383e;
	WBUFL(buf,2) = g->guild_id;
	memcpy(WBUFP(buf,6), g->mes1, 60);
	memcpy(WBUFP(buf,66), g->mes2, 120);
	mapif_sendall(buf, 186);

	return 0;
}
Esempio n. 28
0
// ギルドスキルアップ通知
int mapif_guild_skillupack(int guild_id, int skill_num, int account_id) {
	unsigned char buf[14];

	WBUFW(buf, 0) = 0x383c;
	WBUFL(buf, 2) = guild_id;
	WBUFL(buf, 6) = skill_num;
	WBUFL(buf,10) = account_id;
	mapif_sendall(buf, 14);

	return 0;
}
Esempio n. 29
0
// 解散通知
int mapif_guild_broken(int guild_id, int flag) {
	unsigned char buf[7];

	WBUFW(buf,0) = 0x3836;
	WBUFL(buf,2) = guild_id;
	WBUFB(buf,6) = flag;
	mapif_sendall(buf, 7);
	ShowInfo("Guild Break (%d)\n", guild_id);

	return 0;
}
Esempio n. 30
0
CInventoryAssignPacket::CInventoryAssignPacket(CItem* PItem, uint8 Flag)
{
	this->type = 0x1F;
	this->size = 0x08;

    WBUFL(data,(0x04)) = PItem->getQuantity();
	WBUFW(data,(0x08)) = PItem->getID();
    WBUFB(data,(0x0A)) = PItem->getLocationID();
    WBUFB(data,(0x0B)) = PItem->getSlotID();
	WBUFB(data,(0x0C)) = Flag;
}