server voting for 5165

01/17/2010 02:21 gulpi_de_gulat#16
ok i edit a lil, but basically if what is your web browser uses thats usually open. because in the Philippines only few use internet explorer
01/17/2010 05:06 copz1337#17
Nice. Few people said this was "hard" and look. Looks simple lol'd. +k
01/17/2010 05:34 spare2#18
Won't this open the web page on the host's computer everytime we vote using the NPC?
01/17/2010 06:33 copz1337#19
just change iexplorer to firefox - btw how can i make it so you can open the link as many times as you want. it only lets you do it once.
01/17/2010 06:37 Arcо#20
Quote:
Originally Posted by copz1337 View Post
just change iexplorer to firefox - btw how can i make it so you can open the link as many times as you want. it only lets you do it once.
Change the if vote used == 0 to what you want it to be.
01/17/2010 06:44 copz1337#21
Quote:
Originally Posted by Hepatitis C View Post
Change the if vote used == 0 to what you want it to be.
on character.cs or npcdialog - votedused = 0 is on both.
01/17/2010 06:46 Arcо#22
Quote:
Originally Posted by copz1337 View Post
on character.cs or npcdialog - votedused = 0 is on both.
The one in character.cs is the definition.
I'm talking about when it is actually used.
01/17/2010 20:03 AndreaCo#23
you need to make the number of votes used reset every 12 hhours or you will only be able to use it once.. + you gotta make it save in the database
01/17/2010 20:42 .Ryu#24
Quote:
Originally Posted by AndreaCo View Post
you need to make the number of votes used reset every 12 hhours or you will only be able to use it once.. + you gotta make it save in the database
I Agree with that andrea =P
01/20/2010 07:04 TheLeGend209#25
Tested...

Only Problem i found was that it opens up a internet page on your host's computer sooo when i get the time ill make it were it doesnt do that :P but im busy doing other things
02/04/2010 12:20 mAr1u$#26
it open the host iexplorer. how I can make it to open the player iexplorer?
02/04/2010 13:30 Adziunia#27
well if u relog u can vote again ;p i tried make it like lottery but if u relog u can still vote so i was playing around and made timer ;o but since i am noob in C# :P i want u to look at this and teell if this will work and what i missed:
Heres da npc
Quote:
case 4699:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("You want to vote the server?"));
GC.AddSend(Packets.NPCLink("yes", 1));
GC.AddSend(Packets.NPCLink("no", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());

}
if (GC.MyChar.VoteUsed == 1)
{
Program.VoteTimer = new System.Timers.Timer();
Program.VoteTimer.Interval = (1 * 86400);
Program.VoteTimer.Elapsed += new System.Timers.ElapsedEventHandler(Program.Vote);
Program.VoteTimer.Start();
}
if (Control == 1)
{
if (GC.MyChar.VoteUsed == 0)
{
GC.MyChar.VoteUsed++;
GC.MyChar.CPs += 5000;
System.Diagnostics.Process.Start("http://www.xtremetop100.com/in.php?site=1132300040");
Game.World.SendMsgToAll("SYSTEM", " Congratulation " + GC.MyChar.Name + " recieve 5000 cps upon voting the server ", 2011, 0);

}
else
{
GC.AddSend(Packets.NPCSay("you can vote only once a day"));
GC.AddSend(Packets.NPCLink("I see", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
break;
}
#endregion
heres code for program.cs
Quote:
public static void Vote(object source, System.Timers.ElapsedEventArgs e)
{
try
{
if (VoteTimer != null)
{
Database.ClearVote ();
}
}
catch { }
}
and heres thing for database
Quote:
internal static void ClearVote()
{
throw new NotImplementedException();
}
so what u think guys about it :P u can go on me easy coz i am not so good at this :P
02/04/2010 13:44 Korvacs#28
Quote:
Originally Posted by spare2 View Post
Won't this open the web page on the host's computer everytime we vote using the NPC?
Like spare2 figured out, everytime you visit the npc and it runs this peice of code:

Code:
System.Diagnostics.Process.Start();
The process will be started on the server's host, which is not what you want, there is no way to remotely start a process using code like this, the client has a built in string packet which will open a weblink in the default browser.
02/04/2010 13:45 pro4never#29
Quote:
Originally Posted by Korvacs View Post
Like spare2 figured out, everytime you visit the npc and it runs this peice of code:

Code:
System.Diagnostics.Process.Start();
The process will be started on the server's host, which is not what you want, there is no way to remotely start a process using code like this, the client has a built in string packet which will open a weblink in the default browser.
Mostly just my own curiosity here... but has that packet ever been properly documented/released? As far as I know it hasn't been but you would probably know better than me.
02/04/2010 13:50 Korvacs#30
Quote:
Originally Posted by pro4never View Post
Mostly just my own curiosity here... but has that packet ever been properly documented/released? As far as I know it hasn't been but you would probably know better than me.
Its just your basic string packet:

[Only registered and activated users can see links. Click Here To Register...]

There is just a type which denotes that its a weblink, im not sure which it is, but thats all there is too it, iterate through all of the possible types untill you find the right one, you can just make a command:

Code:
/string http://www.google.co.uk 0
0 being the type.