kira423 Posted May 19, 2012 Share Posted May 19, 2012 Okay so when I save a blank serial it will save, and it will give out the item when the player hits the claim button with a blank text box, but it WILL NOT save a serial that has a number as it crashes the server, I am a bit of a newb so looking at the code I have no idea what the issue is, but it seems to me that something that is being sent (the serial 'name') to the server isn't defined for it to save. Link to comment Share on other sites More sharing options...
kurenai Posted June 15, 2012 Share Posted June 15, 2012 How To Fix Link to comment Share on other sites More sharing options...
Growlith1223 Posted June 15, 2012 Share Posted June 15, 2012 in modConstants add```Public Const MAX_SERIAL_NUMBER As Long = 100```I think it was. Link to comment Share on other sites More sharing options...
kurenai Posted June 15, 2012 Share Posted June 15, 2012 @Arcanine1223:> in modConstants add> ```> Public Const MAX_SERIAL_NUMBER As Long = 100> > ```I think it was.Thank you very muchEDIT : Link to comment Share on other sites More sharing options...
abhi2011 Posted June 15, 2012 Share Posted June 15, 2012 I am not sure, but a hunch. have you added the sub handlesaveserial? And when does this occur? Link to comment Share on other sites More sharing options...
PVJsquad Posted June 16, 2012 Author Share Posted June 16, 2012 @kurenai:> Thank you very much> > EDIT :> > > Are you sure place the code in bottom **modHandleData**```' SerialSub HandleEditSerial(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)  Dim Buffer As clsBuffer  ' Prevent hacking  If GetPlayerAccess(Index) < ADMIN_DEVELOPER Then    Exit Sub  End If  Set Buffer = New clsBuffer  Buffer.WriteLong SSerialEditor  SendDataTo Index, Buffer.ToArray()  Set Buffer = NothingEnd SubSub HandleRequestSerial(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)  SendSerial IndexEnd SubPrivate Sub HandleSaveSerial(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)  Dim SerialNum As Long  Dim Buffer As clsBuffer  Dim SerialSize As Long  Dim SerialData() As Byte  ' Prevent hacking  If GetPlayerAccess(Index) < ADMIN_DEVELOPER Then    Exit Sub  End If  Set Buffer = New clsBuffer  Buffer.WriteBytes Data()  SerialNum = Buffer.ReadLong  ' Prevent hacking  If SerialNum < 0 Or SerialNum > MAX_SERIAL_NUMBER Then    Exit Sub  End If  SerialSize = LenB(Serial(SerialNum))  ReDim SerialData(SerialSize - 1)  SerialData = Buffer.ReadBytes(SerialSize)  CopyMemory ByVal VarPtr(Serial(SerialNum)), ByVal VarPtr(SerialData(0)), SerialSize  ' Save it  Call SendUpdateSerialToAll(SerialNum)  Call SaveSerialNumber(SerialNum)  Call AddLog(GetPlayerName(Index) & " saved Serial Code #" & SerialNum & ".", ADMIN_LOG)End Sub``` Link to comment Share on other sites More sharing options...
BeNjO Posted June 16, 2012 Share Posted June 16, 2012 nm it does work :) Link to comment Share on other sites More sharing options...
kurenai Posted June 17, 2012 Share Posted June 17, 2012 Yes, I do it. Link to comment Share on other sites More sharing options...
lcarens Posted July 20, 2012 Share Posted July 20, 2012 Still getting crashes from the Save button, but for those who actually know what they are doing, the server crashes after displaying the message 'mengirim data…', which means it is crashing either after Sub SendUpdateSerialToAll, or Sub SendUpdateSerialsTo. (Both can be found in modServerTCP)I'll be trying to fix this in the meantime. Link to comment Share on other sites More sharing options...
lcarens Posted July 20, 2012 Share Posted July 20, 2012 Process: [client side]User clicks smdSave [Call SerialEditorOk]SerialEditorOk [calls SendSaveSerial(i) if Serial_Changed = 1 To MAX_SERIAL_NUMBER]SendSaveSerial [buffer.WriteLong CSaveSerial]–SERVER SIDE--CSaveSerial [HandleDataSub(CSaveSerial) = GetAddress(AddressOf HandleSaveSerial)]HandleSaveSerial [Call SaveSerialNumber]SaveSerialNumber [This is where the error is located.]```Sub SaveSerialNumber(ByVal SerialNum As Long)  Dim filename As String  Dim F As Long  filename = App.Path & "\data\serial\" & SerialNum & ".dat"  F = FreeFile  Open filename For Binary As #F    Put #F, , Serial(SerialNum)  Close #FEnd Sub```That section of code must be where the error is. I'll do some testing.Edit: The crashing line is 'Put #F, , Serial(SerialNum)' Link to comment Share on other sites More sharing options...
lcarens Posted July 20, 2012 Share Posted July 20, 2012 Upon closer inspection, the line is fine, but the Serial(SerialNum) seems to be passed incorrectly. If I comment out the whole line, the sub runs fine, but doesn't save the serial in a dat file. If the serial inserted into the frmEditor_Serial is blank, then the sub runs fine too. And, SaveSerialNumber is called upon server startup if the (number).dat files do not exist in the /serial/ folder, and that has no problem. Therefore, the problem must be the Serial(SerialNum), which means that I will have to go back through the program to determine what exactly happens with it.Edit: OK, I give up. What I think is happening is that the Serial part of Serial(SerialNum) is not getting passed at all, and when the Server tries to write that to a file, it crashes. But I have pretty much no experience with VB6, so if someone else would take a look at it, that would be great. Link to comment Share on other sites More sharing options...
Dawntide Posted July 30, 2012 Share Posted July 30, 2012 I get an error here:```'///////////////////'// Game Editor //'///////////////////Public Sub SerialEditorInit()  If frmEditor_Serial.Visible = False Then Exit Sub  EditorIndex = frmEditor_Serial.lstIndex.ListIndex + 1  With frmEditor_Serial    .txtName.text = Serial(EditorIndex).Name    .scrlItem.Value = Serial(EditorIndex).Item    .HScroll1.Value = Serial(EditorIndex).ItemValue  End With  Serial_Changed(EditorIndex) = TrueEnd Sub```line:```EditorIndex = frmEditor_Serial.lstIndex.ListIndex + 1```Error: "method or data member not found" at```.lstIndex.```I think the error is cause of this: "add the frmEditor_Serial in attachfile"i do not know what you mean with that, i just created a new form called frmEditor_Serialhow to make attachfile, help me fix this please Link to comment Share on other sites More sharing options...
Dawntide Posted August 9, 2012 Share Posted August 9, 2012 Could someone please fix this tutorial? It is not saving and its giving crashes, so please fix it. Link to comment Share on other sites More sharing options...
Wortel Angels Posted August 9, 2012 Share Posted August 9, 2012 You can use the codes only 1 time ;-) else you need to change the code a bit Link to comment Share on other sites More sharing options...
Dawntide Posted August 9, 2012 Share Posted August 9, 2012 the weird thing is. When i start the server in debug mode, i can save new codes and redeem them. but the listbox does not show anything, it doesnt show codes or anything else, it is just blank as it were at beginning.when i start the server normally without debug mode, i can't save new codes because the server crashes when i try to save them.so either way there is something wrong Link to comment Share on other sites More sharing options...
Alerd Posted October 13, 2012 Share Posted October 13, 2012 dont work ;Xvariable not defined >>SSerialEditor Link to comment Share on other sites More sharing options...
WiseRock Posted November 14, 2012 Share Posted November 14, 2012 Could someone re upload the attachment files this is such a good tutorial please Link to comment Share on other sites More sharing options...
orcywoo Posted November 23, 2012 Share Posted November 23, 2012 Bumping because the attachment files are needed for this.  Link to comment Share on other sites More sharing options...
WiseRock Posted November 24, 2012 Share Posted November 24, 2012 Last Bump needs the attachments please  Link to comment Share on other sites More sharing options...
WiseRock Posted December 2, 2012 Share Posted December 2, 2012 Final Last Bump Attachments please Link to comment Share on other sites More sharing options...
Wortel Angels Posted December 2, 2012 Share Posted December 2, 2012 > Started by [GoldSide](http://www.touchofdeathforums.com/community/index.php?/user/65994-goldside/), 14 Apr 2012This topic is not longer supported…Make your own form xD its not so hard you can get the names from the code Link to comment Share on other sites More sharing options...
abhi2011 Posted December 4, 2012 Share Posted December 4, 2012 Why wouldn't a topic be supported anymore? It should rather be GoldSide left so the attachments will never be added. Link to comment Share on other sites More sharing options...
WiseRock Posted December 5, 2012 Share Posted December 5, 2012 I need the code for the Serial Editor Link to comment Share on other sites More sharing options...
WiseRock Posted February 17, 2013 Share Posted February 17, 2013 Its easy to get the names for the form but its the code that goes with the forms I need Link to comment Share on other sites More sharing options...
PVJsquad Posted February 19, 2013 Author Share Posted February 19, 2013 The Tutorial Is **UnderConstruction**  Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now