亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? party.c

?? 最新的仙鏡傳說(shuō)服務(wù)器C語(yǔ)言源碼
?? C
字號(hào):
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "party.h"#include "db.h"#include "timer.h"#include "pc.h"#include "map.h"#include "battle.h"#include "intif.h"#include "clif.h"#include "socket.h"#define PARTY_SEND_XYHP_INVERVAL	1000	// 嵗昗傗俫俹憲怣偺娫?shī)ustatic struct dbt* party_db;int party_send_xyhp_timer(int tid,unsigned int tick,int id,int data);// 弶婜壔void do_init_party(void){	party_db=numdb_init();	add_timer_func_list(party_send_xyhp_timer,"party_send_xyhp_timer");	add_timer_interval(gettick()+PARTY_SEND_XYHP_INVERVAL,party_send_xyhp_timer,0,0,PARTY_SEND_XYHP_INVERVAL);}// 専嶕struct party *party_search(int party_id){	return numdb_search(party_db,party_id);}// 嶌惉梫媮int party_create(struct map_session_data *sd,char *name){	if(sd->status.party_id==0)		intif_create_party(sd,name);	else		clif_party_created(sd,2);	return 0;}// 嶌惉壜斲int party_created(int account_id,int fail,int party_id,char *name){	struct map_session_data *sd;	sd=map_id2sd(account_id);	if(sd==NULL)		return 0;		if(fail==0){		struct party *p;		sd->status.party_id=party_id;		if((p=numdb_search(party_db,party_id))!=NULL){			printf("party: id already exists!\n");			exit(1);		}		p=calloc(sizeof(struct party), 1);		if(p==NULL){			printf("party: out of memory!\n");			exit(1);		}		p->party_id=party_id;		memcpy(p->name,name,24);		numdb_insert(party_db,party_id,p);		clif_party_created(sd,0);	}else{		clif_party_created(sd,1);	}	return 0;}// 忣曬梫媮int party_request_info(int party_id){	return intif_request_partyinfo(party_id);}// 強(qiáng)懏僉儍儔偺妋擣int party_check_member(struct party *p){	int i;	struct map_session_data *sd;	for(i=0;i<fd_max;i++){		if(session[i] && (sd=session[i]->session_data) && sd->state.auth){			if(sd->status.party_id==p->party_id){				int j,f=1;				for(j=0;j<MAX_PARTY;j++){	// 僷乕僥傿偵僨乕僞偑偁傞偐妋擣					if(	p->member[j].account_id==sd->status.account_id){						if(	strcmp(p->member[j].name,sd->status.name)==0 )							f=0;	// 僨乕僞偑偁傞						else							p->member[j].sd=NULL;	// 摨岰暿僉儍儔偩偭偨					}				}				if(f){					sd->status.party_id=0;					if(battle_config.error_log)						printf("party: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name);				}			}		}	}	return 0;}// 忣曬強(qiáng)摼幐攕乮偦偺ID偺僉儍儔傪慡晹枹強(qiáng)懏偵偡傞乯int party_recv_noinfo(int party_id){	int i;	struct map_session_data *sd;	for(i=0;i<fd_max;i++){		if(session[i] && (sd=session[i]->session_data) && sd->state.auth){			if(sd->status.party_id==party_id)				sd->status.party_id=0;		}	}	return 0;}// 忣曬強(qiáng)摼int party_recv_info(struct party *sp){	struct party *p;	int i;		if((p=numdb_search(party_db,sp->party_id))==NULL){		p=calloc(sizeof(struct party), 1);		if(p==NULL){			printf("party: out of memory!\n");			exit(1);		}		numdb_insert(party_db,sp->party_id,p);				// 嵟弶偺儘乕僪側(cè)偺偱儐乕僓乕偺僠僃僢僋傪峴偆		party_check_member(sp);	}	memcpy(p,sp,sizeof(struct party));		for(i=0;i<MAX_PARTY;i++){	// sd偺愝掕		struct map_session_data *sd = map_id2sd(p->member[i].account_id);		p->member[i].sd=(sd!=NULL && sd->status.party_id==p->party_id)?sd:NULL;	}	clif_party_info(p,-1);	for(i=0;i<MAX_PARTY;i++){	// 愝掕忣曬偺憲怣//		struct map_session_data *sd = map_id2sd(p->member[i].account_id);		struct map_session_data *sd = p->member[i].sd;		if(sd!=NULL && sd->party_sended==0){			clif_party_option(p,sd,0x100);			sd->party_sended=1;		}	}		return 0;}// 僷乕僥傿傊偺姪桿int party_invite(struct map_session_data *sd,int account_id){	struct map_session_data *tsd= map_id2sd(account_id);	struct party *p=party_search(sd->status.party_id);	int i;		if(tsd==NULL || p==NULL)		return 0;	if( tsd->status.party_id>0 || tsd->party_invite>0 ){	// 憡庤偺強(qiáng)懏妋擣		clif_party_inviteack(sd,tsd->status.name,0);		return 0;	}	for(i=0;i<MAX_PARTY;i++){	// 摨傾僇僂儞僩妋擣		if(p->member[i].account_id==account_id){			clif_party_inviteack(sd,tsd->status.name,0);			return 0;		}	}		tsd->party_invite=sd->status.party_id;	tsd->party_invite_account=sd->status.account_id;	clif_party_invite(sd,tsd);	return 0;}// 僷乕僥傿姪桿傊偺曉摎int party_reply_invite(struct map_session_data *sd,int account_id,int flag){	struct map_session_data *tsd= map_id2sd(account_id);	if(flag==1){	// 彸戻		//inter嶪傊捛壛梫媮		intif_party_addmember( sd->party_invite, sd->status.account_id );		return 0;	}	else {		// 嫅斲		sd->party_invite=0;		sd->party_invite_account=0;		if(tsd==NULL)			return 0;		clif_party_inviteack(tsd,sd->status.name,1);	}	return 0;}// 僷乕僥傿偑捛壛偝傟偨int party_member_added(int party_id,int account_id,int flag){	struct map_session_data *sd= map_id2sd(account_id),*sd2;	if(sd==NULL && flag==0){		if(battle_config.error_log)			printf("party: member added error %d is not online\n",account_id);		intif_party_leave(party_id,account_id); // 僉儍儔懁偵搊榐偱偒側(cè)偐偭偨偨傔扙戅梫媮傪弌偡		return 0;	}	sd2=map_id2sd(sd->party_invite_account);	sd->party_invite=0;	sd->party_invite_account=0;		if(flag==1){	// 幐攕		if( sd2!=NULL )			clif_party_inviteack(sd2,sd->status.name,0);		return 0;	}			// 惉岟	sd->party_sended=0;	sd->status.party_id=party_id;		if( sd2!=NULL)		clif_party_inviteack(sd2,sd->status.name,2);	// 偄偪偍偆嫞崌妋擣	party_check_conflict(sd);	return 0;}// 僷乕僥傿彍柤梫媮int party_removemember(struct map_session_data *sd,int account_id,char *name){	struct party *p = party_search(sd->status.party_id);	int i;	if(p==NULL)		return 0;	for(i=0;i<MAX_PARTY;i++){	// 儕乕僟乕偐偳偆偐僠僃僢僋		if(p->member[i].account_id==sd->status.account_id)			if(p->member[i].leader==0)				return 0;	}	for(i=0;i<MAX_PARTY;i++){	// 強(qiáng)懏偟偰偄傞偐挷傋傞		if(p->member[i].account_id==account_id){			intif_party_leave(p->party_id,account_id);			return 0;		}	}	return 0;}// 僷乕僥傿扙戅梫媮int party_leave(struct map_session_data *sd){	struct party *p = party_search(sd->status.party_id);	int i;	if(p==NULL)		return 0;		for(i=0;i<MAX_PARTY;i++){	// 強(qiáng)懏偟偰偄傞偐		if(p->member[i].account_id==sd->status.account_id){			intif_party_leave(p->party_id,sd->status.account_id);			return 0;		}	}	return 0;}// 僷乕僥傿儊儞僶偑扙戅偟偨int party_member_leaved(int party_id,int account_id,char *name){	struct map_session_data *sd=map_id2sd(account_id);	struct party *p=party_search(party_id);	if(p!=NULL){		int i;		for(i=0;i<MAX_PARTY;i++)			if(p->member[i].account_id==account_id){				clif_party_leaved(p,sd,account_id,name,0x00);				p->member[i].account_id=0;				p->member[i].sd=NULL;			}	}	if(sd!=NULL && sd->status.party_id==party_id){		sd->status.party_id=0;		sd->party_sended=0;	}	return 0;}// 僷乕僥傿夝嶶捠抦int party_broken(int party_id){	struct party *p;	int i;	if( (p=party_search(party_id))==NULL )		return 0;		for(i=0;i<MAX_PARTY;i++){		if(p->member[i].sd!=NULL){			clif_party_leaved(p,p->member[i].sd,				p->member[i].account_id,p->member[i].name,0x10);			p->member[i].sd->status.party_id=0;			p->member[i].sd->party_sended=0;		}	}	numdb_erase(party_db,party_id);	return 0;}// 僷乕僥傿偺愝掕曄峏梫媮int party_changeoption(struct map_session_data *sd,int exp,int item){	struct party *p;	if( sd->status.party_id==0 || (p=party_search(sd->status.party_id))==NULL )		return 0;	intif_party_changeoption(sd->status.party_id,sd->status.account_id,exp,item);	return 0;}// 僷乕僥傿偺愝掕曄峏捠抦int party_optionchanged(int party_id,int account_id,int exp,int item,int flag){	struct party *p;	struct map_session_data *sd=map_id2sd(account_id);	if( (p=party_search(party_id))==NULL)		return 0;	if(!(flag&0x01)) p->exp=exp;	if(!(flag&0x10)) p->item=item;	clif_party_option(p,sd,flag);	return 0;}// 僷乕僥傿儊儞僶偺堏摦捠抦int party_recv_movemap(int party_id,int account_id,char *map,int online,int lv){	struct party *p;	int i;	if( (p=party_search(party_id))==NULL)		return 0;	for(i=0;i<MAX_PARTY;i++){		struct party_member *m=&p->member[i];		if(m->account_id==account_id){			memcpy(m->map,map,16);			m->online=online;			m->lv=lv;			break;		}	}	if(i==MAX_PARTY){		if(battle_config.error_log)			printf("party: not found member %d on %d[%s]",account_id,party_id,p->name);		return 0;	}		for(i=0;i<MAX_PARTY;i++){	// sd嵞愝掕		struct map_session_data *sd= map_id2sd(p->member[i].account_id);		p->member[i].sd=(sd!=NULL && sd->status.party_id==p->party_id)?sd:NULL;	}	party_send_xy_clear(p);	// 嵗昗嵞捠抦梫惪		clif_party_info(p,-1);	return 0;}// 僷乕僥傿儊儞僶偺堏摦int party_send_movemap(struct map_session_data *sd){	struct party *p;	if( sd->status.party_id==0 )		return 0;	intif_party_changemap(sd,1);	if( sd->party_sended!=0 )	// 傕偆僷乕僥傿僨乕僞偼憲怣嵪傒		return 0;	// 嫞崌妋擣		party_check_conflict(sd);		// 偁傞側(cè)傜僷乕僥傿忣曬憲怣	if( (p=party_search(sd->status.party_id))!=NULL ){		party_check_member(p);	// 強(qiáng)懏傪妋擣偡傞		if(sd->status.party_id==p->party_id){			clif_party_info(p,sd->fd);			clif_party_option(p,sd,0x100);			sd->party_sended=1;		}	}		return 0;}// 僷乕僥傿儊儞僶偺儘僌傾僂僩int party_send_logout(struct map_session_data *sd){	struct party *p;	if( sd->status.party_id>0 )		intif_party_changemap(sd,0);		// sd偑柍岠偵側(cè)傞偺偱僷乕僥傿忣曬偐傜嶍彍	if( (p=party_search(sd->status.party_id))!=NULL ){		int i;		for(i=0;i<MAX_PARTY;i++)			if(p->member[i].sd==sd)				p->member[i].sd=NULL;	}		return 0;}// 僷乕僥傿儊僢僙乕僕憲怣int party_send_message(struct map_session_data *sd,char *mes,int len){	if(sd->status.party_id==0)		return 0;	intif_party_message(sd->status.party_id,sd->status.account_id,mes,len);	return 0;}// 僷乕僥傿儊僢僙乕僕庴怣int party_recv_message(int party_id,int account_id,char *mes,int len){	struct party *p;	if( (p=party_search(party_id))==NULL)		return 0;	clif_party_message(p,account_id,mes,len);	return 0;}// 僷乕僥傿嫞崌妋擣int party_check_conflict(struct map_session_data *sd){	intif_party_checkconflict(sd->status.party_id,sd->status.account_id,sd->status.name);	return 0;}// 埵抲傗俫俹捠抦梡int party_send_xyhp_timer_sub(void *key,void *data,va_list ap){	struct party *p=(struct party *)data;	int i;	for(i=0;i<MAX_PARTY;i++){		struct map_session_data *sd;		if((sd=p->member[i].sd)!=NULL){			// 嵗昗捠抦			if(sd->party_x!=sd->bl.x || sd->party_y!=sd->bl.y){				clif_party_xy(p,sd);				sd->party_x=sd->bl.x;				sd->party_y=sd->bl.y;			}			// 俫俹捠抦			if(sd->party_hp!=sd->status.hp){				clif_party_hp(p,sd);				sd->party_hp=sd->status.hp;			}					}	}	return 0;}// 埵抲傗俫俹捠抦int party_send_xyhp_timer(int tid,unsigned int tick,int id,int data){	numdb_foreach(party_db,party_send_xyhp_timer_sub,tick);	return 0;}// 埵抲捠抦僋儕傾int party_send_xy_clear(struct party *p){	int i;	for(i=0;i<MAX_PARTY;i++){		struct map_session_data *sd;		if((sd=p->member[i].sd)!=NULL){			sd->party_x=-1;			sd->party_y=-1;			sd->party_hp=-1;		}	}	return 0;}// HP捠抦偺昁梫惈専嵏梡乮map_foreachinmovearea偐傜屇偽傟傞乯int party_send_hp_check(struct block_list *bl,va_list ap){	int party_id;	int *flag;	struct map_session_data *sd=(struct map_session_data *)bl;	party_id=va_arg(ap,int);	flag=va_arg(ap,int *);		if(sd->status.party_id==party_id){		*flag=1;		sd->party_hp=-1;	}	return 0;}// 宱尡抣岞暯暘攝int party_exp_share(struct party *p,int map,int base_exp,int job_exp){	struct map_session_data *sd;	int i,c;	for(i=c=0;i<MAX_PARTY;i++)		if((sd=p->member[i].sd)!=NULL && sd->bl.m==map)			c++;	if(c==0)		return 0;	for(i=0;i<MAX_PARTY;i++)		if((sd=p->member[i].sd)!=NULL && sd->bl.m==map)			pc_gainexp(sd,base_exp/c+1,job_exp/c+1);	return 0;}// 摨偠儅僢僾偺僷乕僥傿儊儞僶乕慡懱偵張棟傪偐偗傞// type==0 摨偠儅僢僾//     !=0 夋柺撪void party_foreachsamemap(int (*func)(struct block_list*,va_list),	struct map_session_data *sd,int type,...){	struct party *p=party_search(sd->status.party_id);	va_list ap;	int i;	int x0,y0,x1,y1;	struct block_list *list[MAX_PARTY];	int blockcount=0;			if(p==NULL)		return;	x0=sd->bl.x-AREA_SIZE;	y0=sd->bl.y-AREA_SIZE;	x1=sd->bl.x+AREA_SIZE;	y1=sd->bl.y+AREA_SIZE;	va_start(ap,type);		for(i=0;i<MAX_PARTY;i++){		struct party_member *m=&p->member[i];		if(m->sd!=NULL){			if(sd->bl.m!=m->sd->bl.m)				continue;			if(type!=0 &&				(m->sd->bl.x<x0 || m->sd->bl.y<y0 ||				 m->sd->bl.x>x1 || m->sd->bl.y>y1 ) )				continue;			list[blockcount++]=&m->sd->bl; 		}	}	map_freeblock_lock();	// 儊儌儕偐傜偺夝曻傪嬛巭偡傞		for(i=0;i<blockcount;i++)		if(list[i]->prev)	// 桳岠偐偳偆偐僠僃僢僋			func(list[i],ap);	map_freeblock_unlock();	// 夝曻傪嫋壜偡傞	va_end(ap);}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av亚洲一区中文字幕| 精品亚洲国内自在自线福利| 日韩免费一区二区| 一本大道综合伊人精品热热| 久久99国产精品久久99| 亚洲与欧洲av电影| 欧美激情一区二区三区不卡 | 色妞www精品视频| 精品综合免费视频观看| 一区二区高清视频在线观看| 2021久久国产精品不只是精品| 欧美唯美清纯偷拍| 99久久精品一区二区| 狠狠色2019综合网| 日本女优在线视频一区二区| 一区二区三区四区在线免费观看| 久久影音资源网| 日韩欧美国产小视频| 欧美电影一区二区| 在线精品亚洲一区二区不卡| 粗大黑人巨茎大战欧美成人| 精品一区二区综合| 经典三级一区二区| 免费的国产精品| 午夜精品福利一区二区三区蜜桃| 亚洲欧美另类在线| 最新国产成人在线观看| 国产精品久久久久久亚洲伦| 久久精品视频一区| 国产情人综合久久777777| 精品99999| 久久综合av免费| 久久午夜免费电影| 久久久久久久久久久久电影| 日韩欧美在线影院| 日韩精品一区二区三区在线| 欧美一级在线免费| 精品国产3级a| 2023国产精华国产精品| 久久精品免费在线观看| 国产亚洲精品超碰| 中文字幕一区二区三区av| 中文字幕制服丝袜一区二区三区| 国产精品伦理在线| 亚洲男人电影天堂| 一区二区三区蜜桃网| 一区二区在线看| 一区二区三区在线观看国产 | 韩国一区二区视频| 国产成人久久精品77777最新版本| 国产精品一区一区| 国产91在线|亚洲| 99久久久无码国产精品| 欧美图区在线视频| 69堂精品视频| 国产亚洲成年网址在线观看| 欧美经典三级视频一区二区三区| 中文无字幕一区二区三区| 国产精品国模大尺度视频| 亚洲精品一二三四区| 亚洲成a人片在线观看中文| 美女一区二区三区| 国产夫妻精品视频| 色婷婷一区二区三区四区| 欧美日韩国产首页| 欧美va亚洲va| 国产精品久久久久三级| 亚洲第一在线综合网站| 久久精品久久精品| 99久久精品情趣| 欧美伦理电影网| 欧美精品一区二区三区在线| 中文字幕在线免费不卡| 亚洲不卡一区二区三区| 激情综合网av| 91丨porny丨中文| 777午夜精品视频在线播放| 久久久久综合网| 亚洲午夜三级在线| 国产精品1区二区.| 欧美系列一区二区| 欧美激情综合五月色丁香| 亚洲第一主播视频| 懂色av中文一区二区三区| 欧美亚洲一区三区| 国产日产欧美一区二区视频| 亚洲综合色自拍一区| 国产一区在线看| 欧美亚日韩国产aⅴ精品中极品| 欧美大胆一级视频| 一区二区三区日韩欧美精品| 久久精品国产99国产精品| 色偷偷一区二区三区| 久久亚洲精品小早川怜子| 亚洲电影中文字幕在线观看| 国产成人av一区二区三区在线 | 亚洲精品大片www| 精品一区免费av| 欧美图片一区二区三区| 欧美国产欧美亚州国产日韩mv天天看完整 | 欧美精品久久一区| 国产精品福利一区| 激情六月婷婷综合| 欧日韩精品视频| 国产亚洲成年网址在线观看| 手机精品视频在线观看| 97se狠狠狠综合亚洲狠狠| 精品人伦一区二区色婷婷| 亚洲高清三级视频| 99久久精品国产导航| 2022国产精品视频| 男男视频亚洲欧美| 欧美伊人久久久久久久久影院 | 久久精品国产亚洲高清剧情介绍| 色拍拍在线精品视频8848| 国产日韩精品一区二区三区 | 欧美日本精品一区二区三区| 亚洲男帅同性gay1069| 国产成人免费网站| 精品三级在线观看| 日韩电影在线免费| 欧美精品久久99| 一区二区日韩电影| 91浏览器在线视频| 中文字幕一区二区日韩精品绯色| 国产乱码一区二区三区| 日韩欧美国产综合| 久久激情五月婷婷| 精品国产免费一区二区三区四区| 青青草原综合久久大伊人精品 | 粉嫩欧美一区二区三区高清影视| 欧美成人三级在线| 激情综合网天天干| 久久亚洲一级片| 国产精品白丝av| 久久久久9999亚洲精品| 国产美女av一区二区三区| 精品国一区二区三区| 久久国产精品无码网站| 亚洲精品一区二区三区四区高清 | 国模娜娜一区二区三区| 精品国产91洋老外米糕| 国产精品综合av一区二区国产馆| 欧美不卡一二三| 国产乱国产乱300精品| 久久精品欧美一区二区三区不卡| 国产精品一二一区| 亚洲欧洲精品一区二区三区 | 奇米精品一区二区三区在线观看| 欧美精品日韩综合在线| 久久99精品久久久久久国产越南| 日韩精品中文字幕一区| 国产一区二区不卡在线| 国产精品视频免费看| 色哟哟一区二区| 日韩精品一区第一页| 日韩欧美国产综合一区| 粉嫩aⅴ一区二区三区四区五区 | 精品久久一二三区| 国产成人在线观看| 亚洲人妖av一区二区| 欧美日韩亚洲不卡| 久久精品国产澳门| 国产精品久久久久久久久动漫 | 国产精品99久久久久| 2024国产精品| 色综合久久天天| 午夜精品福利在线| 国产欧美日韩精品一区| 一道本成人在线| 免费成人美女在线观看.| 日本一区二区综合亚洲| 欧洲国产伦久久久久久久| 免费成人美女在线观看.| 国产三级欧美三级| 欧美性猛片aaaaaaa做受| 国内精品免费**视频| 亚洲免费视频成人| 日韩欧美久久久| 99精品国产视频| 久久精品国产精品亚洲红杏| 中文字幕亚洲一区二区av在线| 欧美性一级生活| 国产盗摄精品一区二区三区在线| 亚洲欧美日韩国产成人精品影院| 日韩欧美一级特黄在线播放| 波多野结衣欧美| 午夜不卡av免费| 国产精品久久久久久一区二区三区| 9191精品国产综合久久久久久| 国产成人在线免费| 日韩主播视频在线| 日韩理论片中文av| 久久久久综合网| 91精品久久久久久久久99蜜臂| 成人夜色视频网站在线观看| 青娱乐精品视频在线| 一区二区日韩电影| 国产精品久久久久久久久动漫| 日韩情涩欧美日韩视频|