赞 | 0 |
VIP | 1 |
好人卡 | 0 |
积分 | 1 |
经验 | 62216 |
最后登录 | 2024-9-29 |
在线时间 | 17 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 69
- 在线时间
- 17 小时
- 注册时间
- 2005-11-13
- 帖子
- 61
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
Netplay Plus 2.0 Client and Ruby Server
以下地址复制到IE上,在进入网站后点击Free按钮下载,
直接复制到下载工具上,下载会失败
http://rapidshare.com/files/43139697/Netplay_2.0_Server_And_Client.zip
压缩包内包含范例,似乎支持2人同时游戏
看上去要下个ruby,mysql数据库服务器,PHPMyAdmin
不懂英文的可以尝试下架设:XAMPP,配合上Ruby
XAMPP是Apache+MySQL+PHP+PERL 在windows下的集成包,至于Wamp好像是在linux下的偶们用不到
以下是英文,大家可以参考架设.
- 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/Netplay_2.0_Server_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/downloading.php?groupname=wampserver&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 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 = "[email protected]" 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 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 protected]', 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 protected]', 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!
复制代码 |
|