Jump to content

KeyWorld

Members
  • Posts

    379
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by KeyWorld

  1. @Elf0 Great Currently what I did in the server I tested it was an auto-refresh "who is online" with character's head, and showing the body when mouse was hover http://upload.robrowser.com/chargen/who.png A lot of things can be done @BBaking About robe, maybe have to update the robe db, I will check. About the color, are you talking about the white merged with the shadow ? It can be change but not easily, I will add this option in the next update if you want. @Talaysen Thank you @AngelRO Possible problems of the GRF reader : The GRF file isn't repack without DES encryption (official encryption) - as I ask in the first post - so some files can't be open (should throw an error I guess). The search in GRF is case sensitive (it's far faster), so maybe the filename case isn't the same. The last two files isn't a problem at all, the tool try to load the creator weapon and can't find it. That's not a problem.
  2. @BBaking It support it, but not properly because of another problem with PHP GD which, instead of outputting some pixels with an alpha value, it merge them with the background (white transparent background). I didn't find a proper way to fix it. You can remove the shadow if you want by editing render/class.CharacterRender.php and commenting this lines: if ( $this->action !== self::ACTION_SIT && $this->action !== self::ACTION_DIE ) $this->renderImage( $img, array( "path" => "data/sprite/shadow", "scale" => DB::get_shadow_factor($view['class']) )); About the robe it should work fine, do you have a problem with it ?
  3. Can someone confirm the 3rd job filename error ? I don't have an updated GRF with 3rd job right now and I don't have the same informations by checking the web. --------------- To display the userid in the signature for example ? Open controllers/signature, search for: login.sex, So add here what you want to get: login.sex, login.userid, Go to the render() method, and add: $color = imagecolorallocate($output, 255 /*r*/, 0 /*g*/, 0 /*b*/); imagestring($output, 2, 0 /*x*/, 0 /*y*/, $data['userid'], $color);
  4. @ericklucas I don't have one sorry, I'm using two old bigs outdated GRFs. You can use your own GRF without removing files, it will work if properly repack. But it will be faster if you just have the needed files (all files in data/sprite and data/palette), same thing if you're using the data folder, you can upload the whole data or just upload data/sprite and data/palette. @Elf0 Good news @Talaysen There is no security issue, It's just a problem if you have some files you don't want to share in your data. User can guess the location to this file and download it (I will add .htaccess to deny access from user in the next update). @All and @Talaysen If you have problem installing the tool, I did an update last night. Install the latest version, configure it, and once it's done open index.php and uncomment this line : // Set on the debug //Debug::enable(); Once it's done all info and errors will be reporting when rendering an image: If you still don't get what the error is, just contact me and I will try to figure what's your problem.
  5. @Gerome I didn't see your post, sorry. Thank you, what are the next updates you want to see in this tool ? @AngelRO Yeah, check the DATA.INI name and the GRF name, it's maybe case sensitive. If you don't see, PM me and we will do some tests to figure out what's your problem. @BBaking I never use nginx to do rewrite url, but by checking google it should be something like this: server { # basic configs before... # unless the request is for a valid file, send to bootstrap if (!-e $request_filename) { rewrite ^(.*)$ /index.php/$1 last; } # Avoid user to read .htaccess/.htpasswd files location ~ /\.ht { deny all; } } But I have no idea if it will work. @All I'm planning to do a debug mode (or an installation mode) to help configuring it. If you have some idea for this tool, don't hesitate and share it.
  6. To spot the error, change this in index.php://ini_set('display_errors', 1); //error_reporting(E_ALL); To: ini_set('display_errors', 1); error_reporting(E_ALL); Maybe a problem with writing access on cache directory, try to change: Cache::$time = 15 * 60 ; // cache for 15 mins (set to 0 if you want to disable cache). To: Cache::$time = 15 * 60 * 0 ; // cache for 15 mins (set to 0 if you want to disable cache). And: Client::$AutoExtract = true ; // If true, client will save extracted files from GRF into the data folder. To: Client::$AutoExtract = false ; // If true, client will save extracted files from GRF into the data folder.
  7. You're welcome I forget to talk about three known problems related to PHP GD (it sucks !). I show you this problems in only one monster : The Bloody Knight ! Do you see the fire ? There is a white rectangle around. this problems occurs on RGBA images in Sprite files when you try to merge them with the main image. Check the shield, there is a white border around it. When rotating an image it's possible to have this problem : the image border is merging with the transparent background (which is white) and cause this bug. I replace the transparent background by a transparent white background to avoid getting a magenta border (or other flashy border). Check the shield again, poor quality ! Due to image rotation + image scale. The problem n°1 just occurred in some monsters (effects), I don't think there is one hat or character using RGBA frames for now in RO. The problem n°2 and 3 can occurred in all monsters/characters, depend of the scale and rotation. To conclude, PHP GD sucks, I have noone of this problems in javascript (<3).
  8. The client cache the character name to avoid spamming the network each time it hover a player. So no, it will not be a good solution. @Anakid Nice idea
  9. Seriously: wtf. I spent 50 minutes of my life trying to fix bbcodes bugs in my first post, see the result. Edit: Finally able to have a not bad rendering by using some tricks: bbcode [-b] to jump line if use too much [-code], the code switch to inline mode (wth ?) ...
  10. ROChargenPHP Features Core Support for .spr, .act, .pal, .grf, ... .act file completed support (transparency, scale, color, rotate, ...) Characters fully implemented ( body, head, hats, weapon, shield, robe, mount) with palettes support. Can modify action, animation and direction. Class to generate : Full Character / Character Head only / Monster-NPC-Homunculus / Avatar / Signature. Cache system available (and can be set off) with configurable time to cache. Emblem Loader available. Client Data.ini file support (to list your GRFs) Support GRF (0x200 version only without DES encryption - repack before uploading) - the data folder is always read first. Auto-Extract files from GRF if needed (optimize performance) Updater script available to convert some lua files to PHP. How to use Really url-friendly: myserver.com/chargen/<controller>/<data> // with url-rewriting myserver.com/chargen/index.php/<controller>/<data> // without url-rewriting Example for my character called "KeyWorld": myserver.com/chargen/avatar/KeyWorld // avatar myserver.com/chargen/signature/KeyWorld // signature myserver.com/chargen/character/KeyWorld // full Character myserver.com/chargen/characterhead/KeyWorld // Character's head You can change the default link by modify the array $routes in the index.php file: // $routes['url'] = controller $routes['/avatar/(.*)'] = 'Avatar'; $routes['/character/(.*)'] = 'Character'; $routes['/characterhead/(.*)'] = 'CharacterHead'; $routes['/monster/(\d+)'] = 'Monster'; $routes['/signature/(.*)'] = 'Signature'; Custom display At least, the tool is really easy to use, here an example on how to display a static character: $chargen = new CharacterRender(); $chargen->action = CharacterRender::ACTION_READYFIGHT; $chargen->direction = CharacterRender::DIRECTION_SOUTHEAST; $chargen->body_animation = 0; $chargen->doridori = 0; // Custom data: $chargen->sex = "M"; $chargen->class = 4002; $chargen->clothes_color = 0; $chargen->hair = 5; $chargen->hair_color = 12; // ... head_top, head_mid, head_bottom, robe, weapon, shield, ... // Generate Image $img = $chargen->render(); imagepng($img); Examples / Demos Sources Get the source (Thanks to report all bugs) License Instead of selling it, I give a try to "Open Source project with Donation". So if you think, you would have buy it if i was selling it, think to give a donation ? Notes A directory "client" is in the project, it will be a good idea to move it to a directory not accessible by the user (for example /home/client/). If you use generate images from GRFs you have to know it's a little slower, i recommend you in this case to allow the "AutoExtract" option to gain performance. GRFs have to be save as 0x200 version without any encryption (even the official DES), good idea is to remove unused folders ( textures, wav, models).. If you use the options Cache and AutoExtract, don't forget the script need to have a write access to the client and cache folder. Thanks to Khazou for the acces to his server to fully testing the tool
  11. A long time since the last post (vacation, home relocation, waiting internet access). A lot of things were changed in the CORE to have a better organized code, I will not talk a lot about it since it's not finished yet, but it's sure now, roBrowser never be so stable. I will just detail the visual change. Intro Window A new button comes: "start", simply to run the tool without needed to send a client file (and so switching to remote GRF). The idea change too, instead of reading the GRFs, it's now reading the entire client (select all your files and give it to him), so I can select what I want to use (client, data.ini, grfs) and extract informations I need to run the tool. Packetver Auto-Detection Now roBrowser should be able to support packets from 2004 to (near)today and send the appropriate packets to the server. It can detect packetver from two techniques: If you drag drop your client, roBrowser get the packetver from the compiled date of your executable (PE Header). Guessing packetver from the packets received from servers. I didn't see an error for now since I connected on pservers. Configuration File A configuration file appeared in roBrowser, for now there is not much parameters but I will expend it in future. It's currently possible to set the : packetver ( YYYYMMDD / "auto", "client", "server"). remote host (default: http://grf.robrowser.com/). grf_list ( default: "data.ini", or json representation). clientinfo file (sclientinfo ? clientinfo ? other ? json representation ?). set specific configs for each servers in clientinfo if using json representation. UI I modify the chararacters on char-select UI, the selected player is moving (same animation that after the player get hit). I still need to check the window size for the char-select to know if need to write the mapname or not... Still in progress, I continue to write UI for the game, it's the most boring part... I added some checks on map loader, since an old update, if there was an error the loading just stop. So right now, if there is an error with a texture not found, model error, or other, the loading just skip and continue. Log System I extended the log system to be clean with differents colors for each informations, it's just easier to catch information and errors, all packets (and their structures) are accessibles throw the log and it's possible to know if they have a callback or not. And now ? Currently working on finishing to organize the code, after still a lot to do with all the UI and packets to interract with but the structure is here. Planning a release on september if I find time before my next vacations. Bonus Do you remember some posts back, I show some screenshots of a GRF Viewer using roBrowser's Core ? Here a video I made some months ago : Note: the models are a little slow to load : the reason because of a "no-cache" option that reload all scripts (network connection) each time you try to load a RSM. Without this options, it's instant loading. It will of course be available with roBrowser's source code (I would like to post it in my old GRF Viewer topic, but it's archived and I can't update it...).
  12. Nice, keep it up Edit: Why your network parsing is done in the MapLoader.js file ?
  13. To be honest I don't like the way it's code. It's used when an Alchemist/Creator cast a skill (potion pitcher, slim pitcher). It will run the item scripts (potions), get back the percent healed, and add a bonus to the life restored.
  14. There is no way to add new effects on the client for now. You can just build some particles on map using lua but that's all (I didn't test it, I don't know really if it's used yet). I don't think Gravity will add them in lua, too much of them are hardcoded in the client and impossible to convert to lua (in my own opinion).
  15. sd : session data dstsd : destination session data Ex: Player A (sd) attack player B (dstsd).
  16. Yeah, I was a little confused, corrected thanks In your for() version, you are using a goto + jump_zero, when I just use a jump_nonzero. So no it's not better.
  17. I don't get it, you want to remove this code ? Or modifying it ? Well in src/map/status.c: if( sc->data[SC_DEFENDER] ) speed = max(speed, 200); Do what you want, (comment the lines for example).
  18. Hi. If I remember correctly I wrote some things related to this post on the forum, at the beginning of rathena, I'm not able to find it ever, so maybe it was in the staff section. It was talking about script optimization, more specially, how some fake commands (if/else/while/for) are converting to label in the source and can be improved. Since I don't have the motivation (and the time) to work on a patch, I let you the result of my investigations here (because it was waiting from one year on my ftp). So first of all, this modifications required two commands : jump_nonzero, goto_ifexist. There will be used to rewrite all the for() while() code and optimize the code. // jump_nonzero() - inverse of jump_zero. BUILDIN_DEF(jump_nonzero,"il") BUILDIN_FUNC(jump_nonzero) { if( script_getnum(st,2) ) { if( !data_islabel(script_getdata(st,3)) ){ ShowError("script: jump_zero: not label !\n"); st->state=END; return 1; } st->pos = script_getnum(st,3); st->state = GOTO; } return 0; } // goto_ifexist() - Jump to a label if it exist (required a string !) BUILDIN_DEF(goto_ifexist,"s") BUILDIN_FUNC(goto_ifexist) { int n = search_str( script_getstr(st,2) ); if( n == -1 || str_data[n].type != C_POS ) {// label not found return 0; } st->pos = str_data[n].label; st->state = GOTO; return 0; } ---------------------------------------------------- Now, let's have fun: For NPC Script: for ( <a>; <b>; <c> ) { <d>; }Currently compiled to:<a>; __FR%x_J: jump_zero( <b>, __FR%x_FIN ); goto __FR%x_BGN; __FR%x_NXT: <c>; goto __FR%x_J; __FR%x_BGN: <d>; goto __FR%x_NXT; __FR%x_FIN:My proposal:<a>; jump_zero( <b>, __FR%x_FIN ); __FR%x_J: <d>; __FR%x_NXT: <c>; jump_nonzero( <b>, __FR%x_J ); __FR%x_FIN: While NPC Script: while ( <a> ) { <b> } Currently compiled to: __WL%x_NXT: jump_zero( <a>, __WL%x_FIN ); <b> goto __WL%x_NXT; __WL%x_FIN: My proposal: goto __WL%x_NXT; __WL%x_BGN: <b>; __WL%x_NXT: jump_nonzero( <a>, __WL%x_BGN ); __WL%x_FIN: Do-While NPC Script: do { <a> } while( <b> ); Currently compiled to: __DO%x_BGN: <a>; __DO%x_NXT: jump_zero( <b>, __DO%x_FIN ); goto __DO%x_BGN; __DO%x_FIN: My proposal: __DO%x_BGN: <a>; __DO%x_NXT: jump_nonzero( <b>, __DO%x_BGN ); __DO%x_FIN: Switch NPC Script: switch(<a>) { case 1: <b> break; default: <c> } Currently compiled code (simplify, the original is more obscure): set $@__SW%x_VAL, <a>; goto __SW%x_%xJ; __SW%x_%xJ: __SW%x_%x: if(%d != $@__SW%x_VAL) goto __SW%x_%x; <b>; goto __SW%x_FIN; // break __SW%x_%x: goto __SW%x_DEF; __SW%x_DEF: <c>; set $@__SW%x_VAL,0; goto __SW%x_FIN; __SW%x_FIN: My proposal: goto_ifexist("__SW%x_" + <a>); goto_ifexist("__SW%x_DEF"); goto __SW%x_FIN; __SW%x_1: <b> goto __SW%x_FIN; // break; __SW%x_DEF: <d> __SW%x_FIN:
  19. OnInit: bindatcmd("dailyreward",strnpcinfo(0)+"::OnAtCmd"); end; OnAtCmd: set .@today, atoi(gettimestr("%Y%m%d", 9)); if (#dailyreward == .@today ) { message strcharinfo(0),"You should try tomorrow to receive more items."; end; } // getitem x,y; set #dailyreward, .@today; end; It should do the job It set #dailyreward to the date, example today: 20130412. Edit: hehe, Emistry is faster
  20. Patskie It can throw an error in the case the player has an apostrophe on his name (some servers allowed it), but can't be injected because the pseudo can't contain more than 24 characters (and with 24 characters it's hard to do an interesting hack ).
  21. Hi Patskie, Some comments to help you to improve your script : Avoid setting #var for just some check : #insertlp$, #insertlp$, #accountvpw$, #cpassword$, ... you don't need to cache this variables on player account (we are limited so it's better to not polluate). In this line, the @email$ variable is never setmes "Old e-mail: " +@email$; The query will throw an error if there is more than 128 players online (an array can't store more than 128 values):query_sql "SELECT `name` , `class` , `base_level` , `job_level` FROM `char` WHERE `online` = '1'",.@name$,.@class,.@b_level,.@j_level; It missing a escape_sql() in the line (can't be inject but can throw an error):query_sql "SELECT `online` FROM `char` WHERE `name` = '"+@name$[@m]+"'",@online; I don't see the point to have 3 accounts variables to detect if a password is set (#setpwd, #dontp, #lockpw$), isn't it better to just use #lockpw$ and check if the variable is empty or not ?
  22. Hi, You have to add in script.c: BUILDIN_FUNC(getchardirection) { TBL_PC *sd; if( script_hasdata(st,2) ) sd = map_nick2sd(script_getstr(st,2)); else sd = script_rid2sd(st); if( sd == NULL ){ script_pushint(st, -1); return 0; } script_pushint(st, sd->ud.dir); return 0; }And:BUILDIN_DEF(getchardirection,"?"),In your script:set .@dir, getchardirection(); if( .@dir == DIR_NORTHWEST ) { // You can see all DIR_* constantes in db/const.txt mes "Nice !"; }It's also possible to check the direction of another player by adding his name as argument:set .@direction , getchardirection("PlayerTester");Have fun.
  23. 1) (Euphy ways): function script getEquip { // get all equipped item IDs for (set .@i, 1; .@i < 11; set .@i, .@i + 1) { if (-1 != getequipid(.@i)) { set @items[.@idx], getequipid(.@i); set .@idx, .@idx + 1; } } return @items; } callfunc("getEquip"); // @items 2) Your way:function script getEquip { // get all equipped item IDs for (set .@i, 1; .@i < 11; set .@i, .@i + 1) { if (-1 != getequipid(.@i)) { set .@items[.@idx], getequipid(.@i); set .@idx, .@idx + 1; } } return .@items; } copyarray .@items, callfunc("getEquip"), 128; 3) By reference:function script getEquip { // get all equipped item IDs for (set .@i, 1; .@i < 11; set .@i, .@i + 1) { if (-1 != getequipid(.@i)) { set getelementofarray( getarg(0), .@idx), getequipid(.@i); set .@idx, .@idx + 1; } } return @items; } callfunc("getEquip", .@items);
  24. A video to show the cloud/sky feature from the post above, (you can also see how fast is it to load a map compared to the map-viewer video).
×
×
  • Create New...