Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Опубликовано:

My server crash after working for about an hour or two.

Sometimes it throws error message like this:

error1xi.png

error2n.png

Other times, just crash without any notification.

I checked InfinityScript.log and game_mp.log nothing strange in both of them.

The question is.. how to trace the cause of the crashing?

Featured Replies

Опубликовано:
My server crash after working for about an hour or two.

Sometimes it throws error message like this:

pic1

pic2

Other times, just crash without any notification.

I checked InfinityScript.log and game_mp.log nothing strange in both of them.

The question is.. how to trace the cause of the crashing?

Would you be willing to share the code behind the ServerAdmin Plugin?

Опубликовано:
  • Автор
My server crash after working for about an hour or two.

Sometimes it throws error message like this:

pic1

pic2

Other times, just crash without any notification.

I checked InfinityScript.log and game_mp.log nothing strange in both of them.

The question is.. how to trace the cause of the crashing?

Would you be willing to share the code behind the ServerAdmin Plugin?

I really don't mind.. it's from bone'smind source code but converted to InfinityScript with some additions.

But it's a little bit messed up code. so it's not good to be tagged as a RELEASE until it's cleaned a bit.

I'll put the link here after I upload the plugin ehem the source code >.>

http://www.mediafire.com/?tzpb48oht7n5v7h

Опубликовано:
  • Автор
Well I don't see servers on r29 crashing at all, it's your scripts fault most likely.

Sure thing, the question is how to find the problem? There are a lot of lines in there :/

Опубликовано:
  • Автор

This time, server produced this error in server console and in InfinityScript.log:

 

2013-02-03 23:21:39 - [scriptLoader] - INFO: Loading script GameLog v1.1.0.29
2013-02-03 23:21:39 - [scriptLoader] - INFO: Loading script TestScript v1.1.0.29
2013-02-03 23:21:39 - [scriptLoader] - INFO: Loading script ServerAdmin v1.0.0.0
2013-02-03 23:25:09 - [scriptProcessor] - ERROR: Exception during RunAll call: System.InvalidCastException: Value is not a convertible object: System.Int32 to InfinityScript.Entity
 at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider, Boolean try_target_to_type) [0x00000] in :0 
 at System.Int32.System.IConvertible.ToType (System.Type targetType, IFormatProvider provider) [0x00000] in :0 
 at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider, Boolean try_target_to_type) [0x00000] in :0 
 at System.Convert.ChangeType (System.Object value, System.Type conversionType) [0x00000] in :0 
 at InfinityScript.Parameter.As[Entity] () [0x00000] in :0 
 at InfinityScript.SHManager+<>c__DisplayClass13.b__d (InfinityScript.BaseScript script) [0x00000] in :0 
 at InfinityScript.ScriptProcessor.RunAll (System.Action`1 cb) [0x00000] in :0 
2013-02-03 23:25:09 - [scriptProcessor] - ERROR: Exception during RunAll call: System.InvalidCastException: Value is not a convertible object: System.Int32 to InfinityScript.Entity
 at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider, Boolean try_target_to_type) [0x00000] in :0 
 at System.Int32.System.IConvertible.ToType (System.Type targetType, IFormatProvider provider) [0x00000] in :0 
 at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider, Boolean try_target_to_type) [0x00000] in :0 
 at System.Convert.ChangeType (System.Object value, System.Type conversionType) [0x00000] in :0 
 at InfinityScript.Parameter.As[Entity] () [0x00000] in :0 
 at InfinityScript.SHManager+<>c__DisplayClass13.b__d (InfinityScript.BaseScript script) [0x00000] in :0 
 at InfinityScript.ScriptProcessor.RunAll (System.Action`1 cb) [0x00000] in :0 
