[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Running the server
. . -> [Subject]  Saving equipment bug?

Saving equipment bug?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Oblisgr   (123 posts)  [Biography] bio
Date Fri 10 Jul 2020 08:12 PM (UTC)
Message
I face a strange bug.

I run both servers (from local computer and one online)
They have the exact same files.

The local mud saves player's equipment and inventory properly on server restart.

The on line server will not save neither equipment nor inventory.

I checked the file permitions and write/read/execute are enabled.

What is happening?
[Go to top] top

Posted by Nick Gammon   Australia  (23,017 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sat 11 Jul 2020 01:32 AM (UTC)
Message
It sounds like the player files are not being saved. Perhaps you don't have write permissions to the folder the files are in.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Oblisgr   (123 posts)  [Biography] bio
Date Reply #2 on Sat 11 Jul 2020 06:23 AM (UTC)
Message
Eh just to be sure i have made all files and folder in the server read/write/execute. From the starting folder. The problem keeps.

The strange thing is that it saves skills and other data. It has problem only with equipment. I thought that it could be a problem in save.c but since it works in my local computer i dont think it is from there.

This is the permitions for the folders a-z in the player file. Maybe i m mistaken but i dont think.


drwxrwxrwx 2 oblisgr oblisgr 4096 Jul 10 07:58 a
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:53 b
drwxrwxrwx 2 oblisgr oblisgr 4096 Jul  9 23:46 c
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 d
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 e
drwxrwxrwx 2 oblisgr oblisgr 4096 Jul  9 16:02 f
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 g
drwxrwxrwx 2 oblisgr oblisgr 4096 Jul  9 17:35 h
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 i
drwxrwxrwx 2 oblisgr oblisgr 4096 Jul 10 08:06 j
drwxrwxrwx 2 oblisgr oblisgr 4096 Jul  9 17:56 k
drwxrwxrwx 2 oblisgr oblisgr 4096 Jul  9 21:22 l
drwxrwxrwx 2 oblisgr oblisgr 4096 Jul 11 02:10 m
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun 10 19:04 n
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  9 00:37 o
drwxrwxrwx 2 oblisgr oblisgr 4096 Jul  9 22:36 p
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 q
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 r
drwxrwxrwx 2 oblisgr oblisgr 4096 Jul  9 23:42 s
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 t
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 u
drwxrwxrwx 2 oblisgr oblisgr 4096 Jul  9 21:02 v
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 w
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 x
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 14:54 y
drwxrwxrwx 2 oblisgr oblisgr 4096 Jun  8 23:48 z
[Go to top] top

Posted by Oblisgr   (123 posts)  [Biography] bio
Date Reply #3 on Sat 11 Jul 2020 08:48 AM (UTC)

Amended on Sat 11 Jul 2020 08:51 AM (UTC) by Oblisgr

Message
Actually found solution for my problem.

It seems that save command was not saving equipment of higher level than players level. Since in my server all items are available from level 1 (even if they are of higher level) the mud didnt saved them.

So i removed the check for item's level from save.c and how ignores the level and keeps them equipped.

Removed the 3rd if from here:


for( obj = ch->first_carrying; obj; obj = obj->next_content )
   {
      if( obj->wear_loc > -1 && obj->wear_loc < MAX_WEAR )
      {
         if( get_trust( ch ) >= obj->level )
         {
            for( x = 0; x < MAX_LAYERS; x++ )
            {
               if( IS_NPC( ch ) )
               {
                  if( !mob_save_equipment[obj->wear_loc][x] )
                  {
                     mob_save_equipment[obj->wear_loc][x] = obj;
                     break;
                  }
               }
               else
               {
                  if( !save_equipment[obj->wear_loc][x] )
                  {
                     save_equipment[obj->wear_loc][x] = obj;
                     break;
                  }
               }
            }
            if( x == MAX_LAYERS )
            {
               bug( "%s had on more than %d layers of clothing in one location (%d): %s",
                    ch->name, MAX_LAYERS, obj->wear_loc, obj->name );
            }
         }
      }


and the first check from this:


   if( !hotboot )
   {
      if( (ch && ch->level < obj->level)
         || ( obj->item_type == ITEM_KEY && !IS_OBJ_STAT( obj, ITEM_CLANOBJECT ) )
         || ( (os_type == OS_VAULT) && (obj->item_type == ITEM_CORPSE_PC) )
         || obj_extracted( obj )
         || IS_OBJ_STAT( obj, ITEM_PROTOTYPE ) )
      return;
   }
[Go to top] top

Posted by Nick Gammon   Australia  (23,017 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Mon 13 Jul 2020 09:13 PM (UTC)
Message
I'm glad you found it. Your initial post sort-of hinted that the only difference was where the server was, not that that nature of the data was different.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


11,814 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]