Jump to content

Haru

Administrators
  • Content Count

    382
  • Joined

  • Days Won

    38

Posts posted by Haru


  1. The problem with that approach is that you're assuming that no monsters have the same drop listed twice (while it's a valid situation).

     

    This is the mob_db entry for PORING:

    // Mob DB entry for PORING{    Id: 1002    // ...    Drops: {        Jellopy: 7000        Knife_: 100        Sticky_Mucus: 400        Apple: 1000        Empty_Bottle: 1500        Apple: 150        Unripe_Apple: 20        Poring_Card: 1    }},
    If you added this in the mob_db2:
    {    Id: 1002    Override: true    Drops: {        Apple: 0 // Which apple am I removing? The first? The last? Both?    }},
    What would happen?

     

    Also if you added:

    {    Id: 1002    Override: true    Drops: {        Jellopy: 5000 // Am I replacing the existing Jellopy? Or adding a new drop?        Red_Potion: 1000 // What does this do? Replaces an existing entry? Adds a new drop?    }},
    it wouldn't be clear what the result would be.

     

    To remove all existing entries and add a completely different drops list, what would you do? If it was able to override, you'd need a reasonable way to specify that you want to empty the list.

     

     

     

    About increasing the amount of drops and mvp drops, it's possible but it requires several source modifications (and possibly a very radical change in how they're represented in the SQL DB). I'm for the change, but I expect a lot of people to complain if we do, and their control panel breaks.


  2. The issue is related to #737, indeed.

     

    @@kyeme the difference between allowed and trusted is that the former keeps the ipban/DoS checks enabled for the IPs you add, while the latter disables it. As I mentioned in the comment, adding IPs to 'trusted' can be a security threat, and should never be done if the user isn't sure about what they're doing. Adding IPs to 'allowed' is instead safe and doesn't decrease security compared to what we used to have before this was implemented.

     

    In your code snippets, I see that you're using '255.0.0.0' as subnet mask. That's not recommended (I understand that you saw it in the 127.0.0.1 line above, but that's a special address), because it means you're not only adding one IP, but an entire Class A subnet (all 16 million IPs that begin with the same first byte as yours). If you want to add a single IP, the subnet mask should be 255.255.255.255. If you're adding a LAN, it is 255.255.255.0 in most cases.


  3. Very interesting. Windows 10 reports the wrong version once again. I'll have to read the documentation about whatever new trick they came up with this time.

     

    In any case, it won't be a problem as far as I'm aware. The only open issue right now, is that we don't support Visual Studio 2015 (it won't even compile), so please stick with VS2013 even on Windows 10, until I get to fix it.


  4. Hello everyone~!

    Following Ind's resignation from his administrator position last month, we've been working on transferring our services to a new host.

    Some services have already been transferred without any downtime (most notably the stat-server), and now it's finally time to move the rest.

    The remaining services will be transferred during the upcoming week, starting tomorrow (Sunday, June 28th). You can expect some downtime.

      [*]Forum: The forum can be expected to go offline on June 28th at 17:30 GMT, for about two hours. Some features will be temporarily disabled (commit and pull request sidebar widgets), and will be enabled again within 24 or 36 hours. - Completed [*]Wiki: The wiki can be expected to go offline on June 28th at 17:30 GMT, for about two hours. - Completed [*]Bugtracker, git repository: Bugtracker and git repository (hosted by GitHub) won't experience any downtime. [*]Stat-server: The stat-server won't experience any downtime. [*]Hercules IRC bot (commit announcements in the #hercules channel): The IRC bot will go offline on June 28th at 17:30 GMT, for about two hours. The commit announcement hook may experience a longer downtime (up to four more hours). - Completed [*]HerculesWSAPI: The HerculesWSAPI service (HPM Hooks and SQL Item DB automatic re-generation) will be disabled on June 28th at 17:30 GMT, for up to eight hours. - Completed

    Through the week, there may be further, brief, downtimes (10-15 minutes each), for planned upgrades and improvements of the platform and individual services.

    Given the complexity of the system, and the number of moving parts, there may be unforeseen delays on the scheduled times. We'll do our best to minimize those.

    Status updates will be posted here as well as on IRC and on Twitter.


  5. Hello. I apologize for replying after a month, but it was jsut brought to my attention, and since there were no replies during this time, I feel I should.

     

    Your maths is absolutely correct, and one could think it is indeed quite weird to see that happening.

     

    Your statements about the RNG are absolutely incorrect though. You claim that we use (among other things) the character ID to seed the PRNG. This would make it sound like we use a different RNG for each character (and that we only use random numbers for character-related things). We don't.

    The RNG is one and only one, and it is not attached to the current character, nor it uses any character identifiers or any kind (or even knows what a character is).

    The very same RNG is used by the server for all sorts of calculations in-between the item drops you mention (from mob walk direction and distance, to damage calculation during attacks, to teleport or mob spawn destinations or skill success chance. There are so many calls to the RNG between two mob drops, that it would be impossible to find any correlation or pattern just by observing the game.

     

    Now, while the RNG we're using isn't perfect, it's still renown as one of the best for use cases like ours. We're using a Mersenne Twister (specifically, the mt19937ar implementation by Matsumoto Makoto (http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html). As stated by the author, there are better versions of it now (we're going to switch to the SFMT implementation, which is faster and resolves some issues in case the RNG isn't initially well seeded, as soon as possible - we need to verify that it is supported by all compilers we currently target.)

     

    This said, I've personally tested the current RNG several times, and never seen anything that makes me think it's broken. I'm attaching some test results, that show how the distribution of generated numbers (I generated numbers in the [0~9999] range, since that's what we use mostly in Hercules) looks pretty good and unbiased.

     

    All the tests were done with the following code (pasted at the end of the do_init function in map.c):

    #define TEST_COUNT 1000000#define NORMALIZE 10000	int64 buckets[NORMALIZE];	memset(buckets, '0', sizeof(buckets));	for (i = 0; i < TEST_COUNT; ++i) {		int num = rnd()%NORMALIZE;		++buckets[num];	}	FILE *fp = fopen("rng.txt", "w");	for (i = 0; i < NORMALIZE; ++i) {		fprintf(fp, "]: %5"PRId64" (%2.3f%%)n", i, buckets[i], buckets[i]*100.0/TEST_COUNT);	}	fclose(fp);
    and compiled with the following hardware/software, as reported by Hercules itself:
    [Info]: Hercules 64-bit for Mac OS X[Info]: Git revision (src): '9a0b3ad4fb551028f593500698dd560f85cdda6c'[Info]: Git revision (scripts): '9a0b3ad4fb551028f593500698dd560f85cdda6c'[Info]: OS version: 'Mac OS X 10.10.3 14D136 [x86_64]'[Info]: CPU: 'Intel Core i5 (2.3 GHz) [2]'[Info]: Compiled with Clang v6.1.0[Info]: Compile Flags: -g -O2 -pipe -ffast-math -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wempty-body -Wnewline-eof -Wint-conversion -Wenum-conversion -Wshorten-64-to-32 -Wconstant-conversion -Wbool-conversion -Wformat-security -Wno-format-nonliteral -Wno-switch -Wno-missing-field-initializers -Wshadow -fno-strict-aliasing -ggdb -DMAXCONN=16384 -I../common -DHAS_TLS -DHAVE_SETRLIMIT -DHAVE_STRNLEN -DDEBUG -DDISABLE_RENEWAL -I/usr/include
    The tests show the distribution of, respectively, the first million, hundred millions, billion, ten thousands random numbers after server startup.

     

    http://jmp.sh/V12VZ7I 1,000,000

    http://jmp.sh/pigjlRT 100,000,000

    http://jmp.sh/NU8SigY 1,000,000,000

    http://jmp.sh/R8a3lCF 10,000

     

    As you can see, each of the possible values is generated about 0.01% times (1/10,000), without any visible bias.


  6. What version of Visual Studio is that? As of VS2013 (latest released stable version), there's no snprintf in their libraries, so this should never happen.

    If this is VS2015 release candidate, please wait for Microsoft to release the final version, for we'll start testing with and add support for it only *after* it is released in its final version.


  7. Ah, wonderful point. Yes, I'm aware of those, and I agree. Those /shouldn't/ be merged into one line. A separate 'mes' call would still be kept where necessary -- mostly with line breaks required by the dialogue's punctuation. Translation-wise, those are separate sentences anyways, so it makes less sense for them to be in the same string.


  8. I personally love this idea (and I did this in the past, in custom scripts I wrote).

     

    The only argument that there might be against this is that, by changing the scripts to that format, they might word-wrap differently than official servers. I don't think it's a real issue, but I'd like to hear the others about this.

     

    As of commit 09dd209, we actually have source support for a nice syntax such as:

        mes "When you see a broadcast"       // Yep, no semicolon, and no plus sign between this and the next line.        " announcing that we have"       // Just close the quotes and reopen them on the next line.        " arrived at your destination,"        " please use one of the exits"   // Ah, and yes, there can be comments between the lines.        " located at the north and"        " south ends of the Airship.";      // ^ Well, this space is because otherwise there would be no space between "and<>south".
    And after the script engine parses it, it's as if there was just one long string in one line (except, it looks prettier in editors, being split in multiple lines.) This also means that the translation engine sees just one string.

  9. Which is why we have a specific anti-maya-purple-cheat feature in Hercules, that prevents the server from sending the position of hidden or cloaked people altogether.

    Your screenshot shows that you're able to see *yourself*. That's because the client always knows where *you* are (for obvious reasons).

    You should try with enemy units (mobs, or PvP/GvG enemies), and you'll see that - even if you trick your client into thinking that they never hid or cloaked, it still won't show any of their moves.


  10. The warnings you show don't seem to be a problem. The plugin should still compile.

     

    Line 150 and 155 are two lines that are the same as path.c in Hercules (and they cause a warning in your plugin because of different compiler settings -- you can disable sign comparison check warnings in your VS solution)

    Line 501, 566, 567, 568, 569, 570, 571 are recommending the use of a Microsoft-specific function instead of a standard function. For obvious reasons, we can't do that.

     

    You can either silence or ignore those warnings. The warnings we generally silence are:

    - 4018

    - 4100

    - 4800

    - 4996

    (or at the very least, 4018 and 4996 in this case).

     

    If there's any other issues that prevent the plugin from working correctly, please let me know.


  11. I'm personally against this (well, now the pull request got merged accidentally, but we are still in time to revert it). Is there a reason to need two separate table names? i.e. it doesn't make much sense to have both tables loaded at once, it'll always be either one or the other.

     

    Edit: if there's a real reason (other than following rAthena on something that sounds like going backwards), please tell, as I can be easily convinced if you have good arguments.


  12. We'll be updating the guidelines and including them in the doc folder of the repository soon, to give them more visibility.

     

    About the use of set, the reason why I recommend against using it at all (other than it being deprecated) is that by using direct assignment, the language is probably easier for newcomers. If they ever used any other scripting or programming language (and chance is they did at school, perhaps), they'll be probably used to direct assignment rather than a command to set variables. This way they won't have to learn a new (arguably useless) thing such as using 'set'.


  13. GmOcean, good job there! Can I ask you to edit a little something, so that people will script according to the scripting style standards we're setting? (see working draft at http://herc.ws/board/topic/5062-scripting-standards/ )

     

    Setting variables should always happen through direct assignment and without the use of the 'set' command, where possible. So, instead of set Zeny, Zeny - 1000, it should be Zeny -= 1000; instead of set .heal_price, 1000, it should be .heal_price = 1000; and so on.

     

    Some parts of the scripting standards are still being changed, so don't take everything you see there as set in stone, but the part about using 'set' to manipulate variables already is.

     

    Thank you!


  14. Mumbles: see my reply in the pull request. It actually becomes easier with .@select, as you don't even need to use the @menu variable.

     

    Garr: but using labels is even worse than using a switch, and makes the script less readable. If several options lead to the same result, their case labels in the switch can be grouped together without break in between, if you don't wish to use select. Or, nobody forces you to use a switch, and you can use if/else conditions if you prefer.

     

    switch (select("a:b:c:d:e")) {case 1:case 2:case 4:    mes "a, b and d lead here.";    break;case 3:    mes "this is c.";    break;}// and e does nothing

    Or

     

    .@choice = select("a:b:c:d:e"));if (.@choice == 3) {    mes "this is c.";} else if (.@choice < 5) {    mes "a, b and d lead here.";}// and e does nothing

  15. The FluxCP at the link you posted seems to be misconfigured, and doesn't even have the (weak) protection provided by the index.html files that are provided with a standard FluxCP installation. The server owner should check their setup and re-create the file they deleted. (on a side note, the only thing I was able to see by visiting the link you posted, was the file list -- none of the files were actually readable, as they all returned an HTTP error 500. I'm not sure whether the files were previously visible, and I was late to the party)

     

    That said, there are indeed some weak points and missing index.html files in FluxCP, that should be fixed. If any of the maintainers wants some insight, please PM me, as I won't be able to do it before several hours from now (possibly over IRC if you want a quick reply, or here is fine otherwise).

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.