Register for your free account! | Forgot your password?

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

  • 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 07/25/2011, 18:18   #16
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
Yeah you shouldn't read it the same way. in Isro so also in grindroad it is a float.

So you don't read 2 words which are the current and max but 1 float which is a percent from 0 till 1. So you don't know what the player max is but just how full the server is in percent.
kevin_owner is offline  
Old 07/25/2011, 18:30   #17

 
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 you shouldn't read it the same way. in Isro so also in grindroad it is a float.

So you don't read 2 words which are the current and max but 1 float which is a percent from 0 till 1. So you don't know what the player max is but just how full the server is in percent.
hmm how you mean
i read it like that
Quote:
ushort cur = 0;
ushort max = 0;
cur = packet.ReadUInt16();
max = packet.ReadUInt16();
and btw i get curr 0 and max 16248
Haxor is offline  
Old 07/25/2011, 18:44   #18
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
Yeah well in isro you don't have a current and max amount anymore so you should read it like this.

Code:
float ServerFullness = packet.ReadSingle(); // Or ReadFloat();
The value is a value between 0 and 1.
so:
Code:
0 = server empty
0.500000 = server 50% full
0.687 = server for 68,7% full
1 = server full
You don't know how many players there can be in the server. So you might have noticed that rev6 has 3500 as a max but joymax might have decreased the number or increased it you can't know how many players there are.

so what you can do with this value is to multiply it by 3500 so you get the current amount of players with 3500 as max.
kevin_owner is offline  
Old 07/25/2011, 18:50   #19
 
elite*gold: 0
Join Date: May 2007
Posts: 99
Received Thanks: 39
hello,

use ReadSingle() for ratio.

Max player = 3500 everytime
Current Player = ratio * 3500
benco is offline  
Old 07/25/2011, 18:56   #20

 
Haxor's Avatar
 
elite*gold: 0
Join Date: Feb 2008
Posts: 3,777
Received Thanks: 1,455
Ok i read it like that
now
Quote:
byte state = 0;
ushort cur = 0;
ushort max = 0;
id = packet.ReadUInt16();
name = packet.ReadAscii();
float ServerFullness = packet.ReadSingle();
state = packet.ReadUInt8();
new_entry = packet.ReadUInt8();
i get the number 0.96875
But something weird with that because server 1 have 600\1000 and it showed like that
and when i tryed to change id to 5 its didnt show anymore -.-
Haxor is offline  
Old 07/26/2011, 10:14   #21
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by kevin_owner View Post
You don't know how many players there can be in the server. So you might have noticed that rev6 has 3500 as a max but joymax might have decreased the number or increased it you can't know how many players there are.
Actually, you can calculate it.

You save the float before you login.
You log in.
You start another connection to the GatewayServer and save the new float.

Calculation:
Code:
y = increase in float for 1 user. (secondFloat - firstFloat)
1 user = y
all users = 1 / y
You might have to do this a few times because it's possible you don't save it fast enough and someone else logged in/off during the time you were connecting/logging in.
lesderid is offline  
Thanks
1 User
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 09:40.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.