本文整理汇总了C++中RFIFOB函数的典型用法代码示例。如果您正苦于以下问题:C++ RFIFOB函数的具体用法?C++ RFIFOB怎么用?C++ RFIFOB使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RFIFOB函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: chrif_disconnectplayer
//Disconnect the player out of the game, simple packet
//packet.w AID.L WHY.B 2+4+1 = 7byte
int chrif_disconnectplayer(int fd) {
struct map_session_data* sd;
int account_id = RFIFOL(fd, 2);
sd = map_id2sd(account_id);
if( sd == NULL ) {
struct auth_node* auth = chrif_search(account_id);
if( auth != NULL && chrif_auth_delete(account_id, auth->char_id, ST_LOGIN) )
return 0;
return -1;
}
if (!sd->fd) { //No connection
if (sd->state.autotrade)
map_quit(sd); //Remove it.
//Else we don't remove it because the char should have a timer to remove the player because it force-quit before,
//and we don't want them kicking their previous instance before the 10 secs penalty time passes. [Skotlex]
return 0;
}
switch(RFIFOB(fd, 6)) {
case 1: clif_authfail_fd(sd->fd, 1); break; //server closed
case 2: clif_authfail_fd(sd->fd, 2); break; //someone else logged in
case 3: clif_authfail_fd(sd->fd, 4); break; //server overpopulated
case 4: clif_authfail_fd(sd->fd, 10); break; //out of available time paid for
case 5: clif_authfail_fd(sd->fd, 15); break; //forced to dc by gm
}
return 0;
}
示例2: chrif_accountban
/*==========================================
* Disconnection of a player (account has been banned of has a status, from login-server) by [Yor]
*------------------------------------------*/
int chrif_accountban(int fd)
{
int acc;
struct map_session_data *sd;
acc = RFIFOL(fd,2);
if (battle_config.etc_log)
ShowNotice("chrif_accountban %d.\n", acc);
sd = map_id2sd(acc);
if (acc < 0 || sd == NULL) {
ShowError("chrif_accountban failed - player not online.\n");
return 0;
}
sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters
if (RFIFOB(fd,6) == 0) // 0: change of statut, 1: ban
{
switch (RFIFOL(fd,7)) { // status or final date of a banishment
case 1: clif_displaymessage(sd->fd, "Your account has 'Unregistered'."); break;
case 2: clif_displaymessage(sd->fd, "Your account has an 'Incorrect Password'..."); break;
case 3: clif_displaymessage(sd->fd, "Your account has expired."); break;
case 4: clif_displaymessage(sd->fd, "Your account has been rejected from server."); break;
case 5: clif_displaymessage(sd->fd, "Your account has been blocked by the GM Team."); break;
case 6: clif_displaymessage(sd->fd, "Your Game's EXE file is not the latest version."); break;
case 7: clif_displaymessage(sd->fd, "Your account has been prohibited to log in."); break;
case 8: clif_displaymessage(sd->fd, "Server is jammed due to over populated."); break;
case 9: clif_displaymessage(sd->fd, "Your account has not more authorised."); break;
case 100: clif_displaymessage(sd->fd, "Your account has been totally erased."); break;
default: clif_displaymessage(sd->fd, "Your account has not more authorised."); break;
}
}
else if (RFIFOB(fd,6) == 1) // 0: change of statut, 1: ban
{
time_t timestamp;
char tmpstr[2048];
timestamp = (time_t)RFIFOL(fd,7); // status or final date of a banishment
strcpy(tmpstr, "Your account has been banished until ");
strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", localtime(×tamp));
clif_displaymessage(sd->fd, tmpstr);
}
set_eof(sd->fd); // forced to disconnect for the change
map_quit(sd); // Remove leftovers (e.g. autotrading) [Paradox924X]
return 0;
}
示例3: intif_parse_SaveStorage
// 倉庫データ送信成功
static
void intif_parse_SaveStorage(int fd)
{
if (battle_config.save_log)
PRINTF("intif_savestorage: done %d %d\n", RFIFOL(fd, 2),
RFIFOB(fd, 6));
storage_storage_saved(RFIFOL(fd, 2));
}
示例4: chrif_updatefamelist_ack
/// fame ranking update confirmation
/// R 2b22 <table>.B <index>.B <value>.L
int chrif_updatefamelist_ack(int fd)
{
struct fame_list* list;
uint8 index;
switch (RFIFOB(fd,2))
{
case 1: list = smith_fame_list; break;
case 2: list = chemist_fame_list; break;
case 3: list = taekwon_fame_list; break;
default: return 0;
}
index = RFIFOB(fd, 3);
if (index >= MAX_FAME_LIST)
return 0;
list[index].fame = RFIFOL(fd,4);
return 1;
}
示例5: intif_parse_GuildAlliance
// ギルド同盟/敵対通知
static
int intif_parse_GuildAlliance (int fd)
{
guild_allianceack (RFIFOL (fd, 2), RFIFOL (fd, 6), RFIFOL (fd, 10),
RFIFOL (fd, 14), RFIFOB (fd, 18), (const char *)RFIFOP (fd, 19),
(const char *)RFIFOP (fd, 43));
return 0;
}
示例6: chrif_accountban
/*==========================================
* Disconnection of a player (account has been banned of has a status, from login-server) by [Yor]
*------------------------------------------*/
int chrif_accountban(int fd)
{
int acc;
struct map_session_data *sd;
acc = RFIFOL(fd,2);
if (battle_config.etc_log)
ShowNotice("chrif_accountban %d.\n", acc);
sd = map_id2sd(acc);
if (acc < 0 || sd == NULL) {
ShowError("chrif_accountban falhou - personagem nao encontrado.\n");
return 0;
}
sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters
if (RFIFOB(fd,6) == 0) // 0: change of statut, 1: ban
{
switch (RFIFOL(fd,7)) { // status or final date of a banishment
case 1: clif_displaymessage(sd->fd, "Sua conta encontra-se 'N�o Registrada'."); break;
case 2: clif_displaymessage(sd->fd, "Sua conta encontra-se com a 'Senha Incorreta'..."); break;
case 3: clif_displaymessage(sd->fd, "Sua conta foi expirada."); break;
case 4: clif_displaymessage(sd->fd, "Sua conta foi rejeitada pelo servidor."); break;
case 5: clif_displaymessage(sd->fd, "Sua conta foi bloqueada pela Equipe de GMs."); break;
case 6: clif_displaymessage(sd->fd, "Seu execut�vel do jogo n�o encontra-se na �ltima vers�o."); break;
case 7: clif_displaymessage(sd->fd, "Sua conta est� proibida de se conectar."); break;
case 8: clif_displaymessage(sd->fd, "Servidor encontra-se lotado devido ao excesso de usu�rios."); break;
case 9: clif_displaymessage(sd->fd, "Sua conta n�o est� mais autorizada ao acesso."); break;
case 100: clif_displaymessage(sd->fd, "Sua conta foi totalmente apagada."); break;
default: clif_displaymessage(sd->fd, "Sua conta n�o est� mais autorizada ao acesso."); break;
}
}
else if (RFIFOB(fd,6) == 1) // 0: change of statut, 1: ban
{
time_t timestamp;
char tmpstr[2048];
timestamp = (time_t)RFIFOL(fd,7); // status or final date of a banishment
strcpy(tmpstr, "Sua conta foi banida at� ");
strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", localtime(×tamp));
clif_displaymessage(sd->fd, tmpstr);
}
set_eof(sd->fd); // forced to disconnect for the change
map_quit(sd); // Remove leftovers (e.g. autotrading) [Paradox924X]
return 0;
}
示例7: chrif_accountban
/*==========================================
* Disconnection of a player (account has been banned of has a status, from login-server) by [Yor]
*------------------------------------------*/
int chrif_accountban(int fd)
{
int acc;
struct map_session_data *sd;
acc = RFIFOL(fd,2);
if (battle_config.etc_log)
ShowNotice("chrif_accountban %d.\n", acc);
sd = map_id2sd(acc);
if (acc < 0 || sd == NULL) {
ShowError("chrif_accountban failed - player not online.\n");
return 0;
}
sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters
if (RFIFOB(fd,6) == 0) // 0: change of statut, 1: ban
{
switch (RFIFOL(fd,7)) { // status or final date of a banishment
case 1: clif_displaymessage(sd->fd, "Your account has 'Unregistered'."); break;
case 2: clif_displaymessage(sd->fd, "Senha incorreta..."); break;
case 3: clif_displaymessage(sd->fd, "Sua conta expirou."); break;
case 4: clif_displaymessage(sd->fd, "Sua conta foi rejeitada pelo map-server."); break;
case 5: clif_displaymessage(sd->fd, "Sua conta foi bloqueada pela staff do server."); break;
case 6: clif_displaymessage(sd->fd, "Seu EXE do jogo nуo estс na њltima versуo."); break;
case 7: clif_displaymessage(sd->fd, "Sua conta foi proibida de fazer login."); break;
case 8: clif_displaymessage(sd->fd, "Servidor estс lotado."); break;
case 9: clif_displaymessage(sd->fd, "Your account has not more authorised."); break;
case 100: clif_displaymessage(sd->fd, "Sua conta foi totalmente apagada."); break;
default: clif_displaymessage(sd->fd, "Your account has not more authorised."); break;
}
}
else if (RFIFOB(fd,6) == 1) // 0: change of statut, 1: ban
{
time_t timestamp;
char tmpstr[2048];
timestamp = (time_t)RFIFOL(fd,7); // status or final date of a banishment
strcpy(tmpstr, "Sua conta foi banida atщ ");
strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", localtime(×tamp));
clif_displaymessage(sd->fd, tmpstr);
}
set_eof(sd->fd); // forced to disconnect for the change
map_quit(sd); // Remove leftovers (e.g. autotrading) [Paradox924X]
return 0;
}
示例8: chlogif_parse_vipack
/*
* AH 0x2743
* We received the info from login-serv, transmit it to map
*/
int chlogif_parse_vipack(int fd) {
#ifdef VIP_ENABLE
if (RFIFOREST(fd) < 20)
return 0;
else {
uint32 aid = RFIFOL(fd,2); //aid
uint32 vip_time = RFIFOL(fd,6); //vip_time
uint8 isvip = RFIFOB(fd,10); //isvip
uint32 groupid = RFIFOL(fd,11); //new group id
uint8 isgm = RFIFOB(fd,15); //isgm
int mapfd = RFIFOL(fd,16); //link to mapserv for ack
RFIFOSKIP(fd,20);
chmapif_vipack(mapfd,aid,vip_time,isvip,isgm,groupid);
}
#endif
return 1;
}
示例9: mapif_parse_rodex_requestinbox
void mapif_parse_rodex_requestinbox(int fd)
{
int count;
int char_id = RFIFOL(fd,2);
int account_id = RFIFOL(fd, 6);
int8 flag = RFIFOB(fd, 10);
int8 opentype = RFIFOB(fd, 11);
int64 mail_id = RFIFOQ(fd, 12);
struct rodex_maillist mails = { 0 };
VECTOR_INIT(mails);
if (flag == 0)
count = inter_rodex->fromsql(char_id, account_id, opentype, 0, &mails);
else
count = inter_rodex->fromsql(char_id, account_id, opentype, mail_id, &mails);
mapif->rodex_sendinbox(fd, char_id, opentype, flag, count, mail_id, &mails);
VECTOR_CLEAR(mails);
}
示例10: inter_party_parse_frommap
// Communication from the map server
//-Analysis that only one packet
// Data packet length is set to inter.c that you
// Do NOT go and check the packet length, RFIFOSKIP is done by the caller
// Return :
// 0 : error
// 1 : ok
int inter_party_parse_frommap(int fd)
{
RFIFOHEAD(fd);
switch(RFIFOW(fd,0)) {
case 0x3020: mapif->parse_CreateParty(fd, (char*)RFIFOP(fd,4), RFIFOB(fd,28), RFIFOB(fd,29), (struct party_member*)RFIFOP(fd,30)); break;
case 0x3021: mapif->parse_PartyInfo(fd, RFIFOL(fd,2), RFIFOL(fd,6)); break;
case 0x3022: mapif->parse_PartyAddMember(fd, RFIFOL(fd,4), (struct party_member*)RFIFOP(fd,8)); break;
case 0x3023: mapif->parse_PartyChangeOption(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOW(fd,10), RFIFOW(fd,12)); break;
case 0x3024: mapif->parse_PartyLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break;
case 0x3025: mapif->parse_PartyChangeMap(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOW(fd,14), RFIFOB(fd,16), RFIFOW(fd,17)); break;
case 0x3026: mapif->parse_BreakParty(fd, RFIFOL(fd,2)); break;
case 0x3027: mapif->parse_PartyMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), (char*)RFIFOP(fd,12), RFIFOW(fd,2)-12); break;
case 0x3029: mapif->parse_PartyLeaderChange(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break;
default:
return 0;
}
return 1;
}
示例11: intif_parse_PartyCreated
// パーティ作成可否
static
int intif_parse_PartyCreated (int fd)
{
if (battle_config.etc_log)
printf ("intif: party created\n");
party_created (RFIFOL (fd, 2), RFIFOB (fd, 6), RFIFOL (fd, 7),
(const char *)RFIFOP (fd, 11));
return 0;
}
示例12: intif_parse_SaveStorage
// 倉庫データ送信成功
static
int intif_parse_SaveStorage (int fd)
{
if (battle_config.save_log)
printf ("intif_savestorage: done %d %d\n", RFIFOL (fd, 2),
RFIFOB (fd, 6));
storage_storage_saved (RFIFOL (fd, 2));
return 0;
}
示例13: intif_parse_PartyMove
// パーティ移動通知
static
int intif_parse_PartyMove (int fd)
{
// if(battle_config.etc_log)
// printf("intif: party move %d %d %s %d %d\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOP(fd,10),RFIFOB(fd,26),RFIFOW(fd,27));
party_recv_movemap (RFIFOL (fd, 2), RFIFOL (fd, 6), (const char *)RFIFOP (fd, 10),
RFIFOB (fd, 26), RFIFOW (fd, 27));
return 0;
}
示例14: intif_parse_GuildMemberInfoShort
// ギルドメンバオンライン状態/Lv変更通知
static
int intif_parse_GuildMemberInfoShort (int fd)
{
guild_recv_memberinfoshort (RFIFOL (fd, 2), RFIFOL (fd, 6),
RFIFOL (fd, 10), RFIFOB (fd, 14), RFIFOW (fd,
15),
RFIFOW (fd, 17));
return 0;
}
示例15: mapif_parse_mail_requestinbox
/*==========================================
* Client Inbox Request
*------------------------------------------*/
void mapif_parse_mail_requestinbox(int fd)
{
int char_id = RFIFOL(fd,2);
unsigned char flag = RFIFOB(fd,6);
struct mail_data md;
memset(&md, 0, sizeof(md));
inter_mail->fromsql(char_id, &md);
mapif->mail_sendinbox(fd, char_id, flag, &md);
}