Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 04:09

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C#] update Textbox or labelbox?

Discussion on [C#] update Textbox or labelbox? within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1

 
Haxor's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 3,777
Received Thanks: 1,455
[C#] update Textbox or labelbox?

Hello all
im trying to create a server stats program (windows forms)
I used pushedx example and im now trying to make it work on forms
i almost end end but i have one problem that i cant refresh textbox or label
and i get much errors..
And my stats update every 2 sec
So my project crash
I try to make it with diffrent ways from google , but i always get error
any help would be appreciated
Haxor is offline  
Old 07/21/2011, 11:09   #2
 
elite*gold: 0
Join Date: Sep 2010
Posts: 783
Received Thanks: 920


google ftw
ÑõÑ_Ŝŧóp is offline  
Thanks
1 User
Old 07/21/2011, 11:16   #3
 
Shane¸'s Avatar
 
elite*gold: 100
Join Date: May 2010
Posts: 1,948
Received Thanks: 1,635
fuuu signature stealers xD
by the way. did you try with timers?
it won't cause crashes cause of infinite loops
Shane¸ is offline  
Thanks
1 User
Old 07/21/2011, 11:36   #4
 
elite*gold: 0
Join Date: Nov 2007
Posts: 959
Received Thanks: 602
Quote:
Originally Posted by ~ Shane View Post
fuuu signature stealers xD
by the way. did you try with timers?
it won't cause crashes cause of infinite loops
infinite loop FTW
but only on a new thread xD
this way:

Thread loop = new Thread(UpdateThread);
loop.Start();

public void UpdateThread()
{
while(true)
{
//update ***** here

Thread.Sleep(1);
}

}

and it rocks then.

oh and by the way,for the updating I'd do it this way:
create a new function in Form1.cs (or whatever it's called)
like
public void UpdateTxtBox(string msg)
{
lock(this)
{
txtBox1.Text = "blablabla";
}

}

then in program.cs,I'd create a new from,
Form1 MainForm;
in Main function:
MainForm = new Form1();
Application.Run(MainForm);

then you can update textbox1.text using this:
MainForm.UpdateTxtBox("your text here");


I hope that helped :P
vorosmihaly is offline  
Thanks
1 User
Old 07/21/2011, 11:57   #5
 
elite*gold: 0
Join Date: Sep 2010
Posts: 783
Received Thanks: 920
here is a lil example used Invoke
Attached Files
File Type: rar WindowsFormsApplication19.rar (34.3 KB, 31 views)
ÑõÑ_Ŝŧóp is offline  
Thanks
1 User
Old 07/25/2011, 02:03   #6

 
sarkoplata's Avatar
 
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
just use Control.CheckForIllegalThreadCalls = False ;
And you'll be okay
sarkoplata is offline  
Old 07/25/2011, 09:10   #7
 
ZeraPain's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 360
Received Thanks: 249
Quote:
Originally Posted by sarkoplata View Post
just use Control.CheckForIllegalThreadCalls = False ;
And you'll be okay
no comment
ZeraPain is offline  
Thanks
2 Users
Old 07/25/2011, 12:38   #8

 
Haxor's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 3,777
Received Thanks: 1,455
I just get it by more simple way
But now i have problem to get the stats packet in grindroad
in esro its working 100%
but grindroad have 4 servers in same ip and when i put it on my program it crash
also it have diffrent opcode and i cant analyze\parse it

this is the packet
Quote:
<<< [S -> C][A107]
02 ................
00 ................
0D 00 ................
67 73 72 6F 2E 7A 61 70 74 2E 6F 72 67 gsro.zapt.org...
BD 32 .2..............
01 ................
0D 00 ................
67 73 72 6F 2E 7A 61 70 74 2E 6F 72 67 gsro.zapt.org...
BD 32 .2..............
well i cant anything from it
i wonder if you can help me with this
Haxor is offline  
Old 07/25/2011, 16:03   #9
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
If you look at that packet it seems logic to me that the first byte is the amount of servers or whatever those are. then a byte for the id and then a string.

Code:
<<< [S -> C][A107]
[BYTE](Amount of servers) 02 ................
[BYTE](Id of the server)     00 ................
[WORD](Length of the serverName) 0D 00 ................
[STRING](Server Name Size is previous value)67 73 72 6F 2E 7A 61 70 74 2E 6F 72 67 gsro.zapt.org...
BD 32 .2..............
[BYTE](Again Id)01 ................
[WORD](Length of ServerName)0D 00 ................
[STRING](Server Name)67 73 72 6F 2E 7A 61 70 74 2E 6F 72 67 gsro.zapt.org...
BD 32 .2..............
But if grindroad is using isro or any other version isn't the opcode the same as usual. so for the stats 0x303D. At least if you mean that stat packet with the HP, MP, phy atk and defence stuff.
kevin_owner is offline  
Old 07/25/2011, 16:19   #10

 
Haxor's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 3,777
Received Thanks: 1,455
Quote:
Originally Posted by kevin_owner View Post
If you look at that packet it seems logic to me that the first byte is the amount of servers or whatever those are. then a byte for the id and then a string.

Code:
<<< [S -> C][A107]
[BYTE](Amount of servers) 02 ................
[BYTE](Id of the server)     00 ................
[WORD](Length of the serverName) 0D 00 ................
[STRING](Server Name Size is previous value)67 73 72 6F 2E 7A 61 70 74 2E 6F 72 67 gsro.zapt.org...
BD 32 .2..............
[BYTE](Again Id)01 ................
[WORD](Length of ServerName)0D 00 ................
[STRING](Server Name)67 73 72 6F 2E 7A 61 70 74 2E 6F 72 67 gsro.zapt.org...
BD 32 .2..............
But if grindroad is using isro or any other version isn't the opcode the same as usual. so for the stats 0x303D. At least if you mean that stat packet with the HP, MP, phy atk and defence stuff.
i mean stats packet about currentonline maxplayers and serverstats(check-open)
i can get in esro but in this i cant because its 4 servers in ip and i cant find the opcode that have them and how to recive them
Haxor is offline  
Old 07/25/2011, 16:37   #11

 
sarkoplata's Avatar
 
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
Quote:
Originally Posted by ZeraPain View Post
no comment
Why i wonder?
sarkoplata is offline  
Old 07/25/2011, 17:06   #12
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
@saif1999

I can't sniff grindroad atm but can't you use a packet logger and see which packet contains the servers?
kevin_owner is offline  
Old 07/25/2011, 17:11   #13

 
Haxor's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 3,777
Received Thanks: 1,455
Quote:
Originally Posted by kevin_owner View Post
@saif1999

I can't sniff grindroad atm but can't you use a packet logger and see which packet contains the servers?
well now i read it correct
i got it but the problem now that the program read the 4 servers
i get that
Quote:
iridium ang = id 5
iridium dem = id 6
plutonium(ang) = id 1
plutonium(dem) = id 2
but now the problem now that i want it to connect to 1 server from 4
trying right now -.-
Haxor is offline  
Old 07/25/2011, 17:32   #14
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
yeah well in the login packet there is the server id so you just send the server id of the server you want to login to and the username and password and it should be fine. So then you'll receive the server ip and port.
kevin_owner is offline  
Old 07/25/2011, 17:54   #15

 
Haxor's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 3,777
Received Thanks: 1,455
Quote:
Originally Posted by kevin_owner View Post
yeah well in the login packet there is the server id so you just send the server id of the server you want to login to and the username and password and it should be fine. So then you'll receive the server ip and port.
ok now i recived the server name , server stats
but the server current players and max still 0..
Haxor is offline  
Reply


Similar Threads Similar Threads
[Visual Basic]TextBox Leeren
01/02/2011 - .NET Languages - 11 Replies
Hallo ... Falls sich wer mit Vb auskennt, könnte er oder sie mir bitte helfen... Also ich bin dabei in die Windows Programmierung einzusteigen, und habe mit VB 2010 angefangen. so nun habe ich in meinem Programm 2 Textboxen ( tbA und tbB)
Visual Basic Textbox
10/16/2010 - .NET Languages - 4 Replies
Hallo ich bins ma wieder ich wollte mal zu Visual Basic 2010 nachfragen wie ich der code lautet wenn man zum beispiel einen Script "sagen" will das wenn in der Textbox die 2 Stellen ausgelesen wird also ein Beispiel in einer Textbox steht : Hallo nun soll das programm die 2 stelle prüfen und da die stelle ein A ist dafür mir den text ausgibt "Die 2 Stelle ist ein a/A" und dan halt für jede stelle der sinn dahinter ist eine Registry beispiel H = O4K A = F94
vb 08 frage button und textbox?
09/09/2010 - .NET Languages - 9 Replies
Hallo eine frage wie mache ich das wenn ,nix im Textbox drin steht sieht man denn Button nicht wenn was drin steht sieht man denn button ?
TextBox und RichTextBox [VB]
06/06/2010 - .NET Languages - 7 Replies
Hi, Ich hab ein Problem und zwar...: Ich will das man in einer RichBox nicht schreiben kann und das wenn man den Text in der TB eingiebt da er erscheint in der RichBox aber dann wenn man einen anderen Text angibt das er dann nicht verschwindet.
Wie textbox in textdatei !?!
04/30/2010 - General Coding - 1 Replies
Hi comm, ICh habe das problem das ihc mir ein passwort gen coden will der mir die daten dich ich da in eine textbox eingebe in eine txt packt und speihert hier mal ein code schnipsel und das prob is das er das nciht macht und ich mir nicht erklären kann wie ich das problem löse sufu hat nichts gebracht und google gibt mir nur scheißhoffe ihr könnt mir helfen. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim fileno As...



All times are GMT +1. The time now is 04:09.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.