Jump to content
  • 0
sbk_

Send emblem in place of the clan

Question

Well, I was creating a village function style anime Naruto and the part of registration is functioning normally, and maybe I'm not sure that the Emblem loading too, would this code here:

 

/*================================================== * Author: CreativeSD - Romulo de Sousa Mangueira * Description: Naruto Village. *-------------------------------------------------- */void vlgregemblem(int village_id){	struct village_data *vlgd = vlg->search(village_id);	char* data;	size_t len;	char* p;	int i;	if (vlgd == NULL)		return;	if (SQL_ERROR == SQL->Query(map->mysql_handle, "SELECT `emblem_len`, `emblem_id`, `emblem_data` FROM `village_system` WHERE `village_id`='%i'", village_id))	{		Sql_ShowDebug(map->mysql_handle);		return;	}	if (SQL_SUCCESS != SQL->NextRow(map->mysql_handle))	{		ShowDebug("Village ID (%i) does not exist!n", village_id);		return;	}	SQL->GetData(map->mysql_handle, 0, &data, &len); vlgd->emblem_len = atoi(data);	SQL->GetData(map->mysql_handle, 1, &data, &len); vlgd->emblem_id = atoi(data);	if ( !vlgd->emblem_len)	{		ShowInfo("Village ID (%i) has no emblem!n", village_id);		return;	}	SQL->GetData(map->mysql_handle, 2, &data, &len);	// convert emblem data from hexadecimal to binary	//TODO: why not store it in the db as binary directly? [ultramage]	for (i = 0, p = vlgd->emblem_data; i < vlgd->emblem_len; ++i, ++p)	{		if (*data >= '0' && *data <= '9')			*p = *data - '0';		else if (*data >= 'a' && *data <= 'f')			*p = *data - 'a' + 10;		else if (*data >= 'A' && *data <= 'F')			*p = *data - 'A' + 10;		*p <<= 4;		++data;		if (*data >= '0' && *data <= '9')			*p |= *data - '0';		else if (*data >= 'a' && *data <= 'f')			*p |= *data - 'a' + 10;		else if (*data >= 'A' && *data <= 'F')			*p |= *data - 'A' + 10;		++data;	}	return;}void read_village(void) {	vlg = &village_s;	struct village_data *vlgd;	SqlStmt* stmt = SQL->StmtMalloc(map->mysql_handle);	char name[NAME_LENGTH];	int village_id, hokage_id;	unsigned int counter = 0;	if (SQL_ERROR == SQL->StmtPrepare(stmt, "SELECT `village_id`, `name`, `hokage_id` FROM `village_system`")		|| SQL_ERROR == SQL->StmtExecute(stmt)		) {		SqlStmt_ShowDebug(stmt);		SQL->StmtFree(stmt);		return;	}	SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &village_id, 0, NULL, NULL);	SQL->StmtBindColumn(stmt, 1, SQLDT_STRING, &name[0], sizeof(name), NULL, NULL);	SQL->StmtBindColumn(stmt, 2, SQLDT_INT, &hokage_id, 0, NULL, NULL);	ShowStatus("Initializing Village System Created by © Creative Services and Development.n");		vlg->vl_db = NULL;	vlg->vl_counter = 0;	vlg->search = village_search;	vlg->vl_db = idb_alloc(DB_OPT_RELEASE_DATA);	while (SQL_SUCCESS == SQL->StmtNextRow(stmt)) {		vlg->vl_counter++;		CREATE(vlgd, struct village_data, 1);		vlgd->village_id = village_id;		vlgd->hokage_id = hokage_id;		safestrncpy(vlgd->name, name, sizeof(vlgd->name));		//memcpy(vlgd->emblem_data, emblem_data, emblem_len);		//vlgd->emblem_len = emblem_len;		//vlgd->emblem_id = emblem_id;		ShowInfo("Read Village (ID: %i, Hokage %i, Name %s).n", village_id, hokage_id, name);		idb_put(vlg->vl_db, vlg->vl_counter, vlgd);		//vlgregemblem(village_id);	}}
Through the system simulate fakename I can send the village name and clan in place of position and clan name, the more I suffer when sending clan badge.
 
Could someone tell me how to do this?

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.