This was a required change to make the server run on a modern GLIBC version without resorting to shady shared libraries or compatibility tricks. It is very straightforward but we should always keep an eye out for possible bugs. There was also a problem with the Z loop on field sending functions that was causing the server to hang in an infinite loop and should now be fixed. With these changes it is now possible to login into the game for a split second before the client asserting.
1.9 KiB
Synchronization
I'm not sure whether synchronization is done properly. The implementation of the first few crplayer.cc functions left me with a taste of race conditions although integer loads on x86 are generally atomic.
TODO (LEFTOVER)
-
Include
x == 0xFFFFinsideCheckVisibility? -
The map container uses type id zero but it seems to also be used as a "no type" id which makes me want to add some
isNone(),isNull(),isVoid()check toObjectTypeto be used as an alias when pertinent. -
Make some
TNonplayerrandom step function? One version that does a random step and another that does a random step keeping some distance from a certain position. -
I realized that
Changewith anObjectTypeparameter was being called where the version withINSTANCEATTRIBUTEparameter was expected due toObjectTypehaving an implicit conversion constructor fromint. I think it is best to make all converting constructors explicit to avoid these types of errors, although there aren't that many function overloads. -
Define a few constants like
MAX_NAME_LENGTH,MAX_SKILLS, andMAX_OPEN_CONTAINERSinstead of relying onNARRAY.
TODO AFTER FIRST PASS
- Remove VTABLE comments.
- Split NPC, Monster, and Player into separate header files.
- Review dividing comments. I feel like the current "//========" blends in too easily, making it hard to see.
- Trim rough edges.
- Replace unsafe libc functions like
strcpy,strncpy,strcat,sprintfetc... - Handle connections inline with
poll/epoll(probably?). - Remove exceptions.
- Would be desirable but I feel it could change too much of the original code flow while also
littering functions with early return checks like
if(err != NOERROR) { return err }although we could also have some macros to simplify this since we know we only useRESULTfor errors. But then would we be in a better place?
- Would be desirable but I feel it could change too much of the original code flow while also
littering functions with early return checks like
- Review signal usage for timing (SIGALRM, etc...).
- Support Windows.