chraft / c-raft

Project has been retired! -- C#raft the open source c# minecraft server
http://www.c-raft.com
GNU Affero General Public License v3.0
102 stars 43 forks source link

"String field too long" IOException #152

Closed ghost closed 12 years ago

ghost commented 12 years ago

I was attempting to eat a cake when Visual Studio took focus because the server got the following exception:

System.IO.IOException was unhandled by user code
  Message=String field too long
  Source=Chraft
  StackTrace:
       at Chraft.Net.PacketReader.ReadString16(Int16 maxLen) in C:\chraft-c-raft-7f2058c\Chraft\Net\PacketReader.cs:line 147
       at Chraft.Net.Packets.LoginRequestPacket.Read(PacketReader reader) in C:\chraft-c-raft-7f2058c\Chraft\Net\Packets\Packet.cs:line 186
       at Chraft.Net.PacketHandlers.ReadLoginRequest(Client client, PacketReader reader) in C:\chraft-c-raft-7f2058c\Chraft\Net\PacketHandlers.cs:line 90
       at Chraft.Server.<ProcessReadQueue>b__7(Int32 i) in C:\chraft-c-raft-7f2058c\Chraft\Server.cs:line 406
       at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.<ForWorker>b__c()
  InnerException: 

I found the value of len to be 2561. I don't see why the server was parsing a LoginRequestPacket as this was well after I logged into the server.

I am using an unmodified zip of commit 7f2058cf46.

This can be easily reproduced by doing the following:

ghost commented 12 years ago

It would appear that this issue may have nothing to do with the cake as it also occurs when I try to discard an item into the creative mode inventory. I am searching the code but am not too familiar with the layout yet so it may take a while.

justinstenning commented 12 years ago

Hey Daniel, did you get anywhere with tracking this one down?

ghost commented 12 years ago

I've been kind of busy lately, so I haven't gotten the chance. I will look for it after I finish checking my email and other things like that.

ementalo commented 12 years ago

closing