コード例 #1
0
ファイル: account_wrap.c プロジェクト: Danteoriginal/bnetd
extern int account_set_ladder_active_last_time(t_account * account, char const * clienttag, t_ladder_id id, t_bnettime t)
{
    char key[256];
    
    if (!clienttag || strlen(clienttag)!=4)
    {
	eventlog(eventlog_level_error,"account_set_ladder_active_last_time","got bad clienttag");
	return -1;
    }
    sprintf(key,"Record\\%s\\%d\\active last game",clienttag,(int)id);
    return account_set_strattr(account,key,bnettime_get_str(t));
}
コード例 #2
0
ファイル: account_wrap.c プロジェクト: Danteoriginal/bnetd
extern unsigned int account_get_ladder_wins(t_account * account, char const * clienttag, t_ladder_id id)
{
    char key[256];
    
    if (!clienttag || strlen(clienttag)!=4)
    {
	eventlog(eventlog_level_error,"account_get_ladder_wins","got bad clienttag");
	return 0;
    }
    sprintf(key,"Record\\%s\\%d\\wins",clienttag,(int)id);
    return account_get_numattr(account,key);
}
コード例 #3
0
ファイル: account_wrap.c プロジェクト: Danteoriginal/bnetd
extern int account_set_normal_last_result(t_account * account, char const * clienttag, char const * result)
{
    char key[256];
    
    if (!clienttag || strlen(clienttag)!=4)
    {
	eventlog(eventlog_level_error,"account_set_normal_last_result","got bad clienttag");
	return -1;
    }
    sprintf(key,"Record\\%s\\0\\last game result",clienttag);
    return account_set_strattr(account,key,result);
}
コード例 #4
0
ファイル: account_wrap.c プロジェクト: Danteoriginal/bnetd
extern int account_set_ladder_active_rank(t_account * account, char const * clienttag, t_ladder_id id, unsigned int rank)
{
    char key[256];
    
    if (!clienttag || strlen(clienttag)!=4)
    {
	eventlog(eventlog_level_error,"account_set_ladder_active_rank","got bad clienttag");
	return -1;
    }
    sprintf(key,"Record\\%s\\%d\\active rank",clienttag,(int)id);
    return account_set_numattr(account,key,rank);
}
コード例 #5
0
ファイル: conf.cpp プロジェクト: DizKragnet/pvpgn
extern void conf_unload(t_conf_entry *conftab)
{
    t_conf_entry *curr;

    if (!conftab) {
	eventlog(eventlog_level_error,__FUNCTION__,"got NULL conftab");
	return;
    }

    for(curr = conftab;curr->name;curr++)
	curr->set(NULL);
}
コード例 #6
0
ファイル: d2char_db_mysql.c プロジェクト: Danteoriginal/bnetd
extern unsigned int db_connect(MYSQL *mysql)
{
	if (mysql->server_status == 2) return 1;

	if (!db_init(mysql)) return 0;

	eventlog(eventlog_level_trace, __FUNCTION__, "connecting to MySQL");
	if (!mysql_real_connect(mysql,prefs_get_db_host(),prefs_get_db_user(),prefs_get_db_pw(),prefs_get_db_name(),prefs_get_db_port(), 0, CLIENT_COMPRESS))
	{
		eventlog(eventlog_level_error, __FUNCTION__, "could not connect to MySQL \"%d:%s\"",mysql_errno(mysql),mysql_error(mysql));
		return 0;
	}

	if(db_server_connect_done) return 1;

	db_server_connect_done = 1;
	eventlog(eventlog_level_info, __FUNCTION__, "connected to MySQL (server version %s)", mysql_get_server_info(mysql));

	/* Return with table_check status */
	return db_table_check(prefs_get_db_char_table());
}
コード例 #7
0
ファイル: account.c プロジェクト: Danteoriginal/bnetd
extern void account_destroy(t_account * account)
{
    if (!account)
    {
		eventlog(eventlog_level_error,"account_destroy","got NULL account");
		return;
    }
    account_unload_attrs(account);
    if (account->filename)
		free((void *)account->filename); /* avoid warning */
    free(account);
}
コード例 #8
0
ファイル: conf.cpp プロジェクト: DizKragnet/pvpgn
static void _process_option(const char *key, const char *val, t_conf_entry *conftab)
{
    t_conf_entry *curr;

    for(curr = conftab; curr->name; curr++)
	if (!std::strcmp(key,curr->name)) {
	    curr->set(val);
	    return;
	}

    eventlog(eventlog_level_error,__FUNCTION__,"option '%s' unknown",key);
}
コード例 #9
0
ファイル: bits_ext.c プロジェクト: Danteoriginal/bnetd-1
extern void destroy_bits_ext(t_connection *c) {
	if (!c) {
		eventlog(eventlog_level_error,"destroy_bits_ext","got NULL connection");
		return;
	}
	/* FIXME: destroy locklist */
	/* FIXME: destroy channellist */
	if (c->bits) {
		free(c->bits);
	}
	return;
}
コード例 #10
0
ファイル: attrlayer.cpp プロジェクト: AleXoundOS/pvpgn
		extern int attrlayer_load_default(void)
		{
			if (defattrs) attrlayer_unload_default();

			defattrs = attrgroup_create_storage(storage->get_defacct());
			if (!defattrs) {
				eventlog(eventlog_level_error, __FUNCTION__, "could not create attrgroup");
				return -1;
			}

			return attrgroup_load(defattrs);
		}
