Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

About Sod Ranking ... ClanSodManager

Newbie Spellweaver
Joined
Jun 17, 2009
Messages
33
Reaction score
1
Hello People..

i dont know why.. but my ClanSodManager dosent work!

Clan - Work
SoD - Rankset Manuelly work

but if i start the ClanSodManager(1P) and run in Sod then it dont record!

it did a new Database User .. with all right - no records
i used the konfiguration dynamic ip port 1433 - no records

i reinstalled sql server - no record

the settings from Clan sod Manager correctly.. the TMR is 10 and runs 1.2.3. all 10 seconds

i can set the clan prize money with the manager so i see he have connection..

i use win root 2003 32bit and sql server 2005

Database SoD2DB - SODRecSandurr... or so is inside the DB ..


----------------------------------------------

Another thing is .. if i use Gregoos acc manager and want to update a clan icon..

then i get a image error inside the game...the clan dont have any icon..

---------------------------------------------------------------------------

i hope anyone can help with a good answer :)
 
Newbie Spellweaver
Joined
Aug 29, 2009
Messages
92
Reaction score
4
you need run clansodmanager
you can fix all file clansystem with your host .
good luck
 
Newbie Spellweaver
Joined
Jun 17, 2009
Messages
33
Reaction score
1
you need run clansodmanager
you can fix all file clansystem with your host .
good luck

?? what u mean?? i run clansodmanager Oo but dosent record anything

and how u mean fix all file clansystem with your host??
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
Has CSM ever recorded stuff? You know you need to change the SQL tables from the defaults? You also know that you usually need 3 players from the same Clan in SoD2 at the same time in order for anyones' score to be recorded?
 
Newbie Spellweaver
Joined
Jun 17, 2009
Messages
33
Reaction score
1
really? well i have CSM that is configurated for 1P i think..

i will show u here a picture

image1 - About Sod Ranking ... ClanSodManager - RaGEZONE Forums

image2 - About Sod Ranking ... ClanSodManager - RaGEZONE Forums


and how u mean change from the defaults?

never recorded anything
 

Attachments

You must be registered for see attachments list
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
CSM was distributed with SQL files to replace clan and SoD rank tables, and instructions to delete the ones that come with the server and then create new ones (with a different structure) from the supplied SQL scripts.

I've never got sandurrs CSM to actually work, but some people have suggested to me that it isn't reliable for Number of Players <= 2. I hear that it checks that there are that many players in SoD at once, and that they are competing with another Clan and that they are all in the same Clan. That's pretty difficult logic to get right for 1 player.

I can't see how the logic would be flawed for less than 3 players, provided there where at least 3 players in each of at least 3 Clans, and can think how to reduce those 3s to 2s. However, it's not uncommon to require such logic to have a "first record" and a "last record" which must be unique from all records in-between. With only 1 record to choose from, the unique nature of 1st, and last is lost, let alone a minimum 1 unique record between.

