Mirage Source

Free ORPG making software.
It is currently Tue Apr 23, 2024 6:05 am

All times are UTC




Post new topic Reply to topic  [ 268 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next
Author Message
PostPosted: Mon Oct 15, 2007 3:06 pm 
Offline
Newbie

Joined: Tue Nov 07, 2006 11:58 pm
Posts: 12
Currently, I am working with some code that hopefully when finished will accomplish the fallowing task. What I want is so that every time there is a player killer event, it increases your score based on the level difference (Less then, Equal, or greater then). However, I don't know how to use MySQL and I have no intention of learning it currently, so this left me with only one option... .ini files, which I have never used before. I was getting some help from someone on the basics (get var/putvar) but unfortinatly I need some more assistance. For anyone interested, I'll give you as much information as possible on what I want, and what I already have done...

- Upon Char creation it creates a new line in the .ini file ( CharName = 0 )
- Upon char deletion, it deletes that character in the .ini file
- Every time someone kills someone else, it increses the killers score in the .ini file
- Based on a timer on the client (or another good idea if anyone has one), it sends a packet to the server and requests the information from it.
----------------
Here are the segments of code that I have currently...


::Server Side::

- The packet (unfinished)
Code:
        ' :::::::::::::::::::::::::::::
        ' :: Player Killer LB packet ::
        ' :::::::::::::::::::::::::::::
        If LCase(Parse(0)) = CPNPKLLeader Then
            Call PlayerMsg(Index, "Packet is retreiveing new player killer information", Red)
            '***Retreive information***
        End If
    Exit Sub


- In the AddChar sub, near the bottom before it saves, I added this to create a new char on the ini file
Code:
        ' Saves the chars name to 0 on the player leaderboards
        Dim FileName As String
        FileName = App.Path & "\Data\PKLeaderboards.ini"
        Call PutVar(FileName, "PVP Kill Leaderboard", Trim(Player(Index).Char(CharNum).Name), "0")


- In modGameLogic, under "Has been deemed a player killer!" I placed this, and two others simler to it to act out different senerios for killing...

Code:
      Dim PKLAmount As Integer, PKTotal As Integer
      Dim FileName As String
               
      ' Kill a lower level player
      If Player(Attacker).Level > Player(Victim).Level Then
          PKLAmount = 5
          FileName = App.Path & "\Data\PKLeaderboards.ini"
          PKTotal = GetVar(FileName, "PVP Kill Leaderboard", Trim(Player(Index).Char(CharNum).Name))
          Call PutVar(FileName, "PVP Kill Leaderboard", Trim(Player(Index).Char(CharNum).Name), PKTotal + PKLAmount)
      End If


::Client Sided::

- Packet Information

Code:
Sub PKLPacket(ByVal First As Integer, second As Integer, third As Integer)
Dim Packet As String

    Packet = CPNPKLLeader & SEP_CHAR & First & SEP_CHAR & second & SEP_CHAR & third & SEP_CHAR & END_CHAR
    Call SendData(Packet)
End Sub


This is basically all I have currently. If you can give me some segments of code or an idea on how to delete the line for the "DelChar" sub, that would be a good start for me. I also need help with displaying the information onto the frmMirage once I get the packet sending the information back and fourth.

Pleas and thank you!


Top
 Profile  
 
PostPosted: Mon Oct 15, 2007 3:11 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Actually, you can use binary.

DelChar actually just sets everything to 0 and saves it, so have a look around.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Mon Oct 15, 2007 3:15 pm 
Offline
Newbie

Joined: Tue Nov 07, 2006 11:58 pm
Posts: 12
Well yes, but to the player, you are deleting your char and cannot use it anymore (its name disappears from the list so to speak), And when that happens to them, then I want it to disappear from the .ini file for the leaderboard. The best I can see currently is setting it to zero, then perhaps I could add some more code in the client so that when the packet comes back, if the name is equal to 0 then it just dose not display.... That might actually work now that I think about it...


Top
 Profile  
 
PostPosted: Mon Oct 15, 2007 7:16 pm 
Offline
Regular

Joined: Mon May 29, 2006 6:04 pm
Posts: 66
you could also load in the entire PKlist removing any player names that = 0
I would recommend not adding the player to the list until they have their first kill


Top
 Profile  
 
PostPosted: Mon Oct 15, 2007 10:39 pm 
Offline
Newbie

Joined: Tue Nov 07, 2006 11:58 pm
Posts: 12
Thats a possibility, and would incorperate a sort of, "This is the highest killer ever..." kind of thing.. Not sure were I would place this though.


Top
 Profile  
 
PostPosted: Tue Oct 16, 2007 12:27 am 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
I recommend not basing a request on the client side with a timer.

What happens if I set that timer interval to, say, 1ms? Your server gets bogged down.

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
PostPosted: Tue Oct 16, 2007 3:40 pm 
Offline
Newbie

Joined: Tue Nov 07, 2006 11:58 pm
Posts: 12
So you suggest placing it on the Server? That wouldn't be much more trouble... Every couple mins it sends a packet to update the leaderboard...


Top
 Profile  
 
PostPosted: Tue Oct 16, 2007 3:52 pm 
Why not update the leaderboard when the player accesses it?


Top
  
 
PostPosted: Tue Oct 16, 2007 9:48 pm 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
Just export it to the website at a timed interval, the more kills and players there are, the more strain it's going to cause to create the list.


Top
 Profile  
 
PostPosted: Tue Oct 16, 2007 9:48 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Don't export anything on a timer.

Just export it when it's changed.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Tue Oct 16, 2007 9:51 pm 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
But if people are PKing often, wont that rape with lag?
Especially with INI files.


Top
 Profile  
 
PostPosted: Tue Oct 16, 2007 9:57 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Robin wrote:
use binary.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Tue Oct 16, 2007 10:23 pm 
Offline
Knowledgeable
User avatar

Joined: Mon Jul 24, 2006 2:04 pm
Posts: 339
Rezeyu wrote:
But if people are PKing often, wont that rape with lag?
Especially with INI files.


Combination of both, then.

Code:
If StatusChanged Then
   If EnoughTimeElapsed Then...


Not like you'd need to update more than every hour or so, though.

_________________
NetGore Free Open Source MMORPG Maker


Top
 Profile  
 
PostPosted: Tue Oct 16, 2007 10:24 pm 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
Yeah, I would just update every hour, or every day, or whatever. It doesn't need to be to-the-minute.

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
PostPosted: Tue Oct 16, 2007 10:25 pm 
Why not use a separate program to do what Rez said? Make the list, export it to a website, to be included in an html or php page..?

Just have it read directly from the account files and what not.

Wouldn't cause any lag, would it?


Top
  
 
PostPosted: Tue Oct 16, 2007 10:47 pm 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
No, probably not.

The problem comes-
What happens when the server is writing a file and the list exporter is reading one? Something has to fail :P You would have to add extra error checking in the server, or make the exporter send a message to the server that says, "wait, i'm reading these quick"

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
PostPosted: Tue Oct 16, 2007 11:13 pm 
Dave wrote:
No, probably not.

The problem comes-
What happens when the server is writing a file and the list exporter is reading one? Something has to fail :P You would have to add extra error checking in the server, or make the exporter send a message to the server that says, "wait, i'm reading these quick"


There are ways around that.


Top
  
 
PostPosted: Wed Oct 17, 2007 7:20 pm 
Offline
Newbie

Joined: Tue Nov 07, 2006 11:58 pm
Posts: 12
What I am going to do, every time there is a change to the .ini file, then it will send that value to the clients. I have absoultly no idea how to do this. Any ideas people?


Top
 Profile  
 
PostPosted: Wed Oct 17, 2007 11:02 pm 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
Packet = "packetname" & SEP_CHAR & data1 & SEP_CHAR & ... & SEP_CHAR & END_CHAR

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
PostPosted: Thu Oct 18, 2007 12:36 am 
Offline
Newbie

Joined: Tue Nov 07, 2006 11:58 pm
Posts: 12
Apart from my way of comparing levels is not yet completed (more or less, what I thought would work dose not), I have just one more task because I can set up the packet. I am not sure how to get all of the information on the text file stored in an array... Like, I can get an individual one, with a specific name in mind, but not all of them into an array at once. Any ideas?


Top
 Profile  
 
PostPosted: Thu Oct 18, 2007 12:46 am 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
Dim Array(0 to len) as long
Dim t as long
Dim i as long

For i = 0 to len
t = GetVar(yourCatagory, i)
Array(i) = t
Next i


Something like that?

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
PostPosted: Fri Oct 19, 2007 1:49 am 
Offline
Newbie

Joined: Tue Nov 07, 2006 11:58 pm
Posts: 12
Its late at night and my mind is just not functioning... If that is it, wonderful, I'll try it... If not, this is basically what I need...

Array(0) = FirstCharNameValue (Which will be like, Sh4d0ws = 0)
Array(1) = SecondCharName (etc...)


Top
 Profile  
 
PostPosted: Fri Oct 19, 2007 5:25 am 
Offline
Community Leader
User avatar

Joined: Sun May 28, 2006 10:29 pm
Posts: 1762
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com
In order to do it in a loop, you would need each name assigned a number.

_________________
I'm on Facebook! Google Plus LinkedIn My Youtube Channel Send me an email Call me with Skype Check me out on Bitbucket Yup, I'm an EVE Online player!
Why not try my app, ColorEye, on your Android devlce?
Do you like social gaming? Fight it out in Battle Juice!

I am a professional software developer in Salt Lake City, UT.


Top
 Profile  
 
PostPosted: Wed Dec 08, 2021 4:52 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 483837
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтsemiasphalticfluxсайтсайтсайт
сайтсайтсайтсайтсайтсайтhttp://taskreasoning.ruсайтсайтсайтинфосайтсайтtuchkasсайтсайт


Top
 Profile  
 
PostPosted: Tue Feb 08, 2022 5:36 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 483837
hila135.9PERFPERFMarvEricCreaHeinXVIIBurtMornRickKeviLoveJohnXVIIOrieSpecmailRobeFranJackVenu
ReneAlanAretremiDaleBIOSRevelaisEmmaXVIIDomaReadLiliKarlXVIIMartHoneStewPatrOpusCherCoheCred
DailWillXXIXRexaVasiNintWestJameFallAlmoEnjoELEGGesiMcDoBlacJuliBatiFeliMichKarlLaVyEricHenn
TereMichModoKoffFallMatiCircVictWoolDeLiFredRobeNikiCoteZoneParaDistKinoDaisXVIICuddWALLAway
ZoneEGSiEkelKirkZoneZoneLawySusaZoneBranZoneZoneZoneZoneMORGCarnSummZoneWPATZoneElecZoneZone
ZoneChriLippminiDAXXWillZanuVestBakuCrisDONKBookMorgWWQiChicGiglMistWoodRefeFORDWinddomaJazz
GellleftVicthearAliaAlbeAutoWindJohnKaspClasSmilMoonPremEukaDolpWindWindEricBreaSoulBETEMarg
XVIIXVIIHeriBriaAcadGrunHermAcadStifCharBrutMikhMikhVareLeszestaDaniFredPhilAlexPansNormWind
NineTimeVickHubeKaneSynaJackNekoSeymLibeDioxcoloTotaTodaApplAnniSomeJameStepAlleLighminimini
miniNazaTchaBridliveAndrEstoFeatWillNeleEnglCambAlthtuchkasWindwwwr


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 268 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group