All pastes #923679 Raw Edit

Anonymous

public text v1 · immutable
#923679 ·published 2008-02-29 19:28 UTC
rendered paste body
<%@ page import="java.net.*" %>
<%@ page contentType="text/html; charset=iso-8859-9" %>
<%!
	String 		login_server;
	boolean		login_status;
	int			saniye;
	int			dakika;
	
	
	long   		last_time;
	long 		curr_time;
	
	
	int			count_game_server;
	String		game_server_names[];
	String 		game_servers[];
	boolean		gameserver_status[];
	
	
    public void jspInit() {
		login_server = "212.174.90.98";
		
		count_game_server = 1;
		game_servers = new String[count_game_server];
		game_server_names = new String[count_game_server];
		gameserver_status = new boolean[count_game_server];
		
		//game server listesi
		game_servers[0] = "212.174.90.98";
		game_server_names[0] = "Staris";
		
		
		last_time = System.currentTimeMillis();
    }
%>



<%
	curr_time = System.currentTimeMillis();
	if(last_time + 600000 < curr_time) {
		last_time = curr_time;
    	Thread thread = new Thread( new Runnable( ) {
    		public final void run() {
				try {
					Socket login_socket = new Socket(login_server,2106);
					login_status = true;
					try {login_socket.close( );}
					catch(Throwable thw) {}
				} catch(Exception erx) { login_status = false; }
				
				for(int j = 0 ; j < count_game_server ; j++) {
					try {
						Socket game_socket = new Socket( game_servers[j] , 7777 );
						gameserver_status[j] = true;
						try {game_socket.close( );}
						catch(Throwable thw) { }
					} catch(Exception erx) { gameserver_status[j] = false; }
				}
    		}
    	});
    	thread.start();
	}
%>

	<div class="menu">
		<div class="menufooter"></div>
		
		<div class="menuheader"><h3>SUNUCU LİSTESİ</h3></div>
		<div class="menucontent">
		<TABLE class=status cellSpacing=0 cellPadding=0 border=0>
		<TBODY>
		<TR>
		<TD class=top colSpan=2><IMG src="/images/up.gif"></TD></TR>
		<TR>
			<TD class=left noWrap>- <SPAN class=yellow>0. Login Sunucu</SPAN></TD>
				<%
					if(login_status) {
				%>
					<TD class=right noWrap><SPAN class=up>Online</SPAN></TD>
				<%
					} else {
				%>
					<TD class=right noWrap><SPAN class=down>Offline</SPAN></TD>
				<%
					}
				%>
				</TR>
				
				
				<%
					for(int j = 0 ; j < count_game_server ; j++) {
				%>
					<TR>
					<TD class=left noWrap>- <SPAN class=yellow><%= j+1 %><%= ". "+game_server_names[j] %></SPAN></TD>
					<%
						if(gameserver_status[j]) {
					%>
							
						<TD class=right noWrap><SPAN class=up>Online</SPAN></TD>
					<%
						} else {
					%>
					
						<TD class=right noWrap><SPAN class=down>Offline</SPAN></TD>
				
				<%
					}
				%>
					</TR>
				<%
					}
				%>
				
				<%
					saniye = (int)((double)(curr_time - last_time)/1000.0);
					dakika = (int)((float)saniye / 60.0f);
					saniye = (int)(saniye - (dakika*saniye));
				%>
				
				<TD class=full_line colSpan=2>En son <% out.println(dakika+":"+saniye); %> saniye önce yenilendi.</TD></TR>
				
				
				<TR>
					<TD colSpan=2><IMG src="/images/down.gif"></TD></TR></TBODY></TABLE>
				</div>
				
				<div class="menufooter"></div>
			</div>