.ADMIN menu hardcoded - x77x - 05-01-2014 09:58 PM
i know this is hardcoded, but if i could remake this with a gump, it would solve all my problems...
![[Image: adminmenu.png]](http://escanabasucks.com/uo/dragonsoftime/junk/adminmenu.png)
anyone on the inside care to share?
RE: .ADMIN menu hardcoded - Avatar - 05-02-2014 12:51 AM
It is not hard-coded. You can go and check nightly build scripts and there is sphere_admin.scp with include [DIALOG d_sphereadmin]. You can change whatever content inside on it with no problem. Let me ask you which version of sphere server are you using ? I'm talking about last releases including 2008 to 2014.
Here you can look at : http://spherescripts.sytes.net/filedetails.php?repname=Sphere+Script+Pack&path=%2Fsphere_admin.scp
RE: .ADMIN menu hardcoded - darksun84 - 05-02-2014 12:54 AM
it's the sphere 51 section
RE: .ADMIN menu hardcoded - Avatar - 05-02-2014 06:10 AM
Haha lol, Really now I see it. These days, I lost my self because of projects etc. I donot really have any idea about 51a realy. Why dont you upgrade your existed sphere to last one. you can try, it is easy.
RE: .ADMIN menu hardcoded - x77x - 05-02-2014 09:16 PM
even hardcoded, theres gotta be a way to recreate it in gump
51a never had a way to see whos online and/or message them
(for players)
RE: .ADMIN menu hardcoded - XuN - 05-02-2014 10:08 PM
I don't know, can you use <serv.clients> / <serv.client.n.uid> ? if so you can do it ... if not I think it's not scriptable.
RE: .ADMIN menu hardcoded - x77x - 05-03-2014 12:22 AM
just a name would be nice...
kinda like .clients
but without the account name, ip, and location
RE: .ADMIN menu hardcoded - x77x - 05-03-2014 10:38 AM
hmm
Code:
void CClient::addGumpDialogAdmin( int iAdPage, int iSortType )
{
// Alter this routine at your own risk....if anymore
// bytes get sent to the client, you WILL crash them
// Take away, but don't add (heh) (actually there's like
// 100 bytes available, but they get eaten up fast with
// this gump stuff)
static LPCTSTR const sm_szGumps = // These are on every page and don't change
{
"page 0",
"resizepic 0 0 5120 623 310",
"resizepic 242 262 5120 170 35",
"text 230 10 955 0",
};
CGString sControls;
int iControls = 0;
while ( iControls<COUNTOF(sm_szGumps))
{
sControls = sm_szGumps;
iControls++;
}
CGString sText;
int iTexts=1;
sText.Format( "Admin Control Panel (%d clients)", g_Serv.m_Clients.GetCount());
static const int sm_iColSpaces = // These are on every page and don't change
{
8 + 19, // Text (sock)
8 + 73, // Text (account name)
8 + 188, // Text (name)
8 + 328, // Text (ip)
8 + 474 // Text (location)
};
static LPCTSTR const sm_szColText = // These are on every page and don't change
{
"Sock",
"Account",
"Name",
"IP Address",
"Location"
};
while ( iTexts<=COUNTOF(sm_szColText) )
{
sControls.Format( "text %d 30 955 %d", sm_iColSpaces-2, iTexts );
iControls++;
sText = sm_szColText;
iTexts++;
}
// Count clients to show.
// Create sorted list.
CClientSortList ClientList;
ClientList.SortByType( 1, m_pChar );
// none left to display for this page ?
int iClient = iAdPage*ADMIN_CLIENTS_PER_PAGE;
if ( iClient >= ClientList.GetCount())
{
iAdPage = 0; // just go back to first page.
iClient = 0;
}
m_tmGumpAdmin.m_iPageNum = iAdPage;
m_tmGumpAdmin.m_iSortType = iSortType;
int iY = 50;
for ( int i=0; iClient<ClientList.GetCount() && i<ADMIN_CLIENTS_PER_PAGE; iClient++, i++ )
{
CClient * pClient = ClientList.GetAt(iClient);
ASSERT(pClient);
// Sock buttons
// X, Y, Down gump, Up gump, pressable, iPage, id
sControls.Format(
"button 12 %i 2362 2361 1 1 %i",
iY + 4, // Y
901 + i ); // id
for ( int j=0; j<COUNTOF(sm_iColSpaces); j++ )
{
sControls.Format(
"text %i %i 955 %i",
sm_iColSpaces,
iY,
iTexts+j );
}
CSocketAddress PeerName = pClient->m_Socket.GetPeerName();
TCHAR accountName;
strcpylen( accountName, pClient->GetName(), 12 );
// max name size for this dialog....otherwise CRASH!!!, not a big enuf buffer :(
CChar * pChar = pClient->GetChar();
if ( pClient->IsPriv(PRIV_GM) || pClient->GetPrivLevel() >= PLEVEL_Counsel )
{
memmove( accountName+1, accountName, 13 );
accountName = ( pChar && pChar->IsDND()) ? '*' : '+';
}
ASSERT( i<COUNTOF(m_tmGumpAdmin.m_Item));
if ( pChar != NULL )
{
m_tmGumpAdmin.m_Item = pChar->GetUID();
TCHAR characterName;
strcpy(characterName, pChar->GetName());
characterName = 0; // same comment as the accountName...careful with this stuff!
sText.Format("%x", pClient->m_Socket.GetSocket());
sText = accountName;
sText = characterName;
CPointMap pt = pChar->GetTopPoint();
sText.Format( "%s", PeerName.GetAddrStr()) ;
sText.Format( "%d,%d,%d ",
pt.m_x,
pt.m_y,
pt.m_z,
pt.m_mapplane) ;
}
else
{
m_tmGumpAdmin.m_Item = 0;
sText.Format( "%03x", pClient->m_Socket.GetSocket());
sText = accountName;
sText = "N/A";
sText = PeerName.GetAddrStr();
sText = "N/A";
}
iY += 20; // go down a 'line' on the dialog
}
if ( m_tmGumpAdmin.m_iPageNum ) // is there a previous ?
{
sControls = "button 253 267 5537 5539 1 0 801"; // p
}
if ( iClient<ClientList.GetCount()) // is there a next ?
{
sControls = "button 385 267 5540 5542 1 0 802"; // n
}
addGumpDialog( CLIMODE_DIALOG_ADMIN, sControls, iControls, sText, iTexts, 0x05, 0x46 );
}
RE: .ADMIN menu hardcoded - XuN - 05-03-2014 04:55 PM
So?
RE: .ADMIN menu hardcoded - x77x - 05-04-2014 12:16 AM
look at it, is there anyway to do it in a gump?
|