-
Content Count
242 -
Joined
-
Last visited
-
Days Won
81
Posts posted by Ai4rei
-
-
-
Here you go, see if it works alright (did only basic testing). Requires PHP-CLI:
php collapsemes.php /path/to/npc/folder
Old files are backed up as *.bak, files that need no change are not touched. You might want to use this in a separate working copy in case it screws up.collapsemes.php:
#!/usr/bin/php<?php// =================================================================// Collapse consecutive *mes into one, v1.0.1// (c) 2015 Ai4rei/AN//// This work is licensed under a// Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )// =================================================================// Down-level (PHP 4)if(!function_exists('file_put_contents')){ function file_put_contents($sFileName,$sData) { if(($hFile = fopen($sFileName,'wb'))!==false) { return fwrite($hFile,$sData) && fclose($hFile); } return false; }}// Down-level Endfunction ProcessFile($sFile){ $bSuccess = false; echo "File: {$sFile}... load"; if(($sData =@file_get_contents($sFile))!==false) { echo ' conv'; // mes ( ( var | string ) [,+] )* string; mes " $sPattern = '/((?<![a-z0-9_])mess+((??:(??:[$.]?@?|#{1,2}|')(?:[a-zA-Z0-9_]+)$?)|(??<!)"(?:.(?!(?<!)"))*.?"))s*[,+]s*)*(??<!)"(?:.(?!(?<!)"))*.?))"s*;s*mess+")/sS'; if(preg_match($sPattern,$sData)) { do { $sData = preg_replace($sPattern,'mes $2n',$sData); } while(preg_match($sPattern,$sData)); echo ' save'; if(rename($sFile,substr($sFile,0,-3).'bak') && file_put_contents($sFile,$sData)) { echo " successn"; $bSuccess = true; } else { echo " failuren"; } } else { echo " skipn"; $bSuccess = true; } } else { echo " failuren"; } return $bSuccess;}function ProcessPath($sPath){ $bSuccess = true; echo "Enter: {$sPath}n"; if(($hDir =@opendir($sPath))!==false) { while(($sFile = readdir($hDir))!==false) { if(substr($sFile,0,1)=='.') {// unix world: skip self- and parent-references and so-called hidden files continue; } $sFullPath = $sPath.'/'.$sFile; if(is_dir($sFullPath)) { if(!ProcessPath($sFullPath)) { $bSuccess = false; break; } } elseif(is_file($sFullPath) && substr(strtolower($sFile),-4)==='.txt') { if(!ProcessFile($sFullPath)) { $bSuccess = false; break; } } } closedir($hDir); } else { echo "Failed to read directory: {$sPath}n"; } echo "Leave: {$sPath}n"; return $bSuccess;}function Main($nArgc,$aArgv){ if($nArgc<2) { echo "Usage: php collapsemes.php <script path>n"; return true; } return ProcessPath($aArgv[1]);}if(isset($_SERVER['argc']) && isset($_SERVER['argv'])){ return Main($_SERVER['argc'],$_SERVER['argv']) ? 0 : 1;}die("This script must be run on command line.n");?>
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Edit:
v1.0.1: Removed a flag, added regexp overview.
Nebraskka and evilpuncker reacted to this -
I guess I could.(and by the way, since you are a programmer yourself, mind creating a simple tool to convert all npc files to this format you posted?
)
Edit:
Looking at the current trunk, I do not see support for n in *mes.
evilpuncker reacted to this -
What about:
mes "Oh...";mes "...Well.";mes "I guess you are right. It is hard.";
↓↓↓"Oh...n...Well.nI guess you are right. It is hard."
Nebraskka and evilpuncker reacted to this -
Updated to 2.4.7, undoes settings removal in 2.4.5, improves performance and stability, and adds support for idRO (region-locked). There is also some more stuff to read in the doc/ folder.
evilpuncker reacted to this -
You have to:
- Make the client recognize (InitPacketLenWithClient) the modified packet. ~ Easy.
- Make the client parse the modified packet and save the another info in memory (CGameMode::Zc_Ack_Reqnameall). ~ Moderate difficulty.
- Make the client draw the text along with the other data when requested (probably UINameBalloonText::SetNameText). ~ Complicated.
There probably aren't many people willing and able to do such edit, so you might want to reconsider this. Note, that for hex-stuff you should provide your client version, as some mechanics vary from version to version.
-
There is no granny support in the alpha client and no .gr2 files in the data.Omg the alpha client??? I kinda want this just to have a piece of RO history on my computer. Hey maybe it has the missing 3D monsters like zombie dragon.
-
It is one of the early RO clients. It uses the "GRFv0" archive format that uses customized lzxx compression rather than zlib (patching was done though additional GRF files in the format pdata%d.grf that were read by the client in order) and contains the alpha maps, that have slightly different format than maps these days. Instead of "1rag1" command line it uses "ragpassword". It does not recognize any xml file (yes, not even clientinfo.xml works). The packet protocol seems completely different as well with login packets from 0x5 to 0x1D and game packets from 0xF to 0xAA. BGMs 1.mp3 through 5.mp3 are hardcoded. The whole client+data has about 151MB.
In short, no, Hercules does not support this.
evilpuncker reacted to this -
Making an assumption based on the other topic titled HEXED !, the English alpha client does not support login screen BGM. It has 5 BGMs hard-coded for the respective towns/fields available at that time.
With some effort and assembler skills it is possible to assign login.rsw a BGM, though.
-
To get rid of the "warning.bmp" screen on the English alpha client, apply this:
F: C705046152000A000000R: C7050461520000000000
You will get straight to the login screen then: -
There we go.
Updated to 2.4.6, fixed kRO mirror attributions not showing properly on some Windows versions.
On unrelated note, there is a typo in the original patch.txt for patch 2093, so I fixed it in the mirrored one.
evilpuncker reacted to this -
Aww, ...
Yeah I make something like that, I completely forgot to take the new OS' UI changes into account.
evilpuncker reacted to this -
Updated to 2.4.5, added community contributed mirror support for kRO main and sakray. Further applications for approved mirror servers are welcome.
evilpuncker and Naruto reacted to this -
After some talk on the IRC there will be something better than a plug-in. I wonder if I manage to get it done in this extended weekend.
evilpuncker reacted to this -
Since there is no further movement in the poll, it concludes with the following result:
- There will be a new "tool", that does both patching and launching (most likely RO Patcher Lite Core built atop ROCred UI).
- Majority of the RPI's floating around (p-server client survey) are plug-ins responsible for managing patch information, skinning and HTML patch news, which will be part of the new application, so there will be no plug-in system/API for the time being. The RO Patcher Lite API will probably be put on ice as well.
- No further efforts will be put into ROCred anymore, except bug-fixes (or "security patches" as some people love to word it).
Update 2015-12-23:
Currently struggling (for a few months now) with one of the most basic things: sockets.
The current-public patcher (rsu v2) uses WinINet, a Windows networking component responsible for HTTP and FTP client-side tasks among others, primarily used by Internet Explorer to deal with network, cache and cookies. The API is relatively simple to use and stable, though the latter depends on the Windows version in use (WINE compatibility is a different matter, but it works sufficiently for the patcher to work). Unfortunately this blessing of an API is also a curse, in terms of having no control over it. Somewhere around IE7 or IE8 someone came up with the idea to screw with the timeout handling, referring to the fact, that you can update the timeouts to desired values; the problem is, it does not always work. So people were expected to wait for an connection to timeout after 2 hours, where it should have failed after 15 seconds.
The plan was to make replacement (pretty much like rsulib was for libgrf) for the next major release, which would be rsu v4 along with the result of this poll (which only has rocred built atop of it). The result should be 4 more components (internally referred to as snippets, ex. the absent code from rocred reference source): socket, telnet, http and ftp. The last three are pretty much done. But socket, which actually is around for a while (which is maybe one of the problems), cannot deal with conditions beyond localhost and multi-threading properly, and the API merely mirrors the BSD sockets. It also tends to lose data on *nix for a certain reason. So while trying various models and occasionally experimenting with inconsistent IPv6 parts of the API, both releases are being delayed.
Why I do not use some of the available libraries, ex. curl? Some use GPL, some did not work for me and the last few I am merely too stupid to figure out how they work.
Update 2016-02-21:
Things are finally starting moving. While I still cannot state some ETA, sockets are being actively worked on, basically typing.
Also while going through some Windows SDK headers, I found some support code to implement support for IPv6 without having to raise the minimum OS requirements (the code provides down-level functions for OSes without IPv6 support).
Update 2016-09-29:
Sockets are complete, time to put all those puzzle pieces together.
Update 2017-04-15:
The core still needs some work, but it starts to look good.
-
Updated to 2.11.5, adds French translation. No functional changes.
Updated to 2.11.6, adds ASLR/DEP. No functional changes.
evilpuncker reacted to this -
-
Not quite sure what you mean with combine, but putting the client in ROCred's resources, will not make ROCred magically pull the client out of it's sleeve when you press "Start".
evilpuncker reacted to this -
It could be done with a plug-in. Note, that FTP is the main requirement for the patches, HTTP alone will not do it.
evilpuncker reacted to this -
Might be a problem between you and the patch server then, works fine for me.
evilpuncker reacted to this -
INI:
- Menu "Action" -> "Add a new resource..."
- Button "Open file with new resource" -> select your rocred.ini
- Field "Resource Type": Enter RCDATA
- Field "Resource Name": Enter CONFIG
- Field "Resource Language": Enter 0
- Button "Add Resource"
- Menu "File" -> "Save"
- Menu "Action" -> "Add a new resource..."
- Button "Open file with new resource" -> select your background bitmap (.bmp)
- Field "Resource Type" should turn into BITMAP.
- Field "Resource Name": Enter BGSKIN
- Field "Resource Language": Enter 0
- Button "Add Resource"
- Menu "File" -> "Save"
Angelmelody and evilpuncker reacted to this -
In case you connect to Internet over wireless, try fixing that first.All I receive is an error:
"Failed to receive xxxxx..."
and
"Failed to connect to file server."
evilpuncker reacted to this -
-
I assume you have dropped your client on "istarted", which is the wrong way to use it (process parent must be rocred). Please configure "istarted" as client in rocred.ini and login through rocred. Provide the "Command Line" then, thank you.HERE SOME INFORMATION ABOUT MY PROBLEM
IM USING 2012-04-10aRagexeRE_J.exe
- I Started Info.
Putting Username And Password
UNREGISTERED ID WHEN I START
HERE ARE THE LOGIN SERVER CONSOLE
HERE MY MYSQL LOGIN TABLE
; ------------------------------------------------------------------; RO Credentials (ROCred); (c) 2012-2015 Ai4rei/AN;; ------------------------------------------------------------------; Lines starting with ; are comments and can be removed before; embedding the config into rocred.; Numbers are always considered decimal (base 10) unless stated; otherwise.; When a color value is required, it can be in one of the following; CSS-like formats:; #rgb hexadecimal (short); #rrggbb hexadecimal (long); rgb(r,g, decimal or hexadecimal; rgb(r%,g%,b%) percentage[ROCred]; Whether or not user name is remembered.; Values:; 0: No; 1: YesCheckSave=0; Remembered user name.; Client to start when clicking login or replay.ExeName=pinas-ro.exe; Argument to pass to the client.ExeType=1rag1; Whether or not password should be MD5 hashed.; Values:; 0: Plaintext; 1: MD5 hashHashMD5=0; Whether second instances are allowed or not.; Values:; 0: No; 1: Yes; Note: This setting is not meant as measure to prevent double; clienting.SecondInstance=0; Whether or not the checkbox for remembering user name is; available.; Values:; 0: Available; 1: UnavailablePolicyNoCheckSave=0; Whether or not the button for starting replay is available.; Values:; 0: Available; 1: UnavailablePolicyNoReplay=0; Whether or not the notification icon is displayed when in; background waiting for the client to complete.; Values:; 0: Display; 1: HidePolicyNoTrayIcon=0; Whether or not password is kept during a session when in; background waiting for the client to complete.; Values:; 0: Kept; 1: Not keptPolicyNoSessionPassword=0; Font size of the dialog in points.; Note: Sample skin is designed for size 26.FontSize=9; Provides miscellaneous client information to the server as part of; the password/hash data. The password/hash is provided as "key".; Bitmask:; &1: Hardware address of the network adapter (mac).; Internet-bound adapters are searched first, otherwise; the first available is picked. If the MAC address cannot; be retrieved, "000000000000" is passed.; Note: The user receives an agreement prompt the first time they; provide the data to the server.; Note: The server must be modified to support the data format.; Example: mac=112233445566&key=mypwd123; Note: Password is always the last key-value pair and is not; urlencoded.MiscInfo=0
WHAT IS THE PROBLEM SIR ? I TRIED TO EDIT THE .INI BUT NOTHING HAPPEN
The login-server console is interesting, that both username and password are empty.
Create an Installer over 2GB here!
in Off Topic
Posted