コード例 #11
0
ファイル: d2ladder.c プロジェクト: DizKragnet/pvpgn
static int d2ladder_create(unsigned int type, unsigned int len)
{
	if (type>max_ladder_type) {
		eventlog(eventlog_level_error,__FUNCTION__,"ladder type %d exceed max ladder type %d",type,max_ladder_type);
		return -1;
	}
	ladder_data[type].info=xmalloc(sizeof(t_d2cs_client_ladderinfo) * len);
	ladder_data[type].len=len;
	ladder_data[type].type=type;
	ladder_data[type].curr_len=0;
	return 0;
}
コード例 #12
0
ファイル: dbspacket.cpp プロジェクト: AleXoundOS/pvpgn
		static int dbs_packet_updateladder(t_d2dbs_connection * conn)
		{
			char CharName[MAX_CHARNAME_LEN];
			char RealmName[MAX_REALMNAME_LEN];
			t_d2gs_d2dbs_update_ladder	* updateladder;
			char * readpos;
			t_d2ladder_info			charladderinfo;

			readpos = conn->ReadBuf;
			updateladder = (t_d2gs_d2dbs_update_ladder *)readpos;

			readpos += sizeof(*updateladder);
			std::strncpy(CharName, readpos, MAX_CHARNAME_LEN);
			if (CharName[MAX_CHARNAME_LEN - 1] != 0)
			{
				eventlog(eventlog_level_error, __FUNCTION__, "max char name length exceeded");
				return -1;
			}
			readpos += std::strlen(CharName) + 1;
			std::strncpy(RealmName, readpos, MAX_REALMNAME_LEN);
			if (RealmName[MAX_REALMNAME_LEN - 1] != 0)
			{
				eventlog(eventlog_level_error, __FUNCTION__, "max realm name length exceeded");
				return -1;
			}
			readpos += std::strlen(RealmName) + 1;
			if (readpos != conn->ReadBuf + bn_short_get(updateladder->h.size)) {
				eventlog(eventlog_level_error, __FUNCTION__, "request packet size error");
				return -1;
			}

			std::strcpy(charladderinfo.charname, CharName);
			charladderinfo.experience = bn_int_get(updateladder->charexplow);
			charladderinfo.level = bn_int_get(updateladder->charlevel);
			charladderinfo.status = bn_short_get(updateladder->charstatus);
			charladderinfo.chclass = bn_short_get(updateladder->charclass);
			eventlog(eventlog_level_info, __FUNCTION__, "update ladder for %s@%s for gs %s(%d)", CharName, RealmName, conn->serverip, conn->serverid);
			d2ladder_update(&charladderinfo);
			return 1;
		}
