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)
Image
Login
Image
Choosing Characters
Image
Testing Chat
Image
Outhers Characters
Image
Distribuite Points and Menu
Image

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
Image
Login
Image
Choosing Characters (Traditional)
Image
Creating Characters
Image
Testing Chat
Image
Inventory and Store
Image
Status and Distribution Points
Image
Killing Monsters
Image

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
Image
Choosing Characters
Image
Creating Characters
Image
Testing Chat
Image
Inventory
Image
Menu
Image
Window Help
Image
Menu other players
Image
Shop
Image
Hud of outhers players
Image

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)
Downloading.... I'm thinking of using this in my game..
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.

Player Damage Pop Show
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.
  1.        #Display damage
  2.         damage(a.damage, a.critical) if !a.dead? or a.damage != nil
Expand to see the code.


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:
  1.        #Display damage
  2.         damage(a.damage, a.critical) if !a.dead? and a.damage != nil
Expand to see the code.


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.
new version of orpg editor, go download
catkitten wrote:
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 wrote:
catkitten wrote:
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 wrote:
catkitten wrote:
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
  1. Backslash = 193     # => / ?
Expand to see the code.

change number 193 for 191

catkitten wrote:
BlueScope wrote:
catkitten wrote:
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?
It says "This project is from an old version of RPG Maker and cannot be loaded."

...?
efeerk wrote:
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. :)
What's the difference between ORPG and Master Netplay?
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
Ormin wrote:
What's the difference between ORPG and Master Netplay?

3 netplays are different from each other, in order to make the scripts in general

New: Orpg Netplay updated
how many people can this support??
:sad:oh God thanks
but I can't download
i don't know the reason
Mustardy85 wrote:
how many people can this support??

