Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Why i try use Weapon over 255 Slot Number causes crash on server ?


My Brave Shine
 Share

Recommended Posts

Hii Eclipses o/ I have one question.

I use (client and server) constants of item = 999.

Have 999 slots for itens addition. But, case i use someone weapon over 255 slot in Item Editor, he crash the server and down '-'.

it makes my limited game 255 weapons, because above 255, it breaks the server. Can someone explain? or tell me how to increase it?

att lovely
Link to comment
Share on other sites

Oh Darlings, My server and client has compiled, and more of 50 player comes online normally. The constants of Itens is =  999, as long.

Client and Server as compiled perfect. I Create Armor, Consumes, and Other Itens, normally, over 255 Slot. I put 800, 500, etc. to organize my editor. Just functioned fine. BUT, if i create the WEAPON, over 255 slot,

ex: I Create the [ Sword of Black Sanctuary ], in slot 256, and i equiped her, and i try Attack one enemy, or interact on Npc, [ if i use Control default Key… ]  this comes a cause the over flow in server and crashs down. :X

ONLY Weapons. ONLY THIS Type… :X other equip or item, or consume, or key.. etc... no have this problem '-'
Link to comment
Share on other sites

Uhm I Use the E. Final Frontier.

But, i too can't seach the real problem… rsrs, just work fine.. only this.. is a problem.. in weapon item type... u.u

why the other equips? armor? shield and etc, work fine, over 256..etc... consumes and other.. spells etc... but just weapons, only hes... i create and use.. but wen i attack, ou interact, or use the control, causes over flow y.y
Link to comment
Share on other sites

Atleast give us the error message as well?

If you have a problem that involve 255 256 that is most likely a data mismatch type. A byte can only hold a value from 0 to 255 as oppose to long negative some super large number to super duper large number.

Dont try to delete line, that literally the worst way to fix it.

> when you change from Byte to long 
>
> remember to delete all items

That is not the case since all items are under the same object class therefore if 255 of them work you really dont have to remove.

You are right in some case (when you already have saved object (probably by using serialization) AND you modified the class itself, then yes, you will need to remove all the previous created object OR create a converter for it. However, the base item class in this case is not modified and an outer number used solely for the purpose of numbering is used so removing all of them isn't going to change anything

Plus don't you think it would suck if she have to do another 256 items again?
Link to comment
Share on other sites

If you wanna do a teamviewer section where I look over your code I can do that. I mean I have an old copy of vb6 but Im too lazy to go install it.

I mean with only your given information I don't think I know where the problem is.

The picture

PS:

OHHHHHHHHHHHHHHH I THINK I KNWO WHERE THE PROBLEM IS

IT BECAUSE OF THE PARAMETER

change the parameter from byte to long should solve the problem

Since you seem like you are new to coding, the parameter is the stuff u ask for when you call a function

For example

void Givememoney (int howmuch)

{

Character.receiveMoney(howmuch);

}

so when you call it it would be

Givememoney(100);

just change the byte to long in that case

if it doesn't work then I don't know that the closest thing I can think of at the moment
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...