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.
iv been trying to get a server running i did everything the tutorial said but when i load the client it says no server WTF is going on????
 

Jonny

Member

I have the server set up and everything runs perfectly but I don't have the battle system for it. It wasn't in the demo and when I tried re-downloading the demo it still wasn't there. Does anybody know where I can get it?
 
Hiya.

I finally managed to set up Netplay+ into my game, and as far as I know it is working fine. But I have some questions:

- What is unfinished here?
People keep saying that Netplay+ is not finished, and broken. What is broken, what is unfinished, what needs to be done??

-Beta...
I have two versions on my PC. I have the one downloaded from this thread, which is very basic and stripped down. And then I have the Beta (from when there was a big Beta test of Netplay+ that anyone could play but not use - eventually you released it for download but now it's gone along with the site). Am I allowed to use this Beta, and if so, is there anything I should know about it (i.e. what is unfinished, what doesn't work, etc)?

The Beta certainly is a lot more appealing. It has guilds, trade, chat, player versus player (probably doesn't work though), global events, global everything...
 
Icedmetal57;271028 said:
...
And for Icechamp's question, here's the solution. You may have to scroll a bit, depending on how you're web browser is. Anyway, there's the problem you're having. That 0 as shown in red here, should be a 1 for it to automatically validate the registrants. You'll have to manually validate those users already registered by changing that 0 to a 1 in the database in the users table.
Code:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO users (id, login, password, email, reg_dat, validation) VALUES ('', %s, MD5(%s), %s, UNIX_TIMESTAMP(), [color=red]0[/color]);",
                       GetSQLValueString($_POST['login'], "text"),
                       GetSQLValueString($_POST['password'], "text"),
                       GetSQLValueString($_POST['email'], "text"));

Well, I hope that I helped most of you guys and cleared up a few questions as well.

Hi, anyone know what file this coding is in?
 

sytes

Member

Use this index.php if you dont want to lose the 'USERS'

Code:
<?php require_once('Connections/Netplay.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO users (id, login, password, email, reg_dat, validation) VALUES ('', %s, MD5(%s), %s, UNIX_TIMESTAMP(), 0);",
                       GetSQLValueString($_POST['login'], "text"),
                       GetSQLValueString($_POST['password'], "text"),
                       GetSQLValueString($_POST['email'], "text"));

  mysql_select_db($database_Netplay, $Netplay);
  $Result1 = mysql_query($insertSQL, $Netplay) or die(mysql_error());
  $id =  mysql_insert_id();
  
  $insertSQL = "INSERT INTO temp_users (id,email,code) VALUES (".$id.",'".$_POST['email']."',MD5('".$_POST['email']."') );";
  
  $Result2 = mysql_query($insertSQL, $Netplay) or die(mysql_error());
  $message="Thank you ".$_POST['login']." for your registration on the Netplay Server.\n Please click on this link to confirm your email adress : \n
  http://".$_SERVER['PHP_SELF']."/confirm.php?id=".$id."&confirm=".md5($_POST['email'])." \n";
  $headers="From: trebor777@servage.net\n";
  mail($_POST['email'],"Netplay: Confirm your email",$message,$headers);
  
  $insertGoTo = "success.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_Netplay, $Netplay);
$query_User = "SELECT * FROM users";
$User = mysql_query($query_User, $Netplay) or die(mysql_error());
$row_User = mysql_fetch_assoc($User);
$totalRows_User = mysql_num_rows($User);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Netplay Registration Page</title>
</head>

<body>

