Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2016-07-23 21:07:40

BuzzerBee
Forum Admin
From: Texas, U.S.A.
Joined: 2015-02-15
Posts: 4,575

The "Why did I get this error?" Topic

Want to know why you're getting a specific error or why an exception is being thrown?

Post the error as well as the relevant code here and I and other programmers will try to help you out as soon as possible.


TdQRyz3.png
https://wiki.everybodyedits.com/images/5/5d/135_bee

Offline

#2 2016-07-23 21:54:39

Blackmask
Member
From: France
Joined: 2016-06-27
Posts: 199

Re: The "Why did I get this error?" Topic

Why I got that ? : jqsVvK1.png


L'exception InvalidCastException n'a pas été gérée par le code utilisateur

Value at index:13 is not System.Int32. It's a System.String


I made that with the tutorial of jabatheblob1 4 :https://www.youtube.com/watch?v=2bK5bcGWx6E

Offline

#3 2016-07-23 22:14:45

BuzzerBee
Forum Admin
From: Texas, U.S.A.
Joined: 2015-02-15
Posts: 4,575

Re: The "Why did I get this error?" Topic

Jaba's tutorials are mostly outdated I think. World width is now index 18 and height is 19. Replace 12 with 18, and 13 with 19. Also you'll probably need to replace unit kc = 17 with 39.

I'm on my phone right now and I'm about to go to work but there's probably more stuff you need to do. For example where do you check to see if the message type is "init"?


TdQRyz3.png
https://wiki.everybodyedits.com/images/5/5d/135_bee

Offline

#4 2016-07-24 00:09:32

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,853

Re: The "Why did I get this error?" Topic

Could also be a world with new blocks that have special (meta?) data. Adding those

So you've made a "get help here" topic which is basically the gist of half the posts here.
Interesting choice.

Offline

#5 2016-07-24 06:32:13

BuzzerBee
Forum Admin
From: Texas, U.S.A.
Joined: 2015-02-15
Posts: 4,575

Re: The "Why did I get this error?" Topic

hummerz5 wrote:

So you've made a "get help here" topic which is basically the gist of half the posts here.
Interesting choice.

Not really tbh most of the posts are bot releases and questions not related to a specific error


TdQRyz3.png
https://wiki.everybodyedits.com/images/5/5d/135_bee

Offline

#6 2016-07-24 09:06:03

Blackmask
Member
From: France
Joined: 2016-06-27
Posts: 199

Re: The "Why did I get this error?" Topic

It works thx :d

Offline

Wooted by:

#7 2016-08-18 11:46:52

GareY
Member
Joined: 2015-10-28
Posts: 23

Re: The "Why did I get this error?" Topic

This is my problem:

c78ucb

Hidden text

G511Cwj.png

98% of teenagers cannot count; if you're apart of the 3% that can, copy this into your signature.

Offline

#8 2016-08-18 12:10:38

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: The "Why did I get this error?" Topic

GareY wrote:

This is my problem:

http://prnt.sc/c78ucb

Hidden text

Are you sure that block class is set to public?

Offline

Wooted by:

#9 2016-08-18 12:24:26

BuzzerBee
Forum Admin
From: Texas, U.S.A.
Joined: 2015-02-15
Posts: 4,575

Re: The "Why did I get this error?" Topic

Show me a picture of your blocks class please


TdQRyz3.png
https://wiki.everybodyedits.com/images/5/5d/135_bee

Offline

#10 2016-08-18 15:23:26

Hexagon
Member
Joined: 2015-04-22
Posts: 1,213

Re: The "Why did I get this error?" Topic

