Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Netplay Plus Master Thread

Status
Not open for further replies.
Wyatt, Icedmetal, would you be willing to moderate a Netplay board?

Not a full blown forum, unless you wished to, but a simple posting board hosted over at the Palace.
 

Enza

Member

M50;329388 said:
What about server u are talking? Web server or Game Server?

The netplay server is running fine. But i dont know how ppl can connect to my game/server. In the older version of Netplay there was an exe called "Connect to Server". So what to do now? Is there no need for the Connect to server.exe ?
 
holloway;329397 said:
Wyatt, Icedmetal, would you be willing to moderate a Netplay board?

Not a full blown forum, unless you wished to, but a simple posting board hosted over at the Palace.

Sure. It would certainly make it easier to find things than a 32 page topic.
 
here is a instruction for you:

This is the Netplay Plus 2.0 tutorial
What is blue for xxamp and red Wamp
For tips wants Me (tm) and Icedmetal57 thank

And Noud17 thanks for the idea


You have to have Ruby, if not here is the download


Http://www.ruby-lang.org/en/downloads/
Do the One-click installer

Netplay and Xxamp or Wamp
Netplay plus 2.0 (for the second link is the top if you download a little down scrollt) = http://rapidshare.com/files/43139697...And_Client.zip http://www.rmxp.org/ forums / showthread.php? t = 24968 & highlight = netplay + update
Xampp = http://www.apachefriends.org/en/xampp.html
Wamp = http://sourceforge.net/project/down...er&filename=WampServer2.0a.exe&use_mirror=dfn

All set! The server

Let's start with a download from Wamp of xampp and Netplay Plus you install it and then go to the folder where you have geinstaleert. If you are a bit down scrolls you see (at least I) xxamp-control or wampmanager click on it and make sure you Mysql and Apache impetus Now go to the admin of Apache you see your localhost site, and there is left a bar with everything you can use it, click PHPMyAdmin,. Users of Wamp should click on the taskbar and then show them a iglootje click it and then PHPmyadmin now you get a new site open. There is also a new database or create new Create Database that you can create a new database to create a new database using the name to you taste. If it says that it can not be another name and setting. Open your database and select import that apparently top of the page, there is now a new page click to browse or browse it and go to your Netplay folder, click Server and click sqlfile, then simply start or go. Well done you have the files on the server geimporteert! Now go to the start and close the site. Go to the Netplay files and go to the folder where you first called Server was. Open the "Config" file it says Attention! The brackets should continue this ", the brackets
Code:
Host = "152.105.166.15" This is your host that can be found at http://www.whatismyip.com

Port = 50000 This is your port should be the same in the scripts of your game otherwise he may not contact

ServerName = "Netplay Plus Server" So is your server that you can figure out yourself
ServerVersion = "3.0 This is the version of the server (it's best not change)
GameCode = "918302475" This is the password from the server if it is the same in the scripts of your game all the details of it to your server gestuurt

WebServer = "localhost / www / Netplay" The server of your web?
SMTPServer = "localhost" ...
AdminEmail = "trebor777@servage.net" Your email

DB_server = "localhost" The server of your database. Note that must remain!
DB_user = "trebor777" This should be root
DB_password = "D4d1co0l" This should be nothing
DB_name = "netplay_p_db" This should be the name of the database that you have mentioned

Message = "Entering the Official Netplay Plus Server ..." This is the text which will start the server if you

If you have anything you set this step beyond

You scripts of Netplay change

First you open the Netplay game and copy all your scripts of the Netplay game to a new game and overschrijf you with the Main Main of the Netplay game and copy the folder you to the graphics to the game ... So now you have the graphics and scripts of the Netplay game. Put all folders and files in the directory of your new game except for the Data folder, which puts you there are not going to copy you. Open the Data folder of the Netplay game and copy it to the folder Scripts Dates of your new game, test your game.
If it fails to sign the error and let the piece of script. Now go to the script editor and locate line 45 in the Network Library. Now you see 3 texts Ip, Port, Gamecode, put the numbers beside them what you have set the config file so you move your IP address late in the first half in the port that you have set in the config on the server and third is the gamecode which you have set in the config on the server. If you think you can trust everything that steps in your game moves (Please be sure in advance a backup of scripts.rxdata maybe you can scripts override)


Hee I can not register!


Here you learn register for the Netplay game.
Go to your database (you can see how you going in chapter 1)
Users Find the table and if you have done that you have to explore or browse print that is placed in the vicinity of imports. Now click on Insert or insert that is also the top, then you get a whole list of questions that you should introduce the ID here is the first question you have to the number of the ID so you are entering the third account then you 3 filling as that fails 4, the second question is Login this is the username when you log in, now you get the question password but also a bar, but here you need to click on that bar alongside password and function of function and MD5 in implement now you can enter the password you want to log in, now you have a question which states that Email is simply your email, now you get a question which states reg_dat that your registration data one must simply fill out a few figures to view it later to search, now you get the question log_dat same as reg_dat, now you get the permission question that is the grade you have admin is the allerbest moderator below standard and below it, now you get the question guild that knows I am not just 1 introduced and that same money for the next question, now that you have to have on the box of ignoring or ignore pressing than you do not have a time to fill in, and then click on Start. If you can do as well in other news, if you 1 of the others do not understand you can send it here. Now you can return to the home gaanen the bunch. Go to the directory server and go to Lib and you see a ruby program (. Rb) with the name Server open him with wordpad or notebook (Warning! Do not you standart openmaker of) and change it with this:
Code:
# If do not find the default library, the load provided one
Require '. / LIB / gserver' # if! Require 'gserver'
Require '. / LIB / mysql "
Require '. / LIB / functions.rb'
Require '. / LIB / email'
Require '. / LIB / client'
Require 'digest/md5 "