2013-02-03 23:25:09 - [scriptProcessor] - ERROR: Exception during RunAll call: System.InvalidCastException: Value is not a convertible object: System.Int32 to InfinityScript.Entity
 at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider, Boolean try_target_to_type) [0x00000] in :0 
 at System.Int32.System.IConvertible.ToType (System.Type targetType, IFormatProvider provider) [0x00000] in :0 
 at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider, Boolean try_target_to_type) [0x00000] in :0 
 at System.Convert.ChangeType (System.Object value, System.Type conversionType) [0x00000] in :0 
 at InfinityScript.Parameter.As[Entity] () [0x00000] in :0 
 at InfinityScript.SHManager+<>c__DisplayClass13.b__d (InfinityScript.BaseScript script) [0x00000] in :0 
 at InfinityScript.ScriptProcessor.RunAll (System.Action`1 cb) [0x00000] in :0 

Опубликовано:
  • Автор
Remove your threads.

Also why are you using GetServerCFG and reading a file? Why not using dvars?

True. Why I didn't think about it before.

About threads, I don't mind them removed if they are considered spamming or inappropriate. Also, I don't know how to remove them myself. Tell me how or ask an admin to do the job. ^_^

Опубликовано:

Lol, I was referring to program threading ( http://msdn.microsoft.com/en-us/library ... 80%29.aspx ), not threads in terms of a topic in a forum.

You pm'd me about dvars; The server.cfg (located in folder admin/) is loaded on server start up. In this file you can set variables (i.e. settings) which you then can access from your plugin with 'GetDvar'.

 

For an example check my 'Improved AntiCamp' plugin here viewtopic.php?f=40&t=20836

Опубликовано:
  • Автор
Lol, I was referring to program threading ( http://msdn.microsoft.com/en-us/library ... 80%29.aspx ), not threads in terms of a topic in a forum.

I totally misunderstood :lol:

 

You pm'd me about dvars; The server.cfg (located in folder admin/) is loaded on server start up. In this file you can set variables (i.e. settings) which you then can access from your plugin with 'GetDvar'.

This is far more better than reading from a file. I just didn't know how do it before.. Great!

Thank you! :)

Опубликовано:
  • Автор

If I remove all threads from code this will force me to find a replacement.

For example, !shout command shows a message 5 times, each time with different color. There's a pause of say: 4000 milliseconds between each one.

for (int i = 1; i <= 5; i++)
{
AfterDelay(4000, () =>
{
	Utilities.SayAll("^" + i + message);
});
}

This didn't work well with me, the 5 messages appeared all at once after 4 seconds.

Thread.Sleep causes server to lag/stop working.

Any idea? :?

Опубликовано:
If I remove all threads from code this will force me to find a replacement.

For example, !shout command shows a message 5 times, each time with different color. There's a pause of say: 4000 milliseconds between each one.

for (int i = 1; i <= 5; i++)
{
AfterDelay(4000, () =>
{
	Utilities.SayAll("^" + i + message);
});
}

This didn't work well with me, the 5 messages appeared all at once after 4 seconds.

Thread.Sleep causes server to lag/stop working.

Any idea? :?

If you think about it, this makes sense.

 

What you want is something like:

for (int i = 1; i <= 5; i++)
{
AfterDelay(4000 * i, () =>
{
	Utilities.SayAll("^" + i + message);
});
}

this queues the delegate for execution in 4000ms, 8000ms, 1200ms and 1600ms

Опубликовано:
  • Автор

If you think about it, this makes sense.

 

What you want is something like:

for (int i = 1; i <= 5; i++)
{
AfterDelay(4000 * i, () =>
{
	Utilities.SayAll("^" + i + message);
});
}

this queues the delegate for execution in 4000ms, 8000ms, 1200ms and 1600ms

so this

Nope, the exact same problem.. nothing changed. I tested it 2 times.. same result.

What is shown in both cases is this:

^6message

^6message

^6message

^6message

^6message

I don't understand how ^6 appeared.. a mystery!

Опубликовано:

Nope, the exact same problem.. nothing changed. I tested it 2 times.. same result.

What is shown in both cases is this:

^6message

^6message

^6message

^6message

^6message

I don't understand how ^6 appeared.. a mystery!

then you obviously fail; what I posted will work. For instance, check TestScript's doabarrelroll. You'll find that the same technique is used there.

Опубликовано:
  • Автор

Nope, the exact same problem.. nothing changed. I tested it 2 times.. same result.

What is shown in both cases is this:

^6message

^6message

^6message

^6message

^6message

I don't understand how ^6 appeared.. a mystery!

then you obviously fail; what I posted will work. For instance, check TestScript's doabarrelroll. You'll find that the same technique is used there.

Well, this is embarrassing. As you said, I failed. It works. :mrgreen: Thank you

But it prints only in purple that is ^6 why?

this is the exact code:

for (int i = 1; i <= 5; i++)
{
	AfterDelay(4000 * i, () =>
		{
			Utilities.SayAll("^" + i + result);
		}
	);
}

Опубликовано:

Try something like:

   for (int i = 1; i <= 5; i++)
  {
     AfterDelay(4000 * i, () =>
        {
           Utilities.SayAll("^" + i + "The color code is " + i);
        }
     );
  }

So you can see what's really happening.

Опубликовано:
  • Автор
Try something like:

   for (int i = 1; i <= 5; i++)
  {
     AfterDelay(4000 * i, () =>
        {
           Utilities.SayAll("^" + i + "The color code is " + i);
        }
     );
  }

So you can see what's really happening.

brmmh.jpg

Опубликовано:
  • Автор
Please post your code (the whole function).

case "!shout":
{
	if (!(split.Length > 1))
	{
		Utilities.RawSayTo(issuer.EntRef, gmc + "!shout [message]");
		return false;
	}
	string txt = "";
	for (int i = 1; i < split.Length; i++)
	{
		if (split[i] == null)
		{
			return false;
		}
		txt += split[i] + " ";
	}
	string result = txt;
	for (int i = 1; i <= 5; i++)
	{
		AfterDelay(4000 * i, () =>
			{
				Utilities.SayAll("^" + i + "The color code is " + i);
			}
		);
	}
	return false;
}

gmc btw, is a general color: gmc = "^2";

Опубликовано:

Well if you think about it, it actually makes sense.

The loop itself which is increasing the variable i does not have any delay. So when the code of your 'AfterDelay' is executed, the for loop already finished and i is 5.

 

Try something like this

      for (int i = 1, z = i; i <= 5; i++)
     {
        AfterDelay(4000 * i, () =>
           {
              Utilities.SayAll("^" + z + "The color code is " + z);
              z++;
           }
        );
     }

Опубликовано:
  • Автор
Well if you think about it, it actually makes sense.

The loop itself which is increasing the variable i does not have any delay. So when the code of your 'AfterDelay' is executed, the for loop already finished and i is 5.

 

Try something like this

      for (int i = 1, z = i; i <= 5; i++)
     {
        AfterDelay(4000 * i, () =>
           {
              Utilities.SayAll("^" + z + "The color code is " + z);
              z++;
           }
        );
     }

Works great. now each message is in different color starting from 1 :)

Cheers :D

Опубликовано:
Well if you think about it, it actually makes sense

pesky anonymous funcs

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.