Unhandled Exception:
System.ArgumentException: An element with the same key already exists in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.Threading.Tasks.Task,System.Threading.CancellationTokenSource]].Add (System.String key, System.Collections.Generic.Dictionary`2 value) [0x00000] in <filename unknown>:0 
  at Spider.Core.CreateCrawler (System.String roomKey, System.Threading.AutoResetEvent createCrawlerHandle) [0x00000] in <filename unknown>:0 
  at Spider.Pool+<AutoAdjust>d__3.MoveNext () [0x00000] in <filename unknown>:0 

Happens once every ~six months, but causes a fatal crash. Code: http://github.com/decagon/spider

Offline

#11 2016-08-18 17:19:22

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: The "Why did I get this error?" Topic

Hexagon wrote:
Unhandled Exception:
System.ArgumentException: An element with the same key already exists in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.Threading.Tasks.Task,System.Threading.CancellationTokenSource]].Add (System.String key, System.Collections.Generic.Dictionary`2 value) [0x00000] in <filename unknown>:0 
  at Spider.Core.CreateCrawler (System.String roomKey, System.Threading.AutoResetEvent createCrawlerHandle) [0x00000] in <filename unknown>:0 
  at Spider.Pool+<AutoAdjust>d__3.MoveNext () [0x00000] in <filename unknown>:0 

Happens once every ~six months, but causes a fatal crash. Code: http://github.com/decagon/spider

Just check if the key exists, and if it does, stop the room crawler, remove it and create a new one as you did before?

Offline

#12 2016-08-18 17:22:49

Hexagon
Member
Joined: 2015-04-22
Posts: 1,213

Re: The "Why did I get this error?" Topic

den3107 wrote:
Hexagon wrote:
Unhandled Exception:
System.ArgumentException: An element with the same key already exists in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.Threading.Tasks.Task,System.Threading.CancellationTokenSource]].Add (System.String key, System.Collections.Generic.Dictionary`2 value) [0x00000] in <filename unknown>:0 
  at Spider.Core.CreateCrawler (System.String roomKey, System.Threading.AutoResetEvent createCrawlerHandle) [0x00000] in <filename unknown>:0 
  at Spider.Pool+<AutoAdjust>d__3.MoveNext () [0x00000] in <filename unknown>:0 

Happens once every ~six months, but causes a fatal crash. Code: http://github.com/decagon/spider

Just check if the key exists, and if it does, stop the room crawler, remove it and create a new one as you did before?

That's what I'm doing right now, except for some reason the memory is leaking, causing the crawler to occasionally get stuck and hold up the thread since there is a low-level attachment to an object in ms*.dll or something. I've tried using StrongBox and then deleting that, but it doesn't really help.

Offline

#13 2016-08-18 17:26:27, last edited by Zumza (2016-08-18 17:26:52)

Zumza
Member
From: root
Joined: 2015-02-17
Posts: 4,656

Re: The "Why did I get this error?" Topic

Hexagon wrote:
den3107 wrote:
Hexagon wrote:
Unhandled Exception:
System.ArgumentException: An element with the same key already exists in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.Threading.Tasks.Task,System.Threading.CancellationTokenSource]].Add (System.String key, System.Collections.Generic.Dictionary`2 value) [0x00000] in <filename unknown>:0 
  at Spider.Core.CreateCrawler (System.String roomKey, System.Threading.AutoResetEvent createCrawlerHandle) [0x00000] in <filename unknown>:0 
  at Spider.Pool+<AutoAdjust>d__3.MoveNext () [0x00000] in <filename unknown>:0 

Happens once every ~six months, but causes a fatal crash. Code: http://github.com/decagon/spider

Just check if the key exists, and if it does, stop the room crawler, remove it and create a new one as you did before?

That's what I'm doing right now, except for some reason the memory is leaking, causing the crawler to occasionally get stuck and hold up the thread since there is a low-level attachment to an object in ms*.dll or something. I've tried using StrongBox and then deleting that, but it doesn't really help.

If its used cross-thread you should mark it with volatile keyword.
(the dictionary)


Everybody edits, but some edit more than others

Offline

#14 2016-08-18 17:26:51

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: The "Why did I get this error?" Topic

