View Single Post
Old 18.05.2005, 17:23   #16
Livid
Архивный участник
 
Join Date: Apr 2005
Posts: 314
Default

Надоело прикалываться, пишу нормальным русским (моя родная русская языка)
МАСТЕР: ну не нравится буржуйский, сиди на русских форумах. Условием русских постов здесь был перевод на стандартный международный язык (читай: английский) - хоть как-нибудь хоть где-нибудь хоть что-нибудь... И хватит чужое тягать вообще, пора бы уже самостоятельно что-нибудь пытаться делать.
Учите языки (в тч программирования)!

2 Kane Hart
Translated as u requested.
Quote:
(c) kembl

If u'll be satisfied by something like this: http://game.aaanet.ru/?laguild=1&m=5
Then here's my solution

Code:
<%

if request("laguild") <> "" then
main=0

LA_stat = "SELECT * FROM lin2world..v_La2Gamers where GuildName is not NULL order by Gamers desc, GuildName, Lev DESC"
set LASTAT = SELA2(LA_stat)

if not LASTAT.EOF then

%>
<u>Full LineAge2 statistics</u>

Clan - Members / Summ of clan member's levels [/i]

<TABLE cellSpacing=1 cellPadding=3 bgColor=#aaaaaa border=0 width=98%><TBODY>
<TR bgColor=#F5F5F5 class=mnpFileRow align=center><TD colspan=4><font size=+1>Clan statistics</font></TD></TR>
<TR bgColor=#FAFAFA class=mnpFileRow align=center><TD><u>Clan</u></TD><TD>Character</TD><TD>Race / Class</TD></TR>

<%
clanname = ""
poorsection = 0
do while not LASTAT.EOF

gender = "М."
if LASTAT("gender") > 0 then gender = "Ж." end if

clanstat = "-"
first = ""
if clanname <> LASTAT("GuildName") then
clanstat = LASTAT("GuildName") & " - " & LASTAT("Gamers") & "/" & LASTAT("Levels") & ""
clanname = LASTAT("GuildName")
first = "<font color=red>"
end if

online = "black"
if LASTAT("Login") > LASTAT("Logout") then online = "green" end if

builder = ""
if LASTAT("Builder") > 0 and LASTAT("char_name") <> "Katy" then builder = "<font color=blue><sup> - GM</sup></font>" end if

ClanLeader = ""
if LASTAT("ruler_id") = LASTAT("char_id") then ClanLeader = "<font color=navy><sup> - Лидер клана</sup></font>" end if

banned = ""
if LASTAT("block_flag") > 0 then
banned = "<font color='red'>BAN<font size=-3>(" & LASTAT("block_end_date") & ")</font></font>"
end if

if LASTAT("Gamers") < 2 and poorsection = 0 then
poorsection = 1

%>
<TR bgColor=#F5F5F5 class=mnpFileRow align=center><TD colspan=4>"Empty" clans ( less than 2 members )</TD></TR>

<%

end if

%>
<TR bgColor=white class=mnpFileRow align=center><TD><%=clanstat%></TD><TD><%=banned%><font color=<%=online%>><%=LASTAT("char_name")%></font><%=builder%><font size=-3 color=#AFAFAF><%=gender%></font><%=ClanLeader%></TD><TD><%=LA2Race(LASTAT("race"))%> / <%=LA2Class(LASTAT("Class"))%></TD></TR>

<%

LASTAT.MoveNext
Loop
%>
</TABLE>


<%
end if
end if%>



SELA2 function is db request



Code:


MsSqlConnLa2="driver=SQL Server;server=DB_SERVER;uid=DB_USER;pwd=PASSWORD;d atabase=lin2db"
Set ConnGameLa2=Server.CreateObject("ADODB.Connection" )
ConnGameLa2.ConnectionTimeout = 100
ConnGameLa2.CommandTimeout = 100
La2Connected=0
AffCount = 0

Function SELA2(Sqls)
if La2Connected=0 then
ConnGameLa2.Open MsSqlConnLa2
La2Connected=1
end if
Set SELA2=ConnGameLa2.Execute(Sqls,AffCount)
End function



SQL View where I group and select needed data from game tables lin2world..v_La2Gamers


Code:


CREATE VIEW dbo.v_La2Gamers
AS
SELECT dbo.user_data.char_name, dbo.user_data.gender, dbo.user_data.Lev, dbo.user_data.PK, dbo.user_data.PKpardon, dbo.user_data.Duel,
dbo.v_Guilds.name AS GuildName, dbo.v_Guilds.Gamers, dbo.user_data.builder, dbo.user_data.race, dbo.user_data.class, dbo.user_data.login,
dbo.user_data.logout, dbo.v_Guilds.ruler_id, dbo.user_data.char_id, dbo.v_Guilds.Levels, lin2db.dbo.user_account.block_flag,
lin2db.dbo.user_account.block_end_date
FROM dbo.user_data INNER JOIN
lin2db.dbo.user_account ON dbo.user_data.account_name COLLATE Cyrillic_General_CI_AS = lin2db.dbo.user_account.account LEFT OUTER JOIN
dbo.v_Guilds ON dbo.user_data.pledge_id = dbo.v_Guilds.pledge_id




That's all.
Anyone knows how to make server reload? So that database changes would work in game on-the-fly? That's a har thing, Im trying to understand how to make it for a week already.

Anyway, llok how statistics is made: http://game.aaanet.ru/?lastat=1&m=5

Levels are not shown, u can add that by changing request, but actually I suppose u use the following principle: what is unable to know in-game, that shouldn't be shown in statisics. It is better to sort by level, then it is not shown, but u can see char coolness grade.
Livid is offline