コード例 #13
0
ファイル: storage.c プロジェクト: BackupTheBerlios/pvpgn
extern int storage_init(const char *spath)
{
    char *temp, *p;
    int res;
    char dstr[256];

    if (spath == NULL) {
        eventlog(eventlog_level_error, __FUNCTION__, "got NULL spath");
        return -1;
    }

    temp = xstrdup(spath);
    if ((p = strchr(spath, ':')) == NULL) {
        eventlog(eventlog_level_error, __FUNCTION__, "malformed storage_path , driver not found");
        xfree((void*)temp);
        return -1;
    }

    strcpy(dstr, "file");
#ifdef WITH_SQL
    strcat(dstr, ", sql");
    strcat(dstr, ", sql2");
#endif
    eventlog(eventlog_level_info, __FUNCTION__, "initializing storage layer (available drivers: %s)", dstr);

    *p = '\0';
    if (strcasecmp(spath, "file") == 0) {
        storage = &storage_file;
        res = storage->init(p + 1);
        if (!res)
            eventlog(eventlog_level_info, __FUNCTION__, "using file storage driver");
    }
#ifdef WITH_SQL
    else if (strcasecmp(spath, "sql") == 0) {
        storage = &storage_sql;
        res = storage->init(p + 1);
        if (!res)
            eventlog(eventlog_level_info, __FUNCTION__, "using sql storage driver");
    }
    else if (strcasecmp(spath, "sql2") == 0) {
        storage = &storage_sql2;
        res = storage->init(p + 1);
        if (!res)
            eventlog(eventlog_level_info, __FUNCTION__, "using sql2 storage driver");
    }
#endif
    else {
        eventlog(eventlog_level_fatal, __FUNCTION__, "no known driver specified (%s)", spath);
        res = -1;
    }

    xfree((void*)temp);

    return res;
}
コード例 #14
0
ファイル: realm.c プロジェクト: BackupTheBerlios/pvpgn
static t_realm * realm_create(char const * name, char const * description, unsigned int ip, unsigned int port)
{
    t_realm * realm;
    
    if (!name)
    {
	eventlog(eventlog_level_error,__FUNCTION__,"got NULL name");
	return NULL;
    }
    if (!description)
    {
	eventlog(eventlog_level_error,__FUNCTION__,"got NULL description");
	return NULL;
    }

    realm = xmalloc(sizeof(t_realm));
    realm->name = NULL;
    realm->description = NULL;

    if (realm_set_name(realm ,name)<0)
    {
        eventlog(eventlog_level_error,__FUNCTION__,"failed to set name for realm");
	xfree(realm);
	return NULL;
    }
    if (realm->description != NULL) xfree((void *)realm->description);
    realm->description = xstrdup(description);
    realm->ip = ip;
    realm->port = port;
    realm->conn = NULL;
    realm->active = 0;
    realm->player_number = 0;
    realm->game_number = 0;
    realm->sessionnum = 0;
    realm->tcp_sock = 0;
    rcm_init(&realm->rcm);

    eventlog(eventlog_level_info,__FUNCTION__,"created realm \"%s\"",name);
    return realm;
}
コード例 #15
0
ファイル: main.cpp プロジェクト: Danteoriginal/PvPGN-2
int fork_bnetd(int foreground)
{
    int		pid;
    
#ifdef DO_DAEMONIZE
    if (!foreground) {
	if (chdir("/")<0) {
	    eventlog(eventlog_level_error,__FUNCTION__,"could not change working directory to / (chdir: %s)",pstrerror(errno));
	    return -1;
	}
	
	switch ((pid = fork())) {
	    case -1:
		eventlog(eventlog_level_error,__FUNCTION__,"could not fork (fork: %s)",pstrerror(errno));
		return -1;
	    case 0: /* child */
		break;
	    default: /* parent */
		return pid;
	}
	//threadPool.size_controller().resize(1);
#ifndef WITH_D2	
	close(STDINFD);
	close(STDOUTFD);
	close(STDERRFD);
#endif
# ifdef HAVE_SETPGID
	if (setpgid(0,0)<0) {
	    eventlog(eventlog_level_error,__FUNCTION__,"could not create new process group (setpgid: %s)",pstrerror(errno));
	    return -1;
	}
# else
#  ifdef HAVE_SETPGRP
#   ifdef SETPGRP_VOID
        if (setpgrp()<0) {
            eventlog(eventlog_level_error,__FUNCTION__,"could not create new process group (setpgrp: %s)",pstrerror(errno));
            return -1;
        }
#   else
	if (setpgrp(0,0)<0) {
	    eventlog(eventlog_level_error,__FUNCTION__,"could not create new process group (setpgrp: %s)",pstrerror(errno));
	    return -1;
	}
#   endif
#  else
#   ifdef HAVE_SETSID
	if (setsid()<0) {
	    eventlog(eventlog_level_error,__FUNCTION__,"could not create new process group (setsid: %s)",pstrerror(errno));
	    return -1;
	}
#   else
#    error "One of setpgid(), setpgrp(), or setsid() is required"
#   endif
#  endif
# endif
    }
    return 0;
#endif
return 0;
}
コード例 #16
0
ファイル: mail.c プロジェクト: 91D2/pvpgn
static struct maillist_struct * mailbox_get_list(t_mailbox *mailbox) {
   char const * dentry;
   FILE * fd;
   struct maillist_struct *rez=NULL, *p=NULL,*q;
   char *sender,*filename;
   
