Way to view another server's status ingame


(-999-) #1

[EDIT]: Ok, now I still need help regarding this, but changed the title to reflect it better. I’ve got it so that you can switch servers, which was the original problem.

I’ve searched on google, I’ve read through this:http://tramdesign.planetwolfenstein.gamespy.com/tutorials/tut_menuscript.html , looked through menumacros, looked through the source, etc.

Originally while working on it, I got it so you could see the server status of the other server. Apparently, it didn’t last. I don’t know what has changed, but I can’t seem to get it to function again, it just shows the status of the server you’re on.

#include "ui/menudef.h"

// Defines //

#define WINDOW_X		0
#define WINDOW_Y		0
#define WINDOW_WIDTH	640
#define WINDOW_HEIGHT	480
#define GROUP_NAME		"grpGSInfo"

// Macros //

#include "ui/menumacros.h"
		
// Gamespy Info/Switch //
	
menuDef {
	name		"switch_main"
	visible		0
	fullscreen	0
	rect		WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
	style		WINDOW_STYLE_FILLED
	popup
	
	fadeClamp	0.5
	fadeAmount  0.075
	
onOpen {
	setitemcolor background backcolor 0 0 0 0 ;
	fadein background ;
	setcvar ui_serverBrowser 1 ;
	uiScript ServerStatus [b]ipaddress[/b]
}
	
onESC {
	close switch_main ;
	open custom_main
}
	
// Background //

itemDef {
	name		"background"
	rect		0 0 640 480
	style		WINDOW_STYLE_FILLED
	background	"ui/assets/fadebox.tga"
	backcolor	0 0 0 0
	visible		1
	decoration
}

// Subwindows //

#define SUBWINDOW_WIDTH		384
#define SUBWINDOW_HEIGHT	320
#define SUBWINDOW_X			.5*(WINDOW_WIDTH-SUBWINDOW_WIDTH)
#define SUBWINDOW_Y			.5*(WINDOW_HEIGHT-SUBWINDOW_HEIGHT)

	SUBWINDOWBLACK( SUBWINDOW_X, SUBWINDOW_Y, SUBWINDOW_WIDTH, SUBWINDOW_HEIGHT, "SERVER INFO" )
	
itemDef {
	name			"serverInfo"
	group			GROUP_NAME
	rect			 $evalfloat((SUBWINDOW_X)+6)  $evalfloat((SUBWINDOW_Y)+20)  $evalfloat((SUBWINDOW_WIDTH)-12)  $evalfloat((SUBWINDOW_HEIGHT)-20-26)
	type			ITEM_TYPE_LISTBOX
	textfont		UI_FONT_COURBD_21
	textstyle		ITEM_TEXTSTYLE_SHADOWED
	textscale		.2
	textaligny		-3
	forecolor		.6 .6 .6 1
	feeder			FEEDER_SERVERSTATUS
	elementtype		LISTBOX_TEXT
	elementwidth	$evalfloat((SUBWINDOW_WIDTH)-12)
	elementheight	12
	columns			4	0	40	20
						40	40	10
						90	40	10
						135	40	20
	visible			1
}
	
BUTTON( (SUBWINDOW_X)+6, (SUBWINDOW_Y)+(SUBWINDOW_HEIGHT)-24, .33*((SUBWINDOW_WIDTH)-24), 18, "BACK", .3, 14, close switch_main ; open custom_main )
BUTTON( (SUBWINDOW_X)+6+.33*((SUBWINDOW_WIDTH)-24)+6, (SUBWINDOW_Y)+(SUBWINDOW_HEIGHT)-24, .34*((SUBWINDOW_WIDTH)-24), 18, "REFRESH", .3, 14, uiScript ServerStatus [b]ipaddress [/b])
BUTTON( (SUBWINDOW_X)+6+.33*((SUBWINDOW_WIDTH)-24)+6+.34*((SUBWINDOW_WIDTH)-24)+6, (SUBWINDOW_Y)+(SUBWINDOW_HEIGHT)-24, .33*((SUBWINDOW_WIDTH)-24), 18, "SWITCH SERVER", .3, 14, open gs_sub )
}

I used playonline_serverinfo.menu as my template. I tried switching “uiScript ServerStatus ipaddress” with “exec serverstatus ipaddress”, but that just prints it in console, not on the window.

I’d appreciate any help I can get.
Thanks


(-999-) #2

New problem now. :banghead: