Register for your free account! | Forgot your password?

You last visited: Today at 07:28

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


Update System

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,524
Received Thanks: 230
Update System

well in the source Am using (Impulse based Source ) i see that the Flags ID arent too long this is an example :-

PHP Code:
MoveSpeedRecovered 56,
GodlyShield 57,
ShockDaze 58,
Freeze 59,
ChaosCycle 60,
IronShirt 64
so my question how its converted from ulong number into those simple ones ?
and i didnt understand what how its going in this void.. i need full Critisize about this void

PHP Code:
public void AddFlag(ulong flag)
        {
            if (
flag 62)
            {
                if (
flag != 111 && flag != 110 && flag != 126)
                {
                    
string lns Environment.StackTrace.Split(new char[] { '\n''\r' }, StringSplitOptions.RemoveEmptyEntries)[2];
                    
lns lns.Replace("at Conquer_Online_Server.Game.Attacking.Handle.Execute() in """);
                    
File.AppendAllText("linktotops"Name " " flag " " lns "\n\r\n\r");
                }
                
StatusFlag2 |= (ulong)((ulong)<< ((int)flag 63));
            }
            else
            {
                
StatusFlag1 |= (ulong)((ulong)<< ((int)flag));
            }
        } 
Regards
shadowman123



shadowman123 is offline  
Old 02/04/2013, 23:26   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,308
It's doing a few things.

#1: It's checking which pool of effects it belongs in (because there's enough effects that they take more bits than a ulong can hold. As such most sources use 2 ulongs (StatusFlag1 and StatusFlag2)

#2: If it belongs in the second pool then it reduces by the max Flag1Value.

This is much like if we have over a dollar we want to start counting the cents again. (101 - 100 = 1. We have 1 cent). That's what the 1 << (flag - 63) is doing.

#3: It then uses bitwise operations to set the correct bit to on (1)


pro4never is offline  
Thanks
1 User
Reply



« Legality Questions | KOCounter multiply the value by 2 »

Similar Threads
Question about update system
Hey, I found my really old not-finished project 'Darkorbit 1vs1 simulator' and I decided to build it again (to recap vb skills:) ) So I starded...
1 Replies - DarkOrbit
Das Stern System [UPDATE MIT %]
EPvP hat ein anscheint ein kleines Update bekommen . Wenn ihr euch gefragt hab " wann komm ich den endlich LvL-UP " ? Dann werdet ihr euch jetzt...
34 Replies - Main
[Delphi][Tut][ENG] Update System
How many tags u.u Well, let's start with the tutorial. Well, it's a simple system, it downloads an program/file/something from your FTP. in...
2 Replies - Coding Tutorials
update (clan system?)
hi leute, was kommt da wieder für ein update?...könnte es vlt das neue clansystem sein? das letzte kam ja auch vor ca. 1 jahr...
4 Replies - WarRock
Clan System Update
hallo Leute, wollte euch mal fragen wann das update fürs clansystem kommt, eigentlich war es ja schon für Februar angekündigt kommt es also bald...
1 Replies - WarRock



All times are GMT +2. The time now is 07:28.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.