   if (mailbox==NULL) {
      eventlog(eventlog_level_error,__FUNCTION__,"got NULL mailbox");
      return NULL;
   }
   if (mailbox->maildir==NULL) {
      eventlog(eventlog_level_error,__FUNCTION__,"got NULL maildir");
      return NULL;
   }
   filename=xmalloc(strlen(mailbox->path)+1+15+1);
   p_rewinddir(mailbox->maildir);
   for(;(dentry=p_readdir(mailbox->maildir))!=NULL;)
     if (dentry[0]!='.') {
	q=xmalloc(sizeof(struct maillist_struct));
	sprintf(filename,"%s/%s",mailbox->path,dentry);
	if ((fd=fopen(filename,"rb"))==NULL) {
	   eventlog(eventlog_level_error,__FUNCTION__,"error while opening message file");
	   xfree(filename);
	   xfree(q);
	   return rez;
	}
	sender=xmalloc(256);
	fgets(sender,256,fd);
	clean_str(sender);
	fclose(fd);
	q->sender=sender;
	q->timestamp=atoi(dentry);
	q->next=NULL;
	if (p==NULL) rez=q;
	else p->next=q;
	p=q;
     }
   xfree(filename);
   return rez;
}
コード例 #17
0
static void on_signal(int s)
{
	switch (s) {
		case SIGINT:
			eventlog(eventlog_level_debug,__FUNCTION__,"sigint received");
			signal_data.do_quit=1;
			break;
		case SIGTERM:
			eventlog(eventlog_level_debug,__FUNCTION__,"sigint received");
			signal_data.do_quit=1;
			break;
		case SIGABRT:
			eventlog(eventlog_level_debug,__FUNCTION__,"sigabrt received");
			signal_data.cancel_quit=1;
			break;
		case SIGHUP:
			eventlog(eventlog_level_debug,__FUNCTION__,"sighup received");
			signal_data.reload_config=1;
			break;
		case SIGUSR1:
			eventlog(eventlog_level_debug,__FUNCTION__,"sigusr1 received");
			signal_data.save_ladder=1;
			break;
		case SIGPIPE:
			eventlog(eventlog_level_debug,__FUNCTION__,"sigpipe received");
			break;
	}
	std::signal(s,on_signal);
}
コード例 #18
0
ファイル: handle_d2cs.c プロジェクト: Danteoriginal/bnetd
static int on_d2cs_authreply(t_connection * c, t_packet const * packet)
{
	t_packet	* rpacket;
	unsigned int	version;
	unsigned int	try_version;
	unsigned int	reply;
	char const	* realmname;
	t_realm		* realm;

	if (packet_get_size(packet)<sizeof(t_d2cs_bnetd_authreply)) {
		eventlog(eventlog_level_error,"on_d2cs_authreply","got bad packet size");
		return -1;
	}
	if (!(realmname=packet_get_str_const(packet,sizeof(t_d2cs_bnetd_authreply),REALM_NAME_LEN))) {
		eventlog(eventlog_level_error,"on_d2cs_authreply","got bad realmname");
		return -1;
	}
        if (!(realm=realmlist_find_realm_by_ip(conn_get_addr(c)))) {
                eventlog(eventlog_level_error,"handle_init_packet", "realm not found");
                return -1;
        }
	if (realm_get_name(realm) && strcasecmp(realmname,realm_get_name(realm))) {
                eventlog(eventlog_level_error,"handle_init_packet", "warn: realm name mismatch %s %s",
			realm_get_name(realm),realmname);
	}

	version=prefs_get_d2cs_version();
	try_version=bn_int_get(packet->u.d2cs_bnetd_authreply.version);
	if (version && version != try_version) {
		eventlog(eventlog_level_error,"on_d2cs_authreply","d2cs version mismatch 0x%X - 0x%X",
			try_version,version);
		reply=BNETD_D2CS_AUTHREPLY_BAD_VERSION;
	} else {
		reply=BNETD_D2CS_AUTHREPLY_SUCCEED;
	}

	if (reply==BNETD_D2CS_AUTHREPLY_SUCCEED) {
		eventlog(eventlog_level_error,"on_d2cs_authreply","d2cs %s authed",
			addr_num_to_ip_str(conn_get_addr(c)));
		conn_set_state(c,conn_state_loggedin);
		if (prefs_allow_d2cs_setname()) realm_set_name(realm,realmname);
		realm_active(realm,c);
	} else {
		eventlog(eventlog_level_error,"on_d2cs_authreply","failed to auth d2cs %s",
			addr_num_to_ip_str(conn_get_addr(c)));
	}
	if ((rpacket=packet_create(packet_class_d2cs_bnetd))) {
		packet_set_size(rpacket,sizeof(t_bnetd_d2cs_authreply));
		packet_set_type(rpacket,BNETD_D2CS_AUTHREPLY);
		bn_int_set(&rpacket->u.bnetd_d2cs_authreply.reply,reply);
		queue_push_packet(conn_get_out_queue(c),rpacket);
		packet_del_ref(rpacket);
	}
	return 0;
}
コード例 #19
0
ファイル: handle_anongame.cpp プロジェクト: soarqin/pvpgn
static int _client_anongame_set_icon(t_connection * c, t_packet const * const packet)
{
    //BlacKDicK 04/20/2003
    unsigned int desired_icon;
    char user_icon[5];
    t_account * account;
    t_clienttag ctag;

    /*FIXME: In this case we do not get a 'count' but insted of it we get the icon
    that the client wants to set.'W3H2' for an example. For now it is ok, since they share
    the same position	on the packet*/
    desired_icon=bn_int_get(packet->u.client_findanongame.count);
    user_icon[4]=0;
    if (desired_icon==0) {
        std::strcpy(user_icon,"NULL");
        eventlog(eventlog_level_info,__FUNCTION__,"[%d] Set icon packet to DEFAULT ICON [%4.4s]",conn_get_socket(c),user_icon);
    } else {
        std::memcpy(user_icon,&desired_icon,4);
        eventlog(eventlog_level_info,__FUNCTION__,"[%d] Set icon packet to ICON [%s]",conn_get_socket(c),user_icon);
    }

    account = conn_get_account(c);

    if (check_user_icon(account,user_icon) == 0)
    {
        eventlog(eventlog_level_info,__FUNCTION__,"[%s] \"%s\" ICON SWITCH hack attempt, icon set to default ", conn_get_username(c),user_icon);
        std::strcpy(user_icon,"NULL"); // set icon to default
        conn_set_state(c,conn_state_destroy); // kill user session
    }

    account_set_user_icon(conn_get_account(c),conn_get_clienttag(c),user_icon);
    //FIXME: Still need a way to 'refresh the user/channel'
    //_handle_rejoin_command(conn_get_account(c),"");
    /* ??? channel_update_userflags() */
    conn_update_w3_playerinfo(c);

    channel_rejoin(c);
    return 0;
}
コード例 #20
0
ファイル: account.c プロジェクト: 91D2/pvpgn
extern int account_match(t_account * account, char const * username)
{
    unsigned int userid=0;
    unsigned int namehash;
    char const * tname;
    
    if (!account)
    {
	eventlog(eventlog_level_error,__FUNCTION__,"got NULL account");
	return -1;
    }
    if (!username)
    {
	eventlog(eventlog_level_error,__FUNCTION__,"got NULL username");
	return -1;
    }
    
    if (username[0]=='#')
        if (str_to_uint(&username[1],&userid)<0)
            userid = 0;
    
    if (userid)
    {
        if (account->uid==userid)
            return 1;
    }
    else
    {
	namehash = account_hash(username);
        if (account->namehash==namehash &&
	    (tname = account_get_name(account)))
	{
	    if (strcasecmp(tname,username)==0)
		return 1;
	}
    }
    
    return 0;
}
コード例 #21
0
ファイル: list.cpp プロジェクト: Danteoriginal/bnetd-x
extern t_elem const * elem_get_next_const(t_list const * list, t_elem const * elem)
{
    if (!elem)
    {
	eventlog(eventlog_level_error,__FUNCTION__,"got NULL elem");
	return NULL;
    }

    if (elem == &listhead)
        return list->head;
    else
        return elem->next;
}
コード例 #22
0
ファイル: list.cpp プロジェクト: Danteoriginal/bnetd-x
extern t_elem * elem_get_next_real(t_list const * list, t_elem const * elem, char const * fn, unsigned int ln)
{
    if (!elem)
    {
	eventlog(eventlog_level_error,__FUNCTION__,"got NULL elem from %s:%u",fn,ln);
	return NULL;
    }

    if (elem == &listhead)
        return list->head;
    else
        return elem->next;
}
コード例 #23
0
ファイル: list.cpp プロジェクト: Danteoriginal/bnetd-x
extern void * list_get_data_by_pos(t_list const * list, unsigned int pos)
{
    t_elem const * curr;
    unsigned int   len;

    len = 0;
    LIST_TRAVERSE_CONST(list,curr)
	if (len++==pos)
	    return curr->data;

    eventlog(eventlog_level_error,__FUNCTION__,"requested position %u but len=%u",pos,len);
    return NULL;
}
コード例 #24
0
ファイル: list.cpp プロジェクト: Danteoriginal/bnetd-x
extern int list_remove_data(t_list * list, void const * data, t_elem ** elem)
{
    if (!list)
    {
	eventlog(eventlog_level_error,__FUNCTION__,"got NULL list");
	return -1;
    }

    if (!(*elem = list_get_elem_by_data(list,data)))
	return -1;

    return list_remove_elem(list,elem);
}
コード例 #25
0
ファイル: account.cpp プロジェクト: zidane1980slab/pvpgn
		extern int accountlist_create(void)
		{
			eventlog(eventlog_level_info, __FUNCTION__, "started creating accountlist");

			if (!(accountlist_head = hashtable_create(prefs_get_hashtable_size())))
			{
				eventlog(eventlog_level_error, __FUNCTION__, "could not create accountlist_head");
				return -1;
			}

			if (!(accountlist_uid_head = hashtable_create(prefs_get_hashtable_size())))
			{
				eventlog(eventlog_level_error, __FUNCTION__, "could not create accountlist_uid_head");
				return -1;
			}

			/* load accounts without force, indexed storage types wont be loading */
			accountlist_load_all(ST_NONE);
			maxuserid = storage->read_maxuserid();

			return 0;
		}