<div align="center">
  <p>Netplay Registration Page</p>
  <form method="post" name="form1" action="<?php echo $editFormAction; ?>">
    <table align="center">
      <tr valign="baseline">
        <td nowrap align="right">Login:</td>
        <td><input type="text" name="login" value="" size="10" maxlength="8"> 
        8 characters maximum</td>
      </tr>
      <tr valign="baseline">
        <td nowrap align="right">Password:</td>
        <td><input type="password" name="password" value="" size="10" maxlength="8"> 
        8 characters maximum</td>
      </tr>
      <tr valign="baseline">
        <td nowrap align="right">Email:</td>
        <td><input type="text" name="email" value="" size="50" maxlength="255"></td>
      </tr>
      <tr valign="baseline">
        <td nowrap align="right"> </td>
        <td><input type="submit" value="Register"></td>
      </tr>
    </table>
    <input type="hidden" name="MM_insert" value="form1">
  </form>
  <p> </p>
</div>
</body>
</html>
<?php
mysql_free_result($User);
?>
 
Cheers dude.

Urgh.

The server is fully working, nd the game seems to work, unless the server is running, where it just crashes and says "script is hanging". The server works, the game works. So why not both at the same time? :(
 
Ok... details details details.

The error occurs during Scene_Login, which I editted to this:

Code:
#==============================================================================
# ** Scene_Login
#    - The login scene the player is first taken to.
#------------------------------------------------------------------------------
# Muhammet "Mr.Mo" Sivri
# Netplay Plus 2.0
# 1.0
# 02-04-2007
#------------------------------------------------------------------------------
# You can do some edits to this script in Settings.
#==============================================================================
SDK.log('Login', 'Mr.Mo', '2.0', '02-04-07')
# Disable if Network is disabled.
SDK.disable('Login') if !SDK.enabled?('Network')
#-------------------------------------------------------------------------------
# Begin SDK Enabled Check
#-------------------------------------------------------------------------------
if SDK.enabled?('Login')
#-------------------------------------------------------------------------------
class Scene_Login < SDK::Scene_Base
  #----------------------------------------------------------------------------
  # * Initialize Object
  #----------------------------------------------------------------------------
  def initialize
    # Create Mouse Object
    @sprr = 0
    $Mouse = Game_Mouse.new
    $mouse = $Mouse
    $Mouse.visible
    # Load database
    $data_actors        = load_data("Data/Actors.rxdata")
    $data_classes       = load_data("Data/Classes.rxdata")
    $data_skills        = load_data("Data/Skills.rxdata")
    $data_items         = load_data("Data/Items.rxdata")
    $data_weapons       = load_data("Data/Weapons.rxdata")
    $data_armors        = load_data("Data/Armors.rxdata")
    $data_enemies       = load_data("Data/Enemies.rxdata")
    $data_troops        = load_data("Data/Troops.rxdata")
    $data_states        = load_data("Data/States.rxdata")
    $data_animations    = load_data("Data/Animations.rxdata")
    $data_tilesets      = load_data("Data/Tilesets.rxdata")
    $data_common_events = load_data("Data/CommonEvents.rxdata")
    $data_system        = load_data("Data/System.rxdata") 
    # Change Animation Size
    for an in $data_animations
      next if an == nil
      frames = an.frames
      for i in 0...frames.size
        for j in 0...frames[i].cell_max
          frames[i].cell_data[j, 1] /= $settings.animation_divide
          frames[i].cell_data[j, 2] /= $settings.animation_divide
          frames[i].cell_data[j, 3] /= $settings.animation_divide
        end
      end
    end
    # Data creation
    $game_system        = Game_System.new
    $game_temp          = Game_Temp.new
    $game_netplay       = Game_Netplay.new
    # Network Initialization
    Network.initialize
    # Count
    @count = $settings.server_check_time
    @first = true
  end
  #--------------------------------------------------------------------------
  # * Main Window
  #--------------------------------------------------------------------------
  def main_window
    # Create Login
    @login_window = Window_Login.new
    # Create file if in Debug and it doesn't exist.
    if $DEBUG and !FileTest.exist?("Settings.rxdata")
      v = [false," "," "]
      save_data(v,"Settings.rxdata")
    end
    # Get Data
    set = load_data("Settings.rxdata")
    @login_window.username.text = set[1].to_s if set[0]
    @login_window.password.text = set[2].to_s if set[0]
    # If the data is not remembered
    if @login_window.username.text != ""
      @login_window.rememberme.check
    # Else if it is
    else
      @login_window.rememberme.uncheck
    end
    # Create Status window
    @status_window = Window_LoginStatus.new
    # Create Server Selection
    create_server if $settings.display_server 
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Transition
  #--------------------------------------------------------------------------
  def main_transition
    Graphics.transition
    # Create News
    create_news if $settings.display_news
    @first = false
  end
  #--------------------------------------------------------------------------
  # * Main Sprite
  #--------------------------------------------------------------------------
  def main_sprite
    # Background Media
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @sprite2 = Sprite.new
    @sprite2.z = 9999
    @sprite2.bitmap = RPG::Cache.picture('snowfall_2')
    @sprite = Plane.new(@viewport1)
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
  end
  #--------------------------------------------------------------------------
  # * Main Audio
  #--------------------------------------------------------------------------
  def main_audio
    $game_system.bgm_play($data_system.title_bgm)
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Ending
  #--------------------------------------------------------------------------
  def main_end
    $game_system.bgm_stop
  end
  #--------------------------------------------------------------------------
  # * Create Server
  #--------------------------------------------------------------------------
  def create_server
    ostatus = @status_window.status
    @status_window.status = "Reseting server list. Please wait..."
    # Get the servers
    servers = {}
    $settings.servers.each {|key, value|
      # Check if server online or not
      Network.test_connection(value[0],value[1])
      status = "Online" if !Network.result
      status = "Offline" if Network.result
      servers[key] = status
      # Reset
      Network.testreset
      # Update Graphics
      Graphics.update if $settings.servers.size > 2
    } 
    # Update Graphics
    Graphics.update
    # Dispose server window
    @server_window = Window_Server.new if @server_window == nil
    # Create server window
    @server_window.refresh(servers)
    # Reset Complete
    @status_window.status = ostatus
    # Create News
    create_news if $settings.display_news and !@first
  end
  #--------------------------------------------------------------------------
  # * Create News
  #--------------------------------------------------------------------------
  def create_news
    # Get Selected Server
    server = @server_window.server
    return if server == nil
    # Return if the selected server is offline
    return if server[1] == "Offline"
    # Connect temporarly
    $settings.servers.each {|key, value| 
      if server[0].to_s == key.to_s
        Network.connect(value[0],value[1])
        # Get News
        if Network.authenficate ==  "success"
          Graphics.update
          @news_window = Window_News.new if @news_window == nil
          @news_window.get_news
        else
          print "You do not have the right gamecode or connection timed out."
        end
      end
    }
  end
  #--------------------------------------------------------------------------
  # * Login
  #--------------------------------------------------------------------------
  def login
    return create_server if @server_window.server[1] == "Offline" or !@server_window.freeze
    # Get Updates
    result = Network.login(@login_window.username.text,@login_window.password.text)
    if result == result.to_i.to_s
      # Get Updates
      Network.check_for_updates
      # Get Guilds
      Network.get_guilds
      # Store Data
      store_data
      # Go to Character Creator
      $scene = Scene_Character.new
    else
      @status_window.status = result.to_s
    end
  end
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    @sprite.ox += 1
    update_server
  end
  def update_server
    # Update Controls
    if Input.trigger?(Input::DOWN) or Input.trigger?(Input::UP) or Input.trigger?(Keys::TAB)
      if !@login_window.username.active
        # Activate
        @login_window.username.active = true
        @login_window.password.active = false
      elsif !@login_window.password.active
        # Activate
        @login_window.password.active = true
        @login_window.username.active = false
      end
    end
    # Update Count
    @count -= 1 
    @count = 0 if $DEBUG and Input.press?(Input::CTRL)
    # If Count is 0
    if @count <= 0 and $settings.server_check_time > 0
      @count = $settings.server_check_time
      # Create Servers
      create_server if @server_window.server[1] != "Online"
    end
  end
  #--------------------------------------------------------------------------
  # * Store Data
  #--------------------------------------------------------------------------
  def store_data
    if @login_window.rememberme.checked
      v = [true,"#{@login_window.username.text}","#{@login_window.password.text}"]
      save_data(v,"Settings.rxdata")
    else
      v = [false," "," "]
      save_data(v,"Settings.rxdata")
    end
  end
end
end

The error log tells me this:

ON <Mon 12 Nov 2007, 12:30:34> the error: <<() (#<Scene_Login:0x3bdb758>)>> occured.

The error message is this:

Script is Hanging

The database is running with the sql file and everything. The server is online, the correct port is open. The IP address in use is 127.0.0.1. The gamecode is correct. The server shows up as online during the login scene, but nothing moves (not even the mouse cursor) and then it closes after... 5 seconds? bringing the error message.

http://img.photobucket.com/albums/v108/ ... r_err2.png[/IMG]

The server looks like this during this time:

http://img.photobucket.com/albums/v108/ ... r_err1.png[/IMG]
 

sytes

Member

'I had that problem before i had the old netplay server online ...'

*NOW CAN SOMONE help me how to fix the god damn Maps?!*
 
I'm seriously thinking of switching back to 1.x.

2.x has so many bugd and errors. Knowing RGSS doesn't help at all, to fix them you need to have been the one to make it, as the comments and wording and everything is unique to the scripter.

Anything in 2.0 that isn't in 1.x?

(Hah! I've been trying over a year (literally) to set up Netplay+ 2.0, and yet I just set up Netplay+ 1.6.3 in the space it took to post then edit this message. Plus it's faster and less laggy.

But then of course... my server is Linux, and C++ wont run on Linux, unless I use Wine...)
 
Has anyone ever got the ruby server to work on with the orginal netplay code? I like the new server, althought it eats up alot of cpu processing power, but i like the idea of storing user files in a mysql database to prevent alot of shadyness. Has anyone tried, or is it possible by copying some of the new protocals to my existing project to phase out suicides netplay server and run a older version of the netplay code with the new server (ruby)?
 
Just in case it helps anyone:

Wyatt's Guide to Setting Up Netplay+ 1.6.3

1. Download the package 1.6.3 to your PC.

Location: top of this thread

2. This can be helpful... Download the latest SDK. Copy and paste this below the existing SDK, and delete the existing one. Find all the lines that say SDK.state, SDK.log, etc and change them accordingly.

Location: http://www.rmxp.org/forums/showthread.php?t=1802

3. If you are starting anew, use this as your project and skip to 6. If you are continuing an existing project, go to 4.

4. Open your game and the new project at the same time. Copy and paste each script of your game one by one into the new game, below the Netplay+ scripts.

5. Open your game's folder, and go to Data. Move "Scripts" to the side, and highlight everything else. Copy this, and go to the Netplay+ project. Paste them into the Data folder.

6. Copy your "Graphics" and "Audio" folders from your project into the Netplay+ Projects.

For 5 and 6 when it says "do you want to replace" click "yes to all".

7. Go to "User Edits". Find where it says:
"Mr.Mo Home Server"
Delete this whole line. This will cause a shizload of errors, and is the main cause of all the problems, I found out. Delete the comma ( , ) at the end of the line above it too.

8. Download the new server. (0.8.4)

9. Change the port to a number you can remember, also change this in the User Edits. 50,000 is good to start off with, but dangerous because we all know you have 50,000 open then :).

10. Click Netplay > Start.

11. In the server, go to security. Type in username "test", password "test", and group "admin".

12. Open the game client, and play. Login with test/test, and see if it works.

There ya go, Netplay+ 1.6.3 in 12 steps.
 
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