Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Aranshada

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by Aranshada

  1. OP won't respond. He already took down his site and unplugged his modem. He scurred.
  2. This is just… so great... words... cannot describe.
  3. @S.J.R.: > Neither are important, because of the fact that server optimisation i.e. reprogramming the server to be optimal is **far more important** (no exceptions). Hardware is fine nowadays, most software isn't. > > Regards, > Stephan. "Hardware makes a computer fast. Software makes a fast computer slow." Amen? Amen.
  4. I've been using a good mix of Ubuntu and Windows XP for years now. I run an Ubuntu Server machine out of my house that does my web hosting and houses most of my programming project, so I can work on them from anywhere. I dual boot my laptop with Vista (it came with it) and Ubuntu, and for my main rig I usually boot Windows XP and just hop on my server or fire up a VM when I need Linux. I've tried several other distros including DSL, CenOS, LinuxMint, openSUSE, Slackware, and Backtrack (I'm sure I'm leaving a few out), but nothing even comes close to how nice it is to have the whole apt/aptitude package management setup. Almost everything I've ever needed on any Ubuntu system exists in the repository, and updating things is so easy, I have an alias set up so I can hit my shortcut to bring up a terminal (Ctrl+Alt+R), and type "doup" which expands to "doupgrades" (thank you tab completion), and it'll update the local package cache, search for updates, and download/install them. Hell, the alias was just 'cause I got sick of typing "sudo apt-get update; sudo apt-get -y upgrade;". Yes, it's that easy. And you even get to see exactly what's being downloaded, how much has been downloaded, and how much has been installed - much better than the crappy Winblows system that just says, "Yeah, we're still doing stuff. Hold on." with no visible sign that anything is actually happening. Linux can be a little frustrating at time, especially with wireless drivers, but support for old and even newer machines is simply amazing. The only reason I use Windows anymore is for gaming. When you design a game for a certain platform, you really have to use that platform (i.e. Windows instead of Linux/Wine), which is also why I'm against porting console games to PC because they ALWAYS manage to duck it up. Once you get used to it, the way Linux does some things makes more sense (not all things, but definitely a lot of things). tl;dr Coming from an experienced Linux user, it's a lot of give and take, and I advocate the use of each operating system under different circumstances. I like Linux for servers and development (when the target is Linux machines). I like Windows for gaming and… schoolwork that requires you to submit documents as .docx, or when you're in some stupid Database Concepts class that requires you to submit .accdb files every other ducking day.
  5. @Robin: > You're all wrong. The rapture happened but no one was taken up. All religions were bullshit and all of us are sinners. You are a visionary, sir.
  6. Talked to a guy who says he's a Pagan in training to be a High Priest. His view is that the date was actually the beginning of the end of the world "as we know it." He said the date was significant because it was the day that the Faye, including Centaurs and Faeries (things he mentioned specifically), would begin to show themselves and then wage war on the humans to take back the world. Yes, he really believes that. No, I don't know what he's smoking.
  7. Shook my ducking world, man. > There is no such thing as a free choice while being emotionally attached to a belief system. The moment we are self-aware enough to realize this, we can truly work together to figure out the real odds of what will benefit us the most.
  8. If you're going for the code-based one that checks the status every server loop, it'd be something more like this: ``` ' Note: not intended to be real code that should be copy/pasted into the engine '*************************************** ' After a player kills another player, set their timer ' to the current tick + 900000 ticks, so the timer ' actually points to 15 minutes in the future '*************************************** ' Note: not sure if engine still uses GetTickCount() or some other API Player(index).PkTimer = GetTickCount() + 900000 '----------------------------------------------------- '*************************************** ' In the main server loop, check their timer against the current tick ' If the current tick, i.e. our current position in time, is ' greater-than-or-equal-to their PkTimer (which was originally ' set to be 15 minutes in the future), then we have passed ' the mark for that timer, i.e. we're now 15 minutes since that timer was set, ' so we can set it back to 0 '*************************************** If GetTickCount() >= Player(index).PkTimer Then Player(index).PkTimer = 0 End If ``` Using a single PkTimer variable also eliminates the need for a "Boolean PkStatus" variable because we can just check if PkTimer is > 0. ``` Function IsPlayerPk(index) If Player(index).PkTimer > 0 Then IsPlayerPk = True Else IsPlayerPk = False End If End Function ``` Something like that would work to set and reset their PK status at the appropriate times, with the function provided being how you would check if they had a True/False PK status based on the value of the PkTimer.
  9. [http://www.xtremevbtalk.com/archive/index.php/t-122382.html](http://www.xtremevbtalk.com/archive/index.php/t-122382.html) This is what Google spat out about it.
  10. That's because the error has nothing to do with loading a file. You stated the error as: > Subscript out of range run time error 9 This is the RTE that occurs when you try to access an array element that is out of the bounds of the array. You also mentioned that the error occurs on: > getplayersprite(index) This would hint that the index being passed into GetPlayerSprite(), which from looking at that line of code would be the value of MyIndex, is out of the array bounds for the Player array. Start by looking at the value of MyIndex when the error occurs. If it's out of the array bounds, which I suspect it is, then start looking for how it could have been set incorrectly.
  11. It is possible to interface a VB6 program to a database because the language was designed (as Robin keeps pointing out) as a RAD database frontend. Granted, I've never considered interfacing it with MySQL, a quick google search reveals [http://paulbradley.tv/37/](http://paulbradley.tv/37/) as a quick and dirty (and I do mean dirty) look into getting started. Another possibility is that it stores them in a flat file database, just like the rest of the data on the server. As for pulling users from a wordpress site, I've never dealt with the site so I have no idea if you could pull the users from that database. Even then, there's the issue of pulling all of their passwords so you can transfer them. As for having the server connect directly to the wordpress database, that's probably not going to happen for obvious security reasons. People don't like giving random people database access. It goes against the tenements of good database administration. tl;dr It's possible to access a database from VB6 (that's what it was designed for). It's also possible to use the web scripts (or compiled cgi binaries) to take the registration info and save it directly to a flat file like the server traditionally used, in which case there would be no need for the server to access a database because it could just open some regular files and read the data from there.
  12. Aranshada

    Remain…

    Players, Players everywhere.
  13. (I put this at the top so you are free to skip everything else I say) tl;dr You need some way to tell when the event happened and when 15 minutes have passed since that event happened. This can be done with timers either from a control or in the code. –---------------------------------------------------------------------------- To give you an idea of how to get started: You can either use an actual timer object or you can use a "code timer" (for lack of a better term). A timer object you could set to generate an event every minute, and then you could decrement some "RemainingPkTime" from the player. RemainingPkTime will start at 15 when they kill someone. This won't be exact because they could kill right before the timer fires or right after it fires, so they could end up closer to 14 or 16 minutes. Another way would be to, god forbid, create a timer object for each player that's disabled until they kill someone, they they just have a "isPk" status set to True. The timer is set to fire in 15 minute intervals, and when it fires it changes isPk to false and disables itself. The above two ways are somewhat clunky, with the second method being especially horrible. I provided it only as an example of multiple ways to solve the problem. The other method is through what I can only call a "code timer." It's how most of Mirage (and I assume EO) used to work. Some variable is set to a Tick, and each loop through the server there is a check to see if the current Tick the server is on is a certain amount above when the variable was set. There are two problems with this: 1\. it requires checking the value every server loop, but I suppose it's not that bad, 2\. if a player logs out, waits the 15 minutes, and logs back in (if their variable is saved to a file) they will have their Pk status reset immediately because their variable stored the Tick for over 15 minutes ago, and the server will check that old variable against the new tick. The other way to work a code timer would be to have some variable in the server that stores a tick, and then when one second has passed it calls a function that decreases all of the Pk timers (which would be at something like 900,000 for 15 minutes). Of course, this is then just a code-based version of an actual timer control, and not a very good one because it has to check the value every server loop and then call the function every second. A better solution is to simply tweak the very first solution, with the timer set to 1 minute, to a timer set to 1 second. That'll give you finer control over how long they have Pk status (because it'll only be off by .999 seconds at the most). Unfortunately, this still leaves you with a timer firing every second. In the end, you just need to fulfill the requirements of the tl;dr at the top, and there are many ways to do it, some good, some bad, some great, and some horrible.
  14. From what I understand, the engine takes the dimensions of the sprite and calls that the space that your character occupies. So instead of a 32x64 sprite, you're ending up with a 96x128 sprite (because you padded each side with an extra 32 pixels of transparent space). The reason your sprite stops before you hit the bottom of the map is because of that 32 pixel padding you added to the bottom. Your character is being calculated as 96 pixels wide and 128 pixels tall, a full 64 pixels larger for each dimension. There are two options I can see: 1\. Eliminate the padding and have a regular 32x64 sprite. 2\. Modify the code so that the boundaries are no longer linked to the sprite dimensions and are instead specified as a numeric literal… or just modify the calculation so the boundaries take into account 32 pixels of padding on each side.
  15. I never played on the official one, but I did play on the remake that I believe GSD and a few others made.
  16. I used to be very involved in the PW scene until everything started merging into one site and then gradually fading away. I also did some work with Elysium back in the day, but only released like 2-3 tutorials. I was mostly a debugger and general programming knowledge guy. Haven't really been around for at least 3 years… maybe longer.
  17. A cursory glance at your client code flow reveals that you're calling TcpInit before you set your options in Main. Note: I'm at work right now, so I don't have VB6, and I'm just reading through the code with some syntax highlighting. Here is your main routine: ``` Public Sub Main() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Call TcpInit Options.Game_Name = "Eclipse Origins" Options.IP = "localhost" Options.Port = 7001 frmMain.Show ' Error handler Exit Sub errorhandler: HandleError "Main", "modGeneral", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ``` Here is your TcpInit routine: ``` Sub TcpInit() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set PlayerBuffer = New clsBuffer ' connect frmMain.sckSocket.RemoteHost = Options.IP frmMain.sckSocket.RemotePort = Options.Port ' Error handler Exit Sub errorhandler: HandleError "TcpInit", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ``` Notice how TcpInit is called from Main BEFORE you set the IP and Port fields of your Options variable. This means that when the fields are set on the socket, you're using the default values for Options.IP and Options.Port. This means that later once you click your "Connect" button, it's most likely trying to connect to Host "" on Port 0. Move the call to TcpInit below where you set Options.Port = 7001.
  18. That would work, but there's no reason to make separate conditionals that have the same result. This: ``` If Item(itemnum).Type = ITEM_TYPE_CURRENCY Then HasItem = GetPlayerInvItemValue(index, i) ElseIf Item(itemnum).Type = ITEM_TYPE_QUESTITEM Then HasItem = GetPlayerInvItemValue(index, i) Else HasItem = 1 End If ```could be rewritten better as this: ``` If Item(itemnum).Type = ITEM_TYPE_CURRENCY Or Item(itemnum).Type = ITEM_TYPE_QUESTITEM Then HasItem = GetPlayerInvItemValue(index, i) Else HasItem = 1 End If ```See what I did there? I linked the two conditions with an Or, so if either of those conditions matches, it will return the value. Also, the example code you posted: ``` If HasItem(index, 15) >= 5 Then ```was exactly what I was talking about because then you have minimal modification of the function, and you simply check the value that HasItem returns to see if the value is within a certain range - hence, you understand situation 2.
  19. A few questions: 1\. Do you only want exact values? That's what I see in the code right now - it can only match the exact value. You could add another parameter to try to check less-than/greater-than/equal-to, or you could just assume greater-than-or-equal-to. 2\. Are you updating all calls to HasItem to include the third parameter? If you aren't, then it should be producing errors for every call to HasItem(index, num) without the third 'itemval' parameter. Easy fix for that is make the third parameter optional and default to zero. 3\. Also, this will check value on every single item type, and some item types don't necessarily have a value, or the value doesn't mean anything. You'll probably want to restrict the value checking to certain item types, unless you're certain that all items where value doesn't matter will have a value of zero, in which case the default for itemval described in question 2 would be okay since it would match anyway. Or you could expand the innermost conditional to include item types other than currency, because the function actually returns the value and not just a 1 if the item type is currency. Using that, you wouldn't need to check for itemval inside of the function, and you could simply check the returned value yourself in the calling code, which would eliminate the need for any value checks in the function. In short: 1\. You're going to need to modify the function a bit OR 2\. Use the return value to do your own checks from the calling code. Honestly, the simpler answer is probably going to be the second one because it gives you more flexibility in the calling code and keeps the function simpler than it would be if you added stuff in to fit situation 1.
  20. ``` Private Sub menuFileLoad_Click() ' set error handling On Error GoTo Err ' setup common dialog properties commDialog.DialogTitle = "Load picture" commDialog.Filter = "Image Files (*.bmp, *.jpg, *.png)|*.bmp; *.jpg; *.png|All Files (*.*)|*.*" commDialog.ShowOpen ' load picture if file name was chosen If commDialog.FileName vbNullString Then frmMain.Picture = LoadPicture(commDialog.FileName) End If Exit Sub Err: ' if there's an error, we don't care, just tell them and leave Call MsgBox("There was an error while loading the picture.") End Sub ``` Just tested this. Small program with one form, one menu, one menu item, File > Load (Ctrl +L), and one Microsoft Common Dialog Control named 'commDialog.' It opens an "Open File" dialog and loads the resulting picture straight into the form. So change frmMain.Picture to picSomething.Picture and you're gold. Grats, you just made me write the first complete VB6 program I've done in three years.
  21. Look into Microsoft Common Dialog Control and the ShowOpen method, and don't forget to to set the filter.
  22. The first time I even check in to see how things are doing since… well, half a decade... and I find a My Little Pony fansite. You have no idea the joy this brought me. Thank you.
×
×
  • Create New...