コード例 #26
0
ファイル: addr.c プロジェクト: Danteoriginal/bnetd
extern int addrlist_destroy(t_addrlist * addrlist)
{
    t_elem * curr;
    t_addr * addr;
    
    if (!addrlist)
    {
	eventlog(eventlog_level_error,"addrlist_destroy","got NULL addrlist");
	return -1;
    }
    
    LIST_TRAVERSE(addrlist,curr)
    {
        if (!(addr = elem_get_data(curr)))
            eventlog(eventlog_level_error,"addrlist_destroy","found NULL addr in list");
        else
            addr_destroy(addr);
        list_remove_elem(addrlist,curr);
    }
    
    return list_destroy(addrlist);
}
コード例 #27
0
ファイル: addr.c プロジェクト: Danteoriginal/bnetd
extern t_addr_data addr_get_data(t_addr const * addr)
{
    t_addr_data tdata;
    
    if (!addr)
    {
	eventlog(eventlog_level_error,"addr_get_data","got NULL addr");
	tdata.p = NULL;
	return tdata;
    }
    
    return addr->data;
}
コード例 #28
0
ファイル: devaoe.c プロジェクト: Earnestly/plan9
static void
downdev(Aoedev *d, char *err)
{
	Frame *f, *e;

	d->flag &= ~Dup;
	f = d->frames;
	e = f + d->nframes;
	for(; f < e; f->tag = Tfree, f->srb = nil, f++)
		frameerror(d, f, Eaoedown);
	d->inprocess = nil;
	eventlog("%æ: removed; %s\n", d, err);
}
コード例 #29
0
ファイル: ladder.cpp プロジェクト: BackupTheBerlios/pvpgn-svn
void
LadderList::addEntry(unsigned int uid_, unsigned int primary_, unsigned int secondary_, unsigned int tertiary_, const LadderReferencedObject& referencedObject_)
{
	if (referenceType != referencedObject_.getReferenceType())
	{
		eventlog(eventlog_level_error,__FUNCTION__,"referenceType of LadderList and referencedObject do mismatch");
		return;
	}

	LadderEntry entry(uid_, primary_ ,secondary_, tertiary_, referencedObject_);
	ladder.push_back(entry);
	dirty = true;
}
コード例 #30
0
ファイル: s2s.cpp プロジェクト: BNETDocs/pvpgn-server
extern int s2s_destroy(t_connection * c)
{
	ASSERT(c,-1);
	switch (d2cs_conn_get_class(c)) {
		case conn_class_bnetd:
			bnetd_destroy(c);
			break;
		default:
			eventlog(eventlog_level_error,__FUNCTION__,"got bad s2s connection class {}",d2cs_conn_get_class(c));
			return -1;
	}
	return 0;
}