All pastes #162445 Raw Edit

Mine

public text v1 · immutable
·published 2006-09-06 14:57 UTC
rendered paste body
	struct ServerInfo
	{
		ServerInfo (const char* add, uint port)
		{
			address = add;
			ServerInfo::port = port;
		}

		ServerInfo (const char* add)
		{
			address = add;
			size_t pos = address.FindLast (':');
			csString portString = address.Slice (pos + 1);
			sscanf (portString.GetData (), "%u", &port);
			address.Truncate (pos);
		}

		bool operator==(const struct ServerInfo& right) const
		{
			if ((address == right.address) && (port == right.port))
				return true;
			else
				return false;
		}
		csString address;
		uint port;
	};