Hexagon wrote:
Unhandled Exception:
System.ArgumentException: An element with the same key already exists in the dictionary.
  at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.Threading.Tasks.Task,System.Threading.CancellationTokenSource]].Add (System.String key, System.Collections.Generic.Dictionary`2 value) [0x00000] in <filename unknown>:0 
  at Spider.Core.CreateCrawler (System.String roomKey, System.Threading.AutoResetEvent createCrawlerHandle) [0x00000] in <filename unknown>:0 
  at Spider.Pool+<AutoAdjust>d__3.MoveNext () [0x00000] in <filename unknown>:0 

Happens once every ~six months, but causes a fatal crash. Code: http://github.com/decagon/spider

The code are already saying whats wrong, "An element with the same key already exists in the dictionary"
But if you want to go deeper and find exactly where, you need to run visual studio.
Do you run the bot on a VPS? I don't know a way to debug the code on a VPS. I guess you use mono.

If you use Visual Studio:

To get to the correct place there the error came from.
Click on CTRL + ALT + E, then click on "Common Language Runtime Exceptions".
Then click on "System.ArgumentException" and run the code.

Offline

#15 2016-08-19 08:39:01

GareY
Member
Joined: 2015-10-28
Posts: 23

Re: The "Why did I get this error?" Topic

BuzzerBee wrote:

Show me a picture of your blocks class please

Fixed


G511Cwj.png

98% of teenagers cannot count; if you're apart of the 3% that can, copy this into your signature.

Offline

Wooted by:

#16 2016-08-26 15:05:17

GareY
Member
Joined: 2015-10-28
Posts: 23

Re: The "Why did I get this error?" Topic

Thats my error //forums.everybodyedits.com/img/smilies/sad :

COFIr1U


G511Cwj.png

98% of teenagers cannot count; if you're apart of the 3% that can, copy this into your signature.

Offline

#17 2016-08-26 15:06:31

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,853

Re: The "Why did I get this error?" Topic

^IMO we need more information. //forums.everybodyedits.com/img/smilies/smile

my off-the-napkin guess is you're putting that code in the wrong place

Offline

#18 2016-08-26 15:14:00

GareY
Member
Joined: 2015-10-28
Posts: 23

Re: The "Why did I get this error?" Topic

hummerz5 wrote:

^IMO we need more information. //forums.everybodyedits.com/img/smilies/smile

my off-the-napkin guess is you're putting that code in the wrong place

http://dropb.in/regcey.c


G511Cwj.png

98% of teenagers cannot count; if you're apart of the 3% that can, copy this into your signature.

Offline

#19 2016-08-26 15:18:58

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,853

Re: The "Why did I get this error?" Topic

Fun fact: I actually learned something in CS 101: the error isn't always on the line that's flagged, sometimes you have to look up.

        Dictionary<uint, object[]> is your problem.

If you don't know what you want that line to do, just remove it. //forums.everybodyedits.com/img/smilies/smile

Offline

Wooted by:

#20 2016-08-26 15:20:17

GareY
Member
Joined: 2015-10-28
Posts: 23

Re: The "Why did I get this error?" Topic

hummerz5 wrote:

Fun fact: I actually learned something in CS 101: the error isn't always on the line that's flagged, sometimes you have to look up.

        Dictionary<uint, object[]> is your problem.

If you don't know what you want that line to do, just remove it. //forums.everybodyedits.com/img/smilies/smile

Thanks //forums.everybodyedits.com/img/smilies/big_smile


G511Cwj.png

98% of teenagers cannot count; if you're apart of the 3% that can, copy this into your signature.

Offline

#21 2016-08-26 15:54:14

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: The "Why did I get this error?" Topic

Why does so many people use "leave"? When it's "left" in the protocol and have always been "left".

Offline

Wooted by:

#22 2016-08-26 15:56:44

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: The "Why did I get this error?" Topic

capasha wrote:

Why does so many people use "leave"? When it's "left" in the protocol and have always been "left".

Because it'd makes sense if "join" was used when a player enters.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

Koya1472223404620872

Board footer

Powered by FluxBB

[ Started around 1732958255.8269 - Generated in 0.101 seconds, 12 queries executed - Memory usage: 1.8 MiB (Peak: 2.06 MiB) ]