Page 1 of 2
test: more server changes
Posted: 08 Jan 2013, 00:02
by o11c
I've pushed a few more major changes to the 'test' branch of TMWA.
Among other things, I fixed the crash when the map-server stops; and prevented buffer overflows in the savefile-loading code.
(The party savefile is not yet done; it will need to be rewritten from scratch, breaking existing parties, at a later date.)
Almost nothing should have changed from a player's perspective, but there's a lot of backend stuff that has improved. Some GM, script, and ladmin commands have been disabled.
Since I tweaked the savefile loaders, there is a decent chance of savefile corruption, so
do a backup between killing and restarting. (I fixed the most obvious one ... that caused *all* savefiles to be totally truncated.)
This is why I say to never auto-pull server-changes.
You make need to
delete the file 'deps.make'. In any case, it can't hurt.
As usual, there will be lots of compiler warnings that are meant for me, not you. But, they may hide real errors, so make sure to run 'make' twice, making sure the second time says nothing is done, before running 'make install'.
Not as usual, the server now requires GCC 4.6 or later or Clang 3.1 or later. We'll eventually start putting up static builds for people with older systems, such as the test server.
Particular stuff to test:
- ladmin
- GM commands that are actually supported.
- starting from scratch vs starting from existing savefiles.
- parties, storage
- ...
Re: test: more server changes
Posted: 08 Jan 2013, 15:58
by Nard
o11c wrote:
Some GM, script, and ladmin commands have been disabled.
Particular stuff to test:
- ladmin
- GM commands that are actually supported.
- starting from scratch vs starting from existing savefiles.
- parties, storage
- ...
What has been disabled in ladmin, script and GM? Which commands are actually supported?
Re: test: more server changes
Posted: 08 Jan 2013, 17:17
by o11c
As I recall:
the language setting in ladmin,
the date format in ladmin and others
all script functions not usable
a couple of GM commands that mostly don't work or that are related to guilds.
Re: test: more server changes
Posted: 08 Jan 2013, 20:43
by Nard
o11c wrote:As I recall:
the language setting in ladmin,
the date format in ladmin and others
all script functions not usable
a couple of GM commands that mostly don't work or that are related to guilds.
The following couple of GM commands related to guilds
work at the moment:
Code: Select all
@guild Creates a guild.
@guildlvl Levels your guild to a specified level.
@gstorage Brings up your guild's storage wherever you are.
@guildrecall Warps all online characters of a guild to you (at least one member of that guild must be online).
@agitstart Start guild wars.
@agitend Ends guild wars.
@gvgon or @gpvpon Enables GvG on a map (2 same commands).
@gvgoff or @gpvpoff Disables GvG on a map (2 same commands).
@guildspy Allows you to spy on any Guilds Guild chat (at least one member of that guild must be online).
@partyspy Allows you to spy on any party's party chat (at least one party member must be online).
guild invite, ranking inside the guild and guild level work too.
Once again,
I cannot see any reason to remove them except @gpvpon/@gpvpoff . And ,even, as they work I thunk that guild should be enabled in TMW, and guild bot converted to a language channel bot as it was proposed before.
It would be nice to know which script command do sot work so it could be specified on the wiki, and removed frof the reference
.
Re: test: more server changes
Posted: 09 Jan 2013, 17:24
by o11c
Regarding guilds, please see the commit comment.
Regarding documenting on the wiki ... yeah, I need to do that ...
Fix a bug where all varaibles in db/const.txt were interpreted as hex, instead of only if they started with 0x. In previous versions of the server, it always did things in decimal
Re: test: more server changes
Posted: 09 Jan 2013, 19:13
by Nard
o11c (git hub commit) wrote: Remove guilds, finally
If anyone in the future wonders why I did this,
just look at how many lines of code this eliminates.
You could also remove, parties, magic, mobs and players, it would remove even more lines!
Wombat wrote:What o11c should of said is that he is also going to make a new guild system and it is top priority. If it is low priority, you don't have permission to remove guilds.
Thus I suppose rewriting guild code is now your #1 priority. I cannot understand how you can suppress such important things without having a discussion with the main managers of this project. Guilds belong to game heart wether you like it or not. If you are planning to make code from scratch, then manaserv project would be better suited for that.

