|
You last visited: Today at 02:58
Advertisement
All in One questions of mine :)
Discussion on All in One questions of mine :) within the CO2 Private Server forum part of the Conquer Online 2 category.
06/25/2012, 08:44
|
#1
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
All in One questions of mine :)
Since, I don't wanna spam question to the forum so i decided to put my questions here, and I hope someone will try to answer.
#1 StackItem - how stack item is coded? As I know, only pots like (vanilla, etc) are getting stacked together. How can I make the other stack-able item getting stacked together too? Like for examples: Meteors, EXP Pots, and etc.
#2 Weapon Accessory Time Limit - How do I add limit on a accessory for 7 days? Shall I create a column onto Item table? and name it as AccessorryLimit? How will the server know that the accessory is activated? and how it will know that it will expire?
[Please don't make any foolishness on my thread, Thank you]
Sincerly,
~Crystaline
|
|
|
06/25/2012, 09:02
|
#2
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
|
#1 When you send an item packet there`s a value which contains the stack number.
#2 You should save the date, hour, everything when the accessory was activated, then compare that to the current server date.
|
|
|
06/25/2012, 09:19
|
#3
|
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,142
|
Also, a heads up. People tend to use Environment.TickCount to measure the distance between two points in time in their servers. This is not good practice! Though it is okay in certain circumstances where the difference in time is less than, say, 3-4 weeks, any more than that and it will wrap around to a negative number and screw up your system. I recommend that it is avoided completely, short of checking the time between things inside the server itself, such as your last jump, attack, etc. Other than that, I recommend you use something like a unix epoch timestamp. As I've posted before, use these functions I've made, or something similar:
Code:
public static readonly DateTime Epoch = new DateTime(1970, 1, 1);
public static long Microtime()
{
return Convert.ToInt64((DateTime.UtcNow - Epoch).TotalMilliseconds);
}
public static long MilliSecondsSince(long UTS)
{
return (Microtime() - UTS);
}
public static long SecondsSince(long UTS)
{
return (Microtime() - UTS) / 1000;
}
|
|
|
06/25/2012, 10:48
|
#4
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
Thanks for the two of you.
Btw, How will the server know when I activated my accessories?
PS: Any staff around, please don't close this thread since I will be updating this for more questions of mine in future.
|
|
|
06/25/2012, 10:59
|
#5
|
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,142
|
Quote:
Originally Posted by ~Crystaline
Thanks for the two of you.
Btw, How will the server know when I activated my accessories?
PS: Any staff around, please don't close this thread since I will be updating this for more questions of mine in future.
|
You would add a check using a timer or another method.
|
|
|
07/10/2012, 02:54
|
#6
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
Packet 1009 subtype 41 is the weapon accessory activation right?
Any ideas or an example how will the server know that my accessory is not yet active? And How do I spawn the Activate effect to the accessory?
|
|
|
07/10/2012, 03:25
|
#7
|
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
|
For StackItem there's a value in the ItemType which says the Max Stack Size if >= 1 Allow Stacking the max being whats in the ItemType.
To spawn the Activation time : Item Packet Offset : 60 as Uint32, You write the total Seconds of the time left,
|
|
|
07/10/2012, 03:56
|
#8
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
Quote:
Originally Posted by -Shunsui-
For StackItem there's a value in the ItemType which says the Max Stack Size if >= 1 Allow Stacking the max being whats in the ItemType.
To spawn the Activation time : Item Packet Offset : 60 as Uint32, You write the total Seconds of the time left,
|
Umm, nerd question "Will you at least struct that one for me? I'm not sure were to put it."
was it like this?
public uint AccessoryTime
{
get { return BitConverter.ToUInt32(Buffer, 60); }
set { WriteUInt32(value, 60, Buffer); }
}
|
|
|
07/10/2012, 11:55
|
#9
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Quote:
Originally Posted by ~Crystaline
Umm, nerd question "Will you at least struct that one for me? I'm not sure were to put it."
was it like this?
public uint AccessoryTime
{
get { return BitConverter.ToUInt32(Buffer, 60); }
set { WriteUInt32(value, 60, Buffer); }
}
|
its right ..btw the Time is in Seconds
|
|
|
07/11/2012, 12:32
|
#10
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
Umm, okay. Thanks Goodluck to myself lol
|
|
|
07/11/2012, 16:29
|
#11
|
elite*gold: 0
Join Date: Aug 2008
Posts: 94
Received Thanks: 19
|
Quote:
Originally Posted by ~Crystaline
Umm, nerd question "Will you at least struct that one for me? I'm not sure were to put it."
was it like this?
public uint AccessoryTime
{
get { return BitConverter.ToUInt32(Buffer, 60); }
set { WriteUInt32(value, 60, Buffer); }
}
|
Try this ... about the stackitem .
the Class ConquerItemInformation is reading all items and its values which are placed in the file Database/items.txt in ur debg folder
Example for one item :
Code:
1002020 Vanilla 0 0 0 0 0 0 0 0 0 0 600 0 0 0 0 0 0 2000 0 1 1 0 0 0 0 0 0 0 0 0 1 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 [COLOR="Red"]5 [/COLOR] 0 0 0 0 0 Drug None 5 0 0 0 14020 500
1002020 Vanilla 0 0 0 0 0 0 0 0 0 0 600 0 0 0 0 0 0 2000 0 1 1 0 0 0 0 0 0 0 0 0 1 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 Drug None 5 0 0 0 14020 500
count started by Zero ... so zero is id = 1002020 one is name = Vanilla and so on ... the Stack size is 47 which is colord red ... i think u can change it either in the items.txt file .... or while reading in code ... example for the Dragonball :
StackSize = Convert.ToUInt16(data[47]);
if (ID == 1088000) StackSize = 10;
attention :do not take anything from me as a correct answer if you did not try it your self
|
|
|
07/11/2012, 16:47
|
#12
|
elite*gold: 0
Join Date: Jun 2012
Posts: 179
Received Thanks: 55
|
I have already added the StackSize thingy, and it works like a charm
I'm currently doing some research about the AccessoryTime limit and the Refinery issue. Although, thanks for your concern.
|
|
|
07/11/2012, 17:45
|
#13
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Quote:
Originally Posted by ~Crystaline
I have already added the StackSize thingy, and it works like a charm
I'm currently doing some research about the AccessoryTime limit and the Refinery issue. Although, thanks for your concern.
|
Well once Sm1 Wear the Accessory Save this Time In ConquerItem Database and then if 7 days passed Item DisAppear
|
|
|
07/11/2012, 19:01
|
#14
|
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
|
Quote:
Originally Posted by shadowman123
Well once Sm1 Wear the Accessory Save this Time In ConquerItem Database and then if 7 days passed Item DisAppear
|
If you want the thing to work properly, you should be able to see the amount of time left instead of making it just disappear after 7 days.
For the timer you could add 2 more rows to the table, 1 for when it starts and 1 for when it ends.
so you basically insert in the first when it got activated and at the second one 7 days later.
The time within could be used to show the amount of time left.
|
|
|
07/11/2012, 19:20
|
#15
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Quote:
Originally Posted by turk55
If you want the thing to work properly, you should be able to see the amount of time left instead of making it just disappear after 7 days.
For the timer you could add 2 more rows to the table, 1 for when it starts and 1 for when it ends.
so you basically insert in the first when it got activated and at the second one 7 days later.
The time within could be used to show the amount of time left.
|
well in impulse Source it Send the Remaining Time Through Difference bet Start time Stored in database and DateTime.Now.Sec or smthing like that
|
|
|
Similar Threads
|
FLASH MINE |Oder| M14 LAND MINE
10/22/2010 - WarRock - 19 Replies
Was ist besser Flash mine oder Land mine?
Was macht mehr punkte?!
Was machen die punkte?
Sind die für exp und Dinar???
|
All times are GMT +2. The time now is 02:58.
|
|