Load '. / Config.ini "

For file in Dir [ ". / LIB / Game_Class /*.*"]
Print "loading" + file +"... \ n "
Require file
End

Class NetplayServer <GServer
Attr_reader state
#------------------------------------------------- -------------------------------------------------- --
# Initialize the server
#------------------------------------------------- -------------------------------------------------- --
Final initialize (local)
Beginning
@ State = true
Ip = (local? Host: DEFAULT_HOST)
Time = Time.new.strftime ( "[% m-% d-% Y] _% Hh%% Mm Ss)
# Erase all previous errors at each server creation.
@ @ = Error_log ". / LOGS / Error / # () time. Txt"
File = File.open (@ @ error_log, "w")
File.close
# Create a new log file, at each server creation
@ @ Log = File.new ( ". / LOGS / Server_log_ # () time. Txt", "w")
# @ @ Log.flush
# Create the server
Super (Port, ip, 500, @ @ log, true, true)
# Creating SQL Server connection
@ @ _ Mysql = Mysql.new (DB_server, DB_user, DB_password, DB_name)
# Set up the database
Print "Setting up Database ... \ n \ r"
# Print "Step 1 ... \ n"
# @ @ _ Mysql.query ( "TRUNCATE TABLE online_users;")
# Print "Step 2 ... \ n"
# @ @ _ Mysql.query ( "TRUNCATE TABLE users;)
# Print "Step 3 ... \ n"
# @ @ _ Mysql.query ( "TRUNCATE TABLE characters;")
# Print "Step 4 ... Create user 'test' pass' test '\ n"
# @ @ _ Mysql.query ( "INSERT INTO users (id, login, password, email, reg_dat, validation) VALUES ('', 'test', MD5 ( 'test'), [email='test@test.com]'test@test.com[/email]', UNIX_TIMESTAMP ( ), 1); ")
# Print "Step 5 ... Create user 'test2' pass' test2 '\ n"
# @ @ _ Mysql.query ( "INSERT INTO users (id, login, password, email, reg_dat, validation) VALUES ('', 'test2', MD5 ( 'test2'), [email='test2@test.com]'test2@test.com[/email]', UNIX_TIMESTAMP ( ), 1); ")
# Print "Step 6 ... \ n"
# @ @ _ Mysql.query ( "INSERT INTO characters VALUES (2, 2, 0, 0,'1 ',' Alice ', 16, 9, 3, 0, 2,'002 - Fighter02', 'offline', 2 , 5, 0, 0, 0, 1000, 1000, 0, 1, 1,'102, 97 ', 1164649497, 0); ")
# Print "Step 7 ... \ n"
# @ @ _ Mysql.query ( "INSERT INTO characters VALUES (3, 1, 0, 0,'1 ',' Paul ', 11, 6, 3, 0, 8,'001 - Fighter01', 'offline', 2 , 5, 0, 0, 0, 1000, 1000, 0, 1, 1,'102, 97 ', 1164649434, 0); ")
Print "Setup Success ... \ n"
#------------------------------------------------- -----
@ @ = (Clients)
Rescue Exception
Print $!
Store_error ( "Server Error ",$!)
@ @ _ Mysql.close
@ @ Log.close
@ State = false
End
End
#------------------------------------------------- -------------------------------------------------- --
# Return Server's Connection Mysql
#------------------------------------------------- -------------------------------------------------- --
Final mysql
Return @ @ _mysql
End
Final clients
Return @ @ clients
End
Final game_variables
Return @ @ game_variables
End
Final game_switches
Return @ @ game_switches
End

Final setup
Beginning
Print "------------------------------------------------ -- \ n \ r "
Print "game loading data ... \ n \ r"

@ @ Game_variables = Game_Variables.new
@ @ Game_switches = Game_Switches.new
Maps @ @ = []
For f in Dir [ ". / DATA / Map [0-9] * rxdata"]
@ @ Maps.push (Game_Map.new (f))
End
Raise "No map to load \ n" if @ @ maps.size == 0
@ Map_thread = Thread.new (
Beginning
Do loop
For map in @ @ maps
Map.update
End
Sleep (1/35.to_f)
End
Rescue Exception
Print "M: Exception occurred! #{$!} \ N"
Store_error ( "Map Update Server Error ",$!)
End
)
Rescue Exception
Print $!
Store_error ( "Server Error ",$!)
@ @ _ Mysql.close
@ @ Log.close
@ State = false
End
End
#------------------------------------------------- -------------------------------------------------- --
# Answer to the client.
#------------------------------------------------- -------------------------------------------------- --
Final serve (io)
While io.gets
Break if process (io, $ _)
End
Disconnecting (io.peeraddr [1], io) if! Io.closed?
End
#------------------------------------------------- -------------------------------------------------- --
# Server Stopping message stored in the log file, and close the log file Stream
#------------------------------------------------- -------------------------------------------------- --
Final stopping ()
Log ( "# (self.class.to_s) (# @ host }:#{port stop)")
@ @ Log.close
End
#------------------------------------------------- -------------------------------------------------- --
Error # Store in the error log
#------------------------------------------------- -------------------------------------------------- --
Final error (detail)
Store_error ( "Server internal error", detail)
End
#------------------------------------------------- -------------------------------------------------- --
# * Load data from a file. (Exclusive to RMXP data file.
#------------------------------------------------- -------------------------------------------------- --
Final load_data (filename)
F = File.open (filename, "rb")
Return Marshal.load (f)
End
#------------------------------------------------- -------------------------------------------------- --
# * Store error in a log file.
#------------------------------------------------- -------------------------------------------------- --
Final store_error (ori, exception)
Trace = exception.backtrace.join ( "\ n")
File = File.open (@ @ error_log, "a +")
File.write ( "# (Time.new.to_s) # () ori: # exception () \ n \ r")
File.write ( "# (route) \ n \ r")
File.close ()
End
#------------------------------------------------- -------------------------------------------------- --
# * Client Connection process
#------------------------------------------------- -------------------------------------------------- --
Final connecting (client)
Addr = client.peeraddr
Log ( "# (self.class.to_s) (# @ host }:#{port client) # (addr [1]) +
"# (Addr [2 ]}<#{ addr [3])> connect")

@ @ Clients [client] = NClient.new (client)
True
End
#------------------------------------------------- -------------------------------------------------- --
# * DisConnect the client
#------------------------------------------------- -------------------------------------------------- --
Final disconnecting (clientPort, io = nil)
Log ( "# (self.class.to_s) # () @ host }:#{port" +
Client: # (clientPort) disconnect ")
Client = @ @ clients [io]
If client! = Nil
User_id = client.db_id
Client.mysql.query ( "UPDATE characters SET savetime = UNIX_TIMESTAMP (), status = 'offline', client_id # = (0), online_id = # (0) WHERE user_id = # user_id) (AND online_id = # (user_id); ") rescue print" M: Error while updating characters table \ n \ r #{$!} \ n \ r "
Client.mysql.query ( "DELETE from online_users WHERE id = '# user_id }';") rescue (print" M: (ensure) Error while deleting online_users entry \ n \ r #{$!}"
Client.mysql.query ( "OPTIMIZE TABLE` online_users `;") rescue print "M: (ensure) Error while optimizing table online_users \ n \ r"
@ @ Clients.delete (io)
Client.socket.close
Client.mysql.close
End
End
End


Updating and launch

We can upgrade him to the script editor of the game with the scripts of netplay plus you need to go there to go and find your main line 12 there is # map_export change with map_export and do a testplay pressure before he comes to the login window on Z, and then closed the game out now you see your maps and tilesets in the folder converted from the directory of your game. Put those maps and tilesets that is converted to the DATA directory of the server and you have him updated!

Now is the day that you can finally try!

Make sure MYSQL is on concern that Wamp is turned on so you have to Wampmanager click and go to the directory Server and main pressure on the local server if you run press Y and if it is not so in N eventually comes to server running, now try to start the game and if everything fails then send a message on this topic!

i hope i can help
 

Ratke

Member

yay i got it working^^


ps: could some1 explain me how to make a regristration page?
and could some1 explain how to use the Admin commands in 2.0?
 
Ratke;330310 said:
yay i got it working^^


ps: could some1 explain me how to make a regristration page?
To make a registration page (provided you have a web server. Try http://www.awardspace.com
if you don't), simply edit the file %Server Root%\WWW\Connections\Netplay.php to hold your mySQL database data (same as in your config file), then upload the entire contents of the WWW folder onto your web server.


And now I have my own problem. I'm trying to run the NP+ 2.0 ruby server, I have mySQL running on my local machine, and my config file looks something like this:

Code:
Host = "127.0.0.1"

Port = 50000


ServerName = "Netplay Plus Server"

ServerVersion = "3.0"
GameCode = "918302475"

WebServer = "www.spatulacentral.info/np/"
SMTPServer = "localhost"
AdminEmail = "trebor777@servage.net"

DB_server = "localhost"

DB_user = "root"

DB_password =""

DB_name = "netplay"

Message = "Entering the Official Netplay Plus Server..."

When I go to run the server (in local mode) I get the error message:
getaddrinfo: no address associated with hostname. initialized class variable @@_mysql in netplayServer
Server has been terminated
and the error log looks like:
Code:
Server Error: getaddrinfo: no address associated with hostname.
./LIB/mysql.rb:103:in `initialize'
./LIB/mysql.rb:103:in `new'
./LIB/mysql.rb:103:in `real_connect'
./LIB/mysql.rb:91:in `initialize'
./LIB/server.rb:36:in `new'
./LIB/server.rb:36:in `initialize'
RMXP/Server/main.rb:45:in `new'
RMXP/Server/main.rb:45:in `main'
RMXP/Server/main.rb:88
Does anyone have any idea what's going on?
Otherwise I'll just go back to using 1.6.3...
 
Code:
DB_server = "localhost"

This line is your problem. You need a MySQL database.

Sorry for possible advertising but for a free MySQL database I would recommend Freepgs.com, they do free hosting deals just with setup fees, the cheapest is $3 one-off and includes MySQL databases. It's what I use and what I have always used, and it's more than enough to run a website and forum off.
 
masteredu;329929 said:
here is a instruction for you:

This is the Netplay Plus 2.0 tutorial
What is blue for xxamp and red Wamp
For tips wants Me (tm) and Icedmetal57 thank

And Noud17 thanks for the idea


You have to have Ruby, if not here is the download


Http://www.ruby-lang.org/en/downloads/
Do the One-click installer

Netplay and Xxamp or Wamp
Netplay plus 2.0 (for the second link is the top if you download a little down scrollt) = http://rapidshare.com/files/43139697...And_Client.zip http://www.rmxp.org/ forums / showthread.php? t = 24968 & highlight = netplay + update
Xampp = http://www.apachefriends.org/en/xampp.html
Wamp = http://sourceforge.net/project/down...er&filename=WampServer2.0a.exe&use_mirror=dfn

All set! The server

Let's start with a download from Wamp of xampp and Netplay Plus you install it and then go to the folder where you have geinstaleert. If you are a bit down scrolls you see (at least I) xxamp-control or wampmanager click on it and make sure you Mysql and Apache impetus Now go to the admin of Apache you see your localhost site, and there is left a bar with everything you can use it, click PHPMyAdmin,. Users of Wamp should click on the taskbar and then show them a iglootje click it and then PHPmyadmin now you get a new site open. There is also a new database or create new Create Database that you can create a new database to create a new database using the name to you taste. If it says that it can not be another name and setting. Open your database and select import that apparently top of the page, there is now a new page click to browse or browse it and go to your Netplay folder, click Server and click sqlfile, then simply start or go. Well done you have the files on the server geimporteert! Now go to the start and close the site. Go to the Netplay files and go to the folder where you first called Server was. Open the "Config" file it says Attention! The brackets should continue this ", the brackets
Code:
Host = "152.105.166.15" This is your host that can be found at http://www.whatismyip.com

Port = 50000 This is your port should be the same in the scripts of your game otherwise he may not contact

ServerName = "Netplay Plus Server" So is your server that you can figure out yourself
ServerVersion = "3.0 This is the version of the server (it's best not change)
GameCode = "918302475" This is the password from the server if it is the same in the scripts of your game all the details of it to your server gestuurt

WebServer = "localhost / www / Netplay" The server of your web?
SMTPServer = "localhost" ...
AdminEmail = "trebor777@servage.net" Your email

DB_server = "localhost" The server of your database. Note that must remain!
DB_user = "trebor777" This should be root
DB_password = "D4d1co0l" This should be nothing
DB_name = "netplay_p_db" This should be the name of the database that you have mentioned

Message = "Entering the Official Netplay Plus Server ..." This is the text which will start the server if you

If you have anything you set this step beyond

You scripts of Netplay change

First you open the Netplay game and copy all your scripts of the Netplay game to a new game and overschrijf you with the Main Main of the Netplay game and copy the folder you to the graphics to the game ... So now you have the graphics and scripts of the Netplay game. Put all folders and files in the directory of your new game except for the Data folder, which puts you there are not going to copy you. Open the Data folder of the Netplay game and copy it to the folder Scripts Dates of your new game, test your game.
If it fails to sign the error and let the piece of script. Now go to the script editor and locate line 45 in the Network Library. Now you see 3 texts Ip, Port, Gamecode, put the numbers beside them what you have set the config file so you move your IP address late in the first half in the port that you have set in the config on the server and third is the gamecode which you have set in the config on the server. If you think you can trust everything that steps in your game moves (Please be sure in advance a backup of scripts.rxdata maybe you can scripts override)


Hee I can not register!


Here you learn register for the Netplay game.
Go to your database (you can see how you going in chapter 1)
Users Find the table and if you have done that you have to explore or browse print that is placed in the vicinity of imports. Now click on Insert or insert that is also the top, then you get a whole list of questions that you should introduce the ID here is the first question you have to the number of the ID so you are entering the third account then you 3 filling as that fails 4, the second question is Login this is the username when you log in, now you get the question password but also a bar, but here you need to click on that bar alongside password and function of function and MD5 in implement now you can enter the password you want to log in, now you have a question which states that Email is simply your email, now you get a question which states reg_dat that your registration data one must simply fill out a few figures to view it later to search, now you get the question log_dat same as reg_dat, now you get the permission question that is the grade you have admin is the allerbest moderator below standard and below it, now you get the question guild that knows I am not just 1 introduced and that same money for the next question, now that you have to have on the box of ignoring or ignore pressing than you do not have a time to fill in, and then click on Start. If you can do as well in other news, if you 1 of the others do not understand you can send it here. Now you can return to the home gaanen the bunch. Go to the directory server and go to Lib and you see a ruby program (. Rb) with the name Server open him with wordpad or notebook (Warning! Do not you standart openmaker of) and change it with this:
Code:
# If do not find the default library, the load provided one
Require '. / LIB / gserver' # if! Require 'gserver'
Require '. / LIB / mysql "
Require '. / LIB / functions.rb'
Require '. / LIB / email'
Require '. / LIB / client'
Require 'digest/md5 "

Load '. / Config.ini "

For file in Dir [ ". / LIB / Game_Class /*.*"]
Print "loading" + file +"... \ n "
Require file
End

Class NetplayServer <GServer
Attr_reader state
#------------------------------------------------- -------------------------------------------------- --
# Initialize the server
#------------------------------------------------- -------------------------------------------------- --
Final initialize (local)
Beginning
@ State = true
Ip = (local? Host: DEFAULT_HOST)
Time = Time.new.strftime ( "[% m-% d-% Y] _% Hh%% Mm Ss)
# Erase all previous errors at each server creation.
@ @ = Error_log ". / LOGS / Error / # () time. Txt"
File = File.open (@ @ error_log, "w")
File.close
# Create a new log file, at each server creation
@ @ Log = File.new ( ". / LOGS / Server_log_ # () time. Txt", "w")
# @ @ Log.flush
# Create the server
Super (Port, ip, 500, @ @ log, true, true)
# Creating SQL Server connection
@ @ _ Mysql = Mysql.new (DB_server, DB_user, DB_password, DB_name)
# Set up the database
Print "Setting up Database ... \ n \ r"
# Print "Step 1 ... \ n"
# @ @ _ Mysql.query ( "TRUNCATE TABLE online_users;")
# Print "Step 2 ... \ n"
# @ @ _ Mysql.query ( "TRUNCATE TABLE users;)
# Print "Step 3 ... \ n"
# @ @ _ Mysql.query ( "TRUNCATE TABLE characters;")
# Print "Step 4 ... Create user 'test' pass' test '\ n"
# @ @ _ Mysql.query ( "INSERT INTO users (id, login, password, email, reg_dat, validation) VALUES ('', 'test', MD5 ( 'test'), [email='test@test.com]'test@test.com[/email]', UNIX_TIMESTAMP ( ), 1); ")
# Print "Step 5 ... Create user 'test2' pass' test2 '\ n"
# @ @ _ Mysql.query ( "INSERT INTO users (id, login, password, email, reg_dat, validation) VALUES ('', 'test2', MD5 ( 'test2'), [email='test2@test.com]'test2@test.com[/email]', UNIX_TIMESTAMP ( ), 1); ")
# Print "Step 6 ... \ n"
# @ @ _ Mysql.query ( "INSERT INTO characters VALUES (2, 2, 0, 0,'1 ',' Alice ', 16, 9, 3, 0, 2,'002 - Fighter02', 'offline', 2 , 5, 0, 0, 0, 1000, 1000, 0, 1, 1,'102, 97 ', 1164649497, 0); ")
# Print "Step 7 ... \ n"
# @ @ _ Mysql.query ( "INSERT INTO characters VALUES (3, 1, 0, 0,'1 ',' Paul ', 11, 6, 3, 0, 8,'001 - Fighter01', 'offline', 2 , 5, 0, 0, 0, 1000, 1000, 0, 1, 1,'102, 97 ', 1164649434, 0); ")
Print "Setup Success ... \ n"
#------------------------------------------------- -----
@ @ = (Clients)
Rescue Exception
Print $!
Store_error ( "Server Error ",$!)
@ @ _ Mysql.close
@ @ Log.close
@ State = false
End
End
#------------------------------------------------- -------------------------------------------------- --
# Return Server's Connection Mysql
#------------------------------------------------- -------------------------------------------------- --
Final mysql
Return @ @ _mysql
End
Final clients
Return @ @ clients
End
Final game_variables
Return @ @ game_variables
End
Final game_switches
Return @ @ game_switches
End

Final setup
Beginning
Print "------------------------------------------------ -- \ n \ r "
Print "game loading data ... \ n \ r"

@ @ Game_variables = Game_Variables.new
@ @ Game_switches = Game_Switches.new
Maps @ @ = []
For f in Dir [ ". / DATA / Map [0-9] * rxdata"]
@ @ Maps.push (Game_Map.new (f))
End
Raise "No map to load \ n" if @ @ maps.size == 0
@ Map_thread = Thread.new (
Beginning
Do loop
For map in @ @ maps
Map.update
End
Sleep (1/35.to_f)
End
Rescue Exception
Print "M: Exception occurred! #{$!} \ N"
Store_error ( "Map Update Server Error ",$!)
End
)
Rescue Exception
Print $!
Store_error ( "Server Error ",$!)
@ @ _ Mysql.close
@ @ Log.close
@ State = false
End
End
#------------------------------------------------- -------------------------------------------------- --
# Answer to the client.
#------------------------------------------------- -------------------------------------------------- --
Final serve (io)
While io.gets
Break if process (io, $ _)
End
Disconnecting (io.peeraddr [1], io) if! Io.closed?
End
#------------------------------------------------- -------------------------------------------------- --
# Server Stopping message stored in the log file, and close the log file Stream
#------------------------------------------------- -------------------------------------------------- --
Final stopping ()
Log ( "# (self.class.to_s) (# @ host }:#{port stop)")
@ @ Log.close
End
#------------------------------------------------- -------------------------------------------------- --
Error # Store in the error log
#------------------------------------------------- -------------------------------------------------- --
Final error (detail)
Store_error ( "Server internal error", detail)
End
#------------------------------------------------- -------------------------------------------------- --
# * Load data from a file. (Exclusive to RMXP data file.
#------------------------------------------------- -------------------------------------------------- --
Final load_data (filename)
F = File.open (filename, "rb")
Return Marshal.load (f)
End
#------------------------------------------------- -------------------------------------------------- --
# * Store error in a log file.
#------------------------------------------------- -------------------------------------------------- --
Final store_error (ori, exception)
Trace = exception.backtrace.join ( "\ n")
File = File.open (@ @ error_log, "a +")
File.write ( "# (Time.new.to_s) # () ori: # exception () \ n \ r")
File.write ( "# (route) \ n \ r")
File.close ()
End
#------------------------------------------------- -------------------------------------------------- --
# * Client Connection process
#------------------------------------------------- -------------------------------------------------- --
Final connecting (client)
Addr = client.peeraddr
Log ( "# (self.class.to_s) (# @ host }:#{port client) # (addr [1]) +
"# (Addr [2 ]}<#{ addr [3])> connect")

@ @ Clients [client] = NClient.new (client)
True
End
#------------------------------------------------- -------------------------------------------------- --
# * DisConnect the client
#------------------------------------------------- -------------------------------------------------- --
Final disconnecting (clientPort, io = nil)
Log ( "# (self.class.to_s) # () @ host }:#{port" +
Client: # (clientPort) disconnect ")
Client = @ @ clients [io]
If client! = Nil
User_id = client.db_id
Client.mysql.query ( "UPDATE characters SET savetime = UNIX_TIMESTAMP (), status = 'offline', client_id # = (0), online_id = # (0) WHERE user_id = # user_id) (AND online_id = # (user_id); ") rescue print" M: Error while updating characters table \ n \ r #{$!} \ n \ r "
Client.mysql.query ( "DELETE from online_users WHERE id = '# user_id }';") rescue (print" M: (ensure) Error while deleting online_users entry \ n \ r #{$!}"
Client.mysql.query ( "OPTIMIZE TABLE` online_users `;") rescue print "M: (ensure) Error while optimizing table online_users \ n \ r"
@ @ Clients.delete (io)
Client.socket.close
Client.mysql.close
End
End
End


Updating and launch

We can upgrade him to the script editor of the game with the scripts of netplay plus you need to go there to go and find your main line 12 there is # map_export change with map_export and do a testplay pressure before he comes to the login window on Z, and then closed the game out now you see your maps and tilesets in the folder converted from the directory of your game. Put those maps and tilesets that is converted to the DATA directory of the server and you have him updated!

Now is the day that you can finally try!

Make sure MYSQL is on concern that Wamp is turned on so you have to Wampmanager click and go to the directory Server and main pressure on the local server if you run press Y and if it is not so in N eventually comes to server running, now try to start the game and if everything fails then send a message on this topic!

i hope i can help


Lol this is me tutorial O_o
You have translated it
 
This is better


This is the Netplay Plus 2.0 tutorial

What is blue for xxamp and red Wamp

For tips wants Me (tm) and Icedmetal57 thank

And Noud17 thanks for the idea


You have to have Ruby, if not here is the download


Http://www.ruby-lang.org/en/downloads/
Do the One-click installer

Netplay and Xxamp or Wamp
Netplay plus 2.0 (for the second link is the top if you download a little down scrollt) = http://rapidshare.com/files/43139697...And_Client.zip http://www.rmxp.org/ forums / showthread.php? t = 24968 & highlight = netplay + update
Xampp = http://www.apachefriends.org/en/xampp.html
Wamp = http://sourceforge.net/project/downl...use_mirror=dfn

All set! The server

Let's start with a download from Wamp of xampp and Netplay Plus you install it and then go to the folder where you have Wamp or Xxamp. If you are a bit down scrolls you see (at least I) xxamp-control or wampmanager click on it and make sure you Mysql and Apache impetus Now go to the admin of Apache you see your localhost site, and there is left a bar with everything you can use it, click PHPMyAdmin,. Users of Wamp should click on the taskbar and then show them a iglootje click it and then PHPmyadmin now you get a new site open. There is also a new database or create new Create Database that you can create a new database to create a new database using the name to you taste. If it says that it can not be another name and setting. Open your database and select import that apparently top of the page, there is now a new page click to browse or browse it and go to your Netplay folder, click Server and click sqlfile, then simply start or go. Well done you have the files on the server geimporteert! Now go to the start and close the site. Go to the Netplay files and go to the folder where you first called Server was. Open the "Config" file it says Attention! The brackets should continue this ", the brackets
Code:
Code: 
Host = "152.105.166.15" This is your host that can be found at [url]www.whatismyip.com[/url] 

Port = 50000 This is your port should be the same in the scripts of your game otherwise he may not contact 

ServerName = "Netplay Plus Server" So is your server that you can figure out yourself 
ServerVersion = "3.0 This is the version of the server (it's best not change) 
GameCode = "918302475" This is the password from the server if it is the same in the scripts of your game all the details of it to your server gestuurt 

WebServer = "localhost / www / Netplay" The server of your web? 
SMTPServer = "localhost" ... 
AdminEmail = "trebor777@servage.net" Your email 

DB_server = "localhost" The server of your database. Note that must remain! 
DB_user = "trebor777" This should be root 
DB_password = "D4d1co0l" This should be nothing 
DB_name = "netplay_p_db" This should be the name of the database that you have mentioned
Message = "Entering the Official Netplay Plus Server ..." This is the text which will start the server if you

If you have anything you set this step beyond

You scripts of Netplay change

First you open the Netplay game and copy all your scripts of the Netplay game to a new game and overschrijf you with the Main Main of the Netplay game and copy the folder you to the graphics to the game ... So now you have the graphics and scripts of the Netplay game. Put all folders and files in the directory of your new game except for the Data folder, which puts you there are not going to copy you. Open the Data folder of the Netplay game and copy it to the folder Scripts Dates of your new game, test your game.
If it fails to sign the error and let the piece of script. Now go to the script editor and locate line 45 in the Network Library. Now you see 3 texts Ip, Port, Gamecode, put the numbers beside them what you have set the config file so you move your IP address late in the first half in the port that you have set in the config on the server and third is the gamecode which you have set in the config on the server. If you think you can trust everything that steps in your game moves (Please be sure in advance a backup of scripts.rxdata maybe you can scripts override)


Hee I can not register!


Here you learn register for the Netplay game.
Go to your database (you can see how you going in chapter 1)
Users Find the table and if you have done that you have to explore or browse print that is placed in the vicinity of imports. Now click on Insert or insert that is also the top, then you get a whole list of questions that you should introduce the ID here is the first question you have to the number of the ID so you are entering the third account then you 3 filling as that fails 4, the second question is Login this is the username when you log in, now you get the question password but also a bar, but here you need to click on that bar alongside password and function of function and MD5 in implement now you can enter the password you want to log in, now you have a question which states that Email is simply your email, now you get a question which states reg_dat that your registration data one must simply fill out a few figures to view it later to search, now you get the question log_dat same as reg_dat, now you get the permission question that is the grade you have admin is the allerbest moderator below standard and below it, now you get the question guild that knows I am not just 1 introduced and that same money for the next question, now that you have to have on the box of ignoring or ignore pressing than you do not have a time to fill in, and then click on Start. If you can do as well in other news, if you 1 of the others do not understand you can send it here. Now you can return to the home gaanen the bunch. Go to the directory server and go to Lib and you see a ruby program (. Rb) with the name Server open him with wordpad or notebook (Warning! Do not you standart openmaker of) and change it with this:
Code:
#if don't find the default library, load the provided one
require './LIB/gserver'# if !require 'gserver'
require './LIB/mysql'
require './LIB/functions.rb'
require './LIB/email'
require './LIB/client'
require 'digest/md5'

load './config.ini'

for file in Dir["./LIB/Game_Class/*.*"]
	print "loading "+file+"...\n"
	require file
end

class NetplayServer < GServer
	attr_reader :state
	#-----------------------------------------------------------------------------------------------------
	# Initialize the server
	#-----------------------------------------------------------------------------------------------------
	def initialize(local)
		begin
			@state =true
			ip = (local ? Host : DEFAULT_HOST)
			time=Time.new.strftime("[%m-%d-%Y]_%Hh%Mm%Ss")
			# Erase all previous errors at each server creation.
			@@error_log=./LOGS/Error/#{time}.txt"
			file = File.open(@@error_log, "w")
			file.close
			# Create a new log file, at each server creation
			@@log = File.new("./LOGS/Server_log_#{time}.txt", "w")
			#@@log.flush
			# Create the server
			super(Port,ip,500,@@log, true, true)
			# Creating Server SQL connection
			@@_mysql = Mysql.new(DB_server,DB_user,DB_password,DB_name)
			# Set up the database
			print "Setting up Database... \n\r"
			#print "Step 1... \n"
		#@@_mysql.query("TRUNCATE TABLE online_users;")
			#print "Step 2... \n"
			#@@_mysql.query("TRUNCATE TABLE users;")
			#print "Step 3... \n"
			#@@_mysql.query("TRUNCATE TABLE characters;")
			#print "Step 4...Create user 'test' pass 'test' \n"
			#@@_mysql.query("INSERT INTO users(id,login,password,email,reg_dat,validation) VALUES ( '','test',MD5('test'),'test@test.com',UNIX_TIMESTAMP( ),1);")
			#print "Step 5...Create user 'test2' pass 'test2' \n"
			#@@_mysql.query("INSERT INTO users(id,login,password,email,reg_dat,validation) VALUES ( '','test2',MD5('test2'),'test2@test.com',UNIX_TIMESTAMP( ),1);")
			#print "Step 6... \n"
			#@@_mysql.query("INSERT INTO characters VALUES (2, 2, 0, 0, '1', 'Alice', 16, 9, 3, 0, 2, '002-Fighter02', 'offline', 2, 5, 0, 0, 0, 1000, 1000, 0, 1, 1, '102,97', 1164649497, 0);")
			#print "Step 7... \n"
			#@@_mysql.query("INSERT INTO characters VALUES (3, 1, 0, 0, '1', 'Paul', 11, 6, 3, 0, 8, '001-Fighter01', 'offline', 2, 5, 0, 0, 0, 1000, 1000, 0, 1, 1, '102,97', 1164649434, 0);")
			print "Setup Success... \n"
			#------------------------------------------------------
			@@clients={}
		rescue Exception
			print $!
			store_error("Server Error",$!)
			@@_mysql.close
			@@log.close
			@state = false
		end
	end
	#-----------------------------------------------------------------------------------------------------
	# Return Server's Mysql Connection
	#-----------------------------------------------------------------------------------------------------
	def mysql
		return @@_mysql
	end
	def clients
		return @@clients
	end
	def game_variables
		return @@game_variables
	end
	def game_switches
		return @@game_switches
	end
	
	def setup
		begin
		print "--------------------------------------------------\n\r"
		print "loading game data... \n\r"
		
		@@game_variables = Game_Variables.new
		@@game_switches = Game_Switches.new
		@@maps=[]
		for f in Dir["./DATA/Map[0-9]*.rxdata]
			@@maps.push(Game_Map.new(f)) 
		end
		raise "No map to load\n" if @@maps.size==0
		@map_thread = Thread.new {
			begin
				loop do
					for map in @@maps
						map.update
					end 
					sleep(1/35.to_f)
				end
			rescue Exception
				print "M: Exception occured! #{$!}\n"
				store_error("Server Map Update Error",$!)
			end
		}
		rescue Exception
			print $!
			store_error("Server Error",$!)
			@@_mysql.close
			@@log.close
			@state = false
		end
	end
	#-----------------------------------------------------------------------------------------------------
	# Answer to the client.
	#-----------------------------------------------------------------------------------------------------
	def serve(io)
		while io.gets
			break if process(io,$_)
		end
		disconnecting(io.peeraddr[1],io) if !io.closed?
	end
	#-----------------------------------------------------------------------------------------------------
	# Server Stopping message stored in the log file, and close the log file Stream
	#-----------------------------------------------------------------------------------------------------
	def stopping()
		log("#{self.class.to_s} #{@host}:#{@port} stop")
		@@log.close
	end
	#-----------------------------------------------------------------------------------------------------
	# Store Error in the error Log
	#-----------------------------------------------------------------------------------------------------
	def error(detail)
		store_error("Server internal error", detail)
	end
	#-----------------------------------------------------------------------------------------------------
	# * Load data from a file. ( Exclusive to RMXP data file.
	#-----------------------------------------------------------------------------------------------------
	def load_data(filename)
		f = File.open(filename,'rb')
		return Marshal.load(f)
	end
	#-----------------------------------------------------------------------------------------------------
	# * Store error in a log file.
	#-----------------------------------------------------------------------------------------------------
	def store_error(ori,exception)
		trace = exception.backtrace.join("\n")
	file = File.open(@@error_log, "a+")
	file.write("#{Time.new.to_s} - #{ori}: #{exception}\n\r")
	file.write("#{trace}\n\r")
	file.close()
	end
	#-----------------------------------------------------------------------------------------------------
	# * Client Connection process
	#-----------------------------------------------------------------------------------------------------
	def connecting(client)
		addr = client.peeraddr
		log("#{self.class.to_s} #{@host}:#{@port} client:#{addr[1]} " +
			"#{addr[2]}<#{addr[3]}> connect")
		
		@@clients[client]=NClient.new(client)
		true
	end
	#-----------------------------------------------------------------------------------------------------
	# * DisConnect the client
	#-----------------------------------------------------------------------------------------------------
	def disconnecting(clientPort,io=nil)
		log("#{self.class.to_s} #{@host}:#{@port} " +
			"client:#{clientPort} disconnect")
		client = @@clients[io]
		if client!=nil
			user_id = client.db_id
			client.mysql.query("UPDATE characters SET savetime = UNIX_TIMESTAMP(), status='offline', client_id=#{0}, online_id=#{0} WHERE user_id=#{user_id} AND online_id=#{user_id};") rescue print "M: Error while updating characters table\n\r #{$!}\n\r"
			client.mysql.query("DELETE from online_users WHERE id='#{user_id}';") rescue print "M: (ensure) Error while deleting online_users entry\n\r #{$!}"
			client.mysql.query("OPTIMIZE TABLE `online_users`;") rescue print "M: (ensure) Error while optimising table online_users\n\r"
			@@clients.delete(io)
			client.socket.close
			client.mysql.close
		end
	end
end

Updating and launch

We can upgrade him to the script editor of the game with the scripts of netplay plus you need to go there to go and find your main line 12 there is # map_export change with map_export and do a testplay pressure before he comes to the login window on Z, and then closed the game out now you see your maps and tilesets in the folder converted from the directory of your game. Put those maps and tilesets that is converted to the DATA directory of the server and you have him updated!

Now is the day that you can finally try!

Make sure MYSQL is on concern that Wamp is turned on so you have to Wampmanager click and go to the directory Server and main pressure on the local server if you run press Y and if it is not so in N eventually comes to server running, now try to start the game and if everything fails then send a message on this topic!
 

Ratke

Member

bananawithjoy;330533 said:
To make a registration page (provided you have a web server. Try http://www.awardspace.com
if you don't), simply edit the file %Server Root%\WWW\Connections\Netplay.php to hold your mySQL database data (same as in your config file), then upload the entire contents of the WWW folder onto your web server.

Lil tutorial maybe ^^?
gettin kinda confused
managed to get the web server at http://www.awardspace.com
i think :p
 

Ratke

Member

like my title says i got an new problem
i wanted to see or some1 from an other comp could connect to me
so i send it to a friend the exact same file.
mine works perfect
but at him he gets script is hangin

anyone can give a hand?
 

Ratke

Member

for some reason i cant go to the link :/
when i click it i get

error has occured in my internet @_@
like i would force shutdown it
and my internet shuts off an sec later
 
@bananawithjoy - Actually if you have the mysql database running then the problem isn't the server being set up to localhost in the settings, as that's fine, Wyatt. The problem is, you don't have a username by the name of root on that mysql server, which is what you need to set up and I don't really remember how I did it for mine.
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top