Jump to content

freghar

Members
  • Posts

    461
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by freghar

  1. yeah, it has removed @@ chars due to dumb pastebin
  2. Everything in your post can already be done with iptables and Linux kernel limit modifications, it would be nice to have some feature like that in mangos itself, but it's really not needed .. and IMHO it's better to beat those things before they reach userspace. You can also use classic defenses against a syn flood - like increasing TCP backlog queue, turning on syncookies, decreasing the number of ack retries and so on.
  3. A targeted (D)DoS will simply do a portscan ..., so it it's a real attack, it will take some effort to stop it.
  4. Right, but that most likely indicates a (D)DoS attack. Anyway - maximum of allowed open file descriptors can be set using ulimit for a given environment. Global settings depends on your kernel version. The file you need to check for is /proc/sys/fs/file-max, 2.6.17 and older (~ on that, I'm not sure) had /proc/sys/fs/inode-max as well, it's dynamically alocated on newer kernels. Simply use ulimit for that and, if it isn't enough, increase file-max.
  5. Yep, those two. Setup a basic iptables firewall, google for tutorials.
  6. Looks like you forgot the first line with declaration. As for the other errors .. isn't that a namespace issue? What about target->GetZoneId()
  7. if(targetAreaEntry && ((targetAreaEntry->flags & AREA_FLAG_CAPITAL) || GetAreaId() == 2317 || GetZoneId() == 3817)) You were trying to do bitwise AND with all those getarea/getzone. edit: err, I mislooked, you weren't, but this way is more clear
  8. freghar

    When Compiling

    Depends on the build system. GNU make does that automatically, VC has something as well (I just don't know the name).
  9. Just a few words of warning ahead - I don't know if it deserves an "announcement", but it's one of those almost-official and frequently asked things, .. it can also fall under "News". This smallish article is about getting and controling old mangos svn history in it's git form. So, basically there are two old git repositories I know about (+ svn one): http://github.com/freghar/mangos-svn/commits and http://github.com/freghar/mangos-svn-backup . The first one can be called "primary" as that's the one you should use. The second one shouldn't be normally used, it's previuos name was git-svn-archive, I renamed it to make it's purpose more clear - it's a mere backup, nothing for everyday search/usage. So for the rest of this post, I'll show some examples of the "primary" repo usage. First of all - there are no branches. Everything is referenced by tags. Right, no master branch as it's useless here. Github has probably some web-interface-display problem with that (on "tree" page), but that isn't related to git at all. Tags are divided into three parts; mangos version tags (v0.1, v0.5, etc.), client version tags (c1.2.0, c1.3.1, etc.) and a "head" (lowercase!) tag, pointing to last commit in the repo (= 6767). Client version tags point to the most recent commits with support for target client. Ie. if you checkout c1.12.1, you'll get the last commit with 1.12.1 support, which is the same as for 1.12.2, NOT the point where 1.12.2 became supported as well, in addition to 1.12.1. So enough of theory, some examples: I want to get old 1.12.2 source, just before 2.x switch $ git clone git://github.com/freghar/mangos-svn.git mangos-svn Initialized empty Git repository in /root/delme/mangos-svn/.git/ remote: Counting objects: 62811, done. remote: Compressing objects: 100% (13742/13742), done. remote: Total 62811 (delta 52111), reused 59637 (delta 48937) Receiving objects: 100% (62811/62811), 35.25 MiB | 232 KiB/s, done. Resolving deltas: 100% (52111/52111), done. warning: remote HEAD refers to nonexistent ref, unable to checkout. $ cd mangos-svn/ $ ls -l total 0 $ As you may see, the cloned directory is empty, no files in there. This is because the repo has no master branch, in this example, it saves you some time and keeps things cleaner (no local master branch), because a master checkout would be useless for you. The clone warning informs us about that. So now we simply checkout the c1.12.2 tag: $ git checkout -q c1.12.2 $ ls AUTHORS COPYING ChangeLog Makefile.am NEWS README THANKS bcpp.cfg configure.ac contrib dep doc sql src win $ Now you have 1.12.2 source! That's all! I want to see all tags $ git tag c1.10.1 c1.10.2 c1.12.1 c1.12.2 c1.6.0 c1.6.1 c1.6.2 c1.7.0 c1.8.2 c1.8.3 c1.9.2 c1.9.4 c2.0.12 c2.1.2 c2.1.3 c2.2.3 c2.3.0 c2.3.2 c2.3.3 c2.4.1 c2.4.2 c2.4.3 head v0.1 v0.10 v0.11 v0.5 v0.6 v0.7 v0.8 v0.9 It may change over time, new tags added for example, simply use the "git tag" command. What about revision numbers? $ git log -1 commit 908a3dbe7788c89eaffac4f08076513267a0a36a Author: vladimir_mangos <[email protected]> Date: Sun Apr 15 16:15:54 2007 +0000 [3462] Fixed compiler warning at float->uint32 conversion Revert talent related code changes from [3460] until additional research. $ Every commit has a revision number on the beginning of it's first line in the commit message. Therefore to checkout revision 1234, simply $ git checkout -q [1234] $ git log -1 commit 67b29444a89fc4120282f1b89dedf67fe758113e Author: theluda <[email protected]> Date: Tue May 9 06:43:52 2006 +0000 [1234] Fixed #161 --- .setpoi command crashes the server when no creature is selected. $ How to get hash from revision number or vice versa? As written above, using git log; $ git log -1 --pretty=oneline [4321] ff44bde9096e565e4877b9f97013154b485b00a7 [4321] * Fixed: prevent return in quest list deleted timed quests at character loading. Optimize access to quest status data at load/add. $ git log -1 --pretty=oneline ff44bde9096e ff44bde9096e565e4877b9f97013154b485b00a7 [4321] * Fixed: prevent return in quest list deleted timed quests at character loading. Optimize access to quest status data at load/add. $ I want to browse the source on github Well that's a bit tricky, but: * go to http://github.com/freghar/mangos-svn/commits * find your favorite tag from the tag menu (below the source/commits/wiki/download/etc bar) if you don't know it already * use http://github.com/freghar/mangos-svn/tree/c1.12.2 for example (substitute c1.12.2 for the tag / commit hash you want) I want to download source without any git usage Right, there's this nice download page: http://github.com/freghar/mangos-svn/downloads I want to checkout the latest revision in the svn, so I can use git-blame $ git checkout -q head $ Simply. There are some revision numbers missing Yes, that's because they changed stuff only outside trunk/, like moved files to tags. The truth is, that mangos svn had two branches, theluda-dev and bleach-dev. From what I understood, those were only temporary branches with very few commits and nothing really interesting, but if you really _need_ them for some strange reason, use mangos-svn-backup repo and "git log -- branches/". If you find such a missing number, simply use a lower one. What else? Just a note to more git-advanced users; the repository has been under heavy changes, I connected the very old history r1 - r400 (no trunk) with the trunk-only history, it took some filter-branching, rebasing (hah, even found "rebase -i" bug), fine tuning (emails, commiter == author, old dates for commits, etc.), so if you really don't want to lose whole evening for setting up a fine-tuned git repo from the old svn, use this one.
  10. I never really used this patch, gave a quick try to original bot + buyer from Paradox/Kerbe, I just have a few suggestions for this topic's author. * It would be a nice to post http link to your repo in the first post, when I wanted to take a look, I had to manually write it using the git:// version. It isn't really a big deal, but it helps. * Looks like your git work is very well limited to local branches. I, in fact, almost never use local branches. I make some stuff, commits along the way, then push it to some hosting. I'm able to use remotename/remotebranch as a referency. My HEAD is very dynamic, so it really serves well. What does this mean for you? Really nothing, but you could simplify a lot of things for yourself, the "diff creation" described on front page can be done using single command (excluding clone) - see below. * This list point is reserved for everything I forgot during the creation of the second point * A good idea would be to perhaps rename "master" to "upstream" or so. That will disable initial default checkout after git clone (which can be suppressed by -n switch OR when there's no master branch). Anyway, the diff output can be reduced from git clone git://github.com/Naicisum/mangos.git ahbot cd ahbot git checkout origin/ahbot git checkout -b ahbot git diff master ahbot > auctionhousebot.patch to something like git clone -n git://github.com/Naicisum/mangos.git ahbot cd ahbot git diff origin/master origin/ahbot > auctionhousebot.patch or in existing mangos repo: git fetch git://github.com/Naicisum/mangos.git master cat .git/FETCH_HEAD # copy the output to clipboard or simply scroll up later git fetch git://github.com/Naicisum/mangos.git ahbot git diff a1b2c3d FETCH_HEAD > auctionhousebot.patch could be done in a nicer way, but this way it gets garbage-collected over time (since it's not needed). a1b2c3d is the output from "cat" command. The last solution will probably be the quickest one if the user has already pulled from clean mangos / got the objects from any other ref. I guess like ~30 seconds for the first one, ~20 seconds for the second one and ~3 seconds for the last one - raw processing time. Sorry for duplication of anyone in this thread already suggested that.
  11. Perhaps there's something with locale going wrong. Try putting LANG=C before each command on the cmd line. Like "LANG=C ../configure" , "LANG=C make", etc.
  12. I'm pretty sure it did say what the errors are. Or at least produced some output on stderr.
  13. Yes, I missed the mangos-0.12, sure it is, git-fetch can be also used for that. I suggested (some months ago) moving the 2.4.3 branch to a separate repository (because people getting master won't need mangos-0.12 and otherwise -- and if they do, they can fetch from both), but I'm not the one with admin access on "mangos" user on github. So ..
  14. Pushed new version, supports --disable-pch and --enable-pch (default). Also thanks a lot to Derex for solving the pchdef dependency issue. Now should any modifications of included (and nested) headers trigger recompilation. The speed difference isn't really big, but it helps. --disable-pch: user 18m31.065s user 18m32.474s user 18m32.270s --enable-pch: user 12m44.244s user 12m44.284s user 12m43.860s
  15. Either you're going to provide more info about hardware/network .. or lend us a crystal ball.
  16. Well I would have to update it everytime I fix something .. you can generate it by diff origin/master FETCH_HEAD after fetch for example .. there was IIRC some "raw diff" thing on github as well. edit: well here it is, if it's get outdated, don't blame me; diff --git a/src/game/Makefile.am b/src/game/Makefile.am index b06ebbe..9bc9767 100644 --- a/src/game/Makefile.am +++ b/src/game/Makefile.am @@ -19,7 +19,25 @@ ## Sub-directories to parse ## CPP flags for includes, defines, etc. -AM_CPPFLAGS = $(MANGOS_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir) -I$(srcdir)/../../dep/include -I$(srcdir)/../framework -I$(srcdir)/../shared -I$(srcdir)/../shared/vmap -I$(srcdir)/../realmd -DSYSCONFDIR=\\"$(sysconfdir)/\\" +DEF_CPPFLAGS = $(MANGOS_INCLUDES) -I$(top_builddir)/src/shared -I$(srcdir) -I$(srcdir)/../../dep/include -I$(srcdir)/../framework -I$(srcdir)/../shared -I$(srcdir)/../shared/vmap -I$(srcdir)/../realmd -DSYSCONFDIR=\\"$(sysconfdir)/\\" +AM_CPPFLAGS = $(DEF_CPPFLAGS) + +## Precompiled headers +# need to be processed before *_SOURCES +# builddir can be used, since we already -I. +pch_src = pchdef.h +pch_out = pchdef.h.gch + +BUILT_SOURCES = $(builddir)/$(pch_out) +CLEANFILES = $(builddir)/$(pch_out) +AM_CPPFLAGS += -Winvalid-pch -include $(pch_src) + +# taken from CXXCOMPILE, changed AM_CPPFLAGS to DEF_CPPFLAGS +PCHCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\ + $(DEF_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) + +$(builddir)/$(pch_out): ${srcdir}/$(pch_src) + $(PCHCOMPILE) $(PCHFLAGS) -x c++-header -c -o $@ $< ## Build MaNGOS game library as convenience library. # All libraries will be convenience libraries. Might be changed to shared
  17. Here we go, simply pull from my repo: for master: git://github.com/freghar/mangos.git gch for mangos-0.12: git://github.com/freghar/mangos.git gch-0.12 * What bug does the patch fix? What features does the patch add? Adds precompiled header support for Makefile/autotools based build system. * For which repository revision was the patch created? MaNGOS HEADs as of this date (1249052020), shouldn't conflict with anything made in the last few months. * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread. Nothing I know about. * Who has been writing this patch? Please include either forum user names or email addresses. Freghar It's a basic implementation used (probably) only by gcc family. For some reason, it hasn't so cool effect seen on windows build, but it reduced compile time on my src/game/ from 24 minutes to 14 minutes. You can measure the exact time via "time make" instead of "make". It will show statistics after it finishes. It's also possible (for test reasons) to build only game to see more exact difference before/after. If you're going to post any statistics, please use 46daad5f54b (or c1d5f68c1 for mangos-0.12) to measure the time WITHOUT precompiled headers, so we have something to compare the pch results with (for more git-advanced people: it's actually gch~4 / gch-0.12~4). To compile only src/game/, do the autoreconf + configure steps and then "cd objdir/src/game/" before make. note: gch isn't a typo for pch, it's "gnu precompiled header" - their implementation of it for the gcc family Thanks to all the people who kept supporting me when I ran on gcc bugs. edit: for those interested in diff/patch, see http://github.com/freghar/mangos/commits/gch -- changes are the same for both master and mangos-0.12 branches.
  18. code_blocks + ctags for VIm and I have a console IDE
  19. Not even then, as MAC changes everytime you route a packet using router. Do a traceroute to google.com for example - every machine in the way changes both (source + dest) MAC addresses in the packet. Furthermore - MAC header is not always standard, there can be a sattelite link in the way, using something else for link-level addressing.
  20. No, as MAC addressing is used only within local subnet / the nearest node in subnet 255.255.255.254 (when we talk about the Internet).
  21. If you'd ban your router, you would ban everyone.
  22. I will only provide a base for patch authors / testers. When we have something like my tree with ~5 active testers, all of them will be using the same revision with same patches (mostly), so it's easier to compare their test results. This means yes, I plan to do a 14 days cycle with 7 day knowledge of the next revision (therefore the tree will be always 7-21 days behind mangos/master. That has disadvantages, but advantages as well - for those 7 days we can check if the rev is stable enough to become our next base. That means ~7 days for patch autors to prepare their patches for new rev and fixing possible conflicts. During that time, the "old" rev will still be in use for testing and fixes. The 7-day limit isn't hard-defined, we shall see once the tree is up and running. I currently do not plan a 0.12 version, because all major patches are being made for mangos/master and needs testing (they're written from scratch). Backported patches to 0.12 are often tested on master, compatibility issues can be fixed in a normal way. But if there will be interest for such branch in my tree, why not.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use