Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: edwardthefma on May 25, 2010, 09:21:20 pm

Title: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: edwardthefma on May 25, 2010, 09:21:20 pm
i need a script that can prevent 1 user from logging on to 2 servers at the same
i have a idea but i dont  know how to wright it is whare

you have that script reads a .php file that is displaying users logged into a server
and it takes the names and dose not allow them to log into the server while already
being logged into 1 i want to prevent messing up the sql
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: Blizzard on May 26, 2010, 02:48:02 am
In case you didn't know, a lot of professional MMOs solve that problem by using a separate database for each server.
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: edwardthefma on May 26, 2010, 10:05:48 am
well i don't want to have to set up another sql
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: Blizzard on May 26, 2010, 10:18:15 am
Good. Then let 2 servers work with one data and risk data corruption. Go ahead.
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: edwardthefma on May 26, 2010, 10:54:36 am
well i guess ill have to warn my users that doing that will risk damaging their acct and i wont restore them
XD
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: SBR* on May 26, 2010, 01:45:02 pm
Quote from: edwardthefma on May 26, 2010, 10:54:36 am
well i guess ill have to warn my users that doing that will risk damaging their acct and i wont restore them
XD


Why do you really need two servers then?
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: edwardthefma on May 26, 2010, 02:53:05 pm
the servers i have have to have small limits on them prventing a certen number of users per server
to i dont eat up the resources of the server
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: Blizzard on May 26, 2010, 03:18:19 pm
Why don't you just increase the setting on the server to allow more connected users? -_-
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: G_G on May 26, 2010, 03:26:49 pm
I thought there was a limit because rmxp could only handle so many connections.
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: Blizzard on May 26, 2010, 03:35:45 pm
Not really, no. Besides, it's RMXP unrelated. This is Ruby. If you have a monster server with 256 cores and 100 Gbps network connection, you can let it handle 10000 users if you want. :P The limit option is so your server doesn't get overloaded. Nobody wants a lagging server with 500 players online. It's better to run it properly with 100 players.
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: jcsnider on May 26, 2010, 03:58:01 pm
Quote from: Blizzard on May 26, 2010, 03:35:45 pm
Not really, no. Besides, it's RMXP unrelated. This is Ruby. If you have a monster server with 256 cores and 100 Gbps network connection, you can let it handle 10000 users if you want. :P The limit option is so your server doesn't get overloaded. Nobody wants a lagging server with 500 players online. It's better to run it properly with 100 players.


Agreed.

But, with Windows PC's it only allows 10 connections before giving an error. If you have a server edition of windows you are fine. If not, then it is time to take the great journey to Ubuntu :D
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the
Post by: Subsonic_Noise on May 26, 2010, 04:19:40 pm
First off, edwardthefma, how many people do you expect to play your game? It's an rpg maker mmo, you're lucky if you get 30 active users. Also, I don't get how everyone always talks about Ubuntu. It's literally one of the worst linux distros I ever used.
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: Blizzard on May 26, 2010, 04:48:51 pm
Sub, we have to accept that Ubuntu is a user-friendly distro. We all know how "good" another user-friendly OS is, though. >_> *cough* ...Windoze... *cough* Soon everybody will start using Ubuntu (yeah, right) and 5 years later people will complain that is sucks and there will be books of jokes about Ubuntu. Ubuntu will become the new Windows (yeah, right again) with all that goes with it including the bad stuff.

Quote from: jcsnider on May 26, 2010, 03:58:01 pm
But, with Windows PC's it only allows 10 connections before giving an error. If you have a server edition of windows you are fine.


Lol, I remember when I was googling around to find a way to increase that number because I thought it was responsible for a problem I was having. Turned out it wasn't. xD
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: edwardthefma on May 26, 2010, 05:08:08 pm
Quote from: Blizzard on May 26, 2010, 03:18:19 pm
Why don't you just increase the setting on the server to allow more connected users? -_-

as i said
Quote from: edwardthefma on May 26, 2010, 02:53:05 pm
the servers i have have to have small limits on them prventing a certen number of users per server
to i dont eat up the resources of the server
to prevent eating up the resources i lmit it to 20 users per server i plan to get 2 servers that run at the same time so if 1 goes offline the other is still up
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the
Post by: Subsonic_Noise on May 26, 2010, 07:02:04 pm
Ubuntu already is the Windows of Linux. If you want Linux, get a real one. I myself like SuSe because it's userfriendly while still providing nearly the full customizablilty that is typical for linix.
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: edwardthefma on June 07, 2010, 03:45:46 pm
how did this simple script request get into talking about linux :???:
also i relised i was going about it all wrong XD with the user log
why not just make it stop the users with a logged in table 

XD hear is what i have so far
module RMXOS

#------------------------------------------------------------------
# Passes the extension's main module to RMX-OS on the top
# level so it can handle this extension.
# Returns: Module of this extension for update.
#------------------------------------------------------------------
def self.load_current_extension
return Server_States
end

end

#======================================================================
# module ExtensionSkeleton
#======================================================================

module Server_States

# extension version
VERSION = 1.0
# required RMX-OS version
RMXOS_VERSION = 1.14
# whether the server should update this extension in an idividual thread or not
SERVER_THREAD = true

# :::: START Configuration
# - YOUR CONFIGURATION HERE
# :::: END Configuration

#------------------------------------------------------------------
# Initializes the extension (i.e. instantiation of classes).
#------------------------------------------------------------------
def self.initialize
end
#------------------------------------------------------------------
# Calls constant updating on the server.
#------------------------------------------------------------------
def try_login

        return RMXOS::RESULT_DENIED if hash['online'] != '1'
user_id = hash['user_id'].to_i
        RMXOS.server.sql.query #needs to add 1 digit in online in users table


end
def ????
        #wen the user loggs out it needs to put a 0 in in online in users table

   
  end

end
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: Blizzard on June 07, 2010, 05:05:32 pm
*facepalm*

The probably single worst thing I have seen in Netplay+ was exactly this: putting the online status into the database. In case you didn't know, if your server crashes or somebody gets disconnected without the server noticing, that player won't be able to login anymore, ever, until you change the online status in the database manually. If it's that what you want, go ahead break the server.
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: edwardthefma on June 07, 2010, 05:28:06 pm
then i would need to add a section whare it changes the online table to 0 wen a server is just being started
also i can make a bot command
!cantgetin user-name password
and the bot just puts the 0 where it belongs
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: Blizzard on June 07, 2010, 05:56:00 pm
Quote from: Blizzard on June 07, 2010, 05:05:32 pm
or somebody gets disconnected without the server noticing, that player won't be able to login anymore
Title: Re: i need a script that can prevent 1 user from logging on to 2 servers at the same
Post by: edwardthefma on June 08, 2010, 05:42:56 pm
lol you dint hear me wen i sayed ill just have a bot fix the acounts wen the server dosent notice som 1 diced
right away