I don't have the foggiest clue how to read this .Net shizzle, but for the reference of anyone who does:-
Code:
Public Class frmMain
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents txtSQL As System.Windows.Forms.TextBox
    Friend WithEvents txtDB As System.Windows.Forms.TextBox
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents txtUSR As System.Windows.Forms.TextBox
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents txtPW As System.Windows.Forms.TextBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents txtTMR As System.Windows.Forms.TextBox
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents btnTMR As System.Windows.Forms.Button
    Friend WithEvents btnPW As System.Windows.Forms.Button
    Friend WithEvents btnUSR As System.Windows.Forms.Button
    Friend WithEvents btnDB As System.Windows.Forms.Button
    Friend WithEvents btnSQL As System.Windows.Forms.Button
    Friend WithEvents btnSandurrA As System.Windows.Forms.Button
    Friend WithEvents lblStatus As System.Windows.Forms.Label
    Friend WithEvents lblTMR As System.Windows.Forms.Label
    Friend WithEvents Timer As System.Timers.Timer
    Friend WithEvents btnTBL As System.Windows.Forms.Button
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents txtTBL As System.Windows.Forms.TextBox
    Friend WithEvents btnStop As System.Windows.Forms.Button
    Friend WithEvents lstErrorLog As System.Windows.Forms.ListBox
    Friend WithEvents lstErrorLog2 As System.Windows.Forms.ListBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents txtPNum As System.Windows.Forms.TextBox
    Friend WithEvents btnGold As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmMain))
        Me.Label1 = New System.Windows.Forms.Label
        Me.txtSQL = New System.Windows.Forms.TextBox
        Me.txtDB = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.txtUSR = New System.Windows.Forms.TextBox
        Me.Label3 = New System.Windows.Forms.Label
        Me.txtPW = New System.Windows.Forms.TextBox
        Me.Label4 = New System.Windows.Forms.Label
        Me.txtTMR = New System.Windows.Forms.TextBox
        Me.Label5 = New System.Windows.Forms.Label
        Me.btnTMR = New System.Windows.Forms.Button
        Me.btnPW = New System.Windows.Forms.Button
        Me.btnUSR = New System.Windows.Forms.Button
        Me.btnDB = New System.Windows.Forms.Button
        Me.btnSQL = New System.Windows.Forms.Button
        Me.btnSandurrA = New System.Windows.Forms.Button
        Me.lblStatus = New System.Windows.Forms.Label
        Me.lblTMR = New System.Windows.Forms.Label
        Me.Timer = New System.Timers.Timer
        Me.btnTBL = New System.Windows.Forms.Button
        Me.txtTBL = New System.Windows.Forms.TextBox
        Me.Label6 = New System.Windows.Forms.Label
        Me.btnStop = New System.Windows.Forms.Button
        Me.lstErrorLog = New System.Windows.Forms.ListBox
        Me.lstErrorLog2 = New System.Windows.Forms.ListBox
        Me.Label7 = New System.Windows.Forms.Label
        Me.txtPNum = New System.Windows.Forms.TextBox
        Me.btnGold = New System.Windows.Forms.Button
        CType(Me.Timer, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(8, 8)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(56, 16)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "SQL"
        '
        'txtSQL
        '
        Me.txtSQL.Location = New System.Drawing.Point(64, 8)
        Me.txtSQL.Name = "txtSQL"
        Me.txtSQL.Size = New System.Drawing.Size(128, 20)
        Me.txtSQL.TabIndex = 1
        Me.txtSQL.Text = "127.0.0.1"
        '
        'txtDB
        '
        Me.txtDB.Location = New System.Drawing.Point(64, 32)
        Me.txtDB.Name = "txtDB"
        Me.txtDB.Size = New System.Drawing.Size(128, 20)
        Me.txtDB.TabIndex = 3
        Me.txtDB.Text = "SOD2DB"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(8, 32)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(56, 16)
        Me.Label2.TabIndex = 2
        Me.Label2.Text = "DB"
        '
        'txtUSR
        '
        Me.txtUSR.Location = New System.Drawing.Point(64, 56)
        Me.txtUSR.Name = "txtUSR"
        Me.txtUSR.Size = New System.Drawing.Size(128, 20)
        Me.txtUSR.TabIndex = 5
        Me.txtUSR.Text = "sa"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(8, 56)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(56, 16)
        Me.Label3.TabIndex = 4
        Me.Label3.Text = "USR"
        '
        'txtPW
        '
        Me.txtPW.Location = New System.Drawing.Point(64, 80)
        Me.txtPW.Name = "txtPW"
        Me.txtPW.PasswordChar = Microsoft.VisualBasic.ChrW(42)
        Me.txtPW.Size = New System.Drawing.Size(128, 20)
        Me.txtPW.TabIndex = 7
        Me.txtPW.Text = ""
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(8, 80)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(56, 16)
        Me.Label4.TabIndex = 6
        Me.Label4.Text = "PW"
        '
        'txtTMR
        '
        Me.txtTMR.Location = New System.Drawing.Point(64, 104)
        Me.txtTMR.Name = "txtTMR"
        Me.txtTMR.Size = New System.Drawing.Size(128, 20)
        Me.txtTMR.TabIndex = 9
        Me.txtTMR.Text = "10"
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(8, 104)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(56, 16)
        Me.Label5.TabIndex = 8
        Me.Label5.Text = "TMR"
        '
        'btnTMR
        '
        Me.btnTMR.Location = New System.Drawing.Point(200, 104)
        Me.btnTMR.Name = "btnTMR"
        Me.btnTMR.Size = New System.Drawing.Size(32, 16)
        Me.btnTMR.TabIndex = 10
        Me.btnTMR.Text = "set"
        '
        'btnPW
        '
        Me.btnPW.Location = New System.Drawing.Point(200, 80)
        Me.btnPW.Name = "btnPW"
        Me.btnPW.Size = New System.Drawing.Size(32, 16)
        Me.btnPW.TabIndex = 11
        Me.btnPW.Text = "set"
        '
        'btnUSR
        '
        Me.btnUSR.Location = New System.Drawing.Point(200, 56)
        Me.btnUSR.Name = "btnUSR"
        Me.btnUSR.Size = New System.Drawing.Size(32, 16)
        Me.btnUSR.TabIndex = 12
        Me.btnUSR.Text = "set"
        '
        'btnDB
        '
        Me.btnDB.Location = New System.Drawing.Point(200, 32)
        Me.btnDB.Name = "btnDB"
        Me.btnDB.Size = New System.Drawing.Size(32, 16)
        Me.btnDB.TabIndex = 13
        Me.btnDB.Text = "set"
        '
        'btnSQL
        '
        Me.btnSQL.Location = New System.Drawing.Point(200, 8)
        Me.btnSQL.Name = "btnSQL"
        Me.btnSQL.Size = New System.Drawing.Size(32, 16)
        Me.btnSQL.TabIndex = 14
        Me.btnSQL.Text = "set"
        '
        'btnSandurrA
        '
        Me.btnSandurrA.Enabled = False
        Me.btnSandurrA.Location = New System.Drawing.Point(240, 32)
        Me.btnSandurrA.Name = "btnSandurrA"
        Me.btnSandurrA.Size = New System.Drawing.Size(368, 80)
        Me.btnSandurrA.TabIndex = 16
        Me.btnSandurrA.Text = "Activate"
        '
        'lblStatus
        '
        Me.lblStatus.Location = New System.Drawing.Point(8, 152)
        Me.lblStatus.Name = "lblStatus"
        Me.lblStatus.Size = New System.Drawing.Size(512, 16)
        Me.lblStatus.TabIndex = 17
        Me.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'lblTMR
        '
        Me.lblTMR.Location = New System.Drawing.Point(536, 152)
        Me.lblTMR.Name = "lblTMR"
        Me.lblTMR.Size = New System.Drawing.Size(72, 16)
        Me.lblTMR.TabIndex = 18
        Me.lblTMR.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Timer
        '
        Me.Timer.Interval = 60000
        Me.Timer.SynchronizingObject = Me
        '
        'btnTBL
        '
        Me.btnTBL.Location = New System.Drawing.Point(200, 128)
        Me.btnTBL.Name = "btnTBL"
        Me.btnTBL.Size = New System.Drawing.Size(32, 16)
        Me.btnTBL.TabIndex = 21
        Me.btnTBL.Text = "set"
        '
        'txtTBL
        '
        Me.txtTBL.Location = New System.Drawing.Point(64, 128)
        Me.txtTBL.Name = "txtTBL"
        Me.txtTBL.Size = New System.Drawing.Size(128, 20)
        Me.txtTBL.TabIndex = 20
        Me.txtTBL.Text = "SOD2RecBySandurr"
        '
        'Label6
        '
        Me.Label6.Location = New System.Drawing.Point(8, 128)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(56, 16)
        Me.Label6.TabIndex = 19
        Me.Label6.Text = "TBL"
        '
        'btnStop
        '
        Me.btnStop.Enabled = False
        Me.btnStop.Location = New System.Drawing.Point(240, 120)
        Me.btnStop.Name = "btnStop"
        Me.btnStop.Size = New System.Drawing.Size(264, 24)
        Me.btnStop.TabIndex = 22
        Me.btnStop.Text = "Stop"
        '
        'lstErrorLog
        '
        Me.lstErrorLog.Location = New System.Drawing.Point(8, 168)
        Me.lstErrorLog.Name = "lstErrorLog"
        Me.lstErrorLog.Size = New System.Drawing.Size(288, 147)
        Me.lstErrorLog.TabIndex = 23
        '
        'lstErrorLog2
        '
        Me.lstErrorLog2.Location = New System.Drawing.Point(304, 168)
        Me.lstErrorLog2.Name = "lstErrorLog2"
        Me.lstErrorLog2.Size = New System.Drawing.Size(304, 147)
        Me.lstErrorLog2.TabIndex = 24
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(240, 8)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(312, 16)
        Me.Label7.TabIndex = 25
        Me.Label7.Text = "Minimum clan players needed to survive SoD to save points:"
        '
        'txtPNum
        '
        Me.txtPNum.Location = New System.Drawing.Point(560, 8)
        Me.txtPNum.Name = "txtPNum"
        Me.txtPNum.Size = New System.Drawing.Size(48, 20)
        Me.txtPNum.TabIndex = 26
        Me.txtPNum.Text = "2"
        '
        'btnGold
        '
        Me.btnGold.Location = New System.Drawing.Point(512, 120)
        Me.btnGold.Name = "btnGold"
        Me.btnGold.Size = New System.Drawing.Size(96, 24)
        Me.btnGold.TabIndex = 27
        '
        'frmMain
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(618, 328)
        Me.Controls.Add(Me.btnGold)
        Me.Controls.Add(Me.txtPNum)
        Me.Controls.Add(Me.Label7)
        Me.Controls.Add(Me.lstErrorLog2)
        Me.Controls.Add(Me.lstErrorLog)
        Me.Controls.Add(Me.btnStop)
        Me.Controls.Add(Me.btnTBL)
        Me.Controls.Add(Me.txtTBL)
        Me.Controls.Add(Me.Label6)
        Me.Controls.Add(Me.lblTMR)
        Me.Controls.Add(Me.lblStatus)
        Me.Controls.Add(Me.btnSandurrA)
        Me.Controls.Add(Me.btnSQL)
        Me.Controls.Add(Me.btnDB)
        Me.Controls.Add(Me.btnUSR)
        Me.Controls.Add(Me.btnPW)
        Me.Controls.Add(Me.btnTMR)
        Me.Controls.Add(Me.txtTMR)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.txtPW)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.txtUSR)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.txtDB)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.txtSQL)
        Me.Controls.Add(Me.Label1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.MaximizeBox = False
        Me.Name = "frmMain"
        Me.Text = "Clan SoD Score System Manager (Made by Sandurr)"
        CType(Me.Timer, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Dim strSQL As String
    Dim strDB As String
    Dim strUSR As String
    Dim strPW As String
    Dim strTMR As String
    Dim strTBL As String

    Dim strTXTPNUMOLD As String = "2"

    Dim strErrorLog As String = ""
    Dim strErrorLog2 As String = ""

    Dim bReady As Boolean = False
    Dim iReady As Integer = 0
    Dim aReady(6) As Integer

    Dim connectionString As String

    Dim strQuery As String
    Dim objConn, objReader, objCommand
    Dim objConn2, objReader2, objCommand2
    Dim objConn3, objReader3, objCommand3

    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lblStatus.Text = "Welcome... Made by Sandurr... Licensed to rPT"
        lblTMR.Text = "0"

        Dim i As Integer
        For i = 1 To 6
            aReady(i) = 0
        Next i
    End Sub

    Private Sub btnSQL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSQL.Click
        strSQL = txtSQL.Text

        If aReady(1) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(1) = 1
        End If
        lblStatus.Text = "Set SQL"
    End Sub

    Private Sub btnDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDB.Click
        strDB = txtDB.Text

        If aReady(2) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(2) = 1
        End If
        lblStatus.Text = "Set DB"
    End Sub

    Private Sub btnUSR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUSR.Click
        strUSR = txtUSR.Text

        If aReady(3) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(3) = 1
        End If
        lblStatus.Text = "Set USR"
    End Sub

    Private Sub btnPW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPW.Click
        strPW = txtPW.Text

        If aReady(4) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(4) = 1
        End If
        lblStatus.Text = "Set PW"
    End Sub

    Private Sub btnTMR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTMR.Click
        Dim strTMRt As String
        strTMRt = txtTMR.Text
        If IsNumeric(strTMRt) = True Then
            If strTMRt > 0 Then
                strTMR = (CInt(strTMRt) * 1000)
                Timer.Interval = strTMR
            Else
                MsgBox("Must be higher than 0")
            End If
        Else
            MsgBox("Must be a numeric")
        End If

        If aReady(5) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(5) = 1
        End If
        lblStatus.Text = "Set TMR"
    End Sub

    Private Sub btnTBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTBL.Click
        strTBL = txtTBL.Text

        If aReady(6) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(6) = 1
        End If
        lblStatus.Text = "Set TBL"
    End Sub

    Private Sub btnSandurrA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSandurrA.Click
        If iReady >= 6 And bReady = True Then
            Timer.Enabled = True
            btnSandurrA.Enabled = False
            btnSQL.Enabled = False
            btnDB.Enabled = False
            btnUSR.Enabled = False
            btnPW.Enabled = False
            btnTMR.Enabled = False
            btnTBL.Enabled = False
            btnStop.Enabled = True

            lstErrorLog.Items.Clear()
            lstErrorLog2.Items.Clear()

            connectionString = "server='" & strSQL & "'; user id='" & strUSR & "'; password='" & strPW & "'; database='" & strDB & "'"
            objConn = New System.Data.SqlClient.SqlConnection(connectionString)
            objConn3 = New System.Data.SqlClient.SqlConnection(connectionString)
            connectionString = "server='" & strSQL & "'; user id='" & strUSR & "'; password='" & strPW & "'; database='ClanDB'"
            objConn2 = New System.Data.SqlClient.SqlConnection(connectionString)
            objConn.Open()
            objConn2.Open()
            objConn3.Open()

            lblStatus.Text = "Activated"
        End If
    End Sub

    Private Sub Timer_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer.Elapsed
        If bReady = True Then
            lblTMR.Text = CInt(CInt(lblTMR.Text) + 1)
            'SoD Stuff
            strQuery = "SELECT CharName, ServerTime, TotalPoint, SuccessUser FROM " & strTBL
            objCommand = New System.Data.SqlClient.SqlCommand(strQuery, objConn)
            objReader = objCommand.ExecuteReader()

            Dim tCharName As String
            Dim tCharName2 As String
            Dim tTPoint As Integer
            Dim tTime As Integer
            Dim tSU As Integer
            Dim tClanName As String
            Dim tClanName2 As String
            Dim tCurPoint As Integer
            Dim tCPoint As Integer
            Dim tPNum As Integer

            While objReader.Read()
                tPNum = 0
                tCharName = objReader.Item(0)
                tTime = objReader.Item(1)
                tTPoint = objReader.Item(2)
                tSU = objReader.Item(3)

                If tTPoint > 0 Or tSU >= CInt(strTXTPNUMOLD) Then
                    tClanName = GetClan(tCharName)
                    If Not tClanName = "" Then
                        tPNum = 1
                        tCurPoint = GetClanPoint(tClanName)

                        strQuery = "SELECT CharName, Point FROM " & strTBL & " WHERE ServerTime='" & tTime & "' AND TotalPoint='" & tTPoint & "' AND SuccessUser='" & tSU & "'"
                        objCommand3 = New System.Data.SqlClient.SqlCommand(strQuery, objConn3)
                        objReader3 = objCommand3.ExecuteReader()

                        While objReader3.Read()
                            tCharName2 = objReader3.Item(0)
                            tCPoint = objReader3.Item(1)
                            If tCPoint > 0 Then
                                If Not tCharName2 = tCharName Then
                                    tClanName2 = GetClan(tCharName2)
                                    If tClanName2 = tClanName Then
                                        tPNum = tPNum + 1
                                    Else
                                        tTPoint = tTPoint - tCPoint
                                    End If
                                End If
                            End If
                        End While
                        objReader3.Close()

                        If tPNum >= CInt(strTXTPNUMOLD) And tTPoint > tCurPoint Then
                            lstErrorLog.Items.Add("SaveData: " & tClanName & "(tPNum:" & tPNum & " & tTPoint:" & tTPoint & ")")
                            ClanInsertClanScore(tClanName, tTPoint)
                        Else
                            lstErrorLog2.Items.Add("NoSaveData: " & tClanName & "(tPNum:" & tPNum & " & tTPoint:" & tTPoint & ")")
                        End If
                    End If
                End If
            End While

            objReader.Close()
        End If
    End Sub

    Private Sub ClanInsertClanScore(ByRef strClanName As String, ByRef iTotalPoint As Integer)
        strQuery = "UPDATE CL SET Cpoint='" & iTotalPoint & "' WHERE ClanName='" & strClanName & "'"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        objReader2.Close()
    End Sub

    Private Function GetClan(ByRef strCharName As String) As String
        strQuery = "SELECT ClanName FROM UL WHERE ChName='" & strCharName & "'"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        If objReader2.Read() Then
            GetClan = objReader2.GetString(0)
        Else
            GetClan = ""
        End If

        objReader2.Close()
    End Function

    Private Function GetClanPoint(ByRef strClanName As String) As Integer
        strQuery = "SELECT Cpoint FROM CL WHERE ClanName='" & strClanName & "'"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        If objReader2.Read() Then
            GetClanPoint = objReader2.GetInt32(0)
        Else
            GetClanPoint = ""
        End If

        objReader2.Close()
    End Function

    Private Sub frmMain_Closed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closed
        If iReady = 6 And btnSandurrA.Enabled = False And bReady = True Then
            objConn.Close()
            objConn2.Close()
            objConn3.Close()
        End If
    End Sub

    Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
        btnStop.Enabled = False
        btnSandurrA.Enabled = True
        Timer.Enabled = False

        lblStatus.Text = "Stopped service..."
        lblTMR.Text = "0"

        Dim i As Integer
        For i = 1 To 6
            aReady(i) = 0
        Next i

        btnSQL.Enabled = True
        btnDB.Enabled = True
        btnUSR.Enabled = True
        btnPW.Enabled = True
        btnTMR.Enabled = True
        btnTBL.Enabled = True

        bReady = False
        iReady = 0
    End Sub

    Private Sub txtPNum_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPNum.TextChanged
        If IsNumeric(txtPNum) = False Then
            txtPNum.Text = strTXTPNUMOLD
        Else
            strTXTPNUMOLD = txtPNum.Text
        End If
    End Sub

    Private Sub btnGold_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGold.Click
        If Timer.Enabled = False Then
            Exit Sub
        End If
        Dim iCurGold As Long
        Dim strNewGold As String
        Dim iNewGold As Long

        Dim strCSoD As String = GetSoDClan()
        Dim strCurSoDGold As String = GetSoDClanMoney(strCSoD)

        If IsNumeric(strCurSoDGold) = True Then
            iCurGold = CInt(strCurSoDGold)
        Else
            iCurGold = 0
        End If

PutGold:
        strNewGold = InputBox("Currently the SoD Owning Clan (" & strCSoD & ") has " & iCurGold & " Clan Money." & vbNewLine & "How much Clan Money do you want to ADD?", "SoD Clan Money", "0")

        If IsNumeric(strNewGold) = False Then
            GoTo PutGOld
        End If

        iNewGold = CInt(strNewGold)
        iNewGold = iCurGold + iNewGold

        SetSoDClanMoney(strCSoD, iNewGold)

        MsgBox("New Clan Money for " & strCSoD & " is " & iNewGold, MsgBoxStyle.OKOnly & MsgBoxStyle.Information, "New Clan Money")
    End Sub

    Private Sub SetSoDClanMoney(ByRef strClanName As String, ByRef iTotalPoint As Integer)
        If Timer.Enabled = False Then
            Exit Sub
        End If
        strQuery = "UPDATE CL SET ClanMoney='" & iTotalPoint & "' WHERE ClanName='" & strClanName & "'"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        objReader2.Close()
    End Sub

    Private Function GetSoDClanMoney(ByRef strClanName As String) As String
        If Timer.Enabled = False Then
            Exit Function
        End If
        strQuery = "SELECT ClanMoney FROM CL WHERE ClanName='" & strClanName & "'"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        If objReader2.Read() Then
            GetSoDClanMoney = objReader2.Item(0)
        End If

        objReader2.Close()
    End Function

    Private Function GetSoDClan() As String
        If Timer.Enabled = False Then
            Exit Function
        End If
        strQuery = "SELECT ClanName FROM CL ORDER BY Cpoint DESC"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        If objReader2.Read() Then
            GetSoDClan = objReader2.Item(0)
        End If

        objReader2.Close()
    End Function
End Class
 
Newbie Spellweaver
Joined
Jun 17, 2009
Messages
33
Reaction score
1
CSM was distributed with SQL files to replace clan and SoD rank tables, and instructions to delete the ones that come with the server and then create new ones (with a different structure) from the supplied SQL scripts.

I've never got sandurrs CSM to actually work, but some people have suggested to me that it isn't reliable for Number of Players <= 2. I hear that it checks that there are that many players in SoD at once, and that they are competing with another Clan and that they are all in the same Clan. That's pretty difficult logic to get right for 1 player.

I can't see how the logic would be flawed for less than 3 players, provided there where at least 3 players in each of at least 3 Clans, and can think how to reduce those 3s to 2s. However, it's not uncommon to require such logic to have a "first record" and a "last record" which must be unique from all records in-between. With only 1 record to choose from, the unique nature of 1st, and last is lost, let alone a minimum 1 unique record between.

I don't have the foggiest clue how to read this .Net shizzle, but for the reference of anyone who does:-
Code:
Public Class frmMain
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents txtSQL As System.Windows.Forms.TextBox
    Friend WithEvents txtDB As System.Windows.Forms.TextBox
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents txtUSR As System.Windows.Forms.TextBox
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents txtPW As System.Windows.Forms.TextBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents txtTMR As System.Windows.Forms.TextBox
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents btnTMR As System.Windows.Forms.Button
    Friend WithEvents btnPW As System.Windows.Forms.Button
    Friend WithEvents btnUSR As System.Windows.Forms.Button
    Friend WithEvents btnDB As System.Windows.Forms.Button
    Friend WithEvents btnSQL As System.Windows.Forms.Button
    Friend WithEvents btnSandurrA As System.Windows.Forms.Button
    Friend WithEvents lblStatus As System.Windows.Forms.Label
    Friend WithEvents lblTMR As System.Windows.Forms.Label
    Friend WithEvents Timer As System.Timers.Timer
    Friend WithEvents btnTBL As System.Windows.Forms.Button
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents txtTBL As System.Windows.Forms.TextBox
    Friend WithEvents btnStop As System.Windows.Forms.Button
    Friend WithEvents lstErrorLog As System.Windows.Forms.ListBox
    Friend WithEvents lstErrorLog2 As System.Windows.Forms.ListBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents txtPNum As System.Windows.Forms.TextBox
    Friend WithEvents btnGold As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmMain))
        Me.Label1 = New System.Windows.Forms.Label
        Me.txtSQL = New System.Windows.Forms.TextBox
        Me.txtDB = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.txtUSR = New System.Windows.Forms.TextBox
        Me.Label3 = New System.Windows.Forms.Label
        Me.txtPW = New System.Windows.Forms.TextBox
        Me.Label4 = New System.Windows.Forms.Label
        Me.txtTMR = New System.Windows.Forms.TextBox
        Me.Label5 = New System.Windows.Forms.Label
        Me.btnTMR = New System.Windows.Forms.Button
        Me.btnPW = New System.Windows.Forms.Button
        Me.btnUSR = New System.Windows.Forms.Button
        Me.btnDB = New System.Windows.Forms.Button
        Me.btnSQL = New System.Windows.Forms.Button
        Me.btnSandurrA = New System.Windows.Forms.Button
        Me.lblStatus = New System.Windows.Forms.Label
        Me.lblTMR = New System.Windows.Forms.Label
        Me.Timer = New System.Timers.Timer
        Me.btnTBL = New System.Windows.Forms.Button
        Me.txtTBL = New System.Windows.Forms.TextBox
        Me.Label6 = New System.Windows.Forms.Label
        Me.btnStop = New System.Windows.Forms.Button
        Me.lstErrorLog = New System.Windows.Forms.ListBox
        Me.lstErrorLog2 = New System.Windows.Forms.ListBox
        Me.Label7 = New System.Windows.Forms.Label
        Me.txtPNum = New System.Windows.Forms.TextBox
        Me.btnGold = New System.Windows.Forms.Button
        CType(Me.Timer, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(8, 8)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(56, 16)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "SQL"
        '
        'txtSQL
        '
        Me.txtSQL.Location = New System.Drawing.Point(64, 8)
        Me.txtSQL.Name = "txtSQL"
        Me.txtSQL.Size = New System.Drawing.Size(128, 20)
        Me.txtSQL.TabIndex = 1
        Me.txtSQL.Text = "127.0.0.1"
        '
        'txtDB
        '
        Me.txtDB.Location = New System.Drawing.Point(64, 32)
        Me.txtDB.Name = "txtDB"
        Me.txtDB.Size = New System.Drawing.Size(128, 20)
        Me.txtDB.TabIndex = 3
        Me.txtDB.Text = "SOD2DB"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(8, 32)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(56, 16)
        Me.Label2.TabIndex = 2
        Me.Label2.Text = "DB"
        '
        'txtUSR
        '
        Me.txtUSR.Location = New System.Drawing.Point(64, 56)
        Me.txtUSR.Name = "txtUSR"
        Me.txtUSR.Size = New System.Drawing.Size(128, 20)
        Me.txtUSR.TabIndex = 5
        Me.txtUSR.Text = "sa"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(8, 56)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(56, 16)
        Me.Label3.TabIndex = 4
        Me.Label3.Text = "USR"
        '
        'txtPW
        '
        Me.txtPW.Location = New System.Drawing.Point(64, 80)
        Me.txtPW.Name = "txtPW"
        Me.txtPW.PasswordChar = Microsoft.VisualBasic.ChrW(42)
        Me.txtPW.Size = New System.Drawing.Size(128, 20)
        Me.txtPW.TabIndex = 7
        Me.txtPW.Text = ""
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(8, 80)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(56, 16)
        Me.Label4.TabIndex = 6
        Me.Label4.Text = "PW"
        '
        'txtTMR
        '
        Me.txtTMR.Location = New System.Drawing.Point(64, 104)
        Me.txtTMR.Name = "txtTMR"
        Me.txtTMR.Size = New System.Drawing.Size(128, 20)
        Me.txtTMR.TabIndex = 9
        Me.txtTMR.Text = "10"
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(8, 104)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(56, 16)
        Me.Label5.TabIndex = 8
        Me.Label5.Text = "TMR"
        '
        'btnTMR
        '
        Me.btnTMR.Location = New System.Drawing.Point(200, 104)
        Me.btnTMR.Name = "btnTMR"
        Me.btnTMR.Size = New System.Drawing.Size(32, 16)
        Me.btnTMR.TabIndex = 10
        Me.btnTMR.Text = "set"
        '
        'btnPW
        '
        Me.btnPW.Location = New System.Drawing.Point(200, 80)
        Me.btnPW.Name = "btnPW"
        Me.btnPW.Size = New System.Drawing.Size(32, 16)
        Me.btnPW.TabIndex = 11
        Me.btnPW.Text = "set"
        '
        'btnUSR
        '
        Me.btnUSR.Location = New System.Drawing.Point(200, 56)
        Me.btnUSR.Name = "btnUSR"
        Me.btnUSR.Size = New System.Drawing.Size(32, 16)
        Me.btnUSR.TabIndex = 12
        Me.btnUSR.Text = "set"
        '
        'btnDB
        '
        Me.btnDB.Location = New System.Drawing.Point(200, 32)
        Me.btnDB.Name = "btnDB"
        Me.btnDB.Size = New System.Drawing.Size(32, 16)
        Me.btnDB.TabIndex = 13
        Me.btnDB.Text = "set"
        '
        'btnSQL
        '
        Me.btnSQL.Location = New System.Drawing.Point(200, 8)
        Me.btnSQL.Name = "btnSQL"
        Me.btnSQL.Size = New System.Drawing.Size(32, 16)
        Me.btnSQL.TabIndex = 14
        Me.btnSQL.Text = "set"
        '
        'btnSandurrA
        '
        Me.btnSandurrA.Enabled = False
        Me.btnSandurrA.Location = New System.Drawing.Point(240, 32)
        Me.btnSandurrA.Name = "btnSandurrA"
        Me.btnSandurrA.Size = New System.Drawing.Size(368, 80)
        Me.btnSandurrA.TabIndex = 16
        Me.btnSandurrA.Text = "Activate"
        '
        'lblStatus
        '
        Me.lblStatus.Location = New System.Drawing.Point(8, 152)
        Me.lblStatus.Name = "lblStatus"
        Me.lblStatus.Size = New System.Drawing.Size(512, 16)
        Me.lblStatus.TabIndex = 17
        Me.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'lblTMR
        '
        Me.lblTMR.Location = New System.Drawing.Point(536, 152)
        Me.lblTMR.Name = "lblTMR"
        Me.lblTMR.Size = New System.Drawing.Size(72, 16)
        Me.lblTMR.TabIndex = 18
        Me.lblTMR.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'Timer
        '
        Me.Timer.Interval = 60000
        Me.Timer.SynchronizingObject = Me
        '
        'btnTBL
        '
        Me.btnTBL.Location = New System.Drawing.Point(200, 128)
        Me.btnTBL.Name = "btnTBL"
        Me.btnTBL.Size = New System.Drawing.Size(32, 16)
        Me.btnTBL.TabIndex = 21
        Me.btnTBL.Text = "set"
        '
        'txtTBL
        '
        Me.txtTBL.Location = New System.Drawing.Point(64, 128)
        Me.txtTBL.Name = "txtTBL"
        Me.txtTBL.Size = New System.Drawing.Size(128, 20)
        Me.txtTBL.TabIndex = 20
        Me.txtTBL.Text = "SOD2RecBySandurr"
        '
        'Label6
        '
        Me.Label6.Location = New System.Drawing.Point(8, 128)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(56, 16)
        Me.Label6.TabIndex = 19
        Me.Label6.Text = "TBL"
        '
        'btnStop
        '
        Me.btnStop.Enabled = False
        Me.btnStop.Location = New System.Drawing.Point(240, 120)
        Me.btnStop.Name = "btnStop"
        Me.btnStop.Size = New System.Drawing.Size(264, 24)
        Me.btnStop.TabIndex = 22
        Me.btnStop.Text = "Stop"
        '
        'lstErrorLog
        '
        Me.lstErrorLog.Location = New System.Drawing.Point(8, 168)
        Me.lstErrorLog.Name = "lstErrorLog"
        Me.lstErrorLog.Size = New System.Drawing.Size(288, 147)
        Me.lstErrorLog.TabIndex = 23
        '
        'lstErrorLog2
        '
        Me.lstErrorLog2.Location = New System.Drawing.Point(304, 168)
        Me.lstErrorLog2.Name = "lstErrorLog2"
        Me.lstErrorLog2.Size = New System.Drawing.Size(304, 147)
        Me.lstErrorLog2.TabIndex = 24
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(240, 8)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(312, 16)
        Me.Label7.TabIndex = 25
        Me.Label7.Text = "Minimum clan players needed to survive SoD to save points:"
        '
        'txtPNum
        '
        Me.txtPNum.Location = New System.Drawing.Point(560, 8)
        Me.txtPNum.Name = "txtPNum"
        Me.txtPNum.Size = New System.Drawing.Size(48, 20)
        Me.txtPNum.TabIndex = 26
        Me.txtPNum.Text = "2"
        '
        'btnGold
        '
        Me.btnGold.Location = New System.Drawing.Point(512, 120)
        Me.btnGold.Name = "btnGold"
        Me.btnGold.Size = New System.Drawing.Size(96, 24)
        Me.btnGold.TabIndex = 27
        '
        'frmMain
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(618, 328)
        Me.Controls.Add(Me.btnGold)
        Me.Controls.Add(Me.txtPNum)
        Me.Controls.Add(Me.Label7)
        Me.Controls.Add(Me.lstErrorLog2)
        Me.Controls.Add(Me.lstErrorLog)
        Me.Controls.Add(Me.btnStop)
        Me.Controls.Add(Me.btnTBL)
        Me.Controls.Add(Me.txtTBL)
        Me.Controls.Add(Me.Label6)
        Me.Controls.Add(Me.lblTMR)
        Me.Controls.Add(Me.lblStatus)
        Me.Controls.Add(Me.btnSandurrA)
        Me.Controls.Add(Me.btnSQL)
        Me.Controls.Add(Me.btnDB)
        Me.Controls.Add(Me.btnUSR)
        Me.Controls.Add(Me.btnPW)
        Me.Controls.Add(Me.btnTMR)
        Me.Controls.Add(Me.txtTMR)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.txtPW)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.txtUSR)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.txtDB)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.txtSQL)
        Me.Controls.Add(Me.Label1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.MaximizeBox = False
        Me.Name = "frmMain"
        Me.Text = "Clan SoD Score System Manager (Made by Sandurr)"
        CType(Me.Timer, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Dim strSQL As String
    Dim strDB As String
    Dim strUSR As String
    Dim strPW As String
    Dim strTMR As String
    Dim strTBL As String

    Dim strTXTPNUMOLD As String = "2"

    Dim strErrorLog As String = ""
    Dim strErrorLog2 As String = ""

    Dim bReady As Boolean = False
    Dim iReady As Integer = 0
    Dim aReady(6) As Integer

    Dim connectionString As String

    Dim strQuery As String
    Dim objConn, objReader, objCommand
    Dim objConn2, objReader2, objCommand2
    Dim objConn3, objReader3, objCommand3

    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lblStatus.Text = "Welcome... Made by Sandurr... Licensed to rPT"
        lblTMR.Text = "0"

        Dim i As Integer
        For i = 1 To 6
            aReady(i) = 0
        Next i
    End Sub

    Private Sub btnSQL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSQL.Click
        strSQL = txtSQL.Text

        If aReady(1) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(1) = 1
        End If
        lblStatus.Text = "Set SQL"
    End Sub

    Private Sub btnDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDB.Click
        strDB = txtDB.Text

        If aReady(2) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(2) = 1
        End If
        lblStatus.Text = "Set DB"
    End Sub

    Private Sub btnUSR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUSR.Click
        strUSR = txtUSR.Text

        If aReady(3) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(3) = 1
        End If
        lblStatus.Text = "Set USR"
    End Sub

    Private Sub btnPW_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPW.Click
        strPW = txtPW.Text

        If aReady(4) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(4) = 1
        End If
        lblStatus.Text = "Set PW"
    End Sub

    Private Sub btnTMR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTMR.Click
        Dim strTMRt As String
        strTMRt = txtTMR.Text
        If IsNumeric(strTMRt) = True Then
            If strTMRt > 0 Then
                strTMR = (CInt(strTMRt) * 1000)
                Timer.Interval = strTMR
            Else
                MsgBox("Must be higher than 0")
            End If
        Else
            MsgBox("Must be a numeric")
        End If

        If aReady(5) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(5) = 1
        End If
        lblStatus.Text = "Set TMR"
    End Sub

    Private Sub btnTBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTBL.Click
        strTBL = txtTBL.Text

        If aReady(6) = 0 Then
            iReady += 1
            If iReady >= 6 Then
                bReady = True
                btnSandurrA.Enabled = True
            Else
                btnSandurrA.Enabled = False
            End If
            aReady(6) = 1
        End If
        lblStatus.Text = "Set TBL"
    End Sub

    Private Sub btnSandurrA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSandurrA.Click
        If iReady >= 6 And bReady = True Then
            Timer.Enabled = True
            btnSandurrA.Enabled = False
            btnSQL.Enabled = False
            btnDB.Enabled = False
            btnUSR.Enabled = False
            btnPW.Enabled = False
            btnTMR.Enabled = False
            btnTBL.Enabled = False
            btnStop.Enabled = True

            lstErrorLog.Items.Clear()
            lstErrorLog2.Items.Clear()

            connectionString = "server='" & strSQL & "'; user id='" & strUSR & "'; password='" & strPW & "'; database='" & strDB & "'"
            objConn = New System.Data.SqlClient.SqlConnection(connectionString)
            objConn3 = New System.Data.SqlClient.SqlConnection(connectionString)
            connectionString = "server='" & strSQL & "'; user id='" & strUSR & "'; password='" & strPW & "'; database='ClanDB'"
            objConn2 = New System.Data.SqlClient.SqlConnection(connectionString)
            objConn.Open()
            objConn2.Open()
            objConn3.Open()

            lblStatus.Text = "Activated"
        End If
    End Sub

    Private Sub Timer_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer.Elapsed
        If bReady = True Then
            lblTMR.Text = CInt(CInt(lblTMR.Text) + 1)
            'SoD Stuff
            strQuery = "SELECT CharName, ServerTime, TotalPoint, SuccessUser FROM " & strTBL
            objCommand = New System.Data.SqlClient.SqlCommand(strQuery, objConn)
            objReader = objCommand.ExecuteReader()

            Dim tCharName As String
            Dim tCharName2 As String
            Dim tTPoint As Integer
            Dim tTime As Integer
            Dim tSU As Integer
            Dim tClanName As String
            Dim tClanName2 As String
            Dim tCurPoint As Integer
            Dim tCPoint As Integer
            Dim tPNum As Integer

            While objReader.Read()
                tPNum = 0
                tCharName = objReader.Item(0)
                tTime = objReader.Item(1)
                tTPoint = objReader.Item(2)
                tSU = objReader.Item(3)

                If tTPoint > 0 Or tSU >= CInt(strTXTPNUMOLD) Then
                    tClanName = GetClan(tCharName)
                    If Not tClanName = "" Then
                        tPNum = 1
                        tCurPoint = GetClanPoint(tClanName)

                        strQuery = "SELECT CharName, Point FROM " & strTBL & " WHERE ServerTime='" & tTime & "' AND TotalPoint='" & tTPoint & "' AND SuccessUser='" & tSU & "'"
                        objCommand3 = New System.Data.SqlClient.SqlCommand(strQuery, objConn3)
                        objReader3 = objCommand3.ExecuteReader()

                        While objReader3.Read()
                            tCharName2 = objReader3.Item(0)
                            tCPoint = objReader3.Item(1)
                            If tCPoint > 0 Then
                                If Not tCharName2 = tCharName Then
                                    tClanName2 = GetClan(tCharName2)
                                    If tClanName2 = tClanName Then
                                        tPNum = tPNum + 1
                                    Else
                                        tTPoint = tTPoint - tCPoint
                                    End If
                                End If
                            End If
                        End While
                        objReader3.Close()

                        If tPNum >= CInt(strTXTPNUMOLD) And tTPoint > tCurPoint Then
                            lstErrorLog.Items.Add("SaveData: " & tClanName & "(tPNum:" & tPNum & " & tTPoint:" & tTPoint & ")")
                            ClanInsertClanScore(tClanName, tTPoint)
                        Else
                            lstErrorLog2.Items.Add("NoSaveData: " & tClanName & "(tPNum:" & tPNum & " & tTPoint:" & tTPoint & ")")
                        End If
                    End If
                End If
            End While

            objReader.Close()
        End If
    End Sub

    Private Sub ClanInsertClanScore(ByRef strClanName As String, ByRef iTotalPoint As Integer)
        strQuery = "UPDATE CL SET Cpoint='" & iTotalPoint & "' WHERE ClanName='" & strClanName & "'"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        objReader2.Close()
    End Sub

    Private Function GetClan(ByRef strCharName As String) As String
        strQuery = "SELECT ClanName FROM UL WHERE ChName='" & strCharName & "'"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        If objReader2.Read() Then
            GetClan = objReader2.GetString(0)
        Else
            GetClan = ""
        End If

        objReader2.Close()
    End Function

    Private Function GetClanPoint(ByRef strClanName As String) As Integer
        strQuery = "SELECT Cpoint FROM CL WHERE ClanName='" & strClanName & "'"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        If objReader2.Read() Then
            GetClanPoint = objReader2.GetInt32(0)
        Else
            GetClanPoint = ""
        End If

        objReader2.Close()
    End Function

    Private Sub frmMain_Closed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closed
        If iReady = 6 And btnSandurrA.Enabled = False And bReady = True Then
            objConn.Close()
            objConn2.Close()
            objConn3.Close()
        End If
    End Sub

    Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
        btnStop.Enabled = False
        btnSandurrA.Enabled = True
        Timer.Enabled = False

        lblStatus.Text = "Stopped service..."
        lblTMR.Text = "0"

        Dim i As Integer
        For i = 1 To 6
            aReady(i) = 0
        Next i

        btnSQL.Enabled = True
        btnDB.Enabled = True
        btnUSR.Enabled = True
        btnPW.Enabled = True
        btnTMR.Enabled = True
        btnTBL.Enabled = True

        bReady = False
        iReady = 0
    End Sub

    Private Sub txtPNum_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPNum.TextChanged
        If IsNumeric(txtPNum) = False Then
            txtPNum.Text = strTXTPNUMOLD
        Else
            strTXTPNUMOLD = txtPNum.Text
        End If
    End Sub

    Private Sub btnGold_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGold.Click
        If Timer.Enabled = False Then
            Exit Sub
        End If
        Dim iCurGold As Long
        Dim strNewGold As String
        Dim iNewGold As Long

        Dim strCSoD As String = GetSoDClan()
        Dim strCurSoDGold As String = GetSoDClanMoney(strCSoD)

        If IsNumeric(strCurSoDGold) = True Then
            iCurGold = CInt(strCurSoDGold)
        Else
            iCurGold = 0
        End If

PutGold:
        strNewGold = InputBox("Currently the SoD Owning Clan (" & strCSoD & ") has " & iCurGold & " Clan Money." & vbNewLine & "How much Clan Money do you want to ADD?", "SoD Clan Money", "0")

        If IsNumeric(strNewGold) = False Then
            GoTo PutGOld
        End If

        iNewGold = CInt(strNewGold)
        iNewGold = iCurGold + iNewGold

        SetSoDClanMoney(strCSoD, iNewGold)

        MsgBox("New Clan Money for " & strCSoD & " is " & iNewGold, MsgBoxStyle.OKOnly & MsgBoxStyle.Information, "New Clan Money")
    End Sub

    Private Sub SetSoDClanMoney(ByRef strClanName As String, ByRef iTotalPoint As Integer)
        If Timer.Enabled = False Then
            Exit Sub
        End If
        strQuery = "UPDATE CL SET ClanMoney='" & iTotalPoint & "' WHERE ClanName='" & strClanName & "'"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        objReader2.Close()
    End Sub

    Private Function GetSoDClanMoney(ByRef strClanName As String) As String
        If Timer.Enabled = False Then
            Exit Function
        End If
        strQuery = "SELECT ClanMoney FROM CL WHERE ClanName='" & strClanName & "'"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        If objReader2.Read() Then
            GetSoDClanMoney = objReader2.Item(0)
        End If

        objReader2.Close()
    End Function

    Private Function GetSoDClan() As String
        If Timer.Enabled = False Then
            Exit Function
        End If
        strQuery = "SELECT ClanName FROM CL ORDER BY Cpoint DESC"
        objCommand2 = New System.Data.SqlClient.SqlCommand(strQuery, objConn2)
        objReader2 = objCommand2.ExecuteReader()

        If objReader2.Read() Then
            GetSoDClan = objReader2.Item(0)
        End If

        objReader2.Close()
    End Function
End Class


nothing happen.. :/ how works... the CSM??

he create a rec file if the SOd starts?? or if the sod ends??
Need the CSM a Sql.dll??
 
Newbie Spellweaver
Joined
Aug 29, 2009
Messages
92
Reaction score
4
you need wait ...... run clansodmanager .
check sod point.
 
Newbie Spellweaver
Joined
Jun 17, 2009
Messages
33
Reaction score
1
soo i start the Server.exe .. start the CSM then i go in the SOd ..win the round for sure
its 1 Player CSM = 1 Clan member need to survive

then i check the SQL manager .. in the SoD2DB and nothing showing there.. after 2 hour too ^^

so with sql.dll and without
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
You do have SoD score recorded in the logs don't you? Yes, it works via SQL.dll. Well, it relies on the log files which are produced by SQL.dll.
 
Newbie Spellweaver
Joined
Jun 17, 2009
Messages
33
Reaction score
1
You do have SoD score recorded in the logs don't you? Yes, it works via SQL.dll. Well, it relies on the log files which are produced by SQL.dll.


065107|GameServer EyePT
065107|g_LogPath C:\Logs
065107|g_szAccountIP USER\SQLEXPRESS
065107|BillingDbIP USER\SQLEXPRESS
065107|g_szLogIP USER\SQLEXPRESS
065107|g_szBillingLogIP USER\SQLEXPRESS
065107|g_szCountryCheck 0
065107|g_szPCCheck 0
065107|g_szPCDBIP USER\SQLEXPRESS
065107|g_szClanDBIP USER\SQLEXPRESS
065107| GetRegistryInfo End

065107|SiegeMoneyTax lpszClanMarkNum [2] lpszTt [0] lpszTax [10]
065107|SiegeMoneyTax lpszTt=0

065155|SQLLogon===== icro22's sRet[1] lpszGPCode[0] lpszDisuseDay [1607727600] lpszUsePeriod [0] lpszPCRNo [0] [32]
065251|ClanMoney [icro22] lpszClanMoney [0] Gubun 0
065251|RET ClanMoney [icro22] 0
065834|SiegeMoneyTax lpszClanMarkNum [2] lpszTt [0] lpszTax [10]
065834|SiegeMoneyTax lpszTt=0

070601|SiegeMoneyTax lpszClanMarkNum [2] lpszTt [0] lpszTax [10]
070601|SiegeMoneyTax lpszTt=0

071329|SiegeMoneyTax lpszClanMarkNum [2] lpszTt [0] lpszTax [10]
071329|SiegeMoneyTax lpszTt=0

072057|SiegeMoneyTax lpszClanMarkNum [2] lpszTt [0] lpszTax [10]
072057|SiegeMoneyTax lpszTt=0

072825|SiegeMoneyTax lpszClanMarkNum [2] lpszTt [0] lpszTax [10]
072825|SiegeMoneyTax lpszTt=0

072858|ServerExit

this is the log actually
 
Moderator
Staff member
Moderator
Joined
Feb 22, 2008
Messages
2,404
Reaction score
723
the magic is here:

Private Sub Timer_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer.Elapsed
If bReady = True Then
lblTMR.Text = CInt(CInt(lblTMR.Text) + 1)
'SoD Stuff
strQuery = "SELECT CharName, ServerTime, TotalPoint, SuccessUser FROM " & strTBL
objCommand = New System.Data.SqlClient.SqlCommand(strQuery, objConn)
objReader = objCommand.ExecuteReader()


Dim tCharName As String
Dim tCharName2 As String
Dim tTPoint As Integer
Dim tTime As Integer
Dim tSU As Integer
Dim tClanName As String
Dim tClanName2 As String
Dim tCurPoint As Integer
Dim tCPoint As Integer
Dim tPNum As Integer


While objReader.Read()
tPNum = 0
tCharName = objReader.Item(0)
tTime = objReader.Item(1)
tTPoint = objReader.Item(2)
tSU = objReader.Item(3)


If tTPoint > 0 Or tSU >= CInt(strTXTPNUMOLD) Then
tClanName = GetClan(tCharName)
If Not tClanName = "" Then
tPNum = 1
tCurPoint = GetClanPoint(tClanName)


strQuery = "SELECT CharName, Point FROM " & strTBL & " WHERE ServerTime='" & tTime & "' AND TotalPoint='" & tTPoint & "' AND SuccessUser='" & tSU & "'"
objCommand3 = New System.Data.SqlClient.SqlCommand(strQuery, objConn3)
objReader3 = objCommand3.ExecuteReader()


While objReader3.Read()
tCharName2 = objReader3.Item(0)
tCPoint = objReader3.Item(1)
If tCPoint > 0 Then
If Not tCharName2 = tCharName Then
tClanName2 = GetClan(tCharName2)
If tClanName2 = tClanName Then
tPNum = tPNum + 1
Else
tTPoint = tTPoint - tCPoint
End If
End If
End If
End While
objReader3.Close()


If tPNum >= CInt(strTXTPNUMOLD) And tTPoint > tCurPoint Then
lstErrorLog.Items.Add("SaveData: " & tClanName & "(tPNum:" & tPNum & " & tTPoint:" & tTPoint & ")")
ClanInsertClanScore(tClanName, tTPoint)
Else
lstErrorLog2.Items.Add("NoSaveData: " & tClanName & "(tPNum:" & tPNum & " & tTPoint:" & tTPoint & ")")
End If
End If
End If
End While


objReader.Close()
End If
End Sub
you could try running the queries manually. probably the error is in one of the queries
 
Newbie Spellweaver
Joined
Aug 29, 2009
Messages
92
Reaction score
4
i think you need delete Sod2db and creat new sod2db with script by shabug clansystem 2.0 ,
edit all file by your host. and change sql.reg file with your host.
good luck !
 
Custom Title Activated
Loyal Member
Joined
May 26, 2007
Messages
5,545
Reaction score
1,315
i think you need delete Sod2db and creat new sod2db with script by shabug clansystem 2.0 ,
edit all file by your host. and change sql.reg file with your host.
Shagpub ClanSystem 2.0 is a repack of sandurr clan system. (Credit is given) He just packaged it in a convenient way, with the scripts and stuff that you need, and none of the crap that was in the many of the other archives being passed around. (evidencing that he actually understood what sandurr had done and wasn't just a leeching nubstickle XD)
 
Back
Top