This is dependent on your Internet and computer
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?

  1. #===============================================================================
  2. # ** Network - Manages network data.
  3. #-------------------------------------------------------------------------------
  4. # Author    Me™ and Mr.Mo
  5. # Version   1.0
  6. # Date      11-04-06
  7. #===============================================================================
  8. SDK.log("Network", "Mr.Mo and Me™", "1.0", " 11-04-06")
  9.  
  10. p "TCPSocket script not found (class Network)" if not SDK.state('TCPSocket')
  11. #-------------------------------------------------------------------------------
  12. # Begin SDK Enabled Check
  13. #-------------------------------------------------------------------------------
  14. if SDK.state('TCPSocket') == true and SDK.state('Network')
  15.  
  16. module Network
  17.  
  18. class Main
  19.  
  20.   #--------------------------------------------------------------------------
  21.   # * Attributes
  22.   #--------------------------------------------------------------------------
  23.   attr_accessor :socket
  24.   attr_accessor :pm
  25.   # getpm, pmname, writepm
  26.  
  27.   # AUTHENFICATION  = 0     => Authenficates
  28.   # ID_REQUEST      = 1     => Returns ID
  29.   # NAME_REQUEST    = 2     => Returns UserName
  30.   # GROUP_REQUEST   = 3     => Returns Group
  31.   # CLOSE           = 4     => Close, Stop Connection
  32.   # NET_PLAYER      = 5     => Netplayers Data
  33.   # MAP_PLAYER      = 6     => Mapplayers Data
  34.   # KICK            = 7     => Kick a Player
  35.   # KICK ALL        = 8     => Kick all Players
  36.   # REMOVE          = 9     => Remove Player (CLOSE SYNONYM)
  37.   # SYSTEM          = 10    => System (Var's and Switches)
  38.   # MOD_CHANGE      = 11    => Message ot Day Change
  39.   # TRADE           = 12    => Trade
  40.   # PRIVATE_CHAT    = 13    => Private Chat
  41.   #                 = 14
  42.   # POKE            = 15    => Poke Player
  43.   # SLAP            = 16    => Decrease HP or SP PLayer
  44.   # SLAP ALL        = 17    => Decrease Hp or SP ALL
  45.   # ADM - MOD       = 18    => Admin/Mod Command Returns
  46.   #                 = 19
  47.   # TEST STOP       = 20    => Connection Test End
  48.  
  49.   #--------------------------------------------------------------------------
  50.   # * Initialiation
  51.   #--------------------------------------------------------------------------
  52.   def self.initialize
  53.     @players    = {}
  54.     @mapplayers = {}
  55.     @netactors  = {}
  56.     @pm = {}
  57.     @pm_lines = []
  58.     @user_test  = false
  59.     @user_exist = false
  60.     @socket     = nil
  61.     @nooprec    = 0
  62.     @id         = -1
  63.     @name       = ""
  64.     @characname = ""
  65.     @characgfx = ""
  66.     @group      = ""
  67.     @status     = ""
  68.     @oldx       = -1
  69.     @oldy       = -1
  70.     @oldd       = -1
  71.     @oldp       = -1
  72.     @oldid      = -1
  73.     @login      = false
  74.     @pchat_conf = false
  75.     @send_conf  = false
  76.     @trade_conf = false
  77.     @servername = ""
  78.     @pm_getting = false
  79.     @self_key1 = nil
  80.     @self_key2 = nil
  81.     @self_key3 = nil
  82.     @self_value = nil
  83.     @trade_compelete = false
  84.     @trading = false
  85.     @trade_id = -1
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # * Returns Servername
  89.   #--------------------------------------------------------------------------
  90.   def self.servername
  91.     return @servername.to_s
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # * Returns Socket
  95.   #--------------------------------------------------------------------------
  96.   def self.socket
  97.     return @socket
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # * Returns UserID
  101.   #--------------------------------------------------------------------------
  102.   def self.id
  103.     return @id
  104.   end
  105.   #--------------------------------------------------------------------------
  106.   # * Returns UserName
  107.   #--------------------------------------------------------------------------
  108.   def self.name
  109.     return @name
  110.   end  
  111.  
  112.   def self.char_name
  113.     return @characname
  114.   end
  115.  
  116.   def self.char_gfx
  117.     return @characgfx
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # * Returns current Status
  121.   #--------------------------------------------------------------------------
  122.   def self.status
  123.     return "" if @status == nil or @status == []
  124.     return @status
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # * Returns Group
  128.   #--------------------------------------------------------------------------
  129.   def self.group
  130.     if @group.downcase.include?("adm")
  131.       group = "admin"
  132.     elsif @group.downcase.include?("mod")
  133.       group = "mod"
  134.     else
  135.       group = "standard"
  136.     end
  137.     return group
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # * Returns Mapplayers
  141.   #--------------------------------------------------------------------------
  142.   def self.mapplayers
  143.     return {} if @mapplayers == nil
  144.     return @mapplayers
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # * Returns NetActors
  148.   #--------------------------------------------------------------------------
  149.   def self.netactors
  150.     return {} if @netactors == nil
  151.     return @netactors
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # * Returns Players
  155.   #--------------------------------------------------------------------------
  156.   def self.players
  157.     return {} if @players == nil
  158.     return @players
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # * Destroys player
  162.   #--------------------------------------------------------------------------
  163.   def self.destroy(id)
  164.     @players[id.to_s] = nil rescue nil
  165.     @mapplayers[id.to_s] = "" rescue nil
  166.     for player in @mapplayers
  167.       @mapplayers.delete(id.to_s) if player[0].to_i == id.to_i
  168.     end
  169.     for player in @players
  170.       @players.delete(id.to_s) if player[0].to_i == id.to_i
  171.     end
  172.     if $scene.is_a?(Scene_Map)
  173.       begin
  174.         $scene.spriteset[id].dispose unless $scene.spriteset[id].disposed?
  175.       rescue
  176.         nil
  177.       end
  178.     end
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # * Create A socket
  182.   #--------------------------------------------------------------------------
  183.   def self.start_connection(host, port)
  184.     @socket = TCPSocket.new(host, port)
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # * Asks for Id
  188.   #--------------------------------------------------------------------------
  189.   def self.get_id
  190.     @socket.send("<1>'req'</1>\n")
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # * Asks for name
  194.   #--------------------------------------------------------------------------
  195.   def self.get_name
  196.     @socket.send("<2>'req'</2>\n")
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # * Asks for Group
  200.   #--------------------------------------------------------------------------
  201.   def self.get_group
  202.     #@socket.send("<3>'req'</3>\n")
  203.     @socket.send("<check>#{self.name}</check>\n")
  204.   end
  205.   #--------------------------------------------------------------------------
  206.   # * Registers (Attempt to)
  207.   #--------------------------------------------------------------------------
  208.   def self.send_register(user,pass)
  209.     # Register with User as name, and Pass as password
  210.     @socket.send("<reges #{user}>#{pass}</reges>\n")
  211.     # Start Loop for Retrival
  212.     loop = 0
  213.       loop do
  214.       loop += 1
  215.       self.update
  216.       # Break If Registration Succeeded
  217.       break if @registered
  218.       # Break if Loop reached 10000
  219.       break if loop == 10000
  220.     end
  221.   end
  222.   #--------------------------------------------------------------------------
  223.   # * Asks for Network Version Number
  224.   #--------------------------------------------------------------------------
  225.   def self.retrieve_version
  226.     @socket.send("<ver>#{User_Edit::VERSION}</ver>\n")
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # * Asks for Message of the day
  230.   #--------------------------------------------------------------------------
  231.   def self.retrieve_mod
  232.     @socket.send("<mod>'request'</mod>\n")
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # * Asks for Login (and confirmation)
  236.   #--------------------------------------------------------------------------
  237.   def self.send_login(user,pass)
  238.     @socket.send("<login #{user}>#{pass}</login>\n")
  239.   end
  240.   #--------------------------------------------------------------------------
  241.   # * Send Errors
  242.   #--------------------------------------------------------------------------
  243.   def self.send_error(lines)
  244.     if lines.is_a?(Array)
  245.       for line in lines
  246.         @socket.send("<err>#{line}</err>\n")
  247.       end
  248.     elsif lines.is_a?(String)
  249.       @socket.send("<err>#{lines}</err>\n")
  250.     end
  251.   end  
  252.   #--------------------------------------------------------------------------
  253.   # * Authenfication
  254.   #--------------------------------------------------------------------------
  255.   def self.amnet_auth
  256.     # Send Authenfication
  257.     @socket.send("<0>'e'</0>\n")
  258.     @auth = false
  259.     # Set Try to 0, then start Loop
  260.     try = 0
  261.     loop do
  262.       # Add 1 to Try
  263.       try += 1
  264.       loop = 0
  265.       # Start Loop for Retrieval
  266.       loop do
  267.         loop += 1
  268.         self.update
  269.         # Break if Authenficated
  270.         break if @auth
  271.         # Break if loop reaches 20000
  272.         break if loop == 20000
  273.       end
  274.       # If the loop was breaked because it reached 10000, display message
  275.       p "#{User_Edit::NOTAUTH}, Tentativa #{try} de #{User_Edit::CONNFAILTRY}" if loop == 20000
  276.       # Stop everything if try mets the maximum try's
  277.       break if try == User_Edit::CONNFAILTRY
  278.       # Break loop if Authenficated
  279.       break if @auth
  280.     end
  281.     # Go to Scene Login if Authenficated
  282.     $scene = Scene_Login.new if @auth
  283.   end
  284.   #--------------------------------------------------------------------------
  285.   # * Send Start Data
  286.   #--------------------------------------------------------------------------
  287.   def self.send_start
  288.     send = ""
  289.     # Send Username And character's Graphic Name
  290.     send += "@username = '#{self.name}'; @character_name = '#{$game_player.character_name}';"
  291.     # Sends Map ID, X and Y positions
  292.     send += "@map_id = #{$game_map.map_id}; @x = #{$game_player.x}; @y = #{$game_player.y};"
  293.     # Sends Name
  294.     send += "@nome = '#{$game_party.actors[0].name}';" if User_Edit::Bandwith >= 1
  295.     # Sends Direction
  296.     send += "@direction = #{$game_player.direction};" if User_Edit::Bandwith >= 2
  297.     # Sends Move Speed
  298.     send += "@move_speed = #{$game_player.move_speed};" if User_Edit::Bandwith >= 3
  299.     # Sends Requesting start
  300.     send += "@weapon_id = #{$game_party.actors[0].weapon_id};"
  301.     send += "@armor1_id = #{$game_party.actors[0].armor1_id};"
  302.     send += "@armor2_id = #{$game_party.actors[0].armor2_id};"
  303.     send += "@armor3_id = #{$game_party.actors[0].armor3_id};"
  304.     send += "@armor4_id = #{$game_party.actors[0].armor4_id};"
  305.     send+= "start(#{self.id});"
  306.     @socket.send("<5>#{send}</5>\n")
  307.     self.send_newstats
  308.     #send_actor_start
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # * Return PMs
  312.   #-------------------------------------------------------------------------
  313.   def self.pm
  314.     return @pm
  315.   end
  316.   #--------------------------------------------------------------------------
  317.   # * Get PMs
  318.   #--------------------------------------------------------------------------
  319.   def self.get_pms
  320.     @pm_getting = true
  321.     @socket.send("<22a>'Get';</22a>\n")
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # * Update PMs
  325.   #--------------------------------------------------------------------------
  326.   def self.update_pms(message)
  327.    #Starts all the variables
  328.    @pm = {}
  329.    @current_Pm = nil
  330.    @index = -1
  331.    @message = false
  332.    #Makes a loop to look thru the message
  333.    for line in message
  334.      #If the line is a new PM
  335.      if line == "$NEWPM"
  336.       @index+=1
  337.       @pm[@index] = Game_PM.new(@index)
  338.       @message = false
  339.       #if the word has $to_from
  340.      elsif line == "$to_from" and @message == false
  341.        to_from = true
  342.       #if the word has $subject
  343.      elsif line == "$Subject" and @message == false
  344.        subject = true
  345.       #if the word has $message
  346.      elsif line == "$Message" and @message == false
  347.        @message = true
  348.      elsif @message
  349.        @pm[@index].message += line+"\n"
  350.      elsif to_from
  351.        @pm[@index].to_from = line
  352.        to_from = false
  353.      elsif subject
  354.        @pm[@index].subject = line
  355.        subject = false
  356.      end
  357.    end
  358.    @pm_getting = false
  359.  end
  360.   #--------------------------------------------------------------------------
  361.   # * Checks if the PM is still not get.
  362.   #--------------------------------------------------------------------------
  363.   def self.pm_getting
  364.     return @pm_getting
  365.   end
  366.   #--------------------------------------------------------------------------
  367.   # * Write PMs
  368.   #--------------------------------------------------------------------------
  369.   def self.write_pms(message)
  370.     send = message
  371.     @socket.send("<22d>#{send}</22d>\n")
  372.   end
  373.  
  374.   def self.req_newchar(id, name, classid, template, slot)
  375.     @socket.send("<newchar> #{@name} #{id} #{name} #{classid} #{template} #{slot} </newchar>")
  376.   end
  377.  
  378.   def self.req_charAinfo
  379.     @socket.send("<reqinfo> #{@name} 1 </reqinfo>")
  380.   end
  381.   #--------------------------------------------------------------------------
  382.   # * Delete All PMs
  383.   #--------------------------------------------------------------------------
  384.   def self.delete_all_pms
  385.     @socket.send("<22e>'delete'</22e>\n")
  386.     @pm = {}
  387.   end
  388.   #--------------------------------------------------------------------------
  389.   # * Delete pm(id)
  390.   #--------------------------------------------------------------------------
  391.   def self.delete_pm(id)
  392.     @pm.delete(id)
  393.   end
  394.   #--------------------------------------------------------------------------
  395.   # * Delete MapPlayers
  396.   #--------------------------------------------------------------------------
  397.   def self.mapplayers_delete
  398.     @mapplayers = {}
  399.   end
  400.   #--------------------------------------------------------------------------
  401.   # * Send Requested Data
  402.   #--------------------------------------------------------------------------
  403.   def self.send_start_request(id)
  404.     send = ""
  405.     # Send Username And character's Graphic Name
  406.     send += "@username = '#{self.name}'; @character_name = '#{$game_player.character_name}'; "
  407.     # Sends Map ID, X and Y positions
  408.     send += "@map_id = #{$game_map.map_id}; @x = #{$game_player.x}; @y = #{$game_player.y}; "
  409.     # Sends Name
  410.     send += "@nome = '#{$game_party.actors[0].name}';" if User_Edit::Bandwith >= 1
  411.     # Sends Direction
  412.     send += "@direction = #{$game_player.direction}; " if User_Edit::Bandwith >= 2
  413.     # Sends Move Speed
  414.     send += "@move_speed = #{$game_player.move_speed};" if User_Edit::Bandwith >= 3
  415.     send += "@weapon_id = #{$game_party.actors[0].weapon_id};"
  416.     send += "@armor1_id = #{$game_party.actors[0].armor1_id};"
  417.     send += "@armor2_id = #{$game_party.actors[0].armor2_id};"
  418.     send += "@armor3_id = #{$game_party.actors[0].armor3_id};"
  419.     send += "@armor4_id = #{$game_party.actors[0].armor4_id};"
  420.     #@socket.send("<6a>#{id.to_i}</6a>\n")
  421.     @socket.send("<5>#{send}</5>\n")
  422.     #self.send_map
  423.     #self.send_actor_start
  424.   end
  425.   #--------------------------------------------------------------------------
  426.   # * Send Map Id data
  427.   #--------------------------------------------------------------------------
  428.   def self.send_map
  429.     send = ""
  430.     # Send Username And character's Graphic Name
  431.     send += "@username = '#{self.name}'; @character_name = '#{$game_player.character_name}'; "
  432.     # Sends Map ID, X and Y positions
  433.     send += "@map_id = #{$game_map.map_id}; @x = #{$game_player.x}; @y = #{$game_player.y}; "
  434.     # Sends Direction
  435.     send += "@direction = #{$game_player.direction};" if User_Edit::Bandwith >= 2
  436.     send += "@weapon_id = #{$game_party.actors[0].weapon_id};"
  437.     send += "@armor1_id = #{$game_party.actors[0].armor1_id};"
  438.     send += "@armor2_id = #{$game_party.actors[0].armor2_id};"
  439.     send += "@armor3_id = #{$game_party.actors[0].armor3_id};"
  440.     send += "@armor4_id = #{$game_party.actors[0].armor4_id};"
  441.     @socket.send("<5>#{send}</5>\n")
  442.     for player in @players.values
  443.       next if player.netid == -1
  444.       # If the Player is on the same map...
  445.       if player.map_id == $game_map.map_id and self.in_range?(player)
  446.         # Update Map Players
  447.         self.update_map_player(player.netid, nil)
  448.       elsif @mapplayers[player.netid.to_s] != nil
  449.         # Remove from Map Players
  450.         self.update_map_player(player.netid, nil, true)
  451.       end
  452.     end
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # * Calls a player to trade
  456.   #--------------------------------------------------------------------------
  457.   def self.trade_call(id)
  458.     @trade_compelete = false
  459.     @trading = true
  460.     @socket.send("<24>#{id}\n")
  461.     ids = self.id
  462.     @socket.send("<24c>@trade_id = #{ids}</24c>\n")
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # * Exit trade.
  466.   #--------------------------------------------------------------------------
  467.   def self.trade_exit(id)
  468.     @socket.send("<24>#{id}\n")
  469.     ids = self.id
  470.     @socket.send("<24d>trade_exit = #{ids}</24d>\n")
  471.   end
  472.   #--------------------------------------------------------------------------
  473.   # * Checks if the trade is compelete
  474.   #--------------------------------------------------------------------------
  475.   def self.trade_compelete
  476.     return @trade_compelete
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # * Checks the trade result
  480.   #--------------------------------------------------------------------------
  481.   def self.trading
  482.     return @trading
  483.   end
  484.   #--------------------------------------------------------------------------
  485.   # * Send Move Update
  486.   #--------------------------------------------------------------------------
  487.   def self.trade_add(kind,item_id,netid)
  488.     @socket.send("<25>#{netid}\n")
  489.     me = self.id
  490.     @socket.send("<25a>i_kind = #{kind}; i_id = #{item_id}; id = #{me};</25a>\n")
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # * Send Move Update
  494.   #--------------------------------------------------------------------------
  495.   def self.trade_remove(kind,item_id,netid)
  496.     @socket.send("<25>#{netid}\n")
  497.     me = self.id
  498.     @socket.send("<25b>i_kind = #{kind}; i_id = #{item_id}; id = #{me};</25b>\n")
  499.   end
  500.   #--------------------------------------------------------------------------
  501.   # * Send Trade REquest
  502.   #--------------------------------------------------------------------------
  503.   def self.trade_request(netid)
  504.     @socket.send("<25>#{netid}\n")
  505.     me = self.id
  506.     @socket.send("<25d>id = #{me};</25d>\n")
  507.   end
  508.   #--------------------------------------------------------------------------
  509.   # * Send accept trade
  510.   #--------------------------------------------------------------------------
  511.   def self.trade_accept(netid)
  512.     @socket.send("<25>#{netid}\n")
  513.     me = self.id
  514.     @socket.send("<25e>id = #{me};</25e>\n")
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # * Send cancel trade
  518.   #--------------------------------------------------------------------------
  519.   def self.trade_cancel(netid)
  520.     @socket.send("<25>#{netid}\n")
  521.     me = self.id
  522.     @socket.send("<25f>id = #{me};</25f>\n")
  523.   end
  524.   #--------------------------------------------------------------------------
  525.   # * Send Move Update
  526.   #--------------------------------------------------------------------------
  527.   def self.send_move_change
  528.     return if @oldx == $game_player.x and @oldy == $game_player.y
  529.     return if @mapplayers == {}
  530.     send = ""
  531.     # Increase Steps if the oldx or the oldy do not match the new ones
  532.     if User_Edit::Bandwith >= 1
  533.       send += "ic;"  if @oldx != $game_player.x or @oldy != $game_player.y
  534.     end
  535.     # New x if x does not mathc the old one
  536.     if @oldx != $game_player.x
  537.       send += "@x = #{$game_player.x}; @tile_id = #{$game_player.tile_id};"
  538.       @oldx = $game_player.x
  539.     end
  540.     # New y if y does not match the old one
  541.     if @oldy != $game_player.y
  542.       send += "@y = #{$game_player.y}; @tile_id = #{$game_player.tile_id};"
  543.       @oldy = $game_player.y
  544.     end
  545.     # Send the Direction if it is different then before
  546.     if User_Edit::Bandwith >= 2
  547.       if @oldd != $game_player.direction
  548.         send += "@direction = #{$game_player.direction};"  
  549.         @oldd = $game_player.direction
  550.       end
  551.     end
  552.     # Send everything that needs to be sended
  553.     @socket.send("<5>#{send}</5>\n") if send != ""
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # * Send Stats
  557.   #--------------------------------------------------------------------------
  558.   def self.send_newstats
  559.     hp = $game_party.actors[0].hp
  560.     maxhp = $game_party.actors[0].maxhp
  561.     sp = $game_party.actors[0].sp
  562.     maxsp = $game_party.actors[0].maxsp
  563.     agi = $game_party.actors[0].agi
  564.     eva = $game_party.actors[0].eva
  565.     pdef = $game_party.actors[0].pdef
  566.     mdef = $game_party.actors[0].mdef
  567.     level = $game_party.actors[0].level
  568.     a = $game_party.actors[0]
  569.     c = "["
  570.     m = 1
  571.     for i in a.states
  572.       next if $data_states[i] == nil
  573.       c += i.to_s
  574.       c += ", " if m != a.states.size
  575.       m += 1
  576.     end
  577.     c += "]"
  578.     stats = "@hp = #{hp}; @maxhp = #{maxhp}; @sp = #{sp}; @maxsp = #{maxsp}; @agi = #{agi}; @eva = #{eva}; @pdef = #{pdef}; @mdef = #{mdef}; @states = #{c}; @level = #{level}"
  579.     @socket.send("<5>#{stats}</5>\n")
  580.   end
  581.   #--------------------------------------------------------------------------
  582.   # * Send Gold
  583.   #--------------------------------------------------------------------------
  584.   def self.send_gold
  585.     gold = $game_party.gold
  586.     @socket.send("<5>@gold = #{gold}</5>\n")
  587.   end
  588.   #--------------------------------------------------------------------------
  589.   # * Close Socket
  590.   #--------------------------------------------------------------------------
  591.   def self.close_socket
  592.     return if @socket == nil
  593.     @socket.send("<9>#{self.id}</9>\n")
  594.     #@socket.send("<4>'Close'</4>\n")
  595.   #Se você fechar o jogo quando uma mensagem tiver aberta, quando retornar, ele não está travado
  596.   if $game_temp.message_window_showing
  597.     @message_window = Window_Message.new
  598.     @message_window.terminate_message
  599.   end
  600.     if $scene.is_a?(Scene_Connect)
  601.     end
  602.     if $scene.is_a?(Scene_Login)
  603.     end
  604.     if $scene.is_a?(Scene_Register)
  605.     end
  606.     if $scene.is_a?(Scene_Title)
  607.     end
  608.     if $scene.is_a?(Scene_Create)
  609.     end
  610.     #No jogo
  611.     if $scene.is_a?(Scene_Trade)
  612.     salvar
  613.     end
  614.     if $scene.is_a?(Scene_PChat)
  615.     salvar
  616.     end
  617.     if $scene.is_a?(Scene_Map)
  618.     salvar
  619.     end
  620.     @socket.close
  621.     @socket = nil
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # * Change Messgae of the Day
  625.   #--------------------------------------------------------------------------
  626.   def self.change_mod(newmsg)
  627.     @socket.send("<11>#{newmsg}</11>\n")
  628.   end
  629.   #--------------------------------------------------------------------------
  630.   # * Private Chat Send
  631.   #--------------------------------------------------------------------------
  632.   def self.pchat(id,mesg)
  633.     @pchat_conf = false
  634.     # Send the Private Chat Id (without close!!! \<13a>)
  635.     @socket.send("<13a>#{id}\n")
  636.     # Send Priavte Chat Message
  637.     @socket.send("<13>#{mesg}</13>\n") #if @pchat_conf
  638.     #p "could not send #{mesg} to #{id}..." if not @pchat_conf
  639.   end
  640.   #--------------------------------------------------------------------------
  641.   # * Private Chat Send
  642.   #--------------------------------------------------------------------------
  643.   def self.mchat(id,mesg)
  644.     @mchat_conf = false
  645.     # Send the Chat Id (without close!!! \<21a>)
  646.     @socket.send("<21a>#{id}\n")
  647.     # Send Chat Message
  648.     @socket.send("<21>#{mesg}</21>\n")
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # * Check if the user exists on the network..
  652.   #--------------------------------------------------------------------------
  653.   def self.user_exist?(username)
  654.     # Enable the test
  655.     @user_test  = true
  656.     @user_exist = false
  657.     # Send the data for the test
  658.     self.send_login(username.to_s,"*test*")
  659.     # Check for how to long to wait for data (Dependent on username size)
  660.     if username.size <= 8
  661.       # Wait 1.5 seconds if username is less then 8
  662.       for frame in 0..(1.5*40)
  663.         self.update
  664.       end
  665.     elsif username.size > 8 and username.size <= 15
  666.       # Wait 2.3 seconds if username is less then 15
  667.       for frame in 0..(2.3*40)
  668.         self.update
  669.       end
  670.     elsif username.size > 15
  671.       # Wait 3 seconds if username is more then 15
  672.       for frame in 0..(3*40)
  673.         self.update
  674.       end
  675.     end
  676.     # Start Retreival Loop
  677.     loop = 0
  678.     loop do
  679.       loop += 1
  680.       self.update
  681.       # Break if User Test was Finished
  682.       break if @user_test == false
  683.       # Break if loop meets 10000
  684.       break if loop == 10000
  685.     end
  686.     # If it failed, display message
  687.     p User_Edit::USERTFAIL if loop == 10000
  688.     # Return User exists if failed, or if it exists
  689.     return true if @user_exist or loop == 10000
  690.     return false
  691.   end
  692.   #--------------------------------------------------------------------------
  693.   # * Trade
  694.   #--------------------------------------------------------------------------
  695.   def self.trade(id,type,item,num=1,todo='gain')
  696.     # Gain is used for normal trade,
  697.     # Lose is used as Admin Command
  698.     # Check if you got item
  699.     case type
  700.      when 0
  701.       got = $game_party.item_number(item)
  702.      when 1
  703.       got = $game_party.weapon_number(item)
  704.      when 2
  705.       got = $game_party.armor_number(item)
  706.     end
  707.     # Print if not, return
  708.     p "#{User_Edit::DONTGOTTRADE} (trade: kind = #{type} id = #{item})" if got == 0 and todo == 'gain'
  709.     return if got == 0 and todo == 'gain'
  710.     p "#{User_Edit::NOTENOUGHTRADE} (trade: kind = #{type} id = #{item})" if got < num and todo == 'gain'
  711.     return if got < num and todo == 'gain'
  712.     @pchat_conf = false
  713.     # Send the Trade Id (without close!!! \<12a>)
  714.     @socket.send("<12a>#{id}\n")
  715.     @socket.send("<12>type=#{type} item=#{item} num=#{num} todo=#{todo}</12>\n")
  716.       case type
  717.        when 0
  718.         $game_party.lose_item(item,num) if todo == 'gain'
  719.        when 1
  720.         $game_party.lose_weapon(item, num)  if todo == 'gain'
  721.        when 2
  722.         $game_party.lose_armor(item, num)  if todo == 'gain'
  723.       end
  724.   end
  725.   #--------------------------------------------------------------------------
  726.   # * Send Result
  727.   #--------------------------------------------------------------------------
  728.   def self.send_result(id)
  729.     @socket.send("<result_id>#{id}</result_id>\n")
  730.     @socket.send("<result_effect>#{self.id}</result_effect>\n")
  731.   end
  732.   #--------------------------------------------------------------------------
  733.   # * Send Dead
  734.   #--------------------------------------------------------------------------
  735.   def self.send_dead
  736.     @socket.send("<9>#{self.id}</9>\n")
  737.   end
  738.   #--------------------------------------------------------------------------
  739.   # * Update Net Players
  740.   #--------------------------------------------------------------------------
  741.   def self.update_net_player(id, data)
  742.     # Turn Id in Hash into Netplayer (if not yet)
  743.     @players[id] ||= Game_NetPlayer.new
  744.     # Set the Global NetId if it is not Set yet
  745.     @players[id].do_id(id) if @players[id].netid == -1
  746.     # Refresh -> Change data to new data
  747.     @players[id].refresh(data)      
  748.     # Return if the Id is Yourself
  749.     return if id.to_i == self.id.to_i
  750.     # Return if you are not yet on a Map
  751.     return if $game_map == nil
  752.     # If the Player is on the same map...
  753.     if @players[id].map_id == $game_map.map_id
  754.       # Update Map Players
  755.       self.update_map_player(id, data)
  756.     elsif @mapplayers[id] != nil
  757.       # Remove from Map Players
  758.       self.update_map_player(id, data, true)
  759.     end
  760.   end
  761.   #--------------------------------------------------------------------------
  762.   # * Update Map Players
  763.   #--------------------------------------------------------------------------
  764.   def self.update_map_player(id, data, kill=false)
  765.     # Return if the Id is Yourself
  766.     return if id.to_i == self.id.to_i
  767.     # If Kill (remove) is true...
  768.     if kill and @mapplayers[id] != nil
  769.       # Delete Map Player
  770.       @mapplayers.delete(id.to_i) rescue nil
  771.       if $scene.is_a?(Scene_Map)
  772.          $scene.spriteset.delete(id.to_i) rescue nil
  773.       end
  774.       $game_temp.spriteset_refresh = true
  775.       return
  776.     end
  777.     g = @mapplayers[id]
  778.     @mapplayers[id] ||= @players[id] if @players[id] != nil
  779.     # Turn Id in Hash into Netplayer (if not yet)
  780.     @mapplayers[id] ||= Game_NetPlayer.new
  781.     # Set the Global NetId if it is not Set yet
  782.     @mapplayers[id].netid = id if @mapplayers[id].netid == -1
  783.     # Refresh -> Change data to new data
  784.     @mapplayers[id].refresh(data)
  785.     #Send the player's new stats
  786.     self.send_newstats if g == nil
  787.   end
  788.   #--------------------------------------------------------------------------
  789.   # * Update Net Actors
  790.   #--------------------------------------------------------------------------
  791.   def self.update_net_actor(id,data,actor_id)
  792.     return
  793.     return if id.to_i == self.id.to_i
  794.     # Turn Id in Hash into Netplayer (if not yet)
  795.     @netactors[id] ||= Game_NetActor.new(actor_id)
  796.     # Set the Global NetId if it is not Set yet
  797.     @netactors[id].netid = id if @netactors[id].netid == -1
  798.     # Refresh -> Change data to new data
  799.     @netactors[id].refresh(data)
  800.   end
  801.   #--------------------------------------------------------------------------
  802.   # * Update
  803.   #--------------------------------------------------------------------------
  804.   def self.update
  805.     # If Socket got lines, continue
  806.     return unless @socket.ready?
  807.     for line in @socket.recv(0xfff).split("\n")
  808.       @nooprec += 1 if line.include?("\000\000\000\000")
  809.       return if line.include?("\000\000\000\000")
  810.       p "#{line}" unless line.include?("<5>") or line.include?("<6>")or not $DEBUG or not User_Edit::PRINTLINES
  811.       # Set Used line to false
  812.       updatebool = false
  813.       #Update Walking
  814.       updatebool = self.update_walking(line) if @login and $game_map != nil
  815.       # Update Ingame Protocol, if LogedIn and Map loaded
  816.       updatebool = self.update_ingame(line)  if updatebool == false and @login and $game_map != nil
  817.       # Update System Protocol, if command is not Ingame
  818.       updatebool = self.update_system(line)  if updatebool == false
  819.       # Update Admin/Mod Protocol, if command is not System
  820.       updatebool = self.update_admmod(line)  if updatebool == false
  821.       # Update Outgame Protocol, if command is not Admin/Mod
  822.       updatebool = self.update_outgame(line) if updatebool == false
  823.     end
  824.   end
  825.   #--------------------------------------------------------------------------
  826.   # * Update Admin and Mod Command Recievals -> 18
  827.   #--------------------------------------------------------------------------
  828.   def self.update_admmod(line)
  829.     case line
  830.      # Admin Command Recieval
  831.      when /<18>(.*)<\/18>/
  832.       # Kick All Command
  833.       if $1.to_s == "kick_all"
  834.         p User_Edit::ADMKICKALL
  835.         self.close_socket
  836.         $scene = nil
  837.         return true
  838.       # Kick Command
  839.       elsif $1.to_s == "kicked"
  840.         p User_Edit::ADMKICK
  841.         self.close_socket
  842.         $scene = nil
  843.         return true
  844.       end
  845.      return false
  846.     end
  847.     return false
  848.   end
  849.   #--------------------------------------------------------------------------
  850.   # * Update all Not-Ingame Protocol Parts -> 0, login, reges
  851.   #--------------------------------------------------------------------------
  852.   def self.update_outgame(line)
  853.     case line
  854.      # Server Authenfication
  855.      when /<0 (.*)>(.*) n=(.*)<\/0>/
  856.       a = self.authenficate($1,$2)
  857.       @servername = $3.to_s
  858.       return true if a
  859.      # Server Authenfication
  860.  
  861.      # Registration Conformation
  862.      when /<reges>(.*)<\/reges>/
  863.       @user_test = false
  864.       return true
  865.      # Login, With User Test
  866.      when /<login>(.*)<\/login>/
  867.       if not @user_test
  868.         # When Log in Succeeded, and not User Test...
  869.         if $1 == "allow" and not @user_test
  870.           # Login and Status to Logged-in
  871.           @login = true
  872.           @status = User_Edit::LOGIN_STATUS
  873.           text = [@status]
  874.           $scene.set_status(@status) if $scene.is_a?(Scene_Login)
  875.           # Get Name (By Server)
  876.           self.get_name
  877.           # Start Loop for Retrieval
  878.           loop = 0
  879.           loop do
  880.             self.update
  881.             loop += 1
  882.             # Break if loop reaches 10000
  883.             break if loop == 10000
  884.             # Break if Name and ID are recieved
  885.             break if self.name != "" and self.name != nil and self.id != -1
  886.           end
  887.           self.get_group
  888.           # Goto Scene Title
  889.           self.req_charAinfo
  890.           p self.char_name
  891.           $scene = Scene_Title.new
  892.           return true
  893.         # When Wrong Username and not User Test
  894.         elsif $1 == "wu" and not @user_test
  895.           # Set status to Incorrect Username
  896.           @status = User_Edit::LOGIN_USERERROR
  897.           $scene.set_status(@status) if $scene.is_a?(Scene_Login)
  898.           return true
  899.         # When Wrong Password and not User Test
  900.         elsif $1 == "wp" and not @user_test
  901.           # Set status to Incorrect Passowrd
  902.           @status = User_Edit::LOGIN_PASSERROR
  903.           $scene.set_status(@status) if $scene.is_a?(Scene_Login)
  904.           return true
  905.         # When Other Command, and Not User test
  906.         elsif not @user_test
  907.           # ERROR!
  908.           @status = User_Edit::UNEXPECTLOGERR
  909.           p @status
  910.           return true
  911.         end
  912.       # If it IS a user test...
  913.       else
  914.         @user_exist = false
  915.         #...and wrong user -> does not exist
  916.         if $1 == "wu"
  917.           # User does not Exist
  918.           @user_exist = false
  919.           @user_test = false
  920.         #...and wrong pass -> does exist
  921.         elsif $1 == "wp"
  922.           # User Does Exist
  923.           @user_exist = true
  924.           @user_test = false
  925.         end
  926.         return true
  927.       end
  928.       return false
  929.     end
  930.     return false
  931.   end
  932.   #--------------------------------------------------------------------------
  933.   # * Update System Protocol Parts -> ver, mod, 1, 2, 3, 10
  934.   #--------------------------------------------------------------------------
  935.   def self.update_system(line)
  936.     case line
  937.      # Version Recieval
  938.      when /<ver>(.*)<\/ver>/
  939.       $game_temp.msg = User_Edits::VER_ERROR if $1.to_s == nil
  940.       @version = $1.to_s if $1.to_s != nil
  941.       return true
  942.      when /<infor>(.*) (.*)<\/infor>/
  943.       @characname = $1.to_s
  944.       @characgfx = $2.to_s
  945.       #p self.char_name
  946.       p $2.to_s
  947.       return true
  948.      # Message Of the Day Recieval
  949.      when /<mod>(.*)<\/mod>/
  950.       $game_temp.motd = $1.to_s
  951.       return true
  952.      # User ID Recieval (Session Based)
  953.      when /<1>(.*)<\/1>/
  954.       @id = $1.to_s
  955.       return true
  956.      # User Name Recieval
  957.      when /<2>(.*)<\/2>/
  958.       @name = $1.to_s
  959.       return true
  960.      # Group Recieval
  961.      when /<3>(.*)<\/3>/
  962.       @group = $1.to_s
  963.       return true
  964.      when /<check>(.*)<\/check>/
  965.       @group = $1.to_s
  966.       return true
  967.      # System Update
  968.      when /<10>(.*)<\/10>/
  969.       return true if $1.match(/File|system|`/)
  970.       return true if $1.nil?
  971.       eval($1)
  972.       $game_map.need_refresh = true
  973.       return true
  974.      when /<23>(.*)<\/23>/
  975.       eval($1)
  976.       key = []
  977.       key.push(@self_key1)
  978.       key.push(@self_key2)
  979.       key.push(@self_key3)
  980.       $game_self_switches[key] = @self_value
  981.       @self_key1 = nil
  982.       @self_key2 = nil
  983.       @self_key3 = nil
  984.       @self_value = nil
  985.       $game_map.need_refresh = true
  986.       key = []
  987.       return true
  988.     end
  989.     return false
  990.   end
  991.   #--------------------------------------------------------------------------
  992.   # * Update Walking
  993.   #--------------------------------------------------------------------------
  994.   def self.update_walking(line)
  995.     case line
  996.     # Player information Processing
  997.      when /<player id=(.*)>(.*)<\/player>/
  998.       self.update_net_player($1, $2)
  999.       return true
  1000.      # Player Processing
  1001.      when /<5 (.*)>(.*)<\/5>/
  1002.       # Update Player
  1003.       self.update_net_player($1, $2)
  1004.       # If it is first time connected...
  1005.       return true if !$2.include?("start")
  1006.       # ... and it is not yourself ...
  1007.       return true if $1.to_i == self.id.to_i
  1008.       # ... and it is on the same map...
  1009.       return true if @players[$1].map_id != $game_map.map_id
  1010.       # ...  Return the Requested Information
  1011.       return true if !self.in_range?(@players[$1])
  1012.       self.send_start_request($1.to_i)
  1013.       $game_temp.spriteset_refresh = true
  1014.      return true
  1015.      # Map PLayer Processing
  1016.      when /<6 (.*)>(.*)<\/6>/
  1017.       # Return if it is yourself
  1018.       return true if $1.to_i == self.id.to_i
  1019.       # Update Map Player
  1020.       #self.update_map_player($1, $2)
  1021.       self.update_net_player($1, $2)
  1022.       # If it is first time connected...
  1023.       if $2.include?("start") or $2.include?("map")
  1024.         # ... and it is not yourself ...
  1025.         return true if $1.to_i != self.id.to_i
  1026.         # ... and it is on the same map...
  1027.         return true if @players[$1].map_id != $game_map.map_id
  1028.         # ...  Return the Requested Information
  1029.         return true if !self.in_range?(@players[$1])
  1030.         self.send_start_request($1.to_i)
  1031.         $game_temp.spriteset_refresh = true
  1032.       end
  1033.       return true
  1034.     # Map PLayer Processing
  1035.      when /<netact (.*)>data=(.*) id=(.*)<\/netact>/
  1036.       # Return if it is yourself
  1037.       return true if $1.to_i == self.id.to_i
  1038.       # Update Map Player
  1039.       self.update_net_actor($1, $2, $3)
  1040.       return true
  1041.     when /<state>(.*)<\/state>/
  1042.       $game_party.actors[0].refresh_states($1)
  1043.     # Attacked!
  1044.     when /<attack_effect>dam=(.*) ani=(.*) id=(.*) map=(.*)<\/attack_effect>/
  1045.       return if $4.to_i != $game_map.map_id
  1046.       $game_party.actors[0].hp -= $1.to_i if $1.to_i > 0 and $1 != "Miss"
  1047.       #$game_player.jump(0, 0) if $1.to_i > 0 and $1 != "Miss"
  1048.       $game_player.animation_id = $2.to_i if $1.to_i > 0 and $1 != "Miss"
  1049.       if User_Edit::VISUAL_EQUIP_ACTIVE == true
  1050.       actor = $game_party.actors[0]
  1051.       actor.damage = $1.to_i if $1.to_i > 0 and $1 != "Miss"
  1052.       else
  1053.       $game_player.show_demage($1.to_i,false) if $1.to_i > 0 and $1 != "Miss"
  1054.       end  
  1055.    
  1056.       self.send_newstats
  1057.       if $game_party.actors[0].hp <= 0 or $game_party.actors[0].dead?
  1058.         self.send_result($3.to_i)
  1059.         self.send_dead
  1060.         $scene = Scene_Gameover.new
  1061.       end
  1062.       return true
  1063.       # Killed
  1064.      when /<result_effect>(.*)<\/result_effect>/
  1065.        $ABS.netplayer_killed
  1066.        return true
  1067.     end
  1068.     return false
  1069.   end
  1070.   #--------------------------------------------------------------------------
  1071.   # * Update Ingame Parts -> player, 5, 6, 9, 12, 13
  1072.   #--------------------------------------------------------------------------
  1073.   def self.update_ingame(line)
  1074.     case line
  1075.      when /<6a>(.*)<\/6a>/
  1076.        @send_conf = true
  1077.        return true if $1.to_s ==  "'Confirmed'"
  1078.      # Chat Recieval
  1079.      when /<chat>(.*)<\/chat>/    
  1080.       $game_temp.chat_log.push($1.to_s)
  1081.       $game_temp.chat_refresh = true
  1082.       return true
  1083.      # Remove Player ( Disconnected )
  1084.      when /<9>(.*)<\/9>/
  1085.       # Destroy Netplayer and MapPlayer things
  1086.       self.destroy($1.to_i)
  1087.       # Redraw Mapplayer Sprites
  1088.       $game_temp.spriteset_refresh = true
  1089.       $game_temp.spriteset_renew = true
  1090.      when /<12>type=(.*) item=(.*) num=(.*) todo=(.*)<\/12>/
  1091.       case $1.to_i
  1092.        when 0
  1093.         $game_party.gain_item($2.to_i, $3.to_i)    if $4 == 'gain'
  1094.         $game_party.lose_item($2.to_i, $3.to_i)    if $4 == 'lose'
  1095.        when 1
  1096.         $game_party.gain_weapon($2.to_i, $3.to_i)  if $4 == 'gain'
  1097.         $game_party.lose_weapon($2.to_i, $3.to_i)  if $4 == 'lose'
  1098.        when 2
  1099.         $game_party.gain_armor($2.to_i, $3.to_i)   if $4 == 'gain'
  1100.         $game_party.lose_weapon($2.to_i, $3.to_i)  if $4 == 'lose'
  1101.       end
  1102.       $game_temp.refresh_itemtrade = true
  1103.       return true
  1104.      when /<12a>(.*)<\/12a>/
  1105.        @trade_conf = true
  1106.        return true if $1.to_s == "'Confirmed'"
  1107.      # Private Chat Incomming Message
  1108.      when /<13 (.*)>(.*)<\/13>/
  1109.        got = false
  1110.        id = false
  1111.       for chat in 0..$game_temp.pchat_log.size
  1112.         if $game_temp.lastpchatid[chat].to_i == $1.to_i
  1113.           got = true
  1114.           id = chat
  1115.         end
  1116.       end
  1117.       if got
  1118.         $game_temp.pchat_log[id].push($2)
  1119.         $game_temp.lastpchatid[id] = $1.to_i
  1120.         $game_temp.pchat_refresh[id] = true
  1121.       else
  1122.         id = $game_temp.pchat_log.size
  1123.         $game_temp.pchat_log[id] = []
  1124.         $game_temp.pchat_log[id].push($2)
  1125.         $game_temp.lastpchatid[id] = -1
  1126.         $game_temp.lastpchatid[id] = $1.to_i
  1127.         $game_temp.pchat_refresh[id] = false
  1128.         $game_temp.pchat_refresh[id] = true
  1129.       end
  1130.       return true
  1131.      # Private Chat ID confirmation
  1132.      when /<13a>(.*)<\/13a>/
  1133.       @pchat_conf = true
  1134.       return true if $1.to_s == "'Confirmed'"
  1135.      # Private Chat ID confirmation
  1136.      when /<21a>(.*)<\/21a>/
  1137.        @mchat_conf = true
  1138.        return true if $1.to_s == "'Confirmed'"
  1139.      #Map Chat Recieval
  1140.      when /<21>(.*)<\/21>/      
  1141.       $game_temp.chat_log.push($1.to_s)
  1142.       $game_temp.chat_refresh = true
  1143.       return true
  1144.     when /<22a>(.*)<\/22a>/
  1145.       if $1 != "Compelete"
  1146.         @pm_lines.push("#{$1}")
  1147.       elsif $1 == "Compelete"
  1148.         update_pms(@pm_lines)
  1149.         @pm_lines = []
  1150.       end
  1151.       return true
  1152.     when /<24a>(.*)<\/24a>/
  1153.       @trading = true
  1154.       return true
  1155.     when /<24c>(.*)<\/24c>/
  1156.       eval($1)
  1157.       $scene = Scene_Trade.new(@trade_id)
  1158.       self.trade_add(-1,-1,@trade_id)
  1159.       @trade_id = -1
  1160.       return true
  1161.     when /<24d>(.*)<\/24d>/
  1162.       trade_exit = -1
  1163.       eval($1)
  1164.       #$game_temp.trade_window.dispose
  1165.       $game_temp.trade_window = nil
  1166.       trade_exit = -1
  1167.       return true
  1168.     when /<25a>(.*)<\/25a>/
  1169.       i_kind = -1
  1170.       i_id = -1
  1171.       id = -1
  1172.       eval($1)
  1173.      # p id#$game_temp.items2[id], $game_temp.weapons2[id], $game_temp.armors2[id]
  1174.        if i_id < 0 and i_kind < 0
  1175.          $game_temp.trade_window.dispose if $game_temp.trade_window != nil
  1176.          $game_temp.trade_window = nil
  1177.          $game_temp.trade_window = Trade_List.new(id)
  1178.          $game_temp.trade_window.refresh
  1179.          @trade_compelete = true
  1180.          @trading = false
  1181.        end
  1182.       $game_temp.items2[id] = {} if $game_temp.items2[id] == nil
  1183.       $game_temp.weapons2[id] = {} if $game_temp.weapons2[id] == nil
  1184.       $game_temp.armors2[id] = {} if $game_temp.armors2[id] == nil
  1185.       return if i_id < 0
  1186.       case i_kind
  1187.       when 0
  1188.         if $game_temp.items2[id][i_id] == nil
  1189.           $game_temp.items2[id][i_id] = 1
  1190.         else
  1191.           $game_temp.items2[id][i_id] += 1
  1192.         end
  1193.       when 1
  1194.         if $game_temp.weapons2[id][i_id] == nil
  1195.           $game_temp.weapons2[id][i_id] = 1
  1196.         else
  1197.           $game_temp.weapons2[id][i_id] += 1
  1198.         end
  1199.       when 2
  1200.         if $game_temp.armors2[id][i_id] == nil
  1201.           $game_temp.armors2[id][i_id] = 1
  1202.         else
  1203.           $game_temp.armors2[id][i_id] += 1
  1204.         end
  1205.       end
  1206.       $game_temp.trade_refresh = true
  1207.       return true
  1208.     when /<25b>(.*)<\/25b>/
  1209.       i_kind = -1
  1210.       i_id = -1
  1211.       id = -1
  1212.       eval($1)
  1213.       $game_temp.items2[id] = {} if $game_temp.items2[id] == nil
  1214.       $game_temp.weapons2[id] = {} if $game_temp.weapons2[id] == nil
  1215.       $game_temp.armors2[id] = {} if $game_temp.armors2[id] == nil
  1216.       case i_kind
  1217.       when 0
  1218.         if  $game_temp.items2[id][i_id] > 1
  1219.             $game_temp.items2[id][i_id] -= 1
  1220.         else
  1221.             $game_temp.items2[id].delete(i_id)
  1222.         end
  1223.       when 1
  1224.         if $game_temp.weapons2[id][i_id] > 1
  1225.           $game_temp.weapons2[id][i_id] -= 1
  1226.         else
  1227.           $game_temp.weapons2[id].delete(i_id)
  1228.         end
  1229.       when 2
  1230.         if $game_temp.armors2[id][i_id] > 1
  1231.           $game_temp.armors2[id][i_id] -= 1
  1232.         else
  1233.           $game_temp.armors2[id].delete(i_id)
  1234.         end
  1235.       end
  1236.       $game_temp.trade_refresh = true
  1237.       return true
  1238.     when /<25d>(.*)<\/25d>/
  1239.       $game_temp.trade_accepting = true
  1240.       return true
  1241.     when /<25e>(.*)<\/25e>/ #Accept
  1242.       $game_temp.trade_accepting = false
  1243.       $game_temp.start_trade = false
  1244.       $game_temp.trade_now = true
  1245.       return true
  1246.     when /<25f>(.*)<\/25f>/ #Decline
  1247.       $game_temp.trade_accepting = false
  1248.       $game_temp.start_trade = false
  1249.       return true
  1250.     end
  1251.     return false
  1252.   end
  1253.   #--------------------------------------------------------------------------
  1254.   # * Authenficate <0>
  1255.   #--------------------------------------------------------------------------
  1256.   def self.authenficate(id,echo)
  1257.     if echo == "'e'"
  1258.       # If Echo was returned, Authenficated
  1259.       @auth = true
  1260.       @id = id
  1261.       return true
  1262.     end  
  1263.     return false
  1264.   end
  1265.   #--------------------------------------------------------------------------
  1266.   # * Checks the object range
  1267.   #--------------------------------------------------------------------------
  1268.   def self.in_range?(object)
  1269.     screne_x = $game_map.display_x
  1270.     screne_x -= 256
  1271.     screne_y = $game_map.display_y
  1272.     screne_y -= 256
  1273.     screne_width = $game_map.display_x
  1274.     screne_width += 2816
  1275.     screne_height = $game_map.display_y
  1276.     screne_height += 2176
  1277.     return false if object.real_x <= screne_x
  1278.     return false if object.real_x >= screne_width
  1279.     return false if object.real_y <= screne_y
  1280.     return false if object.real_y >= screne_height
  1281.     return true
  1282.   end
  1283. end
  1284. #-------------------------------------------------------------------------------
  1285. # End Class
  1286. #-------------------------------------------------------------------------------
  1287. class Base
  1288.   #--------------------------------------------------------------------------
  1289.   # * Updates Default Classes
  1290.   #--------------------------------------------------------------------------
  1291.   def self.update
  1292.     # Update Input
  1293.     Input.update
  1294.     # Update Graphics
  1295.     Graphics.update
  1296.     # Update Mouse
  1297.     $mouse.update
  1298.     # Update Main (if Connected)
  1299.     Main.update if Main.socket != nil
  1300.   end
  1301. end
  1302. #-------------------------------------------------------------------------------
  1303. # End Class
  1304. #-------------------------------------------------------------------------------
  1305. class Test
  1306.   attr_accessor :socket
  1307.   #--------------------------------------------------------------------------
  1308.   # * Returns Testing Status
  1309.   #--------------------------------------------------------------------------
  1310.   def self.testing
  1311.     return true if @testing
  1312.     return false
  1313.   end
  1314.   #--------------------------------------------------------------------------
  1315.   # * Tests Connection
  1316.   #--------------------------------------------------------------------------
  1317.   def self.test_connection(host, port)
  1318.     # We are Testing, not Complted the Test
  1319.     @testing = true
  1320.     @complete = false
  1321.     # Start Connection
  1322.     @socket = TCPSocket.new(host, port)
  1323.     if not @complete
  1324.       # If the Test Succeeded (did not encounter errors...)
  1325.       self.test_result(false)
  1326.       @socket.send("<20>'Test Completed'</20>")
  1327.       begin
  1328.         # Close Connection
  1329.         @socket.close rescue @socket = nil
  1330.       end
  1331.     end
  1332.   end
  1333.   #--------------------------------------------------------------------------
  1334.   # * Set Test Result
  1335.   #--------------------------------------------------------------------------
  1336.   def self.test_result(value)
  1337.     # Set Result to value, and Complete Test
  1338.     @result = value
  1339.     @complete = true
  1340.   end
  1341.   #--------------------------------------------------------------------------
  1342.   # * Returns Test Completed Status
  1343.   #--------------------------------------------------------------------------
  1344.   def self.testcompleted
  1345.     return @complete
  1346.   end
  1347.   #--------------------------------------------------------------------------
  1348.   # * Resets Test
  1349.   #--------------------------------------------------------------------------
  1350.   def self.testreset
  1351.     # Reset all Values
  1352.     @complete = false
  1353.     @socket = nil
  1354.     @result = nil
  1355.     @testing = false
  1356.   end
  1357.   #--------------------------------------------------------------------------
  1358.   # * Returns Result
  1359.   #--------------------------------------------------------------------------
  1360.   def self.result
  1361.     return @result
  1362.   end
  1363. end
  1364. #-------------------------------------------------------------------------------
  1365. # End Class
  1366. #-------------------------------------------------------------------------------
  1367.   #--------------------------------------------------------------------------
  1368.   # * Module Update
  1369.   #--------------------------------------------------------------------------
  1370.   def self.update
  1371.   end
  1372. end
  1373. #-------------------------------------------------------------------------------
  1374. # End Module
  1375. #-------------------------------------------------------------------------------
  1376. end
  1377. #-------------------------------------------------------------------------------
  1378. # End SDK Enabled Test
  1379. #-------------------------------------------------------------------------------
Expand to see the code.



Server response code part (It works but just to show)
  1.     public String getInfo(String cuenta, String slot)
  2.     {
  3.         Connection con = null;
  4.         String val = null;
  5.  
  6.         try
  7.         {
  8.             Class.forName("com.mysql.jdbc.Driver");
  9.             con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "password");
  10.             PreparedStatement st = con.prepareStatement("SELECT * FROM `characters` WHERE `cuenta`= ? AND slot =?");
  11.             st.setString(1, cuenta);
  12.             st.setString(2, slot);
  13.             ResultSet rs = st.executeQuery();
  14.             if(rs.next())
  15.             {
  16.                
  17.                     val = "<infor>"+ rs.getString("name") +" " + rs.getString("char_name")+ "</infor>";
  18.             }
  19.  
  20.         }
  21.         catch(Exception e)
  22.         {
  23.             e.printStackTrace();
  24.             System.out.println("Exception: " + e.getMessage());
  25.         }
  26.         finally
  27.         {
  28.             try
  29.             {
  30.                 if(con != null)
  31.                     con.close();
  32.             }
  33.             catch(SQLException e) {}
  34.         }
  35.         return val;
  36.     }
Expand to see the code.


(When done I'll release both sources, so help me please 🙂 )
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?
Go to your project, search for RPGXP project(not game.exe, the other) rightclick it, next click on 'open with...' and then use any note program like notepad. change 1.03 to 1.02 or 1.01 and good luck!

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=70767