Mirage Engine
check the name of a player even if he is offline... - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: check the name of a player even if he is offline... (/showthread.php?tid=173)

Pages: 1 2


check the name of a player even if he is offline... - Gilgamesch - 07-07-2006

hey,

how can i change something in the player account data even if he isnt online? for example his name, the only way i know is this:

n = isplaying(name)

setplayername(n,"his name")



hopefully you know what i mean Smile


thanks!


- Tosuxo - 07-07-2006

getvar and putvar i guess... hmmmm

you'll have to know their account info though... maybe if you make an accounts list tool and char list tool... so it gets all accounts from the server (their names) and so on... but this would be VERY laggy if there are alot of accounts...


- Matt - 07-07-2006

Why don't you just make him log off, and then change his name in his account?


- Gilgamesch - 07-07-2006

Advocate Wrote:Why don't you just make him log off, and then change his name in his account?

so, you mean, let the player log off, and then i just change it? if you mean this, nope, because i use this for something else...actually, what i want is this:

i have the Players name, and lets say he is offline, i can still change or do stuff with the client, because i am an admin, k?

thanks


- Misunderstood - 07-07-2006

with the client?
you cant talk to the client if they arent connected to you. lol.


- Matt - 07-07-2006

I think he wants to be able to edit player accounts from the client.


- Gilgamesch - 07-07-2006

Advocate Wrote:I think he wants to be able to edit player accounts from the client.
exactly, but even if they are offline Smile

we are getting closer xD


- Tosuxo - 07-07-2006

notepad.

lol, nah, erm... i'm trying to think of a way that wouldn't require the server to load ALL accounts.... that would take up too much RAM etc... and make the game aloooot slower.... give me awhile lol


- grimsk8ter11 - 07-07-2006

Me and mis ran into this problem.

We removed characters so the players are directly editable. Account = player :-D


Alternatively yopu could open every file and search for the name, possibly save the account name with with the character names in charlist.txt?


- Matt - 07-07-2006

Just change the charlist.txt to an ini, and have the account name as the header, and list the characters they have under the header.


- Gilgamesch - 07-07-2006

grimsk8ter11 Wrote:Alternatively yopu could open every file and search for the name, possibly save the account name with with the character names in charlist.txt?

yeah, bu thow do i open each file and read it?


- Tosuxo - 07-07-2006

yeh, for Monster Trainer, i've changed things majorly with account saving, i've made a new thing altogether for each single player, they have a player save for their monsters. this means i can just find the file by entering the player name. then I can make an inbuild-editor for monsters e.g. "give levelup" etc. Looks good anyway


- Robin - 07-07-2006

Whats that got to do with his problem?


- Tosuxo - 07-07-2006

Kite Wrote:Whats that got to do with his problem?

duh.... that he should make a system like was mentioned so that it splits accounts and players apart so it has accounts folder and players folder... i was just explaining what use it has


- Robin - 07-07-2006

but this doesnt tell him how to edit their stats when they are offline.

if the stats aren't loaded into the server, you are going to need to read the values out of the ini, change them accordingly and then write the new values into the ini, then erase all the variables used by the server to save RAM, Gilgamesch.


- Tosuxo - 07-07-2006

Kite Wrote:but this doesnt tell him how to edit their stats when they are offline.

if the stats aren't loaded into the server, you are going to need to read the values out of the ini, change them accordingly and then write the new values into the ini, then erase all the variables used by the server to save RAM, Gilgamesch.

if they're offline... it won't have the info stored in RAM... or would it? :S

otherwise if they're online you just call saveplayer(index) and that'll save the player and, i guess, update the stats for the player too, or you'd have to call senddatatoall(updatedstats & sep_char & shit)

so really it's not THAT hard... it's just like... updating items


- Robin - 07-07-2006

It's not. All the items are saved into the RAM of the server because the data is constantly being sent and recieved. Players are not loaded up unless they are online, so we need a different method to check data in offline players.


- Gilgamesch - 07-07-2006

nah tosuxo...if i did that the player HAS to be online..thats the problem :/

because "index" is the number of the player that is online, for example if 10 people are online, the number of you can be between 0 (not sure if its not 1 ) and 10, it depend on when you logged in, k?


but, how can i read them out of the ini?
oh, and kite, if you have time, could you help me with that in msn? and then i post it for the others here, in case someone else needs it too Smile

thanks guys!!!


- Tosuxo - 07-07-2006

Gilgamesch Wrote:nah tosuxo...if i did that the player HAS to be online..thats the problem :/

because "index" is the number of the player that is online, for example if 10 people are online, the number of you can be between 0 (not sure if its not 1 ) and 10, it depend on when you logged in, k?


but, how can i read them out of the ini?
oh, and kite, if you have time, could you help me with that in msn? and then i post it for the others here, in case someone else needs it too Smile

thanks guys!!!

that's what i said.... if the player's online you'd have to do it like that... otherwise have a diff save system... then you won't have a problem with .ini

i meant that if you were editing online players you have to update them and save them... or just update would work...

but if they're offline then you can edit the .ini anyway


- Gilgamesch - 07-07-2006

Tosuxo Wrote:but if they're offline then you can edit the .ini anyway

yup, but that "editing the ini" is the stuff i cant do :/, or at least, i dont know how to do it


- Tosuxo - 07-07-2006

Gilgamesch Wrote:
Tosuxo Wrote:but if they're offline then you can edit the .ini anyway

yup, but that "editing the ini" is the stuff i cant do :/, or at least, i dont know how to do it

that's why you should do as mentioned before... make accounts save to a different file to players... then you only have to do the getvar and putvar for them Smile


- Robin - 07-07-2006

Tosuxo, did you read his original post?

He was asking for a way to search through the data in offline players. The engine does not currently allow this because it can only read data which is currently stored in variables in the server/client. To, say, read a characters guidname, you would have to read the data from the ini, store it as a temp. value, use it to do what you need then dump the memory.

I'm pretty sure he knows how to save and update online player data.

Sorry Gilgamesch, i'm a bit weighed down with coursework at the moment, but ill be back on next week if you haven't sorted it out by then. Smile


- Gilgamesch - 07-07-2006

Kite Wrote:Sorry Gilgamesch, i'm a bit weighed down with coursework at the moment, but ill be back on next week if you haven't sorted it out by then. Smile

k thanks man Smile

and @tosuxo, i really appreciate that you are trying to help me, but like kite said, i know how to do that Smile


- Tosuxo - 07-07-2006

Kite Wrote:Tosuxo, did you read his original post?

He was asking for a way to search through the data in offline players. The engine does not currently allow this because it can only read data which is currently stored in variables in the server/client. To, say, read a characters guidname, you would have to read the data from the ini, store it as a temp. value, use it to do what you need then dump the memory.

I'm pretty sure he knows how to save and update online player data.

Sorry Gilgamesch, i'm a bit weighed down with coursework at the moment, but ill be back on next week if you haven't sorted it out by then. Smile

dude, do you actually UNDERSTAND how visual basic works? you're fuckin stupid if you think it can only read from RAM...

server side make it search the data in the .ini file (which would be made easier making it so it's players have diff ini to the accounts).

Even when i'm tipsy I'm making more sense than you... lol


- Matt - 07-07-2006

No, you're reading what he's saying wrong, he's saying Gilga doesn't know how to edit ini files, so your method won't work. He was talking about players that ARE online, you're twisting everything.