Nov 11 2012, 11:44 pm
|
|
Which you can do with a list which would be saved in the file..
|
Yes, and now onto the problem; Storing the list into a savefile. I seem to be having trouble making that happen. Can you see anything wrong with how I'm saving and loading the variable?
|
Based on what you have posted, you are saving either 1 or 0 on the "player" savefile. If one guy gets banned, 1 will be saved to "player" and he will be kicked out from the server. Then, if someone logs in, they will read 1 from the "player" file. It did not matter who it was you banned and who was trying to connect. Login will simply fail from then onwards.
|
In response to Zerok Kaiba
|
|
Did you do a search?
I found this from 2010 - http://www.byond.com/forum/?post=140342#comment667577 Oh and there is tons more.. |
Once again, that is showing how to add players to a list. I have already stated that is not the problem. I can make the list, and I can make it work. I have also confirmed its existence with fexists(). The problem is the savefile. I seem to be doing something wrong with the savefile, and I'm not sure what I'm doing wrong. I have displayed all of the savefile mechanics in the beginning post of this topic. I'm guessing either there's just 1 slight instruction that isn't being used the way it's supposed to, or I've completely misunderstood how to use savefiles and how to load and save them. I'm not sure.
|
Yes. You do not know how to use savefiles effectively. I need to go now. I'll get back to you later. For now, do some research.
|
I've tried and am trying everything. However, those links you sent me aren't relevent to the problem. As I've said, I know how to make a ban system and the lists. That should have been understood in the beginning post of this topic, where I stated that it works perfectly when I host Daemon, but only for some people. The problem lies entirely in the savefile. No error happens when I store the savefile, the problem is when I load it.
|
Yes did you do a search? instead of just clicking the links I supplied you should do some research yourself.
I'm not trying to be an ass, but have a look around at how save files are done and you'll be able to fix the issue. |
I've searched for a solution to my problem in the developer help forums, but all savefile related issues are involving compile-time errors. My problem isn't a compile-time nor a runtime error. I can't find anything relevant to my post.
Also, other programmers have also looked at my problem and have been having difficulty solving it. |
After reading your posts, most would just say "meh."
It is not because the problem is difficult. It is obvious that you don't know what you are doing and it's quite troublesome to explain everything to you so we want you to do your part. Just a quick lesson: The format for writing a data on a savefile F is F[buffer] << value example:
F["gravity"] << 9.81
If buffer is not indicated, the current buffer will be used. The logic in your code is erroneous. See my previous post. In your previous code, you are saving/loading 1 or 0 into/from the savefile. There was no saved information on who was banned. There are different ways to handle the a ban system. One is saving/loading a list of banned ckeys. Here is a simple example var/list/banlist = new |
Not to sound too severe here, but none of you addressed Zerok's problem of the Login process halting. The Login process halting has nothing to do with:
Jemai1 wrote: Anyways, you should check if the file "player" exists with fexists proc. If it doesn't exist, there is nothing to load/read. nor does it have anything to do with unique savefiles. While those are kind of necessary, the problem here is that Login is halting. There are only a few cases where a process is just flat out halted. One is when it is waiting for input (edit: or when the function is waiting for something else to happen in general). The other is when a runtime error occurs within the function, which he says there isn't. There is nothing wrong with the code by itself, other than some design questions. The code "works." We need more information. |
It works now. The problem was that the executable was in a folder that had a name not identical to the .dme file. I discovered an alert pop-up asking me if I wanted to allow access to the folder containing the savefile. When I changed the folder name to the .dme file name, the alert stopped appearing and everything now works fine. There was nothing wrong with my code from the beginning, Login() was just being haulted by the alert, as Keeth stated could be possible. Thank you Keeth, I finally received the help I needed.
|
In response to Zerok Kaiba
|
|
Zerok Kaiba wrote:
... There was nothing wrong with my code from the beginning, ... Nope. I just spotted your mistakes. Like 3 times already. Your Login() proc is faulty. Aside from the lack of checks, it also produces unexpected termination of connection which is identical to the problem you stated. We were asking you to fix that so we could fix or at least narrow down the source of the problem. Even if you managed to fix the folder problem, the said faults are still there. If you just ignore them, you'll come back here asking for help again. |
There was nothing wrong with it, hence it working on Daemon. All we were doing for 30 comments was changing the same thing and re-writing it in another format (aside where you helped me make it so each player had their own file), which ended up doing the exact same thing as before.
There was only 1 problem the entire time, and that problem never changed. |
In response to Zerok Kaiba
|
|
Use your old code.
Ban someone (it doesn't matter who). Logout. See the horror. |
Hence why I stated that in the brackets. Please properly check my acknowledgement of your help before attempting to ridicule what I say.
|
The thing is that you keep insisting that there is nothing wrong with your code. That is not true.
|