%@ Language="VBScript" %>
<%option explicit%>
<%
Const fname_gamedata = "D:\user\OEMReg\data\games.txt"
Const fname_playerdata = "D:\user\OEMReg\data\players.txt"
Const fname_titleexlog = "D:\user\OEMReg\titleexlog\wmsg2nd.log"
' UTF-8で読み込み
Sub ReadGameDataFile(Title,ENDate,ENName,JPDate,JPName,BlackName1,BlackRank1,WhiteName1,WhiteRank1,BlackName2,BlackRank2,WhiteName2,WhiteRank2)
Dim strWk
Dim Arr
Dim inStream
Set inStream = CreateObject("ADODB.Stream")
inStream.charset = "utf-8"
inStream.type = 2
inStream.open
inStream.LoadFromFile(fname_gamedata)
Do While Not inStream.EOS
strWk = inStream.ReadText(-2)
If(IsCurrentData(strWk) = true) then
Arr = Split(strWk,Chr(9))
Title = Arr(0)
ENDate = Arr(3)
ENName = Arr(4)
JPDate = Arr(5)
JPName = Arr(6)
If(GetTitleExLogUserID(Title, "EuroGoTV1")="EuroGoTV1")Then
call ReadTitleExLogFile(Title,"EuroGoTV1",BlackName1,BlackRank1,WhiteName1,WhiteRank1)
End If
If(GetTitleExLogUserID(Title, "EuroGoTV2")="EuroGoTV2")Then
call ReadTitleExLogFile(Title,"EuroGoTV2",BlackName2,BlackRank2,WhiteName2,WhiteRank2)
End If
End If
Loop
inStream.Close
Set inStream = Nothing
End Sub
Function IsCurrentData(strWk)
Dim Arr
Dim TimeStr
Dim StartDateTime,EndDateTime
Arr = Split(strWk,Chr(9))
StartDateTime = Arr(1)
EndDateTime = Arr(2)
TimeStr = Year(Now) & "/"
TimeStr = TimeStr & Right("0" & Month(Now),2) & "/"
TimeStr = TimeStr & Right("0" & Day(Now),2) & " "
TimeStr = TimeStr & Right("0" & Hour(Now),2) & ":"
TimeStr = TimeStr & Right("0" & Minute(Now),2) & ":"
TimeStr = TimeStr & Right("0" & Second(Now),2)
If (StartDateTime < TimeStr) and (TimeStr < EndDateTime) then
IsCurrentData = true
Else
IsCurrentData = false
End If
End Function
Function GetTitleExLogUserID(Title, RetID)
Dim strWk
Dim Arr
GetTitleExLogUserID=""
Dim inStream
Set inStream = CreateObject("ADODB.Stream")
inStream.charset = "utf-8"
inStream.type = 2
inStream.open
inStream.LoadFromFile(fname_titleexlog)
Do While Not inStream.EOS
strWk = inStream.ReadText(-2)
Arr = Split(strWk,Chr(9))
If(Arr(1)=Title) And (Arr(0)=RetID) Then
GetTitleExLogUserID = Arr(0)
End If
Loop
inStream.Close
Set inStream = Nothing
End Function
Sub ReadTitleExLogFile(Title,UserID,BlackName,BlackRank,WhiteName,WhiteRank)
Dim strWk
Dim Arr
Dim inStream
Set inStream = CreateObject("ADODB.Stream")
inStream.charset = "utf-8"
inStream.type = 2
inStream.open
inStream.LoadFromFile(fname_titleexlog)
Do While Not inStream.EOS
strWk = inStream.ReadText(-2)
If(IsSameTitleAndUserID(strWk,Title,UserID)=true) then
Arr = Split(strWk,Chr(9))
BlackName = Arr(2)
BlackRank = Arr(3)
WhiteName = Arr(4)
WhiteRank = Arr(5)
End If
Loop
inStream.Close
Set inStream = Nothing
End Sub
Function IsSameTitleAndUserID(strWk,Title,UserID)
Dim Arr
Arr = Split(strWk,Chr(9))
If(UserID = Arr(0))and(Title=Arr(1))then
IsSameTitleAndUserID = true
Else
IsSameTitleAndUserID = false
End If
End Function
Sub ReadPlayerDataFile(PlayerName,PlayerRank,PlayerNameEN,PlayerRankEN,PlayerNameJP,PlayerRankJP)
Dim strWk
Dim Arr
Dim inStream
Set inStream = CreateObject("ADODB.Stream")
inStream.charset = "utf-8"
inStream.type = 2
inStream.open
inStream.LoadFromFile(fname_playerdata)
Do While Not inStream.EOS
strWk = inStream.ReadText(-2)
If(IsSameNameAndRank(strWk,PlayerName,PlayerRank)=true) then
Arr = Split(strWk,Chr(9))
PlayerNameEN = Arr(2)
PlayerRankEN = Arr(3)
PlayerNameJP = Arr(4)
PlayerRankJP = Arr(5)
End If
Loop
inStream.Close
Set inStream = Nothing
End Sub
Function IsSameNameAndRank(strWk,PlayerName,PlayerRank)
Dim Arr
Arr = Split(strWk,Chr(9))
If(PlayerName = Arr(0))and(PlayerRank=Arr(1))then
IsSameNameAndRank = true
Else
IsSameNameAndRank = false
End If
End Function
%>
[ PHOTO ] The 2nd World Mind Sports Games Go Competition August 13-23, 2012