Zinal001 / ValheimMods

A collection of Valheim Mods I'm working on
3 stars 1 forks source link

not working #2

Closed Bigfoot129012 closed 3 years ago

Bigfoot129012 commented 3 years ago

this will not work on my valheim server would like some help please

[Debug :Server Messages] Checking 0 FixedTimedMessages [Debug :Server Messages] Checking 0 FixedTimedMessages [Debug :Server Messages] Checking 0 FixedTimedMessages this is what i set it to

TimedMessage True Server The server Welcome we have updated the server files please download them at bigfootsgaming.com/valheim/ today! 2021-03-01 03:00:00 00:30:00 2021-03-08 24:00:00

still not working

Zinal001 commented 3 years ago

Could you upload your copy of BepInEx/config/ServerMessages.xml? Easier to debug that way. (Not sure if Github supports uploading files in comments, if not, use a free service like https://pastebin.com/)

[Debug :Server Messages] Checking 0 FixedTimedMessages basically means that it doesn't recognize any messages in that file, which is wierd.

Bigfoot129012 commented 3 years ago

https://drive.google.com/file/d/1k0T9KVNYJCdJc8izy0u7NRPmtDToXbuJ/view?usp=sharing from my drive

Zinal001 commented 3 years ago

That appears to be the *.dll file (The plugin itself).

In your Server folder, go to BepInEx\config. There should be a ServerMessages.xml file there.

I tried with this XML and it appears to be working:

<Messages>
    <Message>
        <Type>TimedMessage</Type>
        <Enabled>True</Enabled>
        <Sender>Server</Sender>
        <Text>The server Welcome we have updated the server files please download them at bigfootsgaming.com/valheim/ today!</Text>
        <Start_At>2021-03-01 03:00:00</Start_At>
        <Duration_Between>00:30:00</Duration_Between>
        <End_At>2021-03-08 23:59:00</End_At>
    </Message>
</Messages>

Note the End_At element: 24:00:00 is actually not a valid timestamp.

Bigfoot129012 commented 3 years ago

i did send the .xml file i think thats what you wanted and i use Valheim plus if that makes a difference

Bigfoot129012 commented 3 years ago

this is the .xml sorry https://drive.google.com/file/d/1X7D4hkIykqD_vrMGO9Pi13j_Rfn-J_m3/view?usp=sharing

Zinal001 commented 3 years ago

No problem. I can see two errors in your XML: First, the End_At element cannot be 24:00:00. That isn't a valid Time (00:00:00 -> 23:59:59). So change the first End_At to: <End_At>2021-03-09 00:00:00</End_At>

Secondly, Your second message (This is a Test!) Should be a TimedMessage (If you want to send it every half hour)

This seems to work:

<Messages>
  <Message>
    <Type>TimedMessage</Type> <!-- (Required) The type of message, in this case a message that is repeated every [[Duration_Between]] -->
    <Enabled>True</Enabled> <!-- (Required) Is this message currently enabled? -->
    <Sender>Server</Sender> <!-- (Optional, Default: Server) The sender of the message -->
    <Text>The server Welcome we have updated the server files please download them at bigfootsgaming.com/valheim/ today!</Text> <!-- (Required) The text of the message -->
    <Start_At>2021-03-01 03:00:00</Start_At> <!-- (Optional, Default: ) When should this message be enabled (In case of specific date messages, such as christmas) -->
    <Duration_Between>00:30:00</Duration_Between> <!-- (Required) How often should this message be sent. format: Hour:Minute:Second (Seconds are ignored) -->
    <End_At>2021-03-09 00:00:00</End_At> <!-- (Optional, Default: ) When should this message be disabled again (In case of specific date messages, such as christmas) -->
  </Message>
  <Message>
    <Type>TimedMessage</Type> <!-- (Required) The type of message, in this case a message that is sent at a fixed time every day -->
    <Enabled>true</Enabled> <!-- (Required) Is this message currently enabled? -->
    <Sender>Bigfoot</Sender> <!-- (Optional, Default: Server) The sender of the message -->
    <Text>This is a Test!</Text> <!-- (Required) The text of the message -->
    <Start_At>2021-03-01 02:35:00</Start_At> <!-- (Optional, Default: ) When should this message be enabled (In case of specific date messages, such as christmas) -->
    <Duration_Between>00:30:00</Duration_Between> <!-- (Required) How often should this message be sent. format: Hour:Minute:Second (Seconds are ignored) -->
    <End_At>2021-03-08 00:00:00</End_At> <!-- (Optional, Default: ) When should this message be disabled again (In case of specific date messages, such as christmas) -->
  </Message>
  <Message>
    <Type>FixedTimedMessage</Type> <!-- (Required) The type of message, in this case a message that is sent at a fixed time every day -->
    <Enabled>false</Enabled> <!-- (Required) Is this message currently enabled? -->
    <Sender>Server</Sender> <!-- (Optional, Default: Server) The sender of the message -->
    <Text>The server will restart in 10 minutes, please logout before then!</Text> <!-- (Required) The text of the message -->
    <Time>05:50</Time> <!-- (Required) When should this message be sent? format: Hour:Minute -->
  </Message>
  <Message>
    <Type>FixedTimedMessage</Type> <!-- (Required) The type of message, in this case a message that is sent at a fixed time every day -->
    <Enabled>false</Enabled> <!-- (Required) Is this message currently enabled? -->
    <Sender>Server</Sender> <!-- (Optional, Default: Server) The sender of the message -->
    <Text>The server will restart in 5 minutes, please logout before then!</Text> <!-- (Required) The text of the message -->
    <Time>05:55</Time> <!-- (Required) When should this message be sent? format: Hour:Minute -->
  </Message>
  <Message>
    <Type>FixedTimedMessage</Type> <!-- (Required) The type of message, in this case a message that is sent at a fixed time every day -->
    <Enabled>false</Enabled> <!-- (Required) Is this message currently enabled? -->
    <Sender>Server</Sender> <!-- (Optional, Default: Server) The sender of the message -->
    <Text>The server will now restart!</Text> <!-- (Required) The text of the message -->
    <Time>06:00</Time> <!-- (Required) When should this message be sent? format: Hour:Minute -->
  </Message>
</Messages>
Zinal001 commented 3 years ago

I've never tried it with Valheim plus so I'm not sure if that is affecting it or not.

Are you using v0.0.1 or v0.0.2 of my mod? I noticed that the second message has a lower-cased value for Enabled which wasn't supported in v0.0.1.

Try changing

<Message>
    <Type>TimedMessage</Type> <!-- (Required) The type of message, in this case a message that is sent at a fixed time every day -->
    <Enabled>true</Enabled> <!-- (Required) Is this message currently enabled? -->
    <Sender>Bigfoot</Sender> <!-- (Optional, Default: Server) The sender of the message -->
    <Text>This is a Test!</Text> <!-- (Required) The text of the message -->
    <Start_At>2021-03-01 02:35:00</Start_At> <!-- (Optional, Default: ) When should this message be enabled (In case of specific date messages, such as christmas) -->
    <Duration_Between>00:30:00</Duration_Between> <!-- (Required) How often should this message be sent. format: Hour:Minute:Second (Seconds are ignored) -->
    <End_At>2021-03-08 00:00:00</End_At> <!-- (Optional, Default: ) When should this message be disabled again (In case of specific date messages, such as christmas) -->
  </Message>

to

  <Message>
    <Type>TimedMessage</Type> <!-- (Required) The type of message, in this case a message that is sent at a fixed time every day -->
    <Enabled>True</Enabled> <!-- (Required) Is this message currently enabled? -->
    <Sender>Bigfoot</Sender> <!-- (Optional, Default: Server) The sender of the message -->
    <Text>This is a Test!</Text> <!-- (Required) The text of the message -->
    <Start_At>2021-03-01 02:35:00</Start_At> <!-- (Optional, Default: ) When should this message be enabled (In case of specific date messages, such as christmas) -->
    <Duration_Between>00:30:00</Duration_Between> <!-- (Required) How often should this message be sent. format: Hour:Minute:Second (Seconds are ignored) -->
    <End_At>2021-03-08 00:00:00</End_At> <!-- (Optional, Default: ) When should this message be disabled again (In case of specific date messages, such as christmas) -->
  </Message>

Also, If your using v0.0.1 I highly recommend updating since it has a lot more stability than the first version.

Bigfoot129012 commented 3 years ago

it does work now thanks so much fore your help do you have a mod for a server restart? it does not pop it across screen just say's it in the message box unless u hit the enter key people will not be able to see it i wanted it to pop across screen is there a way for it to pop across the screen at all?

Zinal001 commented 3 years ago

Sadly not without forcing the players to install a client-side mod.. I'm in the process of making an optional client-sided mod, to show messages in the middle of the screen on the players side. (Or other position if wanted).

About the server restart: This is a bit tricker since it usually requires another application. Shutting down the server from a mod is not problem, but restarting it might be.. It depends heavily on the OS the server is running on and also the permissions granted to the user which runs the server.

I'm opening an Issue about the client-sided mod and also one for Server restart. I'll also be closing the since this problem is resolved.

Bigfoot129012 commented 3 years ago

i run my own dedicated server from home so the permissions no problem lol we make sure everyone downloads the new server files as they come available we are all friends on my server so they will download all new updates so if you do make another mod that will show it across the middle of the screen or just the top of the screen would be very grateful so it can be put in the server and the client side i bundle all the updates in one download and then they install it on there client side and the restart would be really cool to to bad there's not a mod that tell them you have to have all the server mod installed on the client side to join like a mod enforcer or something like that

Zinal001 commented 3 years ago

@Bigfoot129012 An optional client-sided version of this mod has been released: https://valheim.thunderstore.io/package/Zinal001/Server_Messages_Client/