Nard

Re: test: more server changes
Posted: 09 Jan 2013, 22:00
by o11c
Every single piece of code that I can't remove is code that I have to rewrite without breaking existing behavior. This is why e.g. I'm removing as many script commands as I could, even if some of them could be useful.
It is a vast overstatement to say that guilds were "working" before. The guild code was ... not the worst of TMWA code, but the easiest to safely remove. You may note that I *will* have to remove and reimplement parties (luckily they're slightly less tightly-coupled than guilds), and also have plans to do the same for magic ... doing this for more code than I absolutely have to is simply not going to happen.
Also, remember that *all* existing "guild"s via the bot are NOT affected.
My biggest priority for the near future is fixing save problems. *Any* sort of feature addition is necessarily a lower priority, unless it coincides with maintenance work, like rewriting the magic system, or is absolutely trivial, like adding a script function - but even then, if you can justify its necessity.
--
Now, you can either test what code I *have* done, or you can stand here arguing and stopping me from getting things done.
Re: test: more server changes
Posted: 09 Jan 2013, 23:13
by Frost
o11c wrote:Now, you can either test what code I *have* done, or you can stand here arguing and stopping me from getting things done.
I think it will be easier to stay out of the weeds if you say what your goals are with the rewrite, and what your current priorities are. For example:
Goals
- Fix save file problems
- Improve memory footprint by identifying and removing leaks
- Clean up code so that it's easier to maintain
- As part of cleanup, identify and remove duplication where reasonable
Priorities
- 1) Maintain compatibility with existing and planned content (coordinate changes with devs where necessary)
2) Maintain compatibility with manasource and manaplus clients. Coordinate new feature support with 4144.
3) Replace existing flat data files with a transactional database-like engine
4) Identify and remove duplicate or unused code
Re: test: more server changes
Posted: 10 Jan 2013, 00:00
by Nard
o11c wrote:Every single piece of code that I can't remove is code that I have to rewrite without breaking existing behavior.
I do agree with that.
This is why e.g. I'm removing as many script commands as I could, even if some of them could be useful..
By doing so you break the existing behaviour. If the code is useful it should be removed ONLY when the new one is ready to replace it even if it is not used.
I do not understand the "why": I cannnot see the cause /consequence relation.
o11c wrote:It is a vast overstatement to say that guilds were "working" before. The guild code was ... not the worst of TMWA code, but the easiest to safely remove. You may note that I *will* have to remove and reimplement parties (luckily they're slightly less tightly-coupled than guilds), and also have plans to do the same for magic ... doing this for more code than I absolutely have to is simply not going to happen.
So you do not remove the guild code because it has any problem, but because it is easy to remove., what an affair! If you do not plan to touch this code why do you remove it
Also, remember that *all* existing "guild"s via the bot are NOT affected.
I absolutely do NOT Care about Guild bot. Guild bot is a substitute brought to this game by players and developers who think like I do. It fills a lack in game: Guilds are a central point in any game which pretends to be MMORPG.
My biggest priority for the near future is fixing save problems. *Any* sort of feature addition is necessarily a lower priority, unless it coincides with maintenance work, like rewriting the magic system, or is absolutely trivial, like adding a script function - but even then, if you can justify its necessity.
These priorities are nice to me because this work is critical. Guild is
not an addition but a
feature that other servers enabled with no problem, you just disabled them, because (Freeyorp dixit) you (collective) feared that guild inflation could cause memory problems. Rules can be easily set to avoid them.
Now, you can either test what code I *have* done, or you can stand here arguing and stopping me from getting things done.
Can you understand that
I have no critics on the code you *have* done and am happy to test it.
If you do not want me to argue with you, do not remove major server feature, content related or not, without a previous developer team discussion and collective agreement. This is the way any member of any team should behave. Stop removing features that you are not working on " because they are easy to remove", it is time loss. Btw I can't see how I am stopping you from getting things done except the guilds point.
I require here from Administrators, GHP or any who is able to decide, as a representant of the CRC guild that:
- you reinstall the guild code
- guilds are re-enabled in game to prevent any further code removal
- The actual 3 or 4 guilds are created (this will slightly increase the account or char server load which may, with addition of some appropriate debug tags help you to solve the issues that happen while databases backups)
- When it is done, Guild bot can be changed to a "Babel Bot" according to Frost's suggestion.
Re: test: more server changes
Posted: 10 Jan 2013, 19:31
by o11c
Nard wrote:
o11c wrote:It is a vast overstatement to say that guilds were "working" before. The guild code was ... not the worst of TMWA code, but the easiest to safely remove. You may note that I *will* have to remove and reimplement parties (luckily they're slightly less tightly-coupled than guilds), and also have plans to do the same for magic ... doing this for more code than I absolutely have to is simply not going to happen.
So you do not remove the guild code because it has any problem, but because it is easy to remove., what an affair! If you do not plan to touch this code why do you remove it
I didn't say the guild code wasn't bad. I just said it wasn't the worst.
Some example detail of why guild code is bad:
- Lots of assumptions about alliances, emblems, and castles.
- Change behavior of player interactions in ways that are invisible to the client.
- Change behavior of seemingly random mobs and items, without any evidence in the db files.
- Complicates the network layer. Changing the network layer is essential to fix the savefiles, which is the number one priority
- Severely complicates the storage code (which appears to have bugs regarding player locking. If you don't understand player locking, you shouldn't be part of this conversation). Long term, the storage code will be rewritten, so it will be feasible to share storage at that time. If you prevent me from the necessary work of the rewrite, it won't happen.
- Complicates the skill system, which is the single worst area of TMWA's code - worse even than the magic system. (I still maintain that magic should have been implemented using the skill protocol though - it can directly say "cast this spell at this location" or "cast this spell at this being". But since we *don't* use that, I can remove that code to help simplify the skill system ... and the magic system is salvagable)
Nard wrote:
o11c wrote:Also, remember that *all* existing "guild"s via the bot are NOT affected.
I absolutely do NOT Care about Guild bot. Guild bot is a substitute brought to this game by players and developers who think like I do. It fills a lack in game: Guilds are a central point in any game which pretends to be MMORPG.
You should. guild bot is the ONLY currently-supported method of guilds in this game.
Nard wrote:
[*]When it is done, Guild bot can be changed to a "Babel Bot" according to Frost's suggestion.[/list]
[/quote]
Guild bot will become obsolete when chat channels are fully implemented. The amount of time until chat channels are fully implemented depends on how quickly I can remove enough code to make it workable, and how much time I waste arguing with people who know nothing about TMWA internals.
--
Received a report from Jenalya that the "make packets read-only" commit sends an invalid packet. Awaiting more details and/or time to investigate it myself.
--
Uncovered a bug, exposed by an earlier fix, that makes 'getactivatedpoolskilllist' and 'getunactivatedpoolskilllist' not return names correctly.
Fix is pretty simple, but not yet released.
I maintain the opinion that a script not working is still better than writing to arbitrary memory.
Re: test: more server changes
Posted: 10 Jan 2013, 21:12
by Jenalya
o11c wrote:
Received a report from Jenalya that the "make packets read-only" commit sends an invalid packet. Awaiting more details and/or time to investigate it myself.
I did some more testing, and I think the invalid packet is sent when players get in range to each other. I didn't get the error when having only one character logged in, and I didn't get the error with two characters logged in, but on different maps, or on the same map in a huge distance. But moving the characters closer to each other or logging in with one of them to a place where the other already is causes both clients to quit with the message "Error: Zero length packet received. Exiting.".
The error doesn't occur when using the state of the commit before (f2fd4885c2a906414e0f36acf95d252e5a9d5805).
Re: test: more server changes
Posted: 10 Jan 2013, 23:22
by o11c
Jenalya wrote:I did some more testing, and I think the invalid packet is sent when players get in range to each other.
Visually, it looks like this is the problem. I changed the second WFIFOSET to clif_send, but not the first one.
that commit wrote:Code: Select all
if (dstsd)
WFIFOSET(dstsd->fd, packet_len_table[0x1d7]);
else
clif_send(buf, packet_len_table[0x1d7], bl, AREA);
}
else
{
WBUFW(buf, 0) = 0x1d7;
WBUFL(buf, 2) = bl->id;
WBUFB(buf, 6) = uint8_t(type);
WBUFW(buf, 7) = val;
WBUFW(buf, 9) = 0;
if (dstsd)
- WFIFOSET(dstsd->fd, packet_len_table[0x1d7]);
+ clif_send(buf, packet_len_table[0x1d7], &dstsd->bl, SELF);
else
clif_send(buf, packet_len_table[0x1d7], bl, AREA);
}
return 0;
Re: test: more server changes
Posted: 11 Jan 2013, 12:03
by Nard
o11c wrote:
Some example detail of why guild code is bad:
- Lots of assumptions about alliances, emblems, and castles.
- Change behavior of player interactions in ways that are invisible to the client.
- Change behavior of seemingly random mobs and items, without any evidence in the db files.
- Complicates the network layer. Changing the network layer is essential to fix the savefiles, which is the number one priority
- Severely complicates the storage code (which appears to have bugs regarding player locking. If you don't understand player locking, you shouldn't be part of this conversation). Long term, the storage code will be rewritten, so it will be feasible to share storage at that time. If you prevent me from the necessary work of the rewrite, it won't happen.
- Complicates the skill system, which is the single worst area of TMWA's code - worse even than the magic system. (I still maintain that magic should have been implemented using the skill protocol though - it can directly say "cast this spell at this location" or "cast this spell at this being". But since we *don't* use that, I can remove that code to help simplify the skill system ... and the magic system is salvagable)
If you do not take into account
now the constraints that guilds will imply when you will have to re-introduce them, you will have to do the job twice.
o11c wrote:You should (take careabout guilbot). guild bot is the ONLY currently-supported method of guilds in this game.
Yes and that's a pity because Guild should be enabled in TMW, just as parties are. But, once again, thanks to Guild developers.
o11c wrote: The amount of time until chat channels are fully implemented depends on how quickly I can remove enough code to make it workable, and how much time I waste arguing with people who know nothing about TMWA internals.
Yes I am different from you: I do not criticize your skills without knowing them, I speak about what I can see: the way you manage the project.
According to your own words, ages will pass between the time were you remove code and the one you will write a single guild line code. You cannot imagine that you may be unable to write them, and that someone could take the relay. Some future potential developer will have no reference if the code is removed now; they cannot know what it does at least on their personal server. You are mortgaging the game's future for immediate interests. I never said the problems you had to deal with were trivial ones but
you said you removed code "bacause it was easy to remove" which obviously not a good reason to remove it. You also said:
Which one of these 3 reasons you exposed here are we supposed to believe?
Re: test: more server changes
Posted: 11 Jan 2013, 20:03
by o11c
Nard wrote:Some future potential developer will have no reference if the code is removed now
That's probably for the best - it should be reimplemented from the network protocol, not the existing implementation. But I expect any developer to be able to traverse git history with ease anyway.
Nard wrote:you said you removed code "bacause it was easy to remove" which obviously not a good reason to remove it.
I said "among the code that needs to be removed, the guild code was the easiest."
Re: test: more server changes
Posted: 11 Jan 2013, 20:06
by Nard
Nard wrote:you said you removed code "bacause it was easy to remove" which obviously not a good reason to remove it.
I said "among the code that needs to be removed, the guild code was the easiest."[/quote]
The guild code was ... not the worst of TMWA code, but the easiest to safely remove