All pastes #558860 Raw Edit

Mine

public text v1 · immutable
·published 2007-06-11 15:05 UTC
rendered paste body
unsigned long CRealmListServer::ShowRealm(RealmInfo &Info, char Total,char *buffer)
{
	char sPort[12]={0};
	char c=0;

	//*(unsigned long *)&buffer[c] = Info.Icon;
	//c+=4;
	buffer[c++] = Info.Color;
	buffer[c++] = Info.Status; // ADD THIS TO REALM STRUCT. values are Good = 0x00,        Locked = 0x01,
	buffer[c++] = Info.Icon;
	
	strcpy(&buffer[c], Info.Name);	// server full name
	c+=strlen(Info.Name)+1;			// string length; null-terminated
	strcpy(&buffer[c],Info.IPAddr); // server address
	c+=strlen(Info.IPAddr);			// string length; port follows
	buffer[c++] = ':';				// port separator
	sprintf(sPort,"%i",Info.Port);	// port number
	strcpy(&buffer[c],sPort);
	c+=strlen(sPort)+1;				// string length; null-terminated

	*(float*)&buffer[c] = (Info.nPlayers+1)/1000.0f; // Population
	c+=4;

	buffer[c++] = 1; // "Characters" // name becomes yellow if this is 0
	buffer[c++] = Info.Language;
	
	// this is realm separator, always been 0 in my logs, but anything should work.
	buffer[c++] = Total; //order? for putting all realms in order perhaps

	return c;
}