.NET Framework 2.0

madmusician

Club Cricketer
Joined
Sep 30, 2005
Location
Ipswich, UK
Online Cricket Games Owned
I'm wanting to download the Real Name patch for Cricket 07 and need the .NET framework for it to work.

The question is - will this install on XP with out SP2? The computer that I've got the game on has only just got the internet and I don't really want to upgrade. Will it work with SP1?

Thanks if anyone knows...
 
May I ask how you have done this using .net.

From what I know it is a lot like VB and all I seem to know is Dim's and If/thens...may I ask you to reveal how you have managed to change all the names and create a player editor in Cricket 2005.
 
manee said:
May I ask how you have done this using .net.

From what I know it is a lot like VB and all I seem to know is Dim's and If/thens...may I ask you to reveal how you have managed to change all the names and create a player editor in Cricket 2005.

Here you go:

Code:
Imports System.IO
Imports System.Xml
Public Class frmMain
    Dim FS As FileStream, BR As BinaryReader, BW As BinaryWriter, j As UInt16
    Dim startoffset As Integer = 204004
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim strFileName As String
        With OpenFileDialog1
            .Reset()
            .Filter = "Cricket 2007 roster file|*.ros"
            If .ShowDialog() = Windows.Forms.DialogResult.Cancel Then Me.Close()
            strFileName = .FileName
        End With
        If strFileName = vbNullString Then Exit Sub
        If Not IsNothing(FS) Then
            BR.Close()
            BW.Close()
            FS.Close()
            FS = Nothing
        End If
        cboplayername.Items.Clear()
        FS = New FileStream(strFileName, FileMode.Open, FileAccess.ReadWrite)
        BR = New BinaryReader(FS)
        BW = New BinaryWriter(FS)
        Dim chrPlayer(14) As Char, x As Integer, shtid As Short
        For x = 0 To 1051 '1052 players
            FS.Seek((startoffset + 4 + x * 360), SeekOrigin.Begin)
            chrPlayer = BR.ReadChars(14)
            cboplayername.Items.Add(Convert.ToString(chrPlayer))
            FS.Seek((startoffset + x * 360), SeekOrigin.Begin)
            shtid = BR.ReadInt16
            cboplayerid.Items.Add(shtid)
        Next
        cboplayername.SelectedIndex = 0
        cboplayerid.SelectedIndex = 0
        txtplayerid.Text = cboplayerid.Text
        'loading XML file
        Dim strAppPath As String
        strAppPath = IIf(Strings.Right(Application.StartupPath, 1) = "\", Application.StartupPath, Application.StartupPath + "\")
        Dim XDocument As XmlDocument, XNodeList As XmlNodeList, XNode As XmlNode
        XDocument = New XmlDocument
        Try
            XDocument.Load(strAppPath + "PlayerNames.xml")
        Catch When Err.Number = 53 'If File Not Found Error
            MsgBox("XML file not found" & vbCrLf & "Please make sure PlayerNames.xml is in the root directory", MessageBoxIcon.Error)
            Me.Close()
        End Try
        XNodeList = XDocument.SelectNodes("/PlayerNames/Player")
        For Each XNode In XNodeList
            Dim genderAttribute As String = XNode.Attributes.GetNamedItem("ID").Value
            Dim firstNameValue As String = XNode.Attributes.GetNamedItem("Name").Value
            lstxmlplayid.Items.Add(genderAttribute)
            lstxmlplayname.Items.Add(firstNameValue)
        Next
        replacenames()
    End Sub

    Private Sub replacenames()
        Dim xmltotalnumber As Integer = lstxmlplayid.Items.Count, x, a As Integer, z As String
        For x = 0 To (xmltotalnumber - 1)
            a = cboplayerid.FindStringExact(lstxmlplayid.Items.Item(x))
            If a = -1 Then
                MsgBox("PlayerID not found for " & lstxmlplayname.Items.Item(x) & vbCrLf & "All names have not been replaced", MsgBoxStyle.Exclamation)
                Me.Close()
            End If
            Dim chrPlayer(13), clrplayer(13) As Char
            Dim s As String
            If lstxmlplayname.Items.Item(x).Length > 14 Then
                MsgBox(lstxmlplayname.Items.Item(x) & " is too long. It will be reduced to 14 characters.", MsgBoxStyle.Information)
                lstxmlplayname.Items.Item(x) = Microsoft.VisualBasic.Left(lstxmlplayname.Items.Item(x), 14)
            End If
            s = lstxmlplayname.Items.Item(x) & New String(Chr(0), (14 - lstxmlplayname.Items.Item(x).Length))
            chrPlayer = s.ToCharArray()
            FS.Seek(startoffset + a * 360 + 4, SeekOrigin.Begin)
            BW.Write(chrPlayer)
            z = lstxmlplayname.Items.Item(x)
            getnames(z)
            If j <> 0 Then
                FS.Seek(startoffset + a * 360 + 2, SeekOrigin.Begin)
                BW.Write(j)
            End If
        Next
        MsgBox("Names successfully replaced", MsgBoxStyle.Information)
        Me.Close()
    End Sub

I've left out the getnames sub for changing commentary but everything else is there.
 
Well, of course, if you put it like that, it sounds so simple :p
 
Seeing that .net framework will work on windows98, why don't you try and install it.
 

Users who are viewing this thread

Top