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.

3 Netplays News (NP Absolute, NP Master and Orpg Netplay)

1 - Netplay Absolute 1.1


Sorry my English, I'm using translator

What is:
-Scene_Connect(2 Models)
-Login
-Registration
-1 Characters on each account
-Character Creator
-Chat
-Message chat also below the character (Incomplete)
-PvP
-Hotkey
-Hud
-Distribution Points
-Global Visual Equip (Optional)
-Characters move with the mouse (Optional)
-Private Chat
-Trade
-And many others...

Screens:
Scene_Connect (1 of Models)
10006556.png

Login
97824357.png

Choosing Characters
18110028.png

Testing Chat
81725771.png

Outhers Characters
78668446.png

Distribuite Points and Menu
23264692.png


Download:
Download Megaupload

2 - Netplay Master 1.1


What is:
-Login
-Registration
-3 Characters in each account
-Character Creator
-Chat
-Message chat also below the character (Incomplete)
-PvP
-Hotkey
-Hud
-Inventory
-New Shop
-Distribution Points (Optional)
-Global Visual Equip (Optional)
-Characters move with the mouse (Optional)
-Commands in the Chat (Including to Admin)
-Private Chat
-Trade
-And many others...

Screens:
Scene_Connect
16271871.png

Login
53051772.png

Choosing Characters (Traditional)
77671793.png

Creating Characters
48354384.png

Testing Chat
14297055.png

Inventory and Store
38345484.png

Status and Distribution Points
92418574.png

Killing Monsters
83799950.png


Download:
Download Megaupload

3 - Orpg Editor - Netplay (Version 1.3)


Introdução:
Here's my latest work!
Many people were a bit sad because a program so good is the Editor Orpg was stopped, but I solved this problem, I redid the Orpg Editor (Game and not the program) in RPG Maker XP, now a little more complete and NO BUGS .... Before some idiot has a thought that I copied the Script Editor Orpg that is impossible, since they are different languages, I copy, I DID get the scripts for almost 100% the same Orpg Editor, I basically only Copei images, ja else I DID!

The name means Orpg Netplay is incoherent, since it means Orpg: Online Role Playing Game, but I put that name because as it mimics the Orpg, I left this part of the name in netplay

What is:
-Login
-Registration
-3 Characters in each account
-Character-Creator
-Chat
-Inventory
-PvP (Orpg The Editor has no original ^ ^)
-Strikes Back Monsters Mouse and people with
-Hotkey
-Hud
-Inventory-to drag the item to equip
-Menu Skills trailing until the magic hotkey
-Global-Visual Equipment (Optional)
-And many others ...

Screens:
Login
13412437.png

Choosing Characters
38567820.png

Creating Characters
50464791.png

Testing Chat
65052420.png

Inventory
98168231.png

Menu
38174689.png

Window Help
70368751.png

Menu other players
wh3q.png

Shop
88239954.png

Hud of outhers players
32960361.png


Download:
Download Megaupload

None of the three has Netplays bug or lag

Créditos:
Marlos Gama (Why Create 3 Netplays)
SnakeDeath (Helped me) ;**
Twinsen (Helped me)
 
Wow, this looks awesome. I downloaded the second one because of the admin commands. Thanks, hope this works.

Edit: IT works! and it's fast too!!! It awesome, great job!!!!!
Edit2: Wish this was in English, but it's still awesome!!
edit3: has no global switches or variables, and it has the old np glitch where you can't see new people on map.
edit4: admins commands do not work. You can't type "/" or "?", also you can't scroll chat
 
A little known bug with MrMo's ABS used in many NetPlay games. I saw you use it in the 1st at least. This error can be repaired through a simple edit to the script itself which I can describe here:noted below.

Almost immediately after it is shown, the damage the player receives disappears from the screen rather than waiting the entire 40 frame delay as defined by the system. Enemy damage is fine, but the player damage just vanishes. This was repaired by doing the following:

I went down to the update method in the Sprite_Character class in Mr.Mo's ABS (roughly line 2480) and found the following.
Code:
        #Display damage

        damage(a.damage, a.critical) if !a.dead? or a.damage != nil

While this looks like it would only show the damage pop if the character was dead or there was no damage, it performed the damage pop constantly. This is because the character was 'not' dead. One of the conditions was already met. As such, this statement was changed to this:
Code:
        #Display damage

        damage(a.damage, a.critical) if !a.dead? and a.damage != nil

I'm relatively familiar with MrMo's ABS nowadays. :thumb:

EDIT: Ne'er mind. The error was in version 4.5. You're using an earlier one.
 
catkitten":2995h97m said:
You can't type "/" or "?"
This sounds much like a keyboard issue. Try setting the keyboard language in your OS to the scripter's language, and press the equivalent key for question mark or slash keys. Alternatively, if you know how to script, you might be able to change the key mapping in the script itself. Note that if that's the issue, it'll cause problems with other people from other countries again, though.
 
BlueScope":3606vghq said:
catkitten":3606vghq said:
You can't type "/" or "?"
This sounds much like a keyboard issue. Try setting the keyboard language in your OS to the scripter's language, and press the equivalent key for question mark or slash keys. Alternatively, if you know how to script, you might be able to change the key mapping in the script itself. Note that if that's the issue, it'll cause problems with other people from other countries again, though.

Thanks, yeah I got that working.
 
BlueScope":3e0ikrng said:
catkitten":3e0ikrng said:
You can't type "/" or "?"
This sounds much like a keyboard issue. Try setting the keyboard language in your OS to the scripter's language, and press the equivalent key for question mark or slash keys. Alternatively, if you know how to script, you might be able to change the key mapping in the script itself. Note that if that's the issue, it'll cause problems with other people from other countries again, though.
Sorry, my keyboard is different
For you change is in script: [INP] Input
Line: 156
Code:
Backslash = 193     # => / ?
change number 193 for 191

catkitten":3e0ikrng said:
BlueScope":3e0ikrng said:
catkitten":3e0ikrng said:
You can't type "/" or "?"
This sounds much like a keyboard issue. Try setting the keyboard language in your OS to the scripter's language, and press the equivalent key for question mark or slash keys. Alternatively, if you know how to script, you might be able to change the key mapping in the script itself. Note that if that's the issue, it'll cause problems with other people from other countries again, though.

Thanks, yeah I got that working.
????


Edit:The three Netplays were upgraded
 
Marlos Gama, thanks, your fix is better than mine was, i went in to the registry and changed the language of my keyboard till the slash worked. But yours is faster and i can now use "/". Thank you.

You said you updated it, but what have you fixed?
 
efeerk":17om3kwd said:
It says "This project is from an old version of RPG Maker and cannot be loaded."

...?

I have the same problem, is anyone willing to help?

EDIT: Never mind, i found a solution, you just copy and paste another project icon to the one in the folder. :)
 
Hey can you change the max gold of 9999? if so how do you do it?
and where can you see your gold in the Netplay Absolute 1.1?

EDIT: Never mind, i found out how
 
Its nt working for me says the servers offline nd gives me an error 53 that it cnt make an connection because the target actively refused it??
 
Hi, I have a little problem with this:

Client sends a request packet -> server sends a response with the following things character name and character graphic(line 942)
The client should take that and save it into the variables(line 942) but when I call the self.char_name function (line 112) it just returns "" (Tested at line 890)

(server does send the asked things cause I used p $1.to_s in the retrival part to make sure)
what am I doing wrong?

Code:
#===============================================================================

# ** Network - Manages network data.

#-------------------------------------------------------------------------------

# Author    Me™ and Mr.Mo

# Version   1.0

# Date      11-04-06

#===============================================================================

SDK.log("Network", "Mr.Mo and Me™", "1.0", " 11-04-06")

 

p "TCPSocket script not found (class Network)" if not SDK.state('TCPSocket')

#-------------------------------------------------------------------------------

# Begin SDK Enabled Check

#-------------------------------------------------------------------------------

if SDK.state('TCPSocket') == true and SDK.state('Network')

 

module Network

  

class Main

  

  #--------------------------------------------------------------------------

  # * Attributes

  #-------------------------------------------------------------------------- 

  attr_accessor :socket

  attr_accessor :pm

  # getpm, pmname, writepm

  

  # AUTHENFICATION  = 0     => Authenficates

  # ID_REQUEST      = 1     => Returns ID

  # NAME_REQUEST    = 2     => Returns UserName

  # GROUP_REQUEST   = 3     => Returns Group

  # CLOSE           = 4     => Close, Stop Connection

  # NET_PLAYER      = 5     => Netplayers Data

  # MAP_PLAYER      = 6     => Mapplayers Data

  # KICK            = 7     => Kick a Player

  # KICK ALL        = 8     => Kick all Players

  # REMOVE          = 9     => Remove Player (CLOSE SYNONYM)

  # SYSTEM          = 10    => System (Var's and Switches)

  # MOD_CHANGE      = 11    => Message ot Day Change

  # TRADE           = 12    => Trade

  # PRIVATE_CHAT    = 13    => Private Chat 

  #                 = 14

  # POKE            = 15    => Poke Player

  # SLAP            = 16    => Decrease HP or SP PLayer

  # SLAP ALL        = 17    => Decrease Hp or SP ALL

  # ADM - MOD       = 18    => Admin/Mod Command Returns

  #                 = 19 

  # TEST STOP       = 20    => Connection Test End

  

  #--------------------------------------------------------------------------

  # * Initialiation

  #-------------------------------------------------------------------------- 

  def self.initialize

    @players    = {}

    @mapplayers = {}

    @netactors  = {}

    @pm = {}

    @pm_lines = []

    @user_test  = false

    @user_exist = false

    @socket     = nil

    @nooprec    = 0

    @id         = -1

    @name       = ""

    @characname = ""

    @characgfx = ""

    @group      = ""

    @status     = ""

    @oldx       = -1

    @oldy       = -1

    @oldd       = -1

    @oldp       = -1

    @oldid      = -1

    @login      = false

    @pchat_conf = false

    @send_conf  = false

    @trade_conf = false

    @servername = ""

    @pm_getting = false

    @self_key1 = nil

    @self_key2 = nil

    @self_key3 = nil

    @self_value = nil

    @trade_compelete = false

    @trading = false

    @trade_id = -1

  end

  #--------------------------------------------------------------------------

  # * Returns Servername

  #-------------------------------------------------------------------------- 

  def self.servername

    return @servername.to_s

  end

  #--------------------------------------------------------------------------

  # * Returns Socket

  #-------------------------------------------------------------------------- 

  def self.socket

    return @socket

  end

  #--------------------------------------------------------------------------

  # * Returns UserID

  #-------------------------------------------------------------------------- 

  def self.id

    return @id

  end

  #--------------------------------------------------------------------------

  # * Returns UserName

  #-------------------------------------------------------------------------- 

  def self.name

    return @name

  end  

  

  def self.char_name

    return @characname

  end

  

  def self.char_gfx

    return @characgfx

  end

  #--------------------------------------------------------------------------

  # * Returns current Status

  #-------------------------------------------------------------------------- 

  def self.status

    return "" if @status == nil or @status == []

    return @status

  end

  #--------------------------------------------------------------------------

  # * Returns Group

  #-------------------------------------------------------------------------- 

  def self.group

    if @group.downcase.include?("adm")

      group = "admin"

    elsif @group.downcase.include?("mod")

      group = "mod"

    else

      group = "standard"

    end

    return group

  end

  #--------------------------------------------------------------------------

  # * Returns Mapplayers

  #-------------------------------------------------------------------------- 

  def self.mapplayers

    return {} if @mapplayers == nil

    return @mapplayers

  end

  #--------------------------------------------------------------------------

  # * Returns NetActors

  #-------------------------------------------------------------------------- 

  def self.netactors

    return {} if @netactors == nil

    return @netactors

  end

  #--------------------------------------------------------------------------

  # * Returns Players

  #-------------------------------------------------------------------------- 

  def self.players

    return {} if @players == nil

    return @players

  end

  #--------------------------------------------------------------------------

  # * Destroys player

  #-------------------------------------------------------------------------- 

  def self.destroy(id)

    @players[id.to_s] = nil rescue nil

    @mapplayers[id.to_s] = "" rescue nil

    for player in @mapplayers

      @mapplayers.delete(id.to_s) if player[0].to_i == id.to_i

    end

    for player in @players

      @players.delete(id.to_s) if player[0].to_i == id.to_i

    end

    if $scene.is_a?(Scene_Map)

      begin

        $scene.spriteset[id].dispose unless $scene.spriteset[id].disposed?

      rescue

        nil

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Create A socket

  #-------------------------------------------------------------------------- 

  def self.start_connection(host, port)

    @socket = TCPSocket.new(host, port)

  end

  #--------------------------------------------------------------------------

  # * Asks for Id

  #-------------------------------------------------------------------------- 

  def self.get_id

    @socket.send("<1>'req'</1>\n")

  end

  #--------------------------------------------------------------------------

  # * Asks for name

  #-------------------------------------------------------------------------- 

  def self.get_name

    @socket.send("<2>'req'</2>\n")

  end

  #--------------------------------------------------------------------------

  # * Asks for Group

  #-------------------------------------------------------------------------- 

  def self.get_group

    #@socket.send("<3>'req'</3>\n")

    @socket.send("<check>#{self.name}</check>\n")

  end

  #--------------------------------------------------------------------------

  # * Registers (Attempt to)

  #-------------------------------------------------------------------------- 

  def self.send_register(user,pass)

    # Register with User as name, and Pass as password

    @socket.send("<reges #{user}>#{pass}</reges>\n")

    # Start Loop for Retrival

    loop = 0

      loop do

      loop += 1

      self.update

      # Break If Registration Succeeded

      break if @registered

      # Break if Loop reached 10000

      break if loop == 10000

    end

  end

  #--------------------------------------------------------------------------

  # * Asks for Network Version Number

  #-------------------------------------------------------------------------- 

  def self.retrieve_version

    @socket.send("<ver>#{User_Edit::VERSION}</ver>\n")

  end

  #--------------------------------------------------------------------------

  # * Asks for Message of the day

  #-------------------------------------------------------------------------- 

  def self.retrieve_mod

    @socket.send("<mod>'request'</mod>\n")

  end

  #--------------------------------------------------------------------------

  # * Asks for Login (and confirmation)

  #-------------------------------------------------------------------------- 

  def self.send_login(user,pass)

    @socket.send("<login #{user}>#{pass}</login>\n")

  end

  #--------------------------------------------------------------------------

  # * Send Errors

  #-------------------------------------------------------------------------- 

  def self.send_error(lines)

    if lines.is_a?(Array)

      for line in lines

        @socket.send("<err>#{line}</err>\n")

      end

    elsif lines.is_a?(String)

      @socket.send("<err>#{lines}</err>\n")

    end

  end  

  #--------------------------------------------------------------------------

  # * Authenfication

  #-------------------------------------------------------------------------- 

  def self.amnet_auth

    # Send Authenfication

    @socket.send("<0>'e'</0>\n")

    @auth = false

    # Set Try to 0, then start Loop

    try = 0

    loop do

      # Add 1 to Try

      try += 1

      loop = 0

      # Start Loop for Retrieval

      loop do

        loop += 1

        self.update

        # Break if Authenficated

        break if @auth

        # Break if loop reaches 20000

        break if loop == 20000

      end

      # If the loop was breaked because it reached 10000, display message

      p "#{User_Edit::NOTAUTH}, Tentativa #{try} de #{User_Edit::CONNFAILTRY}" if loop == 20000

      # Stop everything if try mets the maximum try's

      break if try == User_Edit::CONNFAILTRY

      # Break loop if Authenficated

      break if @auth

    end

    # Go to Scene Login if Authenficated

    $scene = Scene_Login.new if @auth

  end

  #--------------------------------------------------------------------------

  # * Send Start Data

  #-------------------------------------------------------------------------- 

  def self.send_start

    send = ""

    # Send Username And character's Graphic Name

    send += "@username = '#{self.name}'; @character_name = '#{$game_player.character_name}';"

    # Sends Map ID, X and Y positions

    send += "@map_id = #{$game_map.map_id}; @x = #{$game_player.x}; @y = #{$game_player.y};"

    # Sends Name

    send += "@nome = '#{$game_party.actors[0].name}';" if User_Edit::Bandwith >= 1

    # Sends Direction

    send += "@direction = #{$game_player.direction};" if User_Edit::Bandwith >= 2

    # Sends Move Speed

    send += "@move_speed = #{$game_player.move_speed};" if User_Edit::Bandwith >= 3

    # Sends Requesting start

    send += "@weapon_id = #{$game_party.actors[0].weapon_id};"

    send += "@armor1_id = #{$game_party.actors[0].armor1_id};"

    send += "@armor2_id = #{$game_party.actors[0].armor2_id};"

    send += "@armor3_id = #{$game_party.actors[0].armor3_id};"

    send += "@armor4_id = #{$game_party.actors[0].armor4_id};"

    send+= "start(#{self.id});"

    @socket.send("<5>#{send}</5>\n")

    self.send_newstats

    #send_actor_start

  end

  #--------------------------------------------------------------------------

  # * Return PMs

  #-------------------------------------------------------------------------

  def self.pm

    return @pm

  end

  #--------------------------------------------------------------------------

  # * Get PMs

  #-------------------------------------------------------------------------- 

  def self.get_pms

    @pm_getting = true

    @socket.send("<22a>'Get';</22a>\n")

  end

  #--------------------------------------------------------------------------

  # * Update PMs

  #-------------------------------------------------------------------------- 

  def self.update_pms(message)

   #Starts all the variables

   @pm = {}

   @current_Pm = nil

   @index = -1

   @message = false

   #Makes a loop to look thru the message

   for line in message

     #If the line is a new PM

     if line == "$NEWPM"

      @index+=1

      @pm[@index] = Game_PM.new(@index)

      @message = false

      #if the word has $to_from

     elsif line == "$to_from" and @message == false

       to_from = true

      #if the word has $subject

     elsif line == "$Subject" and @message == false

       subject = true

      #if the word has $message

     elsif line == "$Message" and @message == false

       @message = true

     elsif @message

       @pm[@index].message += line+"\n"

     elsif to_from

       @pm[@index].to_from = line

       to_from = false

     elsif subject

       @pm[@index].subject = line

       subject = false

     end

   end

   @pm_getting = false

 end

  #--------------------------------------------------------------------------

  # * Checks if the PM is still not get.

  #-------------------------------------------------------------------------- 

  def self.pm_getting

    return @pm_getting

  end

  #--------------------------------------------------------------------------

  # * Write PMs

  #-------------------------------------------------------------------------- 

  def self.write_pms(message)

    send = message

    @socket.send("<22d>#{send}</22d>\n")

  end

  

  def self.req_newchar(id, name, classid, template, slot)

    @socket.send("<newchar> #{@name} #{id} #{name} #{classid} #{template} #{slot} </newchar>")

  end

  

  def self.req_charAinfo

    @socket.send("<reqinfo> #{@name} 1 </reqinfo>")

  end

  #--------------------------------------------------------------------------

  # * Delete All PMs

  #-------------------------------------------------------------------------- 

  def self.delete_all_pms

    @socket.send("<22e>'delete'</22e>\n")

    @pm = {}

  end

  #--------------------------------------------------------------------------

  # * Delete pm(id)

  #-------------------------------------------------------------------------- 

  def self.delete_pm(id)

    @pm.delete(id)

  end

  #--------------------------------------------------------------------------

  # * Delete MapPlayers

  #-------------------------------------------------------------------------- 

  def self.mapplayers_delete

    @mapplayers = {}

  end

  #--------------------------------------------------------------------------

  # * Send Requested Data

  #-------------------------------------------------------------------------- 

  def self.send_start_request(id)

    send = ""

    # Send Username And character's Graphic Name

    send += "@username = '#{self.name}'; @character_name = '#{$game_player.character_name}'; "

    # Sends Map ID, X and Y positions

    send += "@map_id = #{$game_map.map_id}; @x = #{$game_player.x}; @y = #{$game_player.y}; "

    # Sends Name

    send += "@nome = '#{$game_party.actors[0].name}';" if User_Edit::Bandwith >= 1

    # Sends Direction

    send += "@direction = #{$game_player.direction}; " if User_Edit::Bandwith >= 2

    # Sends Move Speed

    send += "@move_speed = #{$game_player.move_speed};" if User_Edit::Bandwith >= 3 

    send += "@weapon_id = #{$game_party.actors[0].weapon_id};"

    send += "@armor1_id = #{$game_party.actors[0].armor1_id};"

    send += "@armor2_id = #{$game_party.actors[0].armor2_id};"

    send += "@armor3_id = #{$game_party.actors[0].armor3_id};"

    send += "@armor4_id = #{$game_party.actors[0].armor4_id};"

    #@socket.send("<6a>#{id.to_i}</6a>\n")

    @socket.send("<5>#{send}</5>\n")

    #self.send_map

    #self.send_actor_start

  end

  #--------------------------------------------------------------------------

  # * Send Map Id data

  #-------------------------------------------------------------------------- 

  def self.send_map

    send = ""

    # Send Username And character's Graphic Name

    send += "@username = '#{self.name}'; @character_name = '#{$game_player.character_name}'; "

    # Sends Map ID, X and Y positions

    send += "@map_id = #{$game_map.map_id}; @x = #{$game_player.x}; @y = #{$game_player.y}; "

    # Sends Direction

    send += "@direction = #{$game_player.direction};" if User_Edit::Bandwith >= 2

    send += "@weapon_id = #{$game_party.actors[0].weapon_id};"

    send += "@armor1_id = #{$game_party.actors[0].armor1_id};"

    send += "@armor2_id = #{$game_party.actors[0].armor2_id};"

    send += "@armor3_id = #{$game_party.actors[0].armor3_id};"

    send += "@armor4_id = #{$game_party.actors[0].armor4_id};"

    @socket.send("<5>#{send}</5>\n")

    for player in @players.values

      next if player.netid == -1

      # If the Player is on the same map...

      if player.map_id == $game_map.map_id and self.in_range?(player)

        # Update Map Players

        self.update_map_player(player.netid, nil)

      elsif @mapplayers[player.netid.to_s] != nil

        # Remove from Map Players

        self.update_map_player(player.netid, nil, true)

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Calls a player to trade

  #-------------------------------------------------------------------------- 

  def self.trade_call(id)

    @trade_compelete = false

    @trading = true

    @socket.send("<24>#{id}\n")

    ids = self.id

    @socket.send("<24c>@trade_id = #{ids}</24c>\n")

  end

  #--------------------------------------------------------------------------

  # * Exit trade.

  #-------------------------------------------------------------------------- 

  def self.trade_exit(id)

    @socket.send("<24>#{id}\n")

    ids = self.id

    @socket.send("<24d>trade_exit = #{ids}</24d>\n")

  end

  #--------------------------------------------------------------------------

  # * Checks if the trade is compelete

  #-------------------------------------------------------------------------- 

  def self.trade_compelete

    return @trade_compelete

  end

  #--------------------------------------------------------------------------

  # * Checks the trade result

  #-------------------------------------------------------------------------- 

  def self.trading

    return @trading

  end

  #--------------------------------------------------------------------------

  # * Send Move Update

  #--------------------------------------------------------------------------

  def self.trade_add(kind,item_id,netid)

    @socket.send("<25>#{netid}\n")

    me = self.id

    @socket.send("<25a>i_kind = #{kind}; i_id = #{item_id}; id = #{me};</25a>\n")

  end

  #--------------------------------------------------------------------------

  # * Send Move Update

  #--------------------------------------------------------------------------

  def self.trade_remove(kind,item_id,netid)

    @socket.send("<25>#{netid}\n")

    me = self.id

    @socket.send("<25b>i_kind = #{kind}; i_id = #{item_id}; id = #{me};</25b>\n")

  end

  #--------------------------------------------------------------------------

  # * Send Trade REquest

  #--------------------------------------------------------------------------

  def self.trade_request(netid)

    @socket.send("<25>#{netid}\n")

    me = self.id

    @socket.send("<25d>id = #{me};</25d>\n")

  end

  #--------------------------------------------------------------------------

  # * Send accept trade

  #--------------------------------------------------------------------------

  def self.trade_accept(netid)

    @socket.send("<25>#{netid}\n")

    me = self.id

    @socket.send("<25e>id = #{me};</25e>\n")

  end

  #--------------------------------------------------------------------------

  # * Send cancel trade

  #--------------------------------------------------------------------------

  def self.trade_cancel(netid)

    @socket.send("<25>#{netid}\n")

    me = self.id

    @socket.send("<25f>id = #{me};</25f>\n")

  end

  #--------------------------------------------------------------------------

  # * Send Move Update

  #-------------------------------------------------------------------------- 

  def self.send_move_change

    return if @oldx == $game_player.x and @oldy == $game_player.y

    return if @mapplayers == {}

    send = ""

    # Increase Steps if the oldx or the oldy do not match the new ones

    if User_Edit::Bandwith >= 1

      send += "ic;"  if @oldx != $game_player.x or @oldy != $game_player.y

    end

    # New x if x does not mathc the old one

    if @oldx != $game_player.x

      send += "@x = #{$game_player.x}; @tile_id = #{$game_player.tile_id};"

      @oldx = $game_player.x

    end

    # New y if y does not match the old one

    if @oldy != $game_player.y

      send += "@y = #{$game_player.y}; @tile_id = #{$game_player.tile_id};"

      @oldy = $game_player.y

    end

    # Send the Direction if it is different then before

    if User_Edit::Bandwith >= 2

      if @oldd != $game_player.direction 

        send += "@direction = #{$game_player.direction};"  

        @oldd = $game_player.direction

      end

    end

    # Send everything that needs to be sended

    @socket.send("<5>#{send}</5>\n") if send != ""

  end

  #--------------------------------------------------------------------------

  # * Send Stats

  #-------------------------------------------------------------------------- 

  def self.send_newstats

    hp = $game_party.actors[0].hp

    maxhp = $game_party.actors[0].maxhp

    sp = $game_party.actors[0].sp

    maxsp = $game_party.actors[0].maxsp

    agi = $game_party.actors[0].agi

    eva = $game_party.actors[0].eva

    pdef = $game_party.actors[0].pdef

    mdef = $game_party.actors[0].mdef

    level = $game_party.actors[0].level

    a = $game_party.actors[0]

    c = "["

    m = 1

    for i in a.states

      next if $data_states[i] == nil

      c += i.to_s

      c += ", " if m != a.states.size

      m += 1

    end

    c += "]"

    stats = "@hp = #{hp}; @maxhp = #{maxhp}; @sp = #{sp}; @maxsp = #{maxsp}; @agi = #{agi}; @eva = #{eva}; @pdef = #{pdef}; @mdef = #{mdef}; @states = #{c}; @level = #{level}"

    @socket.send("<5>#{stats}</5>\n")

  end

  #--------------------------------------------------------------------------

  # * Send Gold

  #-------------------------------------------------------------------------- 

  def self.send_gold

    gold = $game_party.gold

    @socket.send("<5>@gold = #{gold}</5>\n")

  end

  #--------------------------------------------------------------------------

  # * Close Socket

  #-------------------------------------------------------------------------- 

  def self.close_socket

    return if @socket == nil

    @socket.send("<9>#{self.id}</9>\n")

    #@socket.send("<4>'Close'</4>\n")

  #Se você fechar o jogo quando uma mensagem tiver aberta, quando retornar, ele não está travado

  if $game_temp.message_window_showing

    @message_window = Window_Message.new

    @message_window.terminate_message

  end

    if $scene.is_a?(Scene_Connect)

    end

    if $scene.is_a?(Scene_Login)

    end

    if $scene.is_a?(Scene_Register)

    end

    if $scene.is_a?(Scene_Title)

    end

    if $scene.is_a?(Scene_Create)

    end

    #No jogo

    if $scene.is_a?(Scene_Trade)

    salvar

    end

    if $scene.is_a?(Scene_PChat)

    salvar

    end

    if $scene.is_a?(Scene_Map)

    salvar

    end

    @socket.close

    @socket = nil

  end

  #--------------------------------------------------------------------------

  # * Change Messgae of the Day

  #-------------------------------------------------------------------------- 

  def self.change_mod(newmsg)

    @socket.send("<11>#{newmsg}</11>\n")

  end

  #--------------------------------------------------------------------------

  # * Private Chat Send

  #--------------------------------------------------------------------------

  def self.pchat(id,mesg)

    @pchat_conf = false

    # Send the Private Chat Id (without close!!! \<13a>)

    @socket.send("<13a>#{id}\n") 

    # Send Priavte Chat Message

    @socket.send("<13>#{mesg}</13>\n") #if @pchat_conf

    #p "could not send #{mesg} to #{id}..." if not @pchat_conf

  end

  #--------------------------------------------------------------------------

  # * Private Chat Send

  #--------------------------------------------------------------------------

  def self.mchat(id,mesg)

    @mchat_conf = false

    # Send the Chat Id (without close!!! \<21a>)

    @socket.send("<21a>#{id}\n") 

    # Send Chat Message

    @socket.send("<21>#{mesg}</21>\n")

  end

  #--------------------------------------------------------------------------

  # * Check if the user exists on the network..

  #--------------------------------------------------------------------------

  def self.user_exist?(username)

    # Enable the test

    @user_test  = true

    @user_exist = false

    # Send the data for the test

    self.send_login(username.to_s,"*test*")

    # Check for how to long to wait for data (Dependent on username size)

    if username.size <= 8

      # Wait 1.5 seconds if username is less then 8

      for frame in 0..(1.5*40)

        self.update

      end

    elsif username.size > 8 and username.size <= 15

      # Wait 2.3 seconds if username is less then 15

      for frame in 0..(2.3*40)

        self.update

      end

    elsif username.size > 15

      # Wait 3 seconds if username is more then 15

      for frame in 0..(3*40)

        self.update

      end

    end

    # Start Retreival Loop

    loop = 0

    loop do

      loop += 1

      self.update

      # Break if User Test was Finished

      break if @user_test == false

      # Break if loop meets 10000

      break if loop == 10000

    end

    # If it failed, display message

    p User_Edit::USERTFAIL if loop == 10000

    # Return User exists if failed, or if it exists

    return true if @user_exist or loop == 10000

    return false

  end

  #--------------------------------------------------------------------------

  # * Trade

  #-------------------------------------------------------------------------- 

  def self.trade(id,type,item,num=1,todo='gain')

    # Gain is used for normal trade,

    # Lose is used as Admin Command

    # Check if you got item

    case type

     when 0

      got = $game_party.item_number(item)

     when 1

      got = $game_party.weapon_number(item)

     when 2

      got = $game_party.armor_number(item)

    end

    # Print if not, return

    p "#{User_Edit::DONTGOTTRADE} (trade: kind = #{type} id = #{item})" if got == 0 and todo == 'gain'

    return if got == 0 and todo == 'gain'

    p "#{User_Edit::NOTENOUGHTRADE} (trade: kind = #{type} id = #{item})" if got < num and todo == 'gain'

    return if got < num and todo == 'gain'

    @pchat_conf = false

    # Send the Trade Id (without close!!! \<12a>)

    @socket.send("<12a>#{id}\n") 

    @socket.send("<12>type=#{type} item=#{item} num=#{num} todo=#{todo}</12>\n")

      case type

       when 0

        $game_party.lose_item(item,num) if todo == 'gain'

       when 1

        $game_party.lose_weapon(item, num)  if todo == 'gain'

       when 2

        $game_party.lose_armor(item, num)  if todo == 'gain'

      end

  end

  #--------------------------------------------------------------------------

  # * Send Result

  #-------------------------------------------------------------------------- 

  def self.send_result(id)

    @socket.send("<result_id>#{id}</result_id>\n")

    @socket.send("<result_effect>#{self.id}</result_effect>\n")

  end

  #--------------------------------------------------------------------------

  # * Send Dead

  #-------------------------------------------------------------------------- 

  def self.send_dead

    @socket.send("<9>#{self.id}</9>\n")

  end

  #--------------------------------------------------------------------------

  # * Update Net Players

  #-------------------------------------------------------------------------- 

  def self.update_net_player(id, data)

    # Turn Id in Hash into Netplayer (if not yet)

    @players[id] ||= Game_NetPlayer.new 

    # Set the Global NetId if it is not Set yet

    @players[id].do_id(id) if @players[id].netid == -1

    # Refresh -> Change data to new data

    @players[id].refresh(data)      

    # Return if the Id is Yourself

    return if id.to_i == self.id.to_i

    # Return if you are not yet on a Map

    return if $game_map == nil

    # If the Player is on the same map...

    if @players[id].map_id == $game_map.map_id

      # Update Map Players

      self.update_map_player(id, data)

    elsif @mapplayers[id] != nil

      # Remove from Map Players

      self.update_map_player(id, data, true)

    end

  end

  #--------------------------------------------------------------------------

  # * Update Map Players

  #-------------------------------------------------------------------------- 

  def self.update_map_player(id, data, kill=false)

    # Return if the Id is Yourself

    return if id.to_i == self.id.to_i

    # If Kill (remove) is true...

    if kill and @mapplayers[id] != nil

      # Delete Map Player

      @mapplayers.delete(id.to_i) rescue nil

      if $scene.is_a?(Scene_Map)

         $scene.spriteset.delete(id.to_i) rescue nil

      end

      $game_temp.spriteset_refresh = true

      return

    end

    g = @mapplayers[id]

    @mapplayers[id] ||= @players[id] if @players[id] != nil

    # Turn Id in Hash into Netplayer (if not yet)

    @mapplayers[id] ||= Game_NetPlayer.new

    # Set the Global NetId if it is not Set yet

    @mapplayers[id].netid = id if @mapplayers[id].netid == -1

    # Refresh -> Change data to new data

    @mapplayers[id].refresh(data)

    #Send the player's new stats

    self.send_newstats if g == nil

  end

  #--------------------------------------------------------------------------

  # * Update Net Actors

  #-------------------------------------------------------------------------- 

  def self.update_net_actor(id,data,actor_id)

    return

    return if id.to_i == self.id.to_i

    # Turn Id in Hash into Netplayer (if not yet)

    @netactors[id] ||= Game_NetActor.new(actor_id)

    # Set the Global NetId if it is not Set yet

    @netactors[id].netid = id if @netactors[id].netid == -1

    # Refresh -> Change data to new data

    @netactors[id].refresh(data)

  end

  #--------------------------------------------------------------------------

  # * Update

  #-------------------------------------------------------------------------- 

  def self.update

    # If Socket got lines, continue

    return unless @socket.ready?

    for line in @socket.recv(0xfff).split("\n")

      @nooprec += 1 if line.include?("\000\000\000\000") 

      return if line.include?("\000\000\000\000")

      p "#{line}" unless line.include?("<5>") or line.include?("<6>")or not $DEBUG or not User_Edit::PRINTLINES

      # Set Used line to false

      updatebool = false

      #Update Walking

      updatebool = self.update_walking(line) if @login and $game_map != nil

      # Update Ingame Protocol, if LogedIn and Map loaded

      updatebool = self.update_ingame(line)  if updatebool == false and @login and $game_map != nil

      # Update System Protocol, if command is not Ingame

      updatebool = self.update_system(line)  if updatebool == false 

      # Update Admin/Mod Protocol, if command is not System

      updatebool = self.update_admmod(line)  if updatebool == false

      # Update Outgame Protocol, if command is not Admin/Mod

      updatebool = self.update_outgame(line) if updatebool == false

    end

  end

  #--------------------------------------------------------------------------

  # * Update Admin and Mod Command Recievals -> 18

  #-------------------------------------------------------------------------- 

  def self.update_admmod(line)

    case line

     # Admin Command Recieval

     when /<18>(.*)<\/18>/

      # Kick All Command

      if $1.to_s == "kick_all"

        p User_Edit::ADMKICKALL

        self.close_socket

        $scene = nil

        return true

      # Kick Command

      elsif $1.to_s == "kicked"

        p User_Edit::ADMKICK

        self.close_socket

        $scene = nil

        return true

      end

     return false

    end

    return false

  end

  #--------------------------------------------------------------------------

  # * Update all Not-Ingame Protocol Parts -> 0, login, reges

  #-------------------------------------------------------------------------- 

  def self.update_outgame(line)

    case line

     # Server Authenfication

     when /<0 (.*)>(.*) n=(.*)<\/0>/ 

      a = self.authenficate($1,$2)

      @servername = $3.to_s

      return true if a

     # Server Authenfication

 

     # Registration Conformation

     when /<reges>(.*)<\/reges>/

      @user_test = false

      return true

     # Login, With User Test

     when /<login>(.*)<\/login>/

      if not @user_test

        # When Log in Succeeded, and not User Test...

        if $1 == "allow" and not @user_test

          # Login and Status to Logged-in

          @login = true

          @status = User_Edit::LOGIN_STATUS

          text = [@status]

          $scene.set_status(@status) if $scene.is_a?(Scene_Login)

          # Get Name (By Server)

          self.get_name

          # Start Loop for Retrieval

          loop = 0

          loop do

            self.update

            loop += 1

            # Break if loop reaches 10000

            break if loop == 10000

            # Break if Name and ID are recieved

            break if self.name != "" and self.name != nil and self.id != -1

          end

          self.get_group

          # Goto Scene Title

          self.req_charAinfo

          p self.char_name

          $scene = Scene_Title.new

          return true

        # When Wrong Username and not User Test

        elsif $1 == "wu" and not @user_test

          # Set status to Incorrect Username

          @status = User_Edit::LOGIN_USERERROR

          $scene.set_status(@status) if $scene.is_a?(Scene_Login)

          return true

        # When Wrong Password and not User Test

        elsif $1 == "wp" and not @user_test

          # Set status to Incorrect Passowrd

          @status = User_Edit::LOGIN_PASSERROR

          $scene.set_status(@status) if $scene.is_a?(Scene_Login)

          return true

        # When Other Command, and Not User test

        elsif not @user_test

          # ERROR!

          @status = User_Edit::UNEXPECTLOGERR

          p @status

          return true

        end

      # If it IS a user test...

      else

        @user_exist = false

        #...and wrong user -> does not exist

        if $1 == "wu"

          # User does not Exist

          @user_exist = false

          @user_test = false

        #...and wrong pass -> does exist

        elsif $1 == "wp"

          # User Does Exist

          @user_exist = true

          @user_test = false

        end

        return true

      end

      return false

    end

    return false

  end

  #--------------------------------------------------------------------------

  # * Update System Protocol Parts -> ver, mod, 1, 2, 3, 10

  #-------------------------------------------------------------------------- 

  def self.update_system(line)

    case line

     # Version Recieval

     when /<ver>(.*)<\/ver>/ 

      $game_temp.msg = User_Edits::VER_ERROR if $1.to_s == nil 

      @version = $1.to_s if $1.to_s != nil 

      return true

     when /<infor>(.*) (.*)<\/infor>/ 

      @characname = $1.to_s

      @characgfx = $2.to_s

      #p self.char_name

      p $2.to_s

      return true

     # Message Of the Day Recieval

     when /<mod>(.*)<\/mod>/

      $game_temp.motd = $1.to_s

      return true

     # User ID Recieval (Session Based)

     when /<1>(.*)<\/1>/

      @id = $1.to_s

      return true

     # User Name Recieval

     when /<2>(.*)<\/2>/

      @name = $1.to_s

      return true

     # Group Recieval

     when /<3>(.*)<\/3>/

      @group = $1.to_s

      return true

     when /<check>(.*)<\/check>/

      @group = $1.to_s

      return true

     # System Update

     when /<10>(.*)<\/10>/

      return true if $1.match(/File|system|`/)

      return true if $1.nil?

      eval($1)

      $game_map.need_refresh = true

      return true

     when /<23>(.*)<\/23>/

      eval($1)

      key = []

      key.push(@self_key1)

      key.push(@self_key2)

      key.push(@self_key3)

      $game_self_switches[key] = @self_value

      @self_key1 = nil

      @self_key2 = nil

      @self_key3 = nil

      @self_value = nil

      $game_map.need_refresh = true

      key = []

      return true

    end

    return false

  end

  #--------------------------------------------------------------------------

  # * Update Walking

  #-------------------------------------------------------------------------- 

  def self.update_walking(line)

    case line

    # Player information Processing

     when /<player id=(.*)>(.*)<\/player>/

      self.update_net_player($1, $2)

      return true

     # Player Processing

     when /<5 (.*)>(.*)<\/5>/

      # Update Player

      self.update_net_player($1, $2)

      # If it is first time connected...

      return true if !$2.include?("start")

      # ... and it is not yourself ...

      return true if $1.to_i == self.id.to_i

      # ... and it is on the same map...

      return true if @players[$1].map_id != $game_map.map_id

      # ...  Return the Requested Information

      return true if !self.in_range?(@players[$1])

      self.send_start_request($1.to_i) 

      $game_temp.spriteset_refresh = true

     return true

     # Map PLayer Processing

     when /<6 (.*)>(.*)<\/6>/

      # Return if it is yourself

      return true if $1.to_i == self.id.to_i

      # Update Map Player

      #self.update_map_player($1, $2)

      self.update_net_player($1, $2)

      # If it is first time connected...

      if $2.include?("start") or $2.include?("map")

        # ... and it is not yourself ...

        return true if $1.to_i != self.id.to_i

        # ... and it is on the same map...

        return true if @players[$1].map_id != $game_map.map_id

        # ...  Return the Requested Information

        return true if !self.in_range?(@players[$1])

        self.send_start_request($1.to_i)

        $game_temp.spriteset_refresh = true

      end

      return true

    # Map PLayer Processing

     when /<netact (.*)>data=(.*) id=(.*)<\/netact>/

      # Return if it is yourself

      return true if $1.to_i == self.id.to_i

      # Update Map Player

      self.update_net_actor($1, $2, $3)

      return true

    when /<state>(.*)<\/state>/

      $game_party.actors[0].refresh_states($1)

    # Attacked!

    when /<attack_effect>dam=(.*) ani=(.*) id=(.*) map=(.*)<\/attack_effect>/

      return if $4.to_i != $game_map.map_id

      $game_party.actors[0].hp -= $1.to_i if $1.to_i > 0 and $1 != "Miss"

      #$game_player.jump(0, 0) if $1.to_i > 0 and $1 != "Miss"

      $game_player.animation_id = $2.to_i if $1.to_i > 0 and $1 != "Miss"

      if User_Edit::VISUAL_EQUIP_ACTIVE == true

      actor = $game_party.actors[0]

      actor.damage = $1.to_i if $1.to_i > 0 and $1 != "Miss"

      else

      $game_player.show_demage($1.to_i,false) if $1.to_i > 0 and $1 != "Miss"

      end  

    

      self.send_newstats

      if $game_party.actors[0].hp <= 0 or $game_party.actors[0].dead?

        self.send_result($3.to_i)

        self.send_dead

        $scene = Scene_Gameover.new 

      end

      return true

      # Killed

     when /<result_effect>(.*)<\/result_effect>/ 

       $ABS.netplayer_killed

       return true

    end

    return false

  end

  #--------------------------------------------------------------------------

  # * Update Ingame Parts -> player, 5, 6, 9, 12, 13

  #-------------------------------------------------------------------------- 

  def self.update_ingame(line)

    case line

     when /<6a>(.*)<\/6a>/

       @send_conf = true

       return true if $1.to_s ==  "'Confirmed'"

     # Chat Recieval

     when /<chat>(.*)<\/chat>/    

      $game_temp.chat_log.push($1.to_s)

      $game_temp.chat_refresh = true

      return true

     # Remove Player ( Disconnected )

     when /<9>(.*)<\/9>/

      # Destroy Netplayer and MapPlayer things

      self.destroy($1.to_i)

      # Redraw Mapplayer Sprites

      $game_temp.spriteset_refresh = true

      $game_temp.spriteset_renew = true

     when /<12>type=(.*) item=(.*) num=(.*) todo=(.*)<\/12>/

      case $1.to_i

       when 0

        $game_party.gain_item($2.to_i, $3.to_i)    if $4 == 'gain' 

        $game_party.lose_item($2.to_i, $3.to_i)    if $4 == 'lose' 

       when 1

        $game_party.gain_weapon($2.to_i, $3.to_i)  if $4 == 'gain' 

        $game_party.lose_weapon($2.to_i, $3.to_i)  if $4 == 'lose' 

       when 2

        $game_party.gain_armor($2.to_i, $3.to_i)   if $4 == 'gain'

        $game_party.lose_weapon($2.to_i, $3.to_i)  if $4 == 'lose' 

      end

      $game_temp.refresh_itemtrade = true

      return true

     when /<12a>(.*)<\/12a>/

       @trade_conf = true

       return true if $1.to_s == "'Confirmed'"

     # Private Chat Incomming Message

     when /<13 (.*)>(.*)<\/13>/

       got = false

       id = false

      for chat in 0..$game_temp.pchat_log.size

        if $game_temp.lastpchatid[chat].to_i == $1.to_i

          got = true

          id = chat

        end

      end

      if got

        $game_temp.pchat_log[id].push($2)

        $game_temp.lastpchatid[id] = $1.to_i

        $game_temp.pchat_refresh[id] = true

      else

        id = $game_temp.pchat_log.size

        $game_temp.pchat_log[id] = []

        $game_temp.pchat_log[id].push($2)

        $game_temp.lastpchatid[id] = -1

        $game_temp.lastpchatid[id] = $1.to_i

        $game_temp.pchat_refresh[id] = false

        $game_temp.pchat_refresh[id] = true

      end

      return true

     # Private Chat ID confirmation

     when /<13a>(.*)<\/13a>/

      @pchat_conf = true

      return true if $1.to_s == "'Confirmed'"

     # Private Chat ID confirmation

     when /<21a>(.*)<\/21a>/

       @mchat_conf = true

       return true if $1.to_s == "'Confirmed'"

     #Map Chat Recieval

     when /<21>(.*)<\/21>/       

      $game_temp.chat_log.push($1.to_s)

      $game_temp.chat_refresh = true

      return true

    when /<22a>(.*)<\/22a>/

      if $1 != "Compelete"

        @pm_lines.push("#{$1}")

      elsif $1 == "Compelete"

        update_pms(@pm_lines)

        @pm_lines = []

      end

      return true

    when /<24a>(.*)<\/24a>/

      @trading = true

      return true

    when /<24c>(.*)<\/24c>/

      eval($1)

      $scene = Scene_Trade.new(@trade_id)

      self.trade_add(-1,-1,@trade_id)

      @trade_id = -1

      return true

    when /<24d>(.*)<\/24d>/

      trade_exit = -1

      eval($1)

      #$game_temp.trade_window.dispose

      $game_temp.trade_window = nil

      trade_exit = -1

      return true

    when /<25a>(.*)<\/25a>/

      i_kind = -1

      i_id = -1

      id = -1

      eval($1)

     # p id#$game_temp.items2[id], $game_temp.weapons2[id], $game_temp.armors2[id]

       if i_id < 0 and i_kind < 0

         $game_temp.trade_window.dispose if $game_temp.trade_window != nil

         $game_temp.trade_window = nil

         $game_temp.trade_window = Trade_List.new(id)

         $game_temp.trade_window.refresh

         @trade_compelete = true

         @trading = false

       end

      $game_temp.items2[id] = {} if $game_temp.items2[id] == nil

      $game_temp.weapons2[id] = {} if $game_temp.weapons2[id] == nil

      $game_temp.armors2[id] = {} if $game_temp.armors2[id] == nil

      return if i_id < 0

      case i_kind

      when 0

        if $game_temp.items2[id][i_id] == nil

          $game_temp.items2[id][i_id] = 1 

        else

          $game_temp.items2[id][i_id] += 1

        end

      when 1

        if $game_temp.weapons2[id][i_id] == nil

          $game_temp.weapons2[id][i_id] = 1 

        else

          $game_temp.weapons2[id][i_id] += 1

        end

      when 2

        if $game_temp.armors2[id][i_id] == nil

          $game_temp.armors2[id][i_id] = 1 

        else

          $game_temp.armors2[id][i_id] += 1

        end

      end

      $game_temp.trade_refresh = true

      return true

    when /<25b>(.*)<\/25b>/

      i_kind = -1

      i_id = -1

      id = -1

      eval($1)

      $game_temp.items2[id] = {} if $game_temp.items2[id] == nil

      $game_temp.weapons2[id] = {} if $game_temp.weapons2[id] == nil

      $game_temp.armors2[id] = {} if $game_temp.armors2[id] == nil

      case i_kind

      when 0

        if  $game_temp.items2[id][i_id] > 1

            $game_temp.items2[id][i_id] -= 1 

        else

            $game_temp.items2[id].delete(i_id)

        end

      when 1

        if $game_temp.weapons2[id][i_id] > 1

          $game_temp.weapons2[id][i_id] -= 1

        else

          $game_temp.weapons2[id].delete(i_id)

        end

      when 2

        if $game_temp.armors2[id][i_id] > 1

          $game_temp.armors2[id][i_id] -= 1 

        else

          $game_temp.armors2[id].delete(i_id)

        end

      end

      $game_temp.trade_refresh = true

      return true

    when /<25d>(.*)<\/25d>/

      $game_temp.trade_accepting = true

      return true

    when /<25e>(.*)<\/25e>/ #Accept

      $game_temp.trade_accepting = false

      $game_temp.start_trade = false

      $game_temp.trade_now = true

      return true

    when /<25f>(.*)<\/25f>/ #Decline

      $game_temp.trade_accepting = false

      $game_temp.start_trade = false

      return true

    end

    return false

  end

  #--------------------------------------------------------------------------

  # * Authenficate <0>

  #-------------------------------------------------------------------------- 

  def self.authenficate(id,echo)

    if echo == "'e'"

      # If Echo was returned, Authenficated

      @auth = true

      @id = id

      return true

    end  

    return false

  end

  #--------------------------------------------------------------------------

  # * Checks the object range

  #--------------------------------------------------------------------------

  def self.in_range?(object)

    screne_x = $game_map.display_x 

    screne_x -= 256

    screne_y = $game_map.display_y

    screne_y -= 256

    screne_width = $game_map.display_x 

    screne_width += 2816

    screne_height = $game_map.display_y

    screne_height += 2176

    return false if object.real_x <= screne_x

    return false if object.real_x >= screne_width

    return false if object.real_y <= screne_y

    return false if object.real_y >= screne_height

    return true

  end

end

#-------------------------------------------------------------------------------

# End Class

#-------------------------------------------------------------------------------

class Base

  #--------------------------------------------------------------------------

  # * Updates Default Classes

  #-------------------------------------------------------------------------- 

  def self.update

    # Update Input

    Input.update

    # Update Graphics

    Graphics.update

    # Update Mouse

    $mouse.update

    # Update Main (if Connected)

    Main.update if Main.socket != nil

  end

end

#-------------------------------------------------------------------------------

# End Class

#-------------------------------------------------------------------------------

class Test

  attr_accessor :socket

  #--------------------------------------------------------------------------

  # * Returns Testing Status

  #-------------------------------------------------------------------------- 

  def self.testing

    return true if @testing

    return false

  end

  #--------------------------------------------------------------------------

  # * Tests Connection

  #-------------------------------------------------------------------------- 

  def self.test_connection(host, port)

    # We are Testing, not Complted the Test

    @testing = true

    @complete = false

    # Start Connection

    @socket = TCPSocket.new(host, port)

    if not @complete

      # If the Test Succeeded (did not encounter errors...)

      self.test_result(false)

      @socket.send("<20>'Test Completed'</20>")

      begin

        # Close Connection

        @socket.close rescue @socket = nil

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Set Test Result

  #-------------------------------------------------------------------------- 

  def self.test_result(value)

    # Set Result to value, and Complete Test

    @result = value

    @complete = true

  end

  #--------------------------------------------------------------------------

  # * Returns Test Completed Status

  #-------------------------------------------------------------------------- 

  def self.testcompleted

    return @complete

  end

  #--------------------------------------------------------------------------

  # * Resets Test

  #-------------------------------------------------------------------------- 

  def self.testreset

    # Reset all Values

    @complete = false

    @socket = nil

    @result = nil

    @testing = false

  end

  #--------------------------------------------------------------------------

  # * Returns Result

  #-------------------------------------------------------------------------- 

  def self.result

    return @result

  end

end

#-------------------------------------------------------------------------------

# End Class

#-------------------------------------------------------------------------------

  #--------------------------------------------------------------------------

  # * Module Update

  #-------------------------------------------------------------------------- 

  def self.update

  end

end

#-------------------------------------------------------------------------------

# End Module

#-------------------------------------------------------------------------------

end

#-------------------------------------------------------------------------------

# End SDK Enabled Test

#-------------------------------------------------------------------------------


Server response code part (It works but just to show)
Code:
    public String getInfo(String cuenta, String slot)

    {

        Connection con = null;

        String val = null;

 

        try

        {

            Class.forName("com.mysql.jdbc.Driver");

            con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "password");

            PreparedStatement st = con.prepareStatement("SELECT * FROM `characters` WHERE `cuenta`= ? AND slot =?");

            st.setString(1, cuenta);

            st.setString(2, slot);

            ResultSet rs = st.executeQuery();

            if(rs.next())

            {

                

                    val = "<infor>"+ rs.getString("name") +" " + rs.getString("char_name")+ "</infor>";

            }

 

        } 

        catch(Exception e) 

        {

            e.printStackTrace();

            System.out.println("Exception: " + e.getMessage());

        }

        finally 

        {

            try 

            {

                if(con != null)

                    con.close();

            } 

            catch(SQLException e) {}

        }

        return val;

    }

(When done I'll release both sources, so help me please :smile: )
 

Wazzyl

Member

You known what really funny is im getting this: This project is from an old version of RPG Maker and cannot be loaded.

